
/* CSS : THEME */
:root {
    --background: #ffffff;
    --text: #5e6064;
    --text-gray: #727477;

    --gray: #ececec;
    --red: #c95151;
    --green: #65c951;
    --white: #5e6064;
    --realwhite: #ffffff;
}

.dark-mode {
    --background: #131414;
    --text: #ffffff;
    --text-gray: #727477;
    
    --gray: #212224;
    --red: #c95151;
    --green: #65c951;
    --white: #ffffff;
    --realwhite: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: block !important;
    justify-content: center;
    align-items: center;
    
    min-height: 100vh;
    padding: 0;
    margin: 0;

    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 400;
    font-size: 16px;

    background-color: var(--background);
    color: var(--text);
    color-scheme: light;
}

body.dark-mode { color-scheme: dark; }

/* CSS : BLOCK */

html, body {
  height: 100%;
}

.dashboard-container,
.dashboard-body,
.dashboard-content,
.dashboard-table {
  min-height: 0;
}

.dashboard-content > section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dashboard-container {
    /* border: 1px solid #00aeff !important; */

    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    align-items: stretch;

    width: 100%;
    height: 100vh;
    min-height: 0;

    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top));
    
    border-radius: 8px;
}

.dashboard-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 2px solid var(--gray);
    transition: transform 0.2s ease;
}

.dashboard-image:hover {
    transform: scale(1.05);
    cursor: pointer;
}

.user-initials-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    border-radius: 50%;
    flex-shrink: 0;
    user-select: none;
    letter-spacing: 0.5px;
}

.user-initials-avatar--large {
    width: 120px;
    height: 120px;
    font-size: 42px;
    margin: 16px auto;
}

.dashboard-header {
    /* border: 1px solid #ff00c8 !important;	 */
    
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;

    margin-bottom: 20px;
    border-bottom: 1px solid var(--gray);
    padding-bottom: 20px;
}

.dashboard-body {
    /* border: 1px solid #ff00c8 !important;	 */
    display: flex;
    flex: 1 1 auto;

    width: 100%;
    min-width: 0;
    min-height: 0;

    overflow: hidden;
}

.dashboard-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.dashboard-nav {
    /* border: 1px solid #00ff40 !important; */
    display: flex;
    flex: 1;
    flex-basis: 30vh;
    width: 30vh;
    margin-right: 20px;
    border-right: 1px solid var(--gray);
    padding-right: 20px;
    height: 100%;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
}

html.menu-hidden-preload .dashboard-nav {
    display: none !important;
}

.dashboard-nav-inner{
    /* border: 1px solid #f6fa00 !important; */
    display: flex;
    flex-direction: column;
    height: 100%;
}

@media (max-width: 768px) {
    .dashboard-nav {
        position: fixed !important;
        inset: 0;
        width: 100vw !important;
        height: 100vh !important;
        overflow-x: auto;
        overflow-y: auto;
        margin: 0;
        padding: 20px;
        flex-basis: auto;
        border-right: none;
        background-color: var(--background);
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding-top: calc(20px + env(safe-area-inset-top));
    }

    .dashboard-nav:not(.hidden) {
        transform: translateX(0);
    }
}

.dashboard-content {
    /* border: 1px solid #00ff40 !important; */
    
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;

    width: 100%;
    min-width: 0;
    min-height: 0;
    
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.dashboard-title {
    position: relative;
    padding-top: 22px;
    padding-bottom: 20px;
}

.breadcrumb-nav {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.4;
    max-width: 100%;
    overflow: visible;
}
.bc-item {
    color: #94a3b8;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
    letter-spacing: 0.01em;
}
.bc-item:hover {
    color: #475569;
    text-decoration: none;
}
.bc-sep {
    color: #cbd5e1;
    font-size: 8px;
    flex-shrink: 0;
}

.dark-mode .bc-item { color: #64748b; }
.dark-mode .bc-item:hover { color: #94a3b8; }
.dark-mode .bc-sep { color: #334155; }

.dashboard-table {
    /* border: 1px solid #ff0000 !important; */

    display: flex;
    flex: 1 1 auto;
    flex-direction: column;

    width: 100%;
    min-width: 0;
    min-height: 0;

    /* overflow: hidden; */
}

.dashboard-table-content {
    /* border: 1px solid #0004ff !important; */

    display: flex;
    flex-direction: column;

    flex: 1 1 auto;
    position: relative;
    min-height: 0;
    min-width: 0;
    border: 1px solid rgba(127, 127, 127, 0.25);
    border-radius: 12px;

    overflow: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(127, 127, 127, 0.35) transparent;
}

.dashboard-table-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.dashboard-table-content::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-table-content::-webkit-scrollbar-thumb {
    background: rgba(127, 127, 127, 0.35);
    border-radius: 3px;
}

.dashboard-table-content::-webkit-scrollbar-thumb:hover {
    background: rgba(127, 127, 127, 0.55);
}

.dashboard-table-content::-webkit-scrollbar-corner {
    background: transparent;
}

.dashboard-table-content.is-filtering::after {
    content: '';
    position: sticky;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--white) 45%, transparent 100%);
    background-size: 200% 100%;
    animation: tableFilterLoading 0.9s linear infinite;
    z-index: 3;
}

@keyframes tableFilterLoading {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.dashboard-table-content.has-open-dropdown {
    overflow-x: auto;
    overflow-y: visible;
}

.dashboard-flex {
    /* border: 1px solid #9583fc !important; */
    display: flex;
    box-sizing: border-box;
    width: 100%;
    /* min-height: 0; */
}

.dashboard-toolbar {
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.dashboard-toolbar-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.dashboard-toolbar-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.toolbar-overflow-wrap {
    position: relative;
}

.toolbar-overflow-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--background);
    border: 1px solid var(--gray);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    padding: 5px;
    z-index: 600;
    flex-direction: column;
    gap: 1px;
}

.toolbar-overflow-menu.is-open {
    display: flex;
}

.toolbar-overflow-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--text);
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
    margin: 0;
    cursor: pointer;
    transition: background 0.12s;
}

.toolbar-overflow-item:hover {
    background: rgba(127, 127, 127, 0.1) !important;
    color: var(--text) !important;
}

.toolbar-overflow-item i,
.toolbar-overflow-item .icon-rfid {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.toolbar-overflow-item span {
    flex: 1;
    text-align: left;
}

.toolbar-overflow-item.back_red {
    color: var(--red) !important;
}

.toolbar-overflow-item.back_red:hover {
    background: rgba(201, 81, 81, 0.1) !important;
    color: var(--red) !important;
}

.toolbar-overflow-item.back_red i {
    opacity: 1;
}

.toolbar-overflow-item.toggle-button.is-active {
    background: rgba(101, 201, 81, 0.12) !important;
    color: var(--green) !important;
}

.toolbar-overflow-item.toggle-button.is-active i {
    opacity: 1;
}

.toolbar-overflow-item.toggle-button.is-active:hover {
    background: rgba(101, 201, 81, 0.2) !important;
    color: var(--green) !important;
}

.toggle-button.is-active {
    background: rgba(101, 201, 81, 0.18) !important;
    border-color: rgba(101, 201, 81, 0.45) !important;
    color: var(--green) !important;
}

.bulk-menu {
    position: fixed;
    display: none;
    min-width: 240px;
    max-width: min(320px, calc(100vw - 16px));
    padding: 8px;
    border: 1px solid var(--gray);
    border-radius: 12px;
    background: var(--background);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 9999;
}

.bulk-menu-search {
    width: 100%;
    margin-bottom: 8px;
}

.bulk-menu-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: min(240px, calc(100vh - 220px));
    overflow-y: auto;
    overflow-x: hidden;
}

.bulk-menu.open {
    display: block;
}

.bulk-menu .select-item {
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 8px;
}

.bulk-menu .select-item:hover {
    background: var(--gray);
}

