/* List screens (ft3mweb list recipe in FT3M colours): page header, status tag, list table, row actions, column chooser. */

/* ---------- Page header ---------- */

.ph {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px 20px;
    background: #FFFFFF;
    border: 1px solid var(--ft-line);
    border-left: 4px solid var(--ft-apron);
    border-radius: 0 var(--ft-radius) var(--ft-radius) 0;
    box-shadow: 0 1px 6px rgba(23, 57, 95, 0.08);
}

.ph__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--ft-radius);
    background: rgba(11, 30, 54, 0.06);
    border: 1px solid rgba(11, 30, 54, 0.12);
    color: var(--ft-apron);
}

.ph__icon .mud-icon-root {
    font-size: 1.25rem;
}

.ph__text {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.ph__title {
    margin: 0;
    font-family: var(--ft-font-display);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: var(--ft-stencil);
}

.ph__title:focus,
.ph__title:focus-visible {
    outline: none;
}

.ph .ft-rule--center {
    justify-content: center;
    margin: 5px 0 3px;
}

.ph .ft-rule--center .ft-rule__line,
.ph .ft-rule--center .ft-rule__tail {
    flex-basis: 34px;
}

.ph__subtitle {
    margin: 2px 0 0;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    line-height: 1;
    color: var(--ft-altimeter);
}

.ph__lead {
    max-width: 72ch;
    margin: 8px auto 0;
    font-size: 0.82rem;
    color: var(--ft-stencil-soft);
}

.ph__actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding-left: 12px;
}

.ph .ph__add.mud-icon-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--ft-apron) 0%, var(--ft-sky) 55%, var(--ft-altimeter) 100%);
    box-shadow: 0 2px 8px rgba(23, 57, 95, 0.35);
}

.ph .ph__add.mud-icon-button:hover {
    filter: brightness(1.08);
}

.ph__action-hint {
    display: inline-flex;
    cursor: not-allowed;
}

