/* ============================================
   PMS — Guru Amar Industries
   QMS Style — Navy + Orange | DM Sans + Rajdhani
   ============================================ */

:root {
    --navy: #0f2540;
    --navy2: #1a3a5c;
    --navy3: #234d78;
    --blue: #1a3a5c;
    --orange: #e8500a;
    --orange2: #f06830;
    --green: #0a6b3a;
    --green2: #148f52;
    --red: #b91c1c;
    --red2: #dc2626;
    --gold: #d4960a;
    --gold2: #f0b429;
    --purple: #6d28d9;
    --bg: #e8ecf4;
    --surface: #ffffff;
    --surface2: #f4f6fb;
    --border: #d1d8e8;
    --border2: #b8c4d8;
    --text: #0d1b2a;
    --text2: #2d3f55;
    --muted: #6b7a90;
    --muted2: #9aabb8;
    --shadow: 0 2px 14px rgba(15, 37, 64, .10);
    --shadow2: 0 8px 32px rgba(15, 37, 64, .18);
    --radius: 10px;
    --radius2: 14px;
    --nav-h: 58px;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

/* ===== LOADER ===== */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity .4s;
}

.loader-inner {
    text-align: center;
}

.loader-logo {
    font-family: 'Rajdhani', sans-serif;
    font-size: 42px;
    font-weight: 700;
    color: var(--orange);
    letter-spacing: 4px;
    margin-bottom: 20px;
}

.loader-bar {
    width: 160px;
    height: 3px;
    background: rgba(255, 255, 255, .15);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-fill {
    height: 100%;
    width: 0;
    background: var(--orange);
    animation: loaderAnim 1.2s ease forwards;
}

@keyframes loaderAnim {
    to {
        width: 100%;
    }
}

/* ===== TOP NAVBAR ===== */
.topnav {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy3) 100%);
    color: #fff;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    position: sticky;
    top: 0;
    z-index: 300;
    box-shadow: 0 2px 20px rgba(0, 0, 0, .35);
}

.topnav-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .5px;
    color: #fff;
}

.nav-brand-sub {
    font-size: .65rem;
    color: rgba(255, 255, 255, .5);
}

.nav-links {
    display: flex;
    gap: 2px;
    align-items: center;
    overflow: visible;
}

.nav-link {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, .65);
    font-family: 'DM Sans', sans-serif;
    font-size: .76rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: .15s;
    white-space: nowrap;
    text-decoration: none;
}

.nav-link:hover {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.nav-link.active {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-weight: 600;
}

.topnav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shift-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shift-label {
    font-size: .65rem;
    color: rgba(255, 255, 255, .5);
}

.shift-time {
    font-size: .75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, .12);
    padding: 3px 10px;
    border-radius: 20px;
    color: #fff;
}

.btn-shift-mgr {
    background: rgba(232, 80, 10, .25);
    color: #ffb38a;
    border: 1px solid rgba(232, 80, 10, .4);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
}

.btn-shift-mgr:hover {
    background: var(--orange);
    color: #fff;
}

.live-clock {
    font-family: 'Rajdhani', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .8);
    min-width: 52px;
}

.btn-logout {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: rgba(255, 255, 255, .5);
    transition: .2s;
}

.btn-logout:hover {
    color: var(--red2);
}

/* ===== PAGE WRAP ===== */
.page-wrap {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 14px;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn .22s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ===== SECTION TABS ===== */
.section-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sec-tab {
    background: transparent;
    border: 1.5px solid var(--border2);
    color: var(--text2);
    font-family: 'DM Sans', sans-serif;
    font-size: .76rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: .15s;
}

.sec-tab:hover {
    border-color: var(--navy2);
    color: var(--navy2);
}

.sec-tab.active {
    background: var(--navy2);
    border-color: var(--navy2);
    color: #fff;
}

/* ===== DASHBOARD STAT CARDS ===== */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.dash-stat-card {
    background: var(--surface);
    border-radius: var(--radius2);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-top: 3px solid var(--border2);
}

.dash-stat-card.orange-top {
    border-top-color: var(--orange);
}

.dash-stat-card.teal-top {
    border-top-color: var(--green2);
}

.dsc-label {
    font-size: .68rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 6px;
}

.dsc-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}

.dsc-value sup {
    font-size: 1rem;
}

.dsc-sub {
    font-size: .72rem;
    color: var(--muted);
    margin-top: 4px;
}

/* ===== SECTION ROW ===== */
.section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-heading {
    font-family: 'Rajdhani', sans-serif;
    font-size: .85rem;
    font-weight: 700;
    color: var(--navy2);
    letter-spacing: .5px;
}