@media (max-width: 768px) {
    .dashboard-flex {
        flex-direction: column;
    }

    .dashboard-toolbar.dashboard-flex {
        flex-direction: row;
        align-items: center;
    }

    .dashboard-toolbar-actions {
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    /* On mobile: revert fill-to-bottom — let content stack naturally and dashboard-content scroll */
    .dashboard-content > section {
        flex: 0 0 auto;
        min-height: unset;
    }

    #workshop > .dashboard-flex,
    #material_output > .dashboard-flex {
        flex: 0 0 auto;
        align-items: unset;
        min-height: unset;
    }

    #workshop .dashboard-flex-left,
    #workshop .dashboard-flex-right,
    #material_output .dashboard-flex-left,
    #material_output .dashboard-flex-right {
        flex: 0 0 auto;
        min-height: unset;
    }

    /* Give tables and cards a fixed height on mobile so they don't collapse */
    .dashboard-table-content {
        max-height: 60vh;
    }

    #workshop .cards-container,
    #material_output .cards-container {
        max-height: 50vh;
        overflow-y: auto;
    }
}

.dashboard-flex-left {
    /* border: 1px solid #fc83f6 !important; */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 20px;
    margin-right: 12px;

    flex: 1 1 0;
    min-width: 0;
    /* min-height: 0; */
    left: 0;
}


.dashboard-flex-right {
    /* border: 1px solid #5fdd46 !important; */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-right: 12px;

    flex: 1 1 0;
    min-width: 0;
    /* min-height: 0; */
    right: 0;
}

#rowCount {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    #rowCount {
        font-size: 12px;
        letter-spacing: -0.01em;
    }
}

.dashboard-login-left {
    /* border: 1px solid #fc83f6 !important; */
    display: flex;
    align-items: center;
    justify-content: flex-start;

    flex: 1 1 0;
    min-width: 0;
    left: 0;

    background: url("../../assets/images/login_background.jpg");
    background-color: var(--background);
    background-repeat: no-repeat;
    background-position: 50% 0;
    background-size: cover;
}

@media (max-width: 1024px) {
    .dashboard-login-left {
        display: none !important;
    }
}

/* CSS : TABLE */

.task-table {
    width: 100%;
    min-width: 0;
    min-height: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: linear-gradient(180deg, rgba(127, 127, 127, 0.08) 0%, rgba(127, 127, 127, 0.04) 100%);
}

.task-table th,
.task-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(127, 127, 127, 0.22);
}
  
.task-table th {
    color: var(--text-gray);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(127, 127, 127, 0.16);
    background: color-mix(in srgb, var(--gray) 80%, var(--background) 20%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-table td {
    background: transparent;
}

.task-table tbody tr {
    transition: background-color 180ms ease;
}

.task-table tbody tr:nth-child(even) {
    background: rgba(127, 127, 127, 0.05);
}

.task-table tbody tr:hover {
    background: rgba(94, 96, 100, 0.075);
    background: color-mix(in srgb, var(--text) 7.5%, transparent);
}

.task-table tbody tr:last-child td {
    border-bottom: none;
}


.task-table .table-empty-row td {
    padding: 22px 14px;
    text-align: center;
    background: transparent;
}

@media (max-width: 768px) {
    .task-table th,
    .task-table td {
        padding: 10px 12px;
    }

    .task-table th {
        font-size: 11px;
    }
}

/* CSS : SELECT / INPUT / BUTTON / TEXTAREA */

.icon-rfid {
    width: 1.2em;
    height: 1.2em;
    display: inline-block;
    vertical-align: middle;
    background-color: var(--white);
    -webkit-mask: url('../images/rfid.svg') center / contain no-repeat;
    mask: url('../images/rfid.svg') center / contain no-repeat;
}

button:hover .icon-rfid {
    background-color: var(--background);
}


textarea {    
    resize: none;
    width: auto;
    height: auto;
    min-height: 100px;
}

input, button, select, .select-dropdown, textarea {
    appearance: none;
    line-height: 1.2;
    margin: 5px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    box-sizing: border-box;
    cursor: pointer;
    background-color: var(--gray);
    color: var(--white);
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    text-decoration: none !important;
    transition: background-color 0.2s ease !important;
    transition: color 0.2s ease !important;
    min-width: 0;    
}

@media (max-width: 768px) {
    input, button, select, .select-dropdown, textarea {
        padding: 12px 16px;
        font-size: 16px !important;
        line-height: 1.4;
    }
}

button {
    text-align: center;
}

.toolbar-icon-btn {
    margin: 0px;
}

.qty-btn{
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
}

.qty-btn:disabled{
    opacity: .4;
    cursor: not-allowed;
}

.qty-input{
    width: 70px;
    min-width: 70px;
    flex-shrink: 0;
    text-align: center;
}

.qty-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 28px;
}

.lamp-qty-cell {
    position: relative;
}

.lamp-qty-summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.lamp-stage-panel {
    position: fixed;
    z-index: 1050;
    background: var(--background);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 14px 14px;
    min-width: 200px;
    max-width: 340px;
    max-height: 65vh;
    overflow-y: auto;
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}

@media (max-width: 600px) {
    .lamp-stage-panel {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        max-width: 100%;
        border-radius: 14px 14px 0 0;
        max-height: 80vh;
    }
}

.lamp-stage-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-start;
    justify-content: center;
}

.lamp-stage-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.lamp-stage-name {
    font-size: 11px;
    text-align: center;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lamp-stage-breakdown--inline {
    justify-content: flex-start;
    padding: 6px 0 2px;
}

.task-table td[data-column="number"] {
    text-align: center;
    vertical-align: middle;
}

select option,
.select-dropdown option {
    background-color: var(--gray);
    border-radius: 8px;
    color: var(--white);
}

select {
    padding-right: 38px;
    border: 1px solid transparent;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.72) 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.72) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 1px),
        calc(100% - 12px) calc(50% - 1px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
  
select option:hover,
.select-dropdown option:hover {
    color: var(--white);
    background-color: var(--background);
}
  
.select-dropdown {
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.select-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    cursor: pointer;
    border-radius: 10px;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.select-item-edit-link {
    flex-shrink: 0;
    font-size: 11px;
    color: inherit;
    opacity: 0;
    line-height: 1;
    transition: opacity 0.15s ease;
}

.select-item:hover .select-item-edit-link {
    opacity: 0.65;
}

.select-item-edit-link:hover {
    opacity: 1 !important;
}

/* ── Select pièces condensé dans le tableau commandes workshop ── */
.orders-content-select {
    max-width: 160px;
    font-size: 11px;
}

/* ── Admin dashboard ── */
.admin-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 13px;
}
.admin-stat-row:last-of-type { border-bottom: none; }

/* ── Liseré statut commandes (workshop) ── */
tr.order-status-0 { box-shadow: inset 3px 0 0 0 rgba(130, 130, 130, 0.50); }
tr.order-status-1 { box-shadow: inset 3px 0 0 0 rgba(255, 128,   0, 0.75); }
tr.order-status-2 { box-shadow: inset 3px 0 0 0 rgba( 60, 130, 230, 0.80); }
tr.order-status-3 { box-shadow: inset 3px 0 0 0 rgba( 60, 130, 230, 0.80); }
tr.order-status-4 { box-shadow: inset 3px 0 0 0 rgba( 30, 155,  75, 0.65); }
tr.order-status-5 { box-shadow: inset 3px 0 0 0 rgba( 30, 155,  75, 0.90); }

/* ── Colonnes EPI condensées dans le listing utilisateurs ── */
.epi-type-col-header {
    /* width: 60px; */
    /* max-width: 70px; */
    vertical-align: bottom;
    text-align: center !important;
    padding-bottom: 6px !important;
    padding-top: 4px !important;
    white-space: nowrap;
}
.epi-col-label {
    display: inline-block;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    max-height: 120px;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.2;
    cursor: default;
}
.epi-type-col-header .sortable-indicator {
    display: block;
    margin-top: 3px;
}

/* ── Cellule "Reçu" dans le tableau commande ── */
.order-received-cell {
    display: flex;
    align-items: center;
    gap: 5px;
}
.order-received-max {
    font-size: 11px;
    white-space: nowrap;
}

/* ── Badge "En commande" sur pièces détachées ── */
.sp-order-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    background: rgba(60, 130, 230, 0.14);
    color: #5a9af0;
    border: 1px solid rgba(60, 130, 230, 0.28);
    vertical-align: middle;
    white-space: nowrap;
}