.ph .ph__action.mud-icon-button,
.ph .ph__columns.mud-icon-button,
.ph .ph__export.mud-icon-button,
.ph__busy {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.ph__busy {
    display: grid;
    place-items: center;
    border: 1px solid rgba(46, 139, 87, 0.45);
}

.ph .ph__back.mud-icon-button {
    flex: none;
    border-radius: 50%;
    border: 1px solid var(--ft-line);
    color: var(--ft-stencil);
}

/* ---------- Status tag ---------- */

.badge {
    --badge-bg: #F0F2F5;
    --badge-fg: #5B6775;
    --badge-ring: rgba(91, 103, 117, 0.18);
    --badge-dot: #9AA4B0;

    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: var(--ft-radius-pill);
    background: var(--badge-bg);
    color: var(--badge-fg);
    box-shadow: inset 0 0 0 1px var(--badge-ring);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.badge--md {
    gap: 8px;
    padding: 5px 14px;
    font-size: 0.875rem;
    font-weight: 700;
}

.badge__dot {
    position: relative;
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--badge-dot);
}

.badge--md .badge__dot {
    width: 8px;
    height: 8px;
}

.badge__dot--pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--badge-dot);
    animation: badge-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.badge--success { --badge-bg: #EAF6EF; --badge-fg: #1F6B43; --badge-ring: rgba(46, 139, 87, 0.25); --badge-dot: var(--ft-clear); }
.badge--danger { --badge-bg: #FCEBEE; --badge-fg: #A10D25; --badge-ring: rgba(200, 16, 46, 0.22); --badge-dot: var(--ft-streamer); }
.badge--warning { --badge-bg: #FDF6E3; --badge-fg: #8A6410; --badge-ring: rgba(227, 179, 65, 0.4); --badge-dot: var(--ft-caution); }
.badge--info { --badge-bg: #EAF3FA; --badge-fg: #1F5F8F; --badge-ring: rgba(47, 127, 184, 0.25); --badge-dot: var(--ft-altimeter); }
.badge--purple { --badge-bg: #F2EEFB; --badge-fg: #5B3FA8; --badge-ring: rgba(124, 92, 214, 0.22); --badge-dot: #7C5CD6; }

@keyframes badge-ping {
    75%, 100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

/* ---------- List table ---------- */

.lt {
    position: relative;
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius);
    box-shadow: var(--ft-shadow-soft);
}

.lt__progress {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 4;
}

.lt__error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #FCEBEE;
    color: #A10D25;
    border-bottom: 1px solid rgba(200, 16, 46, 0.2);
    font-size: 0.85rem;
}

.lt__scroll {
    overflow-x: auto;
}

.lt__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.lt__head th {
    padding: 10px 12px;
    background: #EEF2F6;
    border-bottom: 1px solid var(--ft-line);
    font-family: var(--ft-font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ft-stencil);
    text-align: left;
    white-space: nowrap;
}

.lt__sort {
    all: unset;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.lt__sort:focus-visible {
    outline: 2px solid var(--ft-altimeter);
    outline-offset: 2px;
    border-radius: var(--ft-radius-xs);
}

.lt__sort .lt__sort-icon {
    font-size: 1rem;
    opacity: 0.3;
}

.lt__head th.is-sorted {
    color: var(--ft-altimeter-deep);
}

.lt__head th.is-sorted .lt__sort-icon {
    opacity: 1;
}

.lt__filters th {
    padding: 6px 8px;
    background: #F6F8FA;
    border-bottom: 1px solid var(--ft-line);
    font-weight: 400;
    vertical-align: middle;
}

.lt__filter.mud-input-control {
    margin: 0;
    min-width: 7.5rem;
}

.lt__filter .mud-input {
    background: #FFFFFF;
    font-size: 0.82rem;
}

.lt__filter .mud-input.mud-input-outlined .mud-input-slot,
.lt__filter .mud-input.mud-input-outlined input {
    padding-top: 6px;
    padding-bottom: 6px;
}

.lt__row {
    background: #FFFFFF;
}

.lt__row:nth-child(even) {
    background: #FAFBFC;
}

.lt__row.is-clickable {
    cursor: pointer;
}

.lt__row:hover {
    background: #EEF5FB;
}

/* The row whose details are open beside the table (e.g. a warehouse and its bins). */
.lt__row.is-selected {
    background: rgba(47, 127, 184, 0.1);
}

.lt__row.is-selected > td:first-child {
    box-shadow: inset 3px 0 0 var(--ft-caution);
}

.lt__row.is-muted > td {
    color: var(--ft-stencil-soft);
}

.lt__row > td {
    padding: 8px 12px;
    background: inherit;
    border-bottom: 1px solid var(--ft-line);
    vertical-align: middle;
}

.lt__row:last-child > td {
    border-bottom: 0;
}

.lt__row--skeleton > td {
    padding: 10px 16px;
}

.lt .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* The İşlemler column and the key column stay on screen while the table scrolls sideways. */
.lt__pin {
    position: sticky;
    left: 0;
    z-index: 2;
}

.lt__actions {
    width: 64px;
    min-width: 64px;
    text-align: center;
}

.lt__pin--after-actions {
    left: 64px;
}

.lt__head .lt__pin,
.lt__filters .lt__pin {
    z-index: 3;
}

.lt__pin:not(.lt__actions),
.lt__actions:not(:has(+ .lt__pin)) {
    box-shadow: 1px 0 0 var(--ft-line);
}

.lt__nomatch > td {
    padding: 28px 16px;
    color: var(--ft-stencil-soft);
    text-align: center;
}

.lt__nomatch .mud-icon-root {
    vertical-align: middle;
    margin-right: 6px;
}

.lt__pager {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #FBFCFD;
    border-top: 1px solid var(--ft-line);
    font-size: 0.82rem;
    color: var(--ft-stencil-soft);
}

.lt__count {
    font-family: var(--ft-font-display);
    font-variant-numeric: tabular-nums;
    color: var(--ft-stencil);
}

.lt__spacer {
    flex: 1;
}

.lt__size.mud-input-control {
    flex: none;
    width: 84px;
    margin: 0 6px 0 0;
}

.lt__size .mud-input.mud-input-outlined .mud-input-slot,
.lt__size .mud-input.mud-input-outlined input {
    padding-top: 4px;
    padding-bottom: 4px;
}

.lt-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 48px 24px;
    background: #FFFFFF;
    border: 1px dashed var(--ft-line);
    border-radius: var(--ft-radius);
    color: var(--ft-stencil-soft);
    text-align: center;
}

.lt-empty__icon.mud-icon-root {
    font-size: 2.4rem;
    color: var(--ft-altimeter);
}

.lt-empty__title {
    margin: 0;
    font-size: 0.95rem;
}

/* ---------- Row actions ---------- */

.row-actions__trigger .mud-icon-button,
.row-actions__single.mud-icon-button {
    color: var(--ft-stencil-soft);
}

.row-actions__trigger .mud-icon-button:hover,
.row-actions__single.mud-icon-button:hover {
    color: var(--ft-altimeter-deep);
}

.row-actions__menu .mud-menu-item {
    min-width: 13rem;
    border-radius: var(--ft-radius-sm);
}

.row-actions__menu .mud-menu-item:hover {
    background: #EEF5FB;
}

.row-actions__label {
    font-size: 0.875rem;
    font-weight: 500;
}

.row-actions__item--delete .row-actions__label {
    color: var(--ft-streamer);
}

.row-actions__hint {
    display: block;
    max-width: 16rem;
    font-size: 0.74rem;
    line-height: 1.3;
    color: #8A6410;
    white-space: normal;
}

/* ---------- Column chooser ---------- */

.cc,
.cc__anchor {
    position: relative;
    display: inline-flex;
}

.cc__count {
    position: absolute;
    top: -4px;
    right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: var(--ft-radius-pill);
    background: var(--ft-caution);
    color: var(--ft-apron);
    font-size: 10px;
    font-weight: 700;
    pointer-events: none;
}

.cc__panel {
    width: 18rem;
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius);
    box-shadow: var(--ft-shadow-raised);
}

.cc__head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--ft-line);
}

.cc__title {
    font-family: var(--ft-font-display);
    font-weight: 600;
    color: var(--ft-stencil);
}

.cc__toggle-all {
    all: unset;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ft-altimeter-deep);
}