.machine-count {
    font-size: .72rem;
    color: var(--muted);
    margin-left: 10px;
}

.btn-show-all {
    background: transparent;
    border: 1.5px solid var(--border2);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: .72rem;
    cursor: pointer;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    transition: .15s;
}

.btn-show-all:hover {
    border-color: var(--navy2);
    color: var(--navy2);
}

/* ===== MACHINE CARDS ===== */
.machine-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.mc-card {
    background: var(--surface);
    border-radius: var(--radius2);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    transition: .18s;
}

.mc-card:hover {
    box-shadow: var(--shadow2);
}

.mc-card.running {
    border-color: var(--green2);
}

.mc-card.paused {
    border-color: var(--gold);
}

.mc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.mc-code {
    font-family: 'Rajdhani', sans-serif;
    font-size: .72rem;
    font-weight: 700;
    background: var(--navy);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    letter-spacing: .5px;
}

.mc-code.section-hacksaw {
    background: var(--navy2);
}

.mc-code.section-fabrication {
    background: var(--orange);
}

.mc-code.section-lathe {
    background: var(--green);
}

.mc-code.section-auto_machinery {
    background: var(--purple);
}

.mc-code.section-manual_machinery {
    background: var(--gold);
}

.mc-status-dot {
    font-size: .76rem;
    font-weight: 600;
    color: var(--muted);
}

.mc-status-dot.running {
    color: var(--green2);
}

.mc-status-dot.paused {
    color: var(--gold);
}

.mc-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    color: var(--navy);
}

.mc-type {
    font-size: .72rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.mc-operator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.mc-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--navy2);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mc-op-name {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text);
}

.mc-op-sub {
    font-size: .68rem;
    color: var(--muted);
}

.mc-task-box {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.mc-task-name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--navy);
}

.mc-task-meta {
    font-size: .7rem;
    color: var(--muted);
    margin-top: 2px;
}

.mc-timing {
    display: flex;
    justify-content: space-between;
    font-size: .7rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.mc-timer {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green2);
    margin-bottom: 8px;
}

.mc-timer.paused {
    color: var(--gold);
}

.mc-timer.idle {
    color: var(--muted);
}

.mc-actions {
    display: flex;
    gap: 6px;
}

/* ===== TASK QUEUE ===== */
.tq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* ===== TABLE ===== */
.table-wrap {
    background: var(--surface);
    border-radius: var(--radius2);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}

.data-table th {
    background: var(--navy);
    color: #fff;
    padding: 9px 12px;
    text-align: left;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: var(--surface2);
}

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

.td-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* ===== ASSIGN PAGE ===== */
.assign-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
}

.assign-form-panel,
.assign-avail-panel {
    background: var(--surface);
    border-radius: var(--radius2);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.panel-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: .85rem;
    font-weight: 700;
    color: var(--navy2);
    letter-spacing: .5px;
    border-left: 3px solid var(--orange);
    padding-left: 8px;
    margin-bottom: 16px;
}

.assign-divider {
    font-size: .68rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .8px;
    text-transform: uppercase;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-bottom: 14px;
}

.plan-calc-box {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 4px;
}

.plan-calc-label {
    font-size: .68rem;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.plan-calc-val {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy);
}

.assign-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.avail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.avail-list {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.avail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: .15s;
    border-bottom: 1px solid var(--border);
}

.avail-item:last-child {
    border-bottom: none;
}

.avail-item:hover {
    background: var(--surface2);
}

.avail-item.selected {
    background: #fff4ef;
}

.avail-code {
    font-size: .68rem;
    font-weight: 700;
    color: var(--orange);
    margin-bottom: 2px;
}

.avail-name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--navy);
}

.avail-op {
    font-size: .7rem;
    color: var(--muted);
}

.avail-status {
    font-size: .67rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.avail-idle {
    background: #e6f7ee;
    color: var(--green);
}

.avail-pending {
    background: #fff8e0;
    color: #a05a00;
}

.avail-running {
    background: #fff0f0;
    color: var(--red);
}

/* ===== ADMIN ===== */
.admin-section {
    background: var(--surface);
    border-radius: var(--radius2);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Rajdhani', sans-serif;
    font-size: .85rem;
    font-weight: 700;
    color: var(--navy2);
    letter-spacing: .5px;
    border-left: 3px solid var(--orange);
    padding-left: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .82rem;
}

/* ===== REPORTS ===== */
.report-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.report-view-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.view-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted);
    margin-right: 4px;
}

.rep-tab {
    background: transparent;
    border: 1.5px solid var(--border2);
    color: var(--text2);
    font-family: 'DM Sans', sans-serif;
    font-size: .76rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: .15s;
}

