:root {
    --primary: #37b24d;
    --primary-dark: #2f9e44;
    --surface: #ffffff;
    --soft: #f3f5f7;
    --line: #e7ebef;
    --text: #1f2937;
    --muted: #6b7280;
    --danger: #ef4444;
    --warning: #f59f00;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: #eef1f4;
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { text-decoration: none; }
body.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2f9e44 0%, #7cd992 100%);
}
.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.brand-box { display: flex; gap: 14px; align-items: center; }
.brand-mark {
    width: 52px; height: 52px; display: grid; place-items: center;
    background: rgba(55,178,77,0.12); color: var(--primary);
    border-radius: 16px; font-size: 22px;
}
.brand-box h1 { font-size: 19px; margin: 0; font-weight: 700; }
.brand-box small, .user-chip small, .shift-chip span { color: var(--muted); display:block; }
.sidebar .nav-link {
    display: flex; align-items: center; gap: 12px; color: #334155;
    padding: 12px 14px; border-radius: 14px; font-weight: 600;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background: rgba(55,178,77,0.12); color: var(--primary-dark);
}
.sidebar-footer { border-top: 1px solid var(--line); padding-top: 18px; }
.user-chip { display: flex; align-items: center; gap: 12px; }
.shift-chip {
    border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 3px;
    background: #fff;
}
.shift-chip.open { background: rgba(55,178,77,0.08); border-color: rgba(55,178,77,0.18); }
.avatar {
    width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff;
    display: grid; place-items: center; font-weight: 700;
}
.content-area { padding: 24px; }
.topbar {
    background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px 22px;
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 18px;
}
.topbar h2 { margin: 0 0 4px; font-size: 24px; }
.page-wrap { display: grid; gap: 20px; }
.card-soft {
    background: #fff; border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}
.summary-card { padding: 18px; height: 100%; }
.summary-card .label { color: var(--muted); font-size: 14px; }
.summary-card .value { font-size: 28px; font-weight: 800; margin-top: 6px; }
.summary-card .sub { margin-top: 8px; color: var(--muted); font-size: 13px; }
.kpi-inline {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px dashed #e7ebef;
}
.kpi-inline:last-child { border-bottom: 0; }
.table thead th {
    color: var(--muted); font-weight: 700; font-size: 13px; background: #f9fafb;
}
.table td, .table th { vertical-align: middle; }
.form-control, .form-select, .form-control-sm, .form-select-sm {
    border-radius: 12px; border-color: #d7dee6;
}
.form-control, .form-select { min-height: 46px; }
textarea.form-control { min-height: 120px; }
.btn { border-radius: 12px; font-weight: 600; }
.btn-success { background: var(--primary); border-color: var(--primary); }
.btn-success:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.login-card {
    width: min(94vw, 420px); background: rgba(255,255,255,0.95); border-radius: 22px;
    padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}
.login-card .logo-pill {
    width: 74px; height: 74px; border-radius: 20px; background: rgba(55,178,77,0.12);
    display: grid; place-items:center; color: var(--primary); font-size: 30px; margin-bottom: 16px;
}
.pos-body { background: #e8edf0; }
.pos-shell { display: grid; grid-template-columns: 1.25fr 0.75fr; min-height: 100vh; }
.pos-left, .pos-right { padding: 18px; }
.pos-left { background: #f3f5f7; }
.pos-header {
    background: var(--primary); color: #fff; border-radius: 20px; padding: 18px 20px;
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 14px;
}
.pos-header h1 { font-size: 20px; margin: 0; }
.pos-panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.product-card {
    background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: 0.2s ease;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15,23,42,0.08); }
.product-thumb {
    height: 112px; background: linear-gradient(135deg, rgba(55,178,77,0.22), rgba(55,178,77,0.05));
    display: grid; place-items: center; color: var(--primary-dark); font-size: 30px;
}
.product-card .body { padding: 12px; }
.ticket-card {
    background: #fff; border-radius: 20px; border: 1px solid var(--line);
    min-height: calc(100vh - 36px); display: flex; flex-direction: column; overflow: hidden;
}
.ticket-head { background: #fff; padding: 18px; border-bottom: 1px solid var(--line); }
.ticket-list { padding: 12px 18px; flex: 1; overflow: auto; }
.ticket-item {
    display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 0; border-bottom: 1px dashed #e1e5ea;
}
.ticket-foot { padding: 18px; border-top: 1px solid var(--line); background: #fbfcfd; }
.category-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.category-pills a {
    padding: 9px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
    color: #334155; font-weight: 600;
}
.category-pills a.active, .category-pills a:hover { background: rgba(55,178,77,0.12); color: var(--primary-dark); }
.receipt-box { width: 380px; max-width: 100%; margin: 20px auto; background: #fff; padding: 24px; border: 1px dashed #cfd6dd; }
.empty-state { text-align: center; color: var(--muted); padding: 42px 16px; }
.soft-label {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
    background: rgba(55,178,77,0.12); color: var(--primary-dark); font-weight: 700; font-size: 12px;
}
.hold-list { display: grid; gap: 10px; margin-top: 14px; }
.hold-item {
    border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 12px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.filter-card { padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.barcode-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.barcode-label {
    background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px;
    display: grid; gap: 6px; align-content: start;
}
.barcode-label svg { width: 100%; height: 70px; }
.small-muted { color: var(--muted); font-size: 13px; }
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.print-only { display: none; }
@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .barcode-sheet { grid-template-columns: repeat(3, 1fr); }
    .barcode-label { break-inside: avoid; }
    .print-only { display: block; }
}
@media (max-width: 1200px) {
    .report-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .pos-shell { grid-template-columns: 1fr; }
    .ticket-card { min-height: auto; }
    .topbar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
    .report-grid { grid-template-columns: 1fr; }
    .content-area { padding: 16px; }
    .pos-left, .pos-right { padding: 12px; }
}