/* ── Arrow steps : responsive (override styles.css) ── */
.arrow-steps {
    display: flex !important;
    flex-wrap: nowrap;
}

.arrow-steps .step {
    flex: 1 1 0;
    min-width: 0 !important;
    float: none !important;
    white-space: nowrap;
}

/* Medium — texte réduit, flèches ajustées (hauteur ~34px) */
@media (max-width: 1200px) {
    .arrow-steps .step {
        font-size: 11px !important;
        padding: 10px 6px 10px 20px !important;
    }
    .arrow-steps .step:after,
    .arrow-steps .step:before {
        border-top-width: 17px !important;
        border-bottom-width: 17px !important;
    }
    .arrow-steps .step:after {
        right: -13px !important;
        border-left-width: 14px !important;
    }
    .arrow-steps .step:before {
        border-left-width: 14px !important;
    }
    .arrow-steps .step.active:after {
        border-left-width: 14px !important;
    }
}

/* Mobile — texte masqué par .hidephone, icônes seules, très compact (hauteur ~29px) */
@media (max-width: 768px) {
    .arrow-steps .step {
        font-size: 11px !important;
        padding: 8px 2px 8px 12px !important;
        text-align: center;
    }
    .arrow-steps .step:after,
    .arrow-steps .step:before {
        border-top-width: 15px !important;
        border-bottom-width: 15px !important;
    }
    .arrow-steps .step:after {
        right: -11px !important;
        border-left-width: 12px !important;
    }
    .arrow-steps .step:before {
        border-left-width: 12px !important;
    }
    .arrow-steps .step.active:after {
        border-left-width: 12px !important;
    }
}

/* ── Steps de commande cliquables ── */
.arrow-steps[data-order-id] .step[data-step] {
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.arrow-steps[data-order-id] .step[data-step]:not(.active):hover {
    opacity: 0.7;
}
.arrow-steps[data-order-id].is-loading .step[data-step] {
    opacity: 0.45;
    pointer-events: none;
}

select:focus,
.select-item:focus,
select:hover,
.select-item:hover {
    color: var(--white);
    background-color: var(--gray);
    outline: none;
} 

select:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 8px 18px rgba(0, 0, 0, 0.12);
}

select:focus {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 0 3px rgba(255, 255, 255, 0.06),
        0 10px 22px rgba(0, 0, 0, 0.18);
}

.select-dropdown {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: var(--background);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
    padding: 6px;
}

.select-item:hover,
.select-item:focus {
    background-color: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

button:hover {
    background-color: var(--white) !important;
    color: var(--background) !important;
}

.form-inline {
    display: inline;
}

.radio-user-select {
    width: 100%;
    min-width: 180px;
}

.radio-user-select .dropdown-header,
.radio-user-select .select-search {
    width: 100%;
}

.btn-icon-plain {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
}

#stats .stats-toolbar-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

#stats .stats-toolbar-form select {
    margin: 0;
}

#stats .stats-period-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

#stats .stats-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

#stats .stats-panel {
    min-width: 0;
}

#stats .stats-panel-summary {
    position: sticky;
    top: 0;
    align-self: start;
}

#stats .stats-summary-grid,
#stats .stats-dynamic-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#stats .stats-toolbar-summary {
    justify-content: flex-start;
}

#stats .stats-toolbar-dynamic {
    justify-content: flex-end;
    margin-bottom: 10px;
}

#stats .stats-toolbar-dynamic select,
#stats .stats-toolbar-summary select {
    min-width: 240px;
}

#stats .stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 8px 0 12px;
}

#stats .stats-kpi-card {
    background: var(--gray);
    border: 1px solid rgba(127, 127, 127, 0.25);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#stats .stats-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(65, 196, 107, 0.2);
    color: #41c46b;
    flex-shrink: 0;
}

#stats .stats-kpi-icon.warn {
    background: rgba(255, 175, 70, 0.2);
    color: #ffaf46;
}

#stats .stats-kpi-icon.danger {
    background: rgba(255, 101, 101, 0.2);
    color: #ff6565;
}

#stats .stats-kpi-icon.money {
    background: rgba(61, 167, 255, 0.2);
    color: #3da7ff;
}

#stats .stats-kpi-icon.cold {
    background: rgba(82, 196, 255, 0.2);
    color: #52c4ff;
}

#stats .stats-kpi-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#stats .stats-kpi-body small {
    color: var(--text-gray);
}

#stats .stats-kpi-body strong {
    font-size: 1rem;
    line-height: 1.2;
}

#stats .stats-kpi-body span {
    font-size: 12px;
}

#stats .stats-visual-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

#stats .stats-visual-card {
    grid-column: span 4;
    background: var(--gray);
    border: 1px solid rgba(127, 127, 127, 0.25);
    border-radius: 12px;
    padding: 14px;
}

#stats .stats-visual-card-wide {
    grid-column: span 12;
}

#stats .stats-donut-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
}

#stats .stats-donut {
    --pct: 50;
    --accent: #3da7ff;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(var(--accent) calc(var(--pct) * 1%), rgba(127, 127, 127, 0.25) 0);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#stats .stats-donut::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: var(--background);
}

#stats .stats-donut span {
    position: relative;
    font-weight: 700;
    font-size: 1.05rem;
}

#stats .stats-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

#stats .stats-ok {
    color: #41c46b;
}

#stats .stats-ko {
    color: #ff6565;
}

#stats .stats-good {
    color: #41c46b;
}

#stats .stats-bad {
    color: #ff6565;
}

#stats .stats-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}

#stats .stats-bar-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#stats .stats-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#stats .stats-bar-label,
#stats .stats-bar-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#stats .stats-bar-value {
    font-weight: 600;
    white-space: nowrap;
}

#stats .stats-bar-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(127, 127, 127, 0.25);
    overflow: hidden;
}

#stats .stats-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3da7ff 0%, #41c46b 100%);
    animation: stats-bar-grow 800ms ease;
}

#stats .stats-trend {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
}

#stats .stats-trend-item {
    width: 52px;
    min-width: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#stats .stats-trend-item.is-last .stats-trend-bar {
    background: linear-gradient(180deg, #41c46b 0%, #3da7ff 100%);
}

#stats .stats-trend-bar-wrap {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    background: rgba(127, 127, 127, 0.2);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

#stats .stats-trend-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 10px 10px 0 0;
    background: linear-gradient(180deg, #3da7ff 0%, #1e5eff 100%);
    transition: height 400ms ease;
}

#stats .stats-trend-value {
    font-weight: 700;
}

#stats .stats-trend-label {
    color: var(--text-gray);
    white-space: nowrap;
}

#stats .stats-trend-meta {
    margin-top: 10px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

#stats .stats-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

#stats .stats-chip.ok {
    background: rgba(65, 196, 107, 0.15);
    color: #41c46b;
}

#stats .stats-chip.warning {
    background: rgba(255, 175, 70, 0.15);
    color: #ffaf46;
}

#stats .stats-chip.critical {
    background: rgba(255, 101, 101, 0.15);
    color: #ff6565;
}

@keyframes stats-bar-grow {
    from { width: 0; }
}