.rep-tab:hover {
    border-color: var(--navy2);
    color: var(--navy2);
}

.rep-tab.active {
    background: var(--navy2);
    border-color: var(--navy2);
    color: #fff;
}

.report-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpi-table-wrap {
    background: var(--surface);
    border-radius: var(--radius2);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.efficiency-bar {
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.efficiency-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--green2);
}

.efficiency-fill.warn {
    background: var(--gold);
}

.efficiency-fill.bad {
    background: var(--red2);
}

/* ===== FORMS ===== */
.form-control {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 11px;
    font-family: 'DM Sans', sans-serif;
    font-size: .87rem;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: .18s;
    width: 100%;
}

.form-control:focus {
    border-color: var(--navy2);
    box-shadow: 0 0 0 3px rgba(26, 58, 92, .09);
}

textarea.form-control {
    resize: vertical;
    min-height: 60px;
}

.form-group {
    margin-bottom: 14px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.date-sep {
    font-size: .72rem;
    color: var(--muted);
    padding: 0 4px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: .8rem;
    cursor: pointer;
    transition: .17s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--navy2);
    color: #fff;
}

.btn-primary:hover {
    background: var(--navy3);
}

.btn-orange {
    background: var(--orange);
    color: #fff;
}

.btn-orange:hover {
    background: var(--orange2);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border2);
    color: var(--text2);
}

.btn-outline:hover {
    border-color: var(--navy2);
    color: var(--navy2);
}

.btn-success {
    background: var(--green);
    color: #fff;
}

.btn-success:hover {
    background: var(--green2);
}

.btn-danger {
    background: var(--red);
    color: #fff;
}

.btn-danger:hover {
    background: var(--red2);
}

.btn-warning {
    background: var(--gold);
    color: #fff;
}

.btn-warning:hover {
    background: var(--gold2);
}

.btn-sm {
    padding: 5px 10px;
    font-size: .73rem;
    border-radius: 6px;
}

.btn-icon {
    padding: 5px 7px;
    border-radius: 6px;
    font-size: .73rem;
}

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

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.badge-pending {
    background: #fff8e0;
    color: #a05a00;
}

.badge-running {
    background: #e6f7ee;
    color: var(--green);
}

.badge-paused {
    background: #fffbeb;
    color: var(--gold);
}

.badge-done {
    background: #e6f7ee;
    color: var(--green);
}

.badge-idle {
    background: var(--surface2);
    color: var(--muted);
}

.badge-normal {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-high {
    background: #fff8e0;
    color: #a05a00;
}

.badge-urgent {
    background: #fff0f0;
    color: var(--red);
}

.badge-low {
    background: var(--surface2);
    color: var(--muted);
}

.badge-in_production {
    background: #fff4ef;
    color: var(--orange);
}

.badge-on_hold {
    background: #fffbeb;
    color: var(--gold);
}

.badge-completed {
    background: #e6f7ee;
    color: var(--green);
}

.badge-cancelled {
    background: #fff0f0;
    color: var(--red);
}

.badge-manual {
    background: var(--surface2);
    color: var(--muted);
}

.badge-qms {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-service_spare {
    background: #f3e8ff;
    color: var(--purple);
}

/* ===== SUGGESTIONS ===== */
.suggestions-dropdown {
    position: absolute;
    z-index: 200;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow2);
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: .82rem;
    border-bottom: 1px solid var(--border);
    transition: .15s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--surface2);
}

.suggestion-meta {
    font-size: .7rem;
    color: var(--muted);
}

/* ===== CHECKBOX LIST ===== */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    cursor: pointer;
}

.checkbox-item input {
    accent-color: var(--orange);
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 18, 35, .6);
    backdrop-filter: blur(2px);
    z-index: 800;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.modal-overlay.open {
    display: flex;
    animation: fadeIn .18s ease;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius2);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
    padding: 26px;
    width: 100%;
    max-width: 580px;
    max-height: 92vh;
    overflow-y: auto;
}

.modal.modal-sm {
    max-width: 400px;
}

.modal.modal-lg {
    max-width: 820px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--muted);
    padding: 2px 6px;
    border-radius: 4px;
}

.modal-close:hover {
    color: var(--red);
    background: #fff0f0;
}

.modal-body {
    padding: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* ===== BOM ===== */
.bom-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    align-items: start;
}

.bom-list-panel {
    background: var(--surface);
    border-radius: var(--radius2);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.bom-list-item {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: .15s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bom-list-item:last-child {
    border-bottom: none;
}

.bom-list-item:hover {
    background: var(--surface2);
}

.bom-list-item.selected {
    background: #fff4ef;
    border-left: 3px solid var(--orange);
}

.bom-item-code {
    font-size: .68rem;
    font-weight: 700;
    color: var(--orange);
}

.bom-item-name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--navy);
}