.cc__toggle-all:hover,
.cc__toggle-all:focus-visible {
    text-decoration: underline;
}

.cc__note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    padding: 8px 12px;
    background: #FDF6E3;
    border-bottom: 1px solid rgba(227, 179, 65, 0.4);
    color: #8A6410;
    font-size: 0.74rem;
    line-height: 1.35;
}

.cc__list {
    padding: 4px 4px 8px;
}

@media (prefers-reduced-motion: reduce) {
    .badge__dot--pulse::after {
        animation: none;
    }
}

/* Narrow screens: back, icon and actions share the first row; the title block takes the full width below. */
@media (max-width: 720px) {
    .ph {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }

    .ph__text {
        order: 3;
        flex: 1 1 100%;
    }

    .ph__actions {
        padding-left: 0;
    }

    .ph__title {
        font-size: 1.25rem;
    }
}

/* Tick list: a search bar with "select shown / clear shown" and a grid of ticked rows (main system authorizations,
   workshop members, site inspectors). */
.tick-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 10px;
}

.tick-tools__search {
    flex: 1 1 260px;
    max-width: 420px;
}

.tick-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 6px;
}

.tick-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "box name site" "box meta site";
    align-items: center;
    column-gap: 8px;
    padding: 4px 12px 4px 4px;
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius-sm);
    background: #FFFFFF;
}

.tick-list li.is-chosen {
    border-color: var(--ft-altimeter);
    box-shadow: inset 4px 0 0 var(--ft-caution);
}

.tick-list .mud-checkbox {
    grid-area: box;
}

.tick-list__name {
    grid-area: name;
    font-weight: 600;
    color: var(--ft-stencil);
    overflow-wrap: anywhere;
}

.tick-list__meta {
    grid-area: meta;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    font-size: 0.78rem;
    color: var(--ft-stencil-soft);
}

.tick-list__side {
    grid-area: site;
    font-size: 0.78rem;
    color: var(--ft-stencil-soft);
    text-align: right;
}

@media (max-width: 600px) {
    .tick-list {
        grid-template-columns: 1fr;
    }
}

/* Long text in a cell: two lines, the rest in the tooltip. */
.cell-clamp {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