@media (max-width: 1200px) {
    #stats .stats-layout {
        grid-template-columns: 1fr;
    }
    #stats .stats-panel-summary {
        position: static;
    }
    #stats .stats-toolbar-dynamic {
        justify-content: flex-start;
    }
    #stats .stats-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #stats .stats-visual-card {
        grid-column: span 6;
    }
    #stats .stats-visual-card-wide {
        grid-column: span 12;
    }
}

@media (max-width: 768px) {
    #stats .stats-toolbar-form {
        flex-direction: column;
        align-items: stretch;
    }
    #stats .stats-toolbar-dynamic select,
    #stats .stats-toolbar-summary select {
        min-width: 0;
        width: 100%;
    }
    #stats .stats-kpi-grid {
        grid-template-columns: 1fr;
    }
    #stats .stats-visual-card,
    #stats .stats-visual-card-wide {
        grid-column: span 12;
    }
    #stats .stats-donut-row {
        flex-direction: column;
        align-items: flex-start;
    }
    #stats .stats-trend-item {
        width: 44px;
        min-width: 44px;
    }
}

button.qty-btn:hover,
button.btn-icon-plain:hover {
    background-color: transparent !important;
    color: inherit !important;
}

button.active {
    color: var(--background) !important;
    background-color: var(--white) !important;
}

input:focus {
    outline: none;
    border: none;
}

input::placeholder {
    color: var(--text-gray);
}

textarea::placeholder {
    color: var(--text-gray);
}

input[disabled],select[disabled],button[disabled] {
    cursor: not-allowed !important;
    opacity: 0.5;
}

input[disabled]:hover, select[disabled]:hover,button[disabled]:hover {
    background-color: var(--gray) !important;
    color: var(--white) !important;
    cursor: not-allowed !important;
}

input[type="file"] {
    display: none;
}

input[type="datetime-local"] {
    width: calc(100% - 10px);
}

input[type="checkbox"] {
    -webkit-appearance: none;
    border: 1px solid rgba(127, 127, 127, 0.25);
    border-radius: 12px;
    appearance: none;
    width: 20px !important;
    height: 20px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}
  
input[type="checkbox"]:checked {
    background-color: var(--white);
}
  
input[type="checkbox"]:checked::after {
    content: '✔';
    font-size: 10px;
    font-weight: bold;
    color: var(--background);
    position: absolute;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    background-color: var(--gray) !important;
    color: var(--white) !important;
    -webkit-text-fill-color: var(--white) !important;
    -webkit-box-shadow: 0 0 0px 1000px var(--background) inset !important;
}

.table-searchbar, .select-search {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}

#global_fixture_id .doc-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

#global_fixture_id .doc-link-row input {
    flex: 1 1 auto;
    min-width: 0;
}

#global_fixture_id .doc-link-preview-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 768px) {
    #global_fixture_id .doc-link-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    #global_fixture_id .doc-link-preview-button {
        width: calc(100% - 10px);
    }
}

/* CSS : PREFAB */

.bold {
    font-weight: bold;
}

.block {
    display: block;
}

.hidden {
    display: none !important;
}

.force-hidden {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    border: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
}

.back_red:hover {
    background-color: var(--red) !important;
    color: var(--background) !important;
}

.txt_red:hover {
    color: var(--red) !important;
}

.back_invert {
    background-color: var(--text) !important;
    color: var(--background) !important;
}

.back_green:hover {
    background-color: var(--green) !important;
    color: var(--background) !important;
}

.txt_green:hover {
    color: var(--green) !important;
}

.flex-column {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    flex-direction: column;
}

.flex-no-column {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    flex-direction: row !important;
}

.flex-left {
    display: flex;
    justify-content: flex-start;
    left: 0;
}

.flex-right {
    justify-content: flex-end;
    right: 0;
}

.flex-center {
    align-items: center;
    text-align: center;
    justify-content: center;
}

.flex-large { 
    flex: 2 1 0;
    min-width: 0;
}

.flex-space-bottom {
    padding-bottom: 20px;
}

.u-text-center {
    text-align: center !important;
    align-items: center !important;
    justify-content: center !important;
}

.u-cell-center {
    align-items: center;
    text-align: center;
}

.u-w-100 {
    width: 100%;
}

.form-alert {
    margin: 5px;
    padding: 10px 12px;
    border-radius: 8px;
}

.form-alert p {
    margin: 0 0 6px;
}

.form-alert p:last-child {
    margin-bottom: 0;
}

.form-alert-error {
    border: 1px solid var(--red);
    background: rgba(201, 81, 81, 0.15);
    color: var(--white);
}

.form-alert-warning {
    border: 1px solid #ffb400;
    background: rgba(255, 180, 0, 0.15);
    color: var(--white);
}

.form-alert-success {
    border: 1px solid var(--green);
    background: rgba(101, 201, 81, 0.15);
    color: var(--white);
}

.form-alert-info {
    border: 1px solid #78b4ff;
    background: rgba(120, 180, 255, 0.15);
    color: var(--white);
}

.fold-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.fold-section-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.fold-section-body > .title-menu {
    display: none !important;
}

.fold-section-toggle {
    width: 100%;
    margin: 0;
    padding: 12px 14px !important;
    border: 1px solid rgba(127, 127, 127, 0.22);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(127, 127, 127, 0.12), rgba(127, 127, 127, 0.06)) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

.fold-section-toggle:hover {
    background: linear-gradient(180deg, rgba(127, 127, 127, 0.18), rgba(127, 127, 127, 0.08)) !important;
    color: var(--white) !important;
}

.fold-section-toggle.is-static {
    width: 100%;
    cursor: default;
}

.fold-section-toggle.is-static:hover {
    color: inherit !important;
}

.fold-section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-weight: 700;
}

.fold-section-caret {
    flex: 0 0 auto;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.75;
}

.fold-section.is-open .fold-section-caret {
    transform: rotate(180deg);
}

.fold-section-body[hidden] {
    display: none !important;
}

.type-quick-edit {
    position: relative;
    display: inline-block;
    margin-right: 4px;
    vertical-align: middle;
}

.catalog-label-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.catalog-label-link {
    display: block;
    min-width: 0;
}

.type-quick-trigger {
    margin: 0;
    padding: 3px 8px !important;
    min-height: 24px;
    border-radius: 999px;
    font-size: 11px !important;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 160px;
    background: rgba(255, 255, 255, 0.06) !important;
}

.type-quick-trigger:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: var(--white) !important;
}

.type-quick-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.type-quick-caret {
    font-size: 10px;
    opacity: 0.7;
}

.type-quick-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 40;
    min-width: 220px;
    max-width: 280px;
    padding: 6px;
    border: 1px solid var(--gray);
    border-radius: 10px;
    background: var(--background);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
    .catalog-label-cell .type-quick-edit {
        margin-right: 0;
        margin-bottom: 2px;
    }

    .catalog-label-cell .type-quick-trigger {
        max-width: min(100%, 180px);
    }

    .catalog-label-cell .type-quick-label {
        max-width: 138px;
    }
}

.type-quick-menu.is-floating {
    position: fixed;
    top: auto;
    left: auto;
    z-index: 9999;
}

.type-quick-menu.is-open-upward {
    top: auto;
    bottom: calc(100% + 4px);
}

.type-quick-menu[hidden] {
    display: none !important;
}

.type-quick-menu-list {
    max-height: var(--type-quick-menu-max-height, 180px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.type-quick-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

#breakdown .breakdown-mobile-shell {
    width: min(80%, 760px);
    max-width: 90%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
}

#breakdown .breakdown-mobile-hero {
    width: 100%;
    padding: 18px;
    border: 1px solid rgba(127, 127, 127, 0.24);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(127, 127, 127, 0.1), rgba(127, 127, 127, 0.04));
    box-sizing: border-box;
}

#breakdown .breakdown-mobile-hero-compact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