.bom-item-count {
    font-size: .7rem;
    color: var(--muted);
}

.bom-tree-panel {
    background: var(--surface);
    border-radius: var(--radius2);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 16px;
}

.bom-tree-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.bom-tree-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
}

.bom-tree-placeholder {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}

.bom-tree-placeholder .placeholder-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: .35;
}

.bom-tree-node {
    margin-left: 0;
}

.bom-tree-node+.bom-tree-node {
    margin-top: 6px;
}

.bom-node-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    transition: .15s;
    cursor: default;
}

.bom-node-row:hover {
    background: var(--surface2);
}

.bom-node-line {
    width: 20px;
    height: 1px;
    background: var(--border);
}

.bom-node-type {
    font-size: .6rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: .5px;
    flex-shrink: 0;
}

.node-P {
    background: #fff4ef;
    color: var(--orange);
}

.node-N {
    background: var(--surface2);
    color: var(--muted);
}

.bom-node-code {
    font-size: .7rem;
    color: var(--muted);
}

.bom-node-name {
    font-size: .82rem;
    font-weight: 500;
    color: var(--navy);
    flex: 1;
}

.bom-node-qty {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text2);
    white-space: nowrap;
}

.bom-node-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: .15s;
}

.bom-node-row:hover .bom-node-actions {
    opacity: 1;
}

.bom-children {
    padding-left: 20px;
    margin-top: 6px;
    border-left: 1.5px dashed var(--border2);
}

/* ===== STATS GRID (reports) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius2);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-top: 3px solid var(--border2);
}

.stat-card.accent {
    border-top-color: var(--orange);
}

.stat-card.success {
    border-top-color: var(--green2);
}

.stat-icon {
    font-size: 1.3rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.stat-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}

.stat-label {
    font-size: .68rem;
    color: var(--muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* ===== MASTER CARDS (admin) ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.master-card {
    background: var(--surface);
    border-radius: var(--radius2);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: .18s;
}

.master-card:hover {
    box-shadow: var(--shadow2);
}

.master-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}

.master-card-code {
    font-size: .68rem;
    font-weight: 700;
    color: var(--orange);
    letter-spacing: .5px;
}

.master-card-name {
    font-size: .87rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
}

.master-card-sub {
    font-size: .75rem;
    color: var(--muted);
}

.master-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .68rem;
    background: var(--surface2);
    color: var(--muted);
    border: 1px solid var(--border);
}

.master-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.inactive-card {
    opacity: .55;
}

/* ===== COMPLETE INFO ===== */
.complete-info {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: .82rem;
}

.complete-info-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
}

.complete-info-row:last-child {
    border-bottom: none;
    margin-bottom: 12px;
}

.complete-info-row span {
    color: var(--muted);
}

.complete-task-info {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: .82rem;
}

/* ===== PAGE HEADER ===== */
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.page-title-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy2);
    border-left: 3px solid var(--orange);
    padding-left: 8px;
    letter-spacing: .5px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--navy);
    color: #fff;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 500;
    box-shadow: var(--shadow2);
    opacity: 0;
    transform: translateY(8px);
    transition: all .25s;
    pointer-events: none;
    z-index: 2000;
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: none;
}

.toast.success {
    border-left: 4px solid var(--green2);
}

.toast.error {
    border-left: 4px solid var(--red2);
}

.toast.warning {
    border-left: 4px solid var(--gold);
}

/* ===== MISC ===== */
.empty-msg {
    text-align: center;
    padding: 32px;
    color: var(--muted);
    font-size: .82rem;
}

.loading-placeholder {
    text-align: center;
    padding: 32px;
    color: var(--muted);
    font-size: .82rem;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}

.empty-state-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
    opacity: .35;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .assign-layout {
        grid-template-columns: 1fr;
    }

    .dash-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row-3 {
        grid-template-columns: 1fr 1fr;
    }

    .bom-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .nav-links {
        display: none;
    }

    .dash-stats {
        grid-template-columns: 1fr 1fr;
    }

    .page-wrap {
        padding: 12px;
    }

    .report-topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* Nav Dropdown */
.nav-dropdown { position: relative; display: inline-block; }
.nav-drop-btn { background: none; border: none; cursor: pointer; font-family: inherit; font-size: inherit; }
.nav-drop-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--navy2, #1a3a5c);
  border-radius: 6px;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 999;
  padding: 4px 0;
}
.nav-drop-menu .nav-link { display: block; padding: 8px 16px; white-space: nowrap; }