:root {
    --bg: #f3f1ee;
    --sidebar: #1f1b18;
    --sidebar-soft: #3a312b;
    --primary: #f27616;
    --text: #25211e;
    --muted: #746b63;
    --border: #ded7cf;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 268px; background: var(--sidebar); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 22px; }
.brand-mark, .login-logo { width: 46px; height: 46px; border-radius: 8px; background: #1f1b18; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(242,118,22,.45); box-shadow: 0 8px 18px rgba(0,0,0,.22); }
.brand small { display: block; color: #b9c2d3; }
.sidebar .nav-link { color: #d8deea; border-radius: 8px; padding: 11px 12px; display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.sidebar .nav-link:hover, .sidebar .nav-link.active { background: var(--sidebar-soft); color: #fff; }
.sidebar-footer { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.12); display: flex; justify-content: space-between; gap: 10px; }
.sidebar-footer a { color: #ffb36b; text-decoration: none; }
.content { margin-left: 268px; width: calc(100% - 268px); padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.topbar h1 { font-size: 26px; margin: 0; font-weight: 700; }
.panel, .metric-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 25px rgba(15,23,42,.05); }
.panel { padding: 18px; }
.metric-card { padding: 20px; min-height: 126px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-card.compact { min-height: 96px; padding: 16px; }
.metric-card span { color: var(--muted); font-size: 14px; }
.metric-card strong { font-size: 27px; line-height: 1.15; }
.metric-icon { font-size: 26px; }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.search-form { display: flex; gap: 8px; width: min(620px, 100%); }
.form-panel { max-width: 980px; }
.form-panel.narrow { max-width: 560px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.actions { white-space: nowrap; }
.table th { color: #536079; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #1f1b18, #3a312b); padding: 20px; }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 32px; box-shadow: 0 18px 45px rgba(15,23,42,.12); }
.login-logo { margin: 0 auto 12px; }
.login-card h1 { font-size: 28px; margin: 0; }
.login-card p { color: var(--muted); margin: 4px 0 0; }
@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar { position: static; width: 100%; min-height: auto; }
    .content { margin-left: 0; width: 100%; padding: 18px; }
    .toolbar, .search-form { flex-direction: column; align-items: stretch; }
}
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #d85f08; border-color: #d85f08; }
.metric-link { color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.metric-link:hover { color: inherit; transform: translateY(-2px); border-color: rgba(242,118,22,.42); box-shadow: 0 16px 34px rgba(66,43,25,.14); }
.global-search { width: min(360px, 100%); display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.global-search input { border: 0; outline: 0; width: 100%; min-width: 0; }
.global-search i { color: var(--primary); }
.badge.bg-info { background-color: #d7d4cd !important; }
.table tbody tr:hover { background: #fff8f1; }

.btn-success { background-color: #2f8f5b; border-color: #2f8f5b; }
.btn-success:hover { background-color: #27794d; border-color: #27794d; }
.text-primary { color: var(--primary) !important; }
.text-success { color: #2f8f5b !important; }
.panel { border-top: 3px solid rgba(242,118,22,.18); }
.metric-card { border-top: 3px solid rgba(242,118,22,.2); }
.metric-card .text-success { color: #2f8f5b !important; }
.metric-card .text-danger { color: #c2413d !important; }
.metric-card .text-warning { color: #b7791f !important; }
.metric-card .text-info { color: #7c766e !important; }

.receipt { max-width: 860px; margin: 0 auto; padding: 30px; }
.receipt-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 22px; }
.receipt-brand { padding: 0; }
.receipt-brand small { color: var(--muted); }
.receipt-number { text-align: right; }
.receipt-number span { display: block; color: var(--muted); font-size: 13px; text-transform: uppercase; }
.receipt-number strong { font-size: 24px; }
.receipt-status { display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #fff4e8; border: 1px solid #ffd0a5; border-radius: 8px; padding: 18px; margin-bottom: 22px; }
.receipt-status span { color: #9b4300; font-weight: 700; text-transform: uppercase; font-size: 13px; }
.receipt-status strong { font-size: 30px; color: #9b4300; }
.receipt-grid h2 { font-size: 24px; margin: 0 0 8px; }
.receipt-grid p { margin: 0 0 4px; color: var(--muted); }
.receipt-details { display: grid; gap: 8px; margin: 0; }
.receipt-details div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.receipt-details dt { color: var(--muted); font-weight: 600; }
.receipt-details dd { margin: 0; font-weight: 700; text-align: right; }
.receipt-table { margin-top: 24px; }
.receipt-note { background: #fffaf5; border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 18px; }
.receipt-footer { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); padding-top: 18px; margin-top: 28px; }

@media print {
    body { background: #fff; }
    .sidebar, .topbar, .print-hide, .alert { display: none !important; }
    .content { margin: 0; width: 100%; padding: 0; }
    .panel.receipt { border: 0; box-shadow: none; padding: 0; max-width: none; }
    .receipt { color: #111; }
    .receipt-status { background: #fff; border-color: #999; }
    a[href]:after { content: ""; }
}

.login-card { border-top: 4px solid var(--primary); }
.sidebar .nav-link:hover, .sidebar .nav-link.active { border-left: 3px solid var(--primary); padding-left: 9px; }

@media print {
    }


.brand-mark img, .login-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-logo { width: 74px; height: 74px; margin: 0 auto 12px; }
.receipt-brand .brand-mark { width: 54px; height: 54px; }

.uppercase-input { text-transform: uppercase; }