#breakdown .breakdown-mobile-eyebrow {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#breakdown .breakdown-mobile-eyebrow-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#breakdown .breakdown-mobile-zz {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(127, 127, 127, 0.24);
    background: rgba(127, 127, 127, 0.12);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#breakdown .breakdown-mobile-model {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    line-height: 1.15;
}

#breakdown .breakdown-mobile-location-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(127, 127, 127, 0.2);
    box-sizing: border-box;
}

#breakdown .breakdown-mobile-location-card-muted {
    background: rgba(127, 127, 127, 0.08);
}

#breakdown .breakdown-mobile-location-label {
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 700;
}

#breakdown .breakdown-mobile-location-value {
    font-size: clamp(18px, 2.8vw, 26px);
    font-weight: 700;
    line-height: 1.15;
    word-break: break-word;
}

#breakdown .breakdown-mobile-location-date {
    color: var(--text-gray);
    font-size: 12px;
}

#breakdown .breakdown-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

#breakdown .breakdown-quick-link,
#breakdown .breakdown-quick-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    min-height: 132px;
    padding: 16px;
    margin: 0;
    border-radius: 18px;
    border: 1px solid rgba(127, 127, 127, 0.22);
    background: linear-gradient(180deg, rgba(127, 127, 127, 0.1), rgba(127, 127, 127, 0.04));
    text-decoration: none;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

#breakdown .breakdown-quick-link:hover,
#breakdown .breakdown-quick-status:hover {
    background: linear-gradient(180deg, rgba(127, 127, 127, 0.16), rgba(127, 127, 127, 0.08)) !important;
}

#breakdown .breakdown-quick-status.bd-status-ok {
    background: linear-gradient(180deg, rgba(101, 201, 81, 0.22), rgba(101, 201, 81, 0.08));
    border-color: rgba(101, 201, 81, 0.4);
}
#breakdown .breakdown-quick-status.bd-status-ok:hover {
    background: linear-gradient(180deg, rgba(101, 201, 81, 0.32), rgba(101, 201, 81, 0.14)) !important;
}
#breakdown .breakdown-quick-status.bd-status-ok .breakdown-quick-icon {
    color: var(--green);
}

#breakdown .breakdown-quick-status.bd-status-ko {
    background: linear-gradient(180deg, rgba(201, 81, 81, 0.22), rgba(201, 81, 81, 0.08));
    border-color: rgba(201, 81, 81, 0.4);
}
#breakdown .breakdown-quick-status.bd-status-ko:hover {
    background: linear-gradient(180deg, rgba(201, 81, 81, 0.32), rgba(201, 81, 81, 0.14)) !important;
}
#breakdown .breakdown-quick-status.bd-status-ko .breakdown-quick-icon {
    color: var(--red);
}

#breakdown .breakdown-quick-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(127, 127, 127, 0.14);
    font-size: 18px;
}

#breakdown .breakdown-quick-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
}

#breakdown .breakdown-quick-subtitle {
    color: var(--text-gray);
    font-size: 12px;
}

#breakdown .breakdown-quick-link .breakdown-quick-icon + .breakdown-quick-title,
#breakdown .breakdown-quick-status .breakdown-quick-icon + .breakdown-quick-title {
    display: flex;
    align-items: center;
    margin-top: calc(-42px - 8px);
    padding-left: 52px;
    min-height: 42px;
}

#breakdown .breakdown-quick-status {
    align-items: flex-start !important;
}

#breakdown .breakdown-quick-status:hover {
    color: inherit !important;
}

#breakdown .breakdown-move-card {
    width: 100%;
    max-width: 760px;
    box-sizing: border-box;
}

#breakdown .breakdown-move-submit {
    margin-top: 12px;
    min-height: 48px;
    font-weight: 700;
}

#breakdown .breakdown-inprogress-banner {
    width: 100%;
    background: rgba(255, 160, 0, 0.08);
    border: 1px solid rgba(255, 160, 0, 0.3);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#breakdown .breakdown-inprogress-heading {
    color: var(--text-gray);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.08em;
    font-weight: 600;
    padding: 0 4px;
}

#breakdown .breakdown-inprogress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 160, 0, 0.1);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

#breakdown .breakdown-inprogress-item:hover {
    background: rgba(255, 160, 0, 0.22);
}

#breakdown .breakdown-inprogress-dot {
    flex-shrink: 0;
    color: #d07800;
    font-size: 20px;
}

#breakdown .breakdown-inprogress-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#breakdown .breakdown-inprogress-label {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#breakdown .breakdown-inprogress-date {
    color: var(--text-gray);
    font-size: 12px;
}

#breakdown .breakdown-inprogress-arrow {
    flex-shrink: 0;
    color: var(--text-gray);
    font-size: 12px;
}

@media (max-width: 768px) {
    #breakdown .breakdown-mobile-shell {
        width: 100%;
    }

    #breakdown .breakdown-mobile-hero {
        padding: 14px;
        border-radius: 16px;
    }

    #breakdown .breakdown-mobile-hero-compact {
        grid-template-columns: 1fr;
    }

    #breakdown .breakdown-quick-link,
    #breakdown .breakdown-quick-status {
        min-height: 72px;
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 14px 16px;
    }

    #breakdown .breakdown-quick-link-primary,
    #breakdown .breakdown-quick-status {
        grid-column: span 2;
        align-items: center !important;
    }

    #breakdown .breakdown-quick-link .breakdown-quick-icon + .breakdown-quick-title,
    #breakdown .breakdown-quick-status .breakdown-quick-icon + .breakdown-quick-title {
        margin-top: 0;
        padding-left: 0;
        min-height: unset;
    }

    #breakdown .breakdown-quick-icon {
        background: none;
        width: 28px;
        height: 28px;
        font-size: 20px;
        flex-shrink: 0;
    }

    #breakdown .breakdown-quick-title {
        font-size: 16px;
        font-weight: 600;
        text-transform: none;
        letter-spacing: 0;
    }

    #breakdown .breakdown-quick-subtitle {
        display: none;
    }
}

#breakdown_id .bd-status-slider {
    display: block;
    width: 100%;
    cursor: pointer;
    user-select: none;
    margin: 4px 0 8px;
}

#breakdown_id .bd-status-slider--disabled {
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}

#breakdown_id .bd-status-slider-input {
    display: none;
}

#breakdown_id .bd-status-slider-track {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 50px;
    border-radius: 25px;
    background: rgba(201, 81, 81, 0.12);
    border: 1px solid rgba(201, 81, 81, 0.35);
    overflow: hidden;
    transition: background 0.25s ease, border-color 0.25s ease;
    box-sizing: border-box;
}

#breakdown_id .bd-status-slider-thumb {
    position: absolute;
    left: 3px;
    top: 3px;
    bottom: 3px;
    width: calc(50% - 6px);
    background: var(--red);
    border-radius: 22px;
    transition: left 0.25s ease, background 0.25s ease;
    z-index: 1;
}

#breakdown_id .bd-status-slider-text {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 600;
    font-size: 13px;
    z-index: 2;
    pointer-events: none;
    transition: color 0.25s, opacity 0.25s;
}

#breakdown_id .bd-status-slider-text--left {
    left: 0;
    color: #fff;
    opacity: 1;
}

#breakdown_id .bd-status-slider-text--right {
    right: 0;
    color: var(--text-gray);
    opacity: 0.5;
}

#breakdown_id .bd-status-slider-input:checked ~ .bd-status-slider-track {
    background: rgba(101, 201, 81, 0.12);
    border-color: rgba(101, 201, 81, 0.35);
}

#breakdown_id .bd-status-slider-input:checked ~ .bd-status-slider-track .bd-status-slider-thumb {
    left: calc(50% + 3px);
    background: var(--green);
}

#breakdown_id .bd-status-slider-input:checked ~ .bd-status-slider-track .bd-status-slider-text--left {
    color: var(--text-gray);
    opacity: 0.5;
}

