:root {
    --mustard: #f6d04a;
    --mustard-hover: #f0c53a;
    --mustard-dark: #e8b82e;
    --navy: #1b1f24;
    --navy-soft: #24292f;
    --ink: #1a1d21;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f3f4f6;
    --red: #dc3545;
    --green: #198754;
    --orange: #f4a261;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body.app-body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", "Inter", Arial, sans-serif;
}

a { color: inherit; }

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 260px;
    background: var(--navy);
    color: #fff;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 18px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--mustard);
    color: #111;
    display: grid;
    place-items: center;
    font-size: 22px;
}

.brand h1 {
    font-size: 16px;
    margin: 0;
    line-height: 1.2;
}

.brand small {
    color: #9ca3af;
    font-size: 11px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #d1d5db;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 14px;
}

.nav-link:hover,
.nav-link.active {
    background: var(--mustard);
    color: #1a1a1a;
    font-weight: 600;
}

.sidebar-foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    color: #9ca3af;
    font-size: 12px;
}

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h2 {
    margin: 0;
    font-size: 22px;
}

.topbar .sub {
    color: var(--muted);
    font-size: 13px;
}

.content {
    padding: 24px 28px 40px;
}

.card-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 22px;
}

.card-panel h3,
.section-title {
    margin: 0 0 18px;
    font-size: 20px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-control,
.form-select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    min-height: 42px;
    font-size: 14px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--mustard);
    box-shadow: 0 0 0 3px rgba(246, 208, 74, .28);
}

.btn-mustard {
    --bs-btn-color: #1a1a1a;
    --bs-btn-bg: var(--mustard);
    --bs-btn-border-color: var(--mustard);
    --bs-btn-hover-color: #1a1a1a;
    --bs-btn-hover-bg: var(--mustard-hover);
    --bs-btn-hover-border-color: var(--mustard-hover);
    --bs-btn-active-color: #1a1a1a;
    --bs-btn-active-bg: var(--mustard-dark);
    --bs-btn-active-border-color: var(--mustard-dark);
    --bs-btn-disabled-color: #1a1a1a;
    --bs-btn-disabled-bg: #f8e7a0;
    --bs-btn-disabled-border-color: #f8e7a0;
    --bs-btn-focus-shadow-rgb: 240, 197, 58;
    background-color: var(--mustard);
    border-color: var(--mustard);
    color: #1a1a1a;
    font-weight: 700;
    border-radius: 8px;
    padding: 9px 16px;
}

.btn-mustard:hover,
.btn-mustard:focus,
.btn-mustard:focus-visible,
.btn-mustard:active,
.btn-mustard.active,
.btn-mustard:disabled,
.btn-mustard.disabled {
    background-color: var(--mustard-hover) !important;
    border-color: var(--mustard-hover) !important;
    color: #1a1a1a !important;
}

.btn-mustard:disabled,
.btn-mustard.disabled {
    background-color: #f8e7a0 !important;
    border-color: #f8e7a0 !important;
    color: #5c5340 !important;
    opacity: 1;
}

.btn-ghost {
    --bs-btn-color: #1a1a1a;
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #d1d5db;
    --bs-btn-hover-color: #1a1a1a;
    --bs-btn-hover-bg: #f8fafc;
    --bs-btn-hover-border-color: #cbd5e1;
    --bs-btn-active-color: #1a1a1a;
    --bs-btn-active-bg: #f1f5f9;
    --bs-btn-active-border-color: #cbd5e1;
    background-color: #fff;
    border: 1px solid #d1d5db;
    color: #1a1a1a;
    border-radius: 8px;
    padding: 9px 16px;
}

.btn-ghost:hover,
.btn-ghost:focus,
.btn-ghost:active {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #1a1a1a !important;
}

.btn-danger-outline {
    --bs-btn-color: var(--red);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--red);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--red);
    --bs-btn-hover-border-color: var(--red);
    background-color: #fff;
    border: 1px solid var(--red);
    color: var(--red);
    border-radius: 8px;
}

.table thead th {
    font-size: 12px;
    letter-spacing: .04em;
    color: #6b7280;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.table td {
    vertical-align: middle;
    font-size: 14px;
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.list-head {
    background: #dbeafe;
    border-radius: 12px 12px 0 0;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-head h3 { margin: 0; font-size: 18px; }

.search-input {
    min-width: 240px;
    background: #fff;
}

.badge-queue { background: #e5e7eb; color: #374151; }
.badge-process { background: #ffe8cc; color: #9a3412; }
.badge-done { background: #dbeafe; color: #1e3a8a; }
.badge-ready { background: #dcfce7; color: #166534; }
.badge-sold { background: #111827; color: #fff; }
.badge-pending { background: var(--mustard); color: #5b4300; }
.badge-pass { background: #dcfce7; color: #166534; }

.status-badge {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
}

.kpi {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
    height: 100%;
    min-height: 132px;
}

.kpi .icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    font-size: 18px;
}

.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 26px; font-weight: 800; line-height: 1.1; }

.icon-yellow { background: #fff4c2; color: #8a6d00; }
.icon-orange { background: #ffe8cc; color: #9a3412; }
.icon-green { background: #dcfce7; color: #166534; }
.icon-red { background: #fee2e2; color: #991b1b; }
.icon-grey { background: #e5e7eb; color: #374151; }
.icon-navy { background: #1b1f24; color: var(--mustard); }

.info-bar {
    background: #fff1e0;
    border: 1px solid #f4c78a;
    color: #7c4a12;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
}

.workflow-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.workflow-tabs span {
    background: #e5e7eb;
    color: #374151;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
}

.workflow-tabs span.active {
    background: var(--navy);
    color: #fff;
}

.part-line {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.cost-card {
    background: var(--navy);
    color: #fff;
    border-radius: 12px;
    padding: 18px;
}

.cost-card .row-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.cost-card .total {
    border-top: 1px solid rgba(255,255,255,.15);
    padding-top: 10px;
    margin-top: 8px;
    font-weight: 700;
}

.profit-pos { color: #86efac; }
.profit-neg { color: #fca5a5; }

.check-box {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

.ledger-item {
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

.ledger-item:last-child { border-bottom: 0; }

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, rgba(227,181,5,.25), transparent 30%),
        linear-gradient(180deg, #f8fafc, #eef1f5);
}

.auth-card {
    width: min(440px, 92vw);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.modal-xl { --bs-modal-width: 1100px; }

.repair-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
}

@media (max-width: 991px) {
    .app-shell { display: block; }
    .sidebar { width: 100%; height: auto; position: relative; }
    .content, .topbar { padding-left: 16px; padding-right: 16px; }
}
