﻿/* Tables of the Kit board (plan, prepare, today). Moved as they were from laundryTable.css: the selectors keep their
   weight, so the board looks the same. Not paginated and not ServerGrid on purpose: expandable rows, own empty states. */

/*========================= BADGE TABLE =========================*/
.badge-table {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px; /* altezza fissa */
    padding: 0 10px;
    font-size: .8125rem;
    font-weight: 500;
    border-radius: var(--ld-radius-pill);
    white-space: nowrap;
}

.table-container td .badge-table {
    margin: auto;
}


/*========================= KIT BOARD TABLES =========================*/
/* Shared by the Kit tab sections: same column widths everywhere so stacked tables line up. */

.kit-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin: 2rem 0 .75rem; }
.kit-section-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0; font-size: 1.15rem; font-weight: 600; }
.kit-section-sub { font-size: .8125rem; font-weight: 400; color: var(--ld-neutral-500); }
.kit-step { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--ld-primary-light); color: var(--ld-primary-foreground); font-size: .8125rem; font-weight: 600; }

/* Each queue of the board is a card: head with step, title, count and hint, then its table. */
.kit-queue-card { margin-top: 1.5rem; padding: 1rem; }
.kit-queue-card .kit-section-head { margin: 0 0 .75rem; align-items: flex-start; }
.kit-queue-card .kit-section-sub { margin: .25rem 0 0; }
.kit-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .5rem; border-radius: var(--ld-radius-pill); background: var(--ld-neutral-100); color: var(--ld-neutral-600); font-size: .75rem; font-weight: 600; }
.kit-prepare-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

.table-container .hover-scroll-x.kit-scroll { min-height: 0; }

.table-container table.items-table.kit-table[theme="loondry"] { table-layout: fixed; min-width: 800px; }

.table-container table.items-table.kit-table[theme="loondry"] thead th {
    padding: .65rem 1rem;
    font-size: .6875rem;
    font-weight: 600;
    color: var(--ld-neutral-500);
    background-color: color-mix(in srgb, var(--ld-neutral-900) 3%, var(--app-bg-layout));
    white-space: nowrap;
}

.table-container table.items-table.kit-table[theme="loondry"] tbody td { padding: .7rem 1rem; font-size: .8125rem; }
.table-container table.items-table.kit-table[theme="loondry"] tbody tr:last-child td { border-bottom: 0; }

/* Rows are only "clickable" when they open something. */
.table-container table.items-table.kit-table[theme="loondry"] tbody tr { cursor: default; }
.table-container table.items-table.kit-table[theme="loondry"] tbody tr.kc-click { cursor: pointer; }
.table-container table.items-table.kit-table[theme="loondry"] tbody tr:hover td { background-color: color-mix(in srgb, var(--primary-color) 12%, var(--app-bg)); }
.table-container table.items-table.kit-table[theme="loondry"] tbody tr:has(td.kc-empty):hover td { background-color: transparent; }

/* Late rows: red bar on the left, no tinted row. */
.table-container table.items-table.kit-table[theme="loondry"] tbody tr.kit-row-late td:first-child { border-left-color: var(--ld-danger-text); }

/* Badges sit next to the text, not centered in the cell. */
.table-container table.items-table.kit-table td .badge-table { margin: 0; height: 24px; }

/* Column types: the same class always has the same width. */
.kit-table th.kc-when, .kit-table td.kc-when { width: 7.5rem; white-space: nowrap; }
.kit-table th.kc-sets, .kit-table td.kc-sets { width: 24%; }
.kit-table th.kc-state, .kit-table td.kc-state { width: 11rem; }
.kit-table th.kc-actions, .kit-table td.kc-actions { width: 9rem; text-align: right; white-space: nowrap; }
.kit-table th.kc-qty, .kit-table td.kc-qty { width: 7rem; text-align: center; }
.kit-table th.kc-count, .kit-table td.kc-count { width: 10rem; }
.kit-table th.kc-fit, .kit-table td.kc-fit { width: 13rem; }

.kit-table td.kc-prop { overflow: hidden; }
.kit-table .kc-name { display: block; font-weight: 600; text-align: left; }
.kit-table .kc-sub { display: block; font-size: .8125rem; color: var(--ld-neutral-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-table .kc-qty-num { font-weight: 600; }
.kit-table .kc-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.kit-table .kc-select { display: flex; align-items: center; gap: .75rem; }

/* Child rows of an expanded kit: same columns as the parent, quieter. */
.table-container table.items-table.kit-table[theme="loondry"] tbody tr.kc-child td { padding: .5rem 1rem; font-size: .8125rem; background-color: color-mix(in srgb, var(--ld-neutral-900) 2.5%, var(--app-bg-layout)); }
.table-container table.items-table.kit-table[theme="loondry"] tbody tr.kc-child:hover td { background-color: color-mix(in srgb, var(--primary-color) 12%, var(--app-bg)); }
.table-container table.items-table.kit-table[theme="loondry"] tbody tr.kc-child td.kc-child-name { padding-left: 2.6rem; }
.kit-table tr.kc-child .btn { font-size: inherit; }

/* Menu rows: show which one is under the pointer. */
.kit-table .dropdown-item { border-radius: .4rem; }
.kit-table .dropdown-item:hover, .kit-table .dropdown-item:focus-visible { background-color: color-mix(in srgb, var(--primary-color) 18%, var(--app-bg)); }
.kit-table .dropdown-item.text-danger:hover { background-color: color-mix(in srgb, var(--ld-danger-text) 14%, var(--app-bg)); }
.kit-table .dropdown-menu { padding: .35rem; }

/* A filter change reloads only the rows: they stay in place, dimmed, until the new ones arrive. */
.kit-table tbody.kit-reloading { opacity: .5; pointer-events: none; transition: opacity .15s; }

.kc-empty { padding: 2rem 1rem !important; text-align: center; color: var(--ld-neutral-500); font-size: .8125rem; }
.kc-foot { padding: .75rem 1rem; font-size: .8125rem; color: var(--ld-neutral-500); border-top: 1px solid var(--app-border-color); }
.kit-table .kc-icon-button { width: 31px; height: 31px; padding: 0; }

/* Cells may be empty on purpose (no state, no late): never hide the row. */
.table-container table.items-table.kit-table[theme="loondry"] tbody tr:has(td:empty) { display: table-row !important; }
.kit-table .kc-sub-red { color: var(--ld-danger-text); }
.kc-empty-line { margin: 0 0 .5rem; padding: .25rem 0 0; font-size: .8125rem; color: var(--ld-neutral-500); }