#breakdown_id .bd-status-slider-input:checked ~ .bd-status-slider-track .bd-status-slider-text--right {
    color: #fff;
    opacity: 1;
}

#breakdown_id .bd-log-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

#breakdown_id .bd-log-entry {
    background: var(--gray);
    border-radius: 6px;
    padding: 10px 12px;
}

#breakdown_id .bd-log-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

#breakdown_id .bd-log-entry-user {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

#breakdown_id .bd-log-entry-date {
    font-size: 11px;
    color: var(--text-gray);
    white-space: nowrap;
}

#breakdown_id .bd-log-entry-text {
    margin: 0;
    font-size: 13px;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: calc(1.5em * 3);
    overflow-y: auto;
}

/* Toggle switch row — target any <small class="... block"> that wraps a .switch */
small.block:has(> label.switch) {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 4px 0;
    background: rgba(127, 127, 127, 0.05);
    border: 1px solid rgba(127, 127, 127, 0.12);
    font-size: 12px;
    cursor: default;
    transition: background 0.15s;
}

small.block:has(> label.switch):hover {
    background: rgba(127, 127, 127, 0.1);
}

small.block:has(> label.switch) label.switch {
    margin: 0;
}

.badge-type-default {
    font-size: 11px;
    font-weight: 600;
    background: rgba(30, 155, 75, 0.12);
    color: rgb(20, 130, 60);
    border: 1px solid rgba(30, 155, 75, 0.35);
    padding: 2px 9px;
    border-radius: 10px;
    vertical-align: middle;
}

.bd-stats-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.bd-stat-chip {
    flex: 1;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 10px 6px;
    border-radius: 6px;
    border-top: 3px solid transparent;
}
.bd-stat-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.bd-stat-chip-icon {
    font-size: 14px;
    opacity: 0.85;
}
.bd-stat-label i {
    display: none;
}
.bd-stat-count {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}
.bd-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
    opacity: 0.75;
}
.bd-stat-chip--cours   { border-top-color: #888;               background: rgba(136, 136, 136, 0.08); }
.bd-stat-chip--waiting { border-top-color: rgb(255, 128, 0);   background: rgba(255, 128, 0,   0.08); }
.bd-stat-chip--ordered { border-top-color: rgb(60,  130, 230); background: rgba(60,  130, 230, 0.08); }
.bd-stat-chip--sav     { border-top-color: rgb(210, 40,  40);  background: rgba(210, 40,  40,  0.08); }
.bd-stat-chip--done    { border-top-color: rgb(30,  155, 75);  background: rgba(30,  155, 75,  0.08); }

.dark-mode .bd-stat-chip--cours   { background: rgba(136, 136, 136, 0.32); }
.dark-mode .bd-stat-chip--waiting { background: rgba(255, 128, 0,   0.32); }
.dark-mode .bd-stat-chip--ordered { background: rgba(60,  130, 230, 0.32); }
.dark-mode .bd-stat-chip--sav     { background: rgba(210, 40,  40,  0.32); }
.dark-mode .bd-stat-chip--done    { background: rgba(30,  155, 75,  0.32); }

@media (max-width: 768px) {
    .bd-stat-label {
        font-size: 8px;
        letter-spacing: 0.2px;
        margin-top: 3px;
        opacity: 0.6;
    }
    .bd-stat-count {
        font-size: 18px;
    }
}

#workshop .cards-container {
    overflow-y: auto;
}

#workshop .card-text,
#material_output .card-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-overlay-link {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 8px;
}
.card-header {
    z-index: 1;
}
.card-footer,
.card-meta {
    position: relative;
    z-index: 1;
}

#workshop .screen-card,
#material_output .screen-card {
    padding-top: 44px;
}

#workshop .card-body,
#material_output .card-body {
    text-align: left;
    padding-bottom: 6px;
}

#workshop .card-title,
#material_output .card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    padding-bottom: 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--gray);
}

#workshop .card-text,
#material_output .card-text {
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.5;
}

#workshop .card-meta,
#material_output .card-meta {
    flex-direction: column;
    gap: 3px;
    padding-top: 8px;
    font-size: 11px;
    align-items: stretch;
}

#workshop .card-meta-row,
#material_output .card-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

#workshop .card-meta-machine,
#material_output .card-meta-location {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#workshop .bd-infos-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 400px;
}

.bd-banners-wrap {
    position: absolute;
    top: 0; left: 0; right: 0;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}
.bd-banner {
    display: block;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    letter-spacing: 0.3px;
    color: #fff;
    line-height: 1.3;
}
.bd-banner-sav       { background: rgba(210, 40,  40,  0.90); }
.bd-banner-waiting   { background: rgba(255, 128, 0,   0.85); }
.bd-banner-ordered   { background: rgba(60,  130, 230, 0.88); }
.bd-banner-delivered { background: rgba(30,  155, 75,  0.88); }
.bd-banner-partial-waiting {
    background: repeating-linear-gradient(
        -45deg,
        rgba(30,  155, 75,  0.88)  0px,
        rgba(30,  155, 75,  0.88)  6px,
        rgba(255, 128, 0,   0.85)  6px,
        rgba(255, 128, 0,   0.85) 12px
    );
}
.bd-banner-partial-ordered {
    background: repeating-linear-gradient(
        -45deg,
        rgba(30,  155, 75,  0.88)  0px,
        rgba(30,  155, 75,  0.88)  6px,
        rgba(60,  130, 230, 0.88)  6px,
        rgba(60,  130, 230, 0.88) 12px
    );
}

/* Parts chips row — inside bd-banners-wrap */
.bd-parts-row {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 3px 8px 5px;
    background: rgba(0, 0, 0, 0.18);
}

.bd-part-chip {
    display: inline-block;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1.3;
    padding: 1px 5px 2px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.bd-part-chip--more {
    flex-shrink: 0;
    max-width: none;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.25);
}

/* Card padding — 1 banner only */
#workshop .screen-card:has(.bd-banners-wrap) {
    padding-top: 50px;
}
#workshop .screen-card:has(.bd-banners-wrap) .card-header {
    top: 24px;
}
/* Card padding — 2 banners only */
#workshop .screen-card:has(.bd-banner ~ .bd-banner) {
    padding-top: 68px;
}
#workshop .screen-card:has(.bd-banner ~ .bd-banner) .card-header {
    top: 46px;
}
/* Card padding — 1 banner + chips row */
#workshop .screen-card:has(.bd-parts-row) {
    padding-top: 74px;
}
#workshop .screen-card:has(.bd-parts-row) .card-header {
    top: 48px;
}
/* Card padding — 2 banners + chips row */
#workshop .screen-card:has(.bd-banner ~ .bd-banner):has(.bd-parts-row) {
    padding-top: 92px;
}
#workshop .screen-card:has(.bd-banner ~ .bd-banner):has(.bd-parts-row) .card-header {
    top: 68px;
}

#workshop > .dashboard-flex,
#material_output > .dashboard-flex {
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

#workshop .dashboard-flex-left,
#workshop .dashboard-flex-right,
#material_output .dashboard-flex-left,
#material_output .dashboard-flex-right {
    min-height: 0;
}

.type-quick-option {
    margin: 0 !important;
    flex: 1 1 auto;
    width: 100%;
    min-height: 26px;
    padding: 4px 8px !important;
    background: transparent !important;
    border-radius: 6px;
    font-size: 12px !important;
    text-align: left;
}

.type-quick-option:hover {
    background: var(--gray) !important;
    color: var(--white) !important;
}

.type-quick-item.is-active .type-quick-option {
    background: var(--gray) !important;
}

.type-quick-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--text-gray);
}

.type-quick-action:link,
.type-quick-action:visited {
    color: var(--text-gray);
}

.type-quick-add {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--gray);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--white);
}

.type-quick-empty {
    padding: 6px 8px;
    font-size: 12px;
    color: var(--text-gray);
}

.dashboard-global-alerts {
    position: fixed;
    top: calc(90px + env(safe-area-inset-top));
    right: 20px;
    z-index: 10001;
    width: min(420px, calc(100vw - 40px));
    pointer-events: none;
}

.dashboard-global-alerts .form-alert {
    margin-bottom: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    pointer-events: auto;
    animation: global-alert-fade 6s ease forwards;
}

@keyframes global-alert-fade {
    0%, 78% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-6px);
    }
}

@media (max-width: 768px) {
    .dashboard-global-alerts {
        top: calc(78px + env(safe-area-inset-top));
        right: 10px;
        width: calc(100vw - 20px);
    }
}

/* CSS : KIT */

a {
  color: inherit;
  text-decoration: none;
}

a:visited {
  color: inherit;
}

a[disabled] {
    cursor: not-allowed !important;
    opacity: 0.5;
}

/* CSS : MENU NAVIGATEUR */

.dashboard-nav-item {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
    color: var(--white);
    cursor: pointer;
    border-radius: 8px;
    padding: 10px;
    margin: 5px;
    width: 100%;
}

.dashboard-nav-title {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    right: 0;
}

@media (max-width: 768px) {
    .dashboard-nav-title {
        font-weight: bold;
    }
}

.dashboard-nav-item i {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    left: 0;
    width: 10%;
    color: var(--text-gray);
}

@media (max-width: 768px) {
    .dashboard-nav-item i {
        width: 100%;
        font-size: 1.8rem;
    }
}

.dashboard-nav-item:not(.dashboard-nav-list-submenu).active i {
    color: var(--white);
}

/* EPI */
.epi-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
    padding: 10px;
}

.epi-user-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: var(--background);
    border: 1px solid var(--gray);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.epi-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray);
}

.epi-card-type {
    font-weight: 600;
    font-size: 14px;
}

.epi-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.epi-status-ok {
    color: var(--green);
    background: color-mix(in srgb, var(--green) 15%, transparent);
}

.epi-status-expired {
    color: var(--red);
    background: color-mix(in srgb, var(--red) 15%, transparent);
}

.epi-status-none {
    color: var(--text-gray);
    background: color-mix(in srgb, var(--gray) 60%, transparent);
}

.epi-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.epi-card-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.epi-card-row select {
    flex: 1;
    min-width: 0;
}

.epi-card-date {
    width: 100%;
}

.epi-date-mode-tabs {
    display: flex;
    gap: 4px;
}

.epi-date-tab {
    flex: 1;
    padding: 4px 6px;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid var(--gray);
    background: transparent;
    color: var(--text-gray);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: center;
}

.epi-date-tab.is-active {
    background: color-mix(in srgb, var(--green) 15%, transparent);
    color: var(--green);
    border-color: var(--green);
    font-weight: 600;
}

.epi-card-date-input {
    width: 100%;
}

.epi-computed-expiry {
    font-size: 11px;
    padding: 2px 0;
}

.epi-history-delete {
    color: var(--text-gray);
    padding: 2px 4px;
    border-radius: 3px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s, color 0.15s;
}

.epi-history-delete:hover {
    opacity: 1;
    color: var(--red);
}

.epi-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gray);
}

.epi-save-btn.is-saving {
    opacity: 0.6;
    pointer-events: none;
}

.epi-card-dates {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.epi-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.epi-history-toggle {
    color: var(--text-gray);
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}
.epi-history-toggle:hover {
    color: var(--text);
}

.epi-history-list {
    border-top: 1px solid var(--gray);
    padding: 8px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.epi-history-empty {
    padding: 4px 0;
}

.epi-history-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--gray) 50%, transparent);
}

.epi-history-removal {
    opacity: 0.5;
}

.epi-history-label {
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.epi-history-dates {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    white-space: nowrap;
    color: var(--text-gray);
}

@media (max-width: 600px) {
    .epi-cards-grid {
        grid-template-columns: 1fr;
    }
}

#output_id .output-selection-dropdown .dropdown-button {
    min-height: 44px;
}

#output_id .dropdown-selection-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

#output_id .dropdown-selection-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--gray);
    border-radius: 999px;
    background: color-mix(in srgb, var(--gray) 58%, transparent);
    font-size: 12px;
    line-height: 1.2;
    color: var(--white);
    cursor: pointer;
    text-align: left;
}

#output_id .dropdown-selection-text {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

#output_id .dropdown-selection-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--background);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
}

#output_id .dropdown-selection-empty {
    color: var(--text-gray);
    font-size: 12px;
}

#output_id .dropdown-selection-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 13px;
    line-height: 1;
    flex: 0 0 auto;
}

@media (max-width: 768px) {
    #output_id .dropdown-selection-chip {
        width: 100%;
        justify-content: space-between;
        border-radius: 12px;
    }
}
  
.dashboard-nav-item:hover {
    background-color: var(--gray);
}
  
.dashboard-nav-item.active {
    background-color: var(--gray);
}
  
.dashboard-nav-item.open {
    background-color: var(--background);
}

.dashboard-nav-item.open.active {
    background-color: var(--background);
}

.dashboard-nav-list-submenu {
    display: flex;
    flex-direction: column;
}

.dashboard-nav-list-submenu.open {
    border-radius: 8px;
    border: 1px solid var(--gray);
}


.dashboard-nav-list-submenu > span {
    display: flex;
    align-items: center;
     justify-content: flex-start;
    width: 100%;
    gap: 8px;
}

.dashboard-nav-list-submenu .dashboard-nav-item-submenu {
    flex-direction: column;
}

.dashboard-nav-list-submenu.open .dashboard-nav-item-submenu {
    display: flex;
}
  
.dashboard-nav-item-submenu {
    display: none;
    list-style: none;
    flex-direction: column;
    width: 100%;
} 

.dashboard-nav-item-submenu i {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    left: 0;
}
.dashboard-nav-item-submenu > span {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    right: 0;
}
  
.dashboard-nav-item-submenu li {
    background: var(--background);
}
  
.dashboard-nav-item-submenu li:hover {
    background: var(--gray);
}

.dashboard-nav-version {
    list-style: none;
    right: 0;
    color: var(--text-gray);
    font-size: 10px;
    text-decoration: none;
}

/* CSS : RFID OVERLAY */

.rfid-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rfid-overlay-box {
    background: var(--background);
    color: var(--text);
    border-radius: 12px;
    padding: 28px 32px;
    min-width: 280px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--gray);
}

.rfid-overlay-title {
    margin: 0 0 6px;
    font-weight: 700;
    font-size: 1rem;
}

.rfid-overlay-sub {
    margin: 0 0 16px;
    font-size: 0.85rem;
    opacity: 0.7;
}

.rfid-overlay-status {
    margin: 0 0 16px;
    font-weight: 600;
    font-size: 1rem;
}

.rfid-overlay-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(127, 127, 127, 0.25);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: rfid-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes rfid-spin {
    to { transform: rotate(360deg); }
}

.rfid-overlay-btn {
    margin: 4px 0 0 !important;
    padding: 7px 20px !important;
    border-radius: 6px !important;
    border: 1px solid var(--gray) !important;
    background: transparent !important;
    color: inherit !important;
    font-size: 0.9rem !important;
}

/* Camera Scan */

#scannerModal {
    background: #111;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(92vw, 480px);
    padding: 16px;
    gap: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

#scannerViewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

#scannerVideo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

#scannerQuagga {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#scannerQuagga video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#scannerQuagga canvas {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
}

#scannerFrame {
    position: absolute;
    inset: 18%;
    pointer-events: none;
    z-index: 5;
}

.scanner-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: #4da3ff;
    border-style: solid;
}

.scanner-corner.tl { top: 0;    left:  0;   border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.scanner-corner.tr { top: 0;    right: 0;   border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.scanner-corner.bl { bottom: 0; left:  0;   border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.scanner-corner.br { bottom: 0; right: 0;   border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

#scannerFrame::after {
    content: '';
    position: absolute;
    left: -6px;
    right: -6px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #4da3ff 25%, #4da3ff 75%, transparent 100%);
    box-shadow: 0 0 8px 1px rgba(77,163,255,0.6);
    animation: scannerLine 2s ease-in-out infinite;
    top: 0;
}

@keyframes scannerLine {
    0%   { top: 0%;   opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

#scannerStatus {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    text-align: center;
    margin: 0;
    min-height: 18px;
    font-family: var(--font, inherit);
}

#scannerClose {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
    border-radius: 8px;
    padding: 8px 22px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
    font-family: var(--font, inherit);
}

#scannerClose:hover {
    background: rgba(255,255,255,0.16);
}

/* bd-note inline edit */
#breakdown_id .bd-note-edit-area {
    margin-top: 8px;
}

#breakdown_id .bd-note-edit-area textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 60px;
}

#breakdown_id .bd-note-edit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

/* Custom Dialog */
.custom-dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: dialog-fade-in 0.15s ease;
}

@keyframes dialog-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.custom-dialog {
    background: var(--background);
    border: 1px solid var(--gray);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    padding: 24px 24px 20px;
    width: 100%;
    max-width: 360px;
    animation: dialog-slide-up 0.18s ease;
}

@keyframes dialog-slide-up {
    from { transform: translateY(10px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.custom-dialog-message {
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
    white-space: pre-line;
}

.custom-dialog-actions {
    display: flex;
    gap: 8px;
}

.custom-dialog-actions button {
    margin: 0;
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    padding: 9px 16px;
}

.custom-dialog-btn-cancel {
    background: var(--gray) !important;
    color: var(--text) !important;
}

.custom-dialog-btn-cancel:hover {
    filter: brightness(0.92);
}

.custom-dialog-btn-confirm {
    background: var(--gray) !important;
    color: var(--text) !important;
}

.custom-dialog-btn-confirm:hover {
    filter: brightness(0.92);
}

.custom-dialog-btn-confirm.destructive {
    background: rgba(201, 81, 81, 0.15) !important;
    color: var(--red) !important;
}

.custom-dialog-btn-confirm.destructive:hover {
    background: rgba(201, 81, 81, 0.25) !important;
}

.custom-dialog-btn-ok {
    flex: 1;
    background: var(--gray) !important;
    color: var(--text) !important;
    margin: 0 !important;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    padding: 9px 16px;
}

.custom-dialog-btn-ok:hover {
    filter: brightness(0.92);
}

/* ── RADIO BOARD ──────────────────────────────────────────────── */

#radio .radio-stats-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.radio-stat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 22px;
    border-radius: 12px;
    border-top: 3px solid transparent;
    min-width: 90px;
}

.radio-stat-chip--free     { border-top-color: rgb(30,155,75);    background: rgba(30,155,75,.08);  }
.radio-stat-chip--assigned { border-top-color: rgb(255,128,0);    background: rgba(255,128,0,.08);  }
.radio-stat-chip--hs       { border-top-color: rgb(210,40,40);    background: rgba(210,40,40,.08);  }

.dark-mode .radio-stat-chip--free     { background: rgba(30,155,75,.22);  }
.dark-mode .radio-stat-chip--assigned { background: rgba(255,128,0,.22);  }
.dark-mode .radio-stat-chip--hs       { background: rgba(210,40,40,.22);  }

.radio-stat-chip .radio-stat-count {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.radio-stat-chip .radio-stat-label {
    font-size: 11px;
    opacity: 0.65;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.radio-stat-chip--free     .radio-stat-count { color: rgb(30,155,75);   }
.radio-stat-chip--assigned .radio-stat-count { color: rgb(255,128,0);   }
.radio-stat-chip--hs       .radio-stat-count { color: rgb(210,40,40);   }

.radio-board {
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    flex: 1;
}

.radio-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.45;
    margin-bottom: 10px;
}

.radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

@media (min-width: 600px) {
    .radio-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}

.radio-card {
    position: relative;
    background: var(--gray);
    border-radius: 14px;
    padding: 14px 14px 12px;
    border: 1.5px solid transparent;
    border-left-width: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 108px;
    transition: transform .12s ease, box-shadow .12s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.radio-card[role="button"] { cursor: pointer; }
.radio-card[role="button"]:active { transform: scale(0.96); }
.radio-card[role="button"]:hover  { box-shadow: 0 0 0 1.5px rgba(255,255,255,.1); }

.radio-card--free     { border-left-color: rgb(30,155,75);    }
.radio-card--assigned { border-left-color: rgb(255,128,0);    }
.radio-card--hs       { border-left-color: rgb(210,40,40); opacity: .65; }

.radio-card-dot {
    position: absolute;
    top: 13px;
    right: 13px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.radio-card--free .radio-card-dot     { background: rgb(30,155,75);   }
.radio-card--assigned .radio-card-dot { background: rgb(255,128,0);   }
.radio-card--hs .radio-card-dot       { background: rgb(210,40,40);   }

.radio-card-code {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
    padding-right: 16px;
}

.radio-card-label {
    font-size: 11px;
    opacity: 0.45;
    line-height: 1.3;
    margin-bottom: 4px;
}

.radio-card-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding-top: 8px;
}

.radio-card--free .radio-card-user     { opacity: .38; }
.radio-card--assigned .radio-card-user { color: rgb(255,128,0); }
.radio-card--hs .radio-card-user       { color: rgb(210,40,40); }

/* loading state */
.radio-card.is-loading { opacity: .55; pointer-events: none; }

/* ── RADIO MODAL ──────────────────────────────────────────────── */

.radio-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.52);
    z-index: 10500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 600px) {
    .radio-modal-overlay { align-items: center; }
}

.radio-modal {
    background: var(--gray);
    border-radius: 18px 18px 0 0;
    width: 100%;
    max-width: 460px;
    max-height: 78vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: radioModalUp .22s cubic-bezier(.22,.61,.36,1) both;
}

@media (min-width: 600px) {
    .radio-modal { border-radius: 18px; animation: radioModalFade .18s ease both; }
}

@keyframes radioModalUp {
    from { transform: translateY(60px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

@keyframes radioModalFade {
    from { transform: scale(.96); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.radio-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 14px;
    border-bottom: 1px solid var(--background);
    flex-shrink: 0;
    gap: 8px;
}

.radio-modal-head-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }

.radio-modal-title {
    font-size: 17px;
    font-weight: 800;
}

.radio-modal-subtitle {
    font-size: 12px;
    opacity: 0.5;
}

.radio-modal-close {
    background: transparent !important;
    border: none !important;
    min-height: auto !important;
    padding: 6px !important;
    font-size: 18px;
    opacity: 0.55;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 50% !important;
}

.radio-modal-close:hover { opacity: 1; background: var(--background) !important; }

.radio-modal-search {
    padding: 10px 12px;
    border-bottom: 1px solid var(--background);
    flex-shrink: 0;
}

.radio-modal-search input {
    width: 100%;
    margin: 0;
}

.radio-modal-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.radio-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    cursor: pointer;
    transition: background .1s;
}

.radio-user-item:hover, .radio-user-item:active { background: var(--background); }
.radio-user-item.is-active { background: color-mix(in srgb, var(--background) 70%, transparent); }

.radio-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: .5px;
}

.radio-user-name { font-size: 14px; font-weight: 500; flex: 1; }

.radio-user-check { color: rgb(30,155,75); display: none; font-size: 16px; }
.radio-user-item.is-active .radio-user-check { display: block; }

.radio-modal-foot {
    padding: 10px 14px;
    border-top: 1px solid var(--background);
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

.radio-modal-foot button { flex: 1; margin: 0 !important; }

