:root {
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --bg: #f5f7fb;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #fff; border-right: 1px solid var(--border); padding: 20px 14px; }
.brand { display: flex; gap: 12px; align-items: center; padding: 8px 8px 24px; }
.brand span, .muted { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.nav { width: 100%; border: 0; background: transparent; text-align: left; padding: 12px 14px; border-radius: 10px; cursor: pointer; color: var(--text); font-size: 15px; }
.nav.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-parent { font-weight: 600; }
.subnav { display: grid; gap: 4px; margin: 2px 0 8px 12px; }
.subnav.collapsed { display: none; }
.nav.sub { font-size: 14px; padding: 9px 14px; color: var(--muted); }
.nav.sub.active { color: var(--primary); }
.main { flex: 1; padding: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
h1 { margin: 4px 0 0; font-size: 26px; }
.user-card { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px; color: var(--muted); }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 16px; margin-bottom: 18px; overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 18px; }
.panel-body { padding: 18px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: end; }
.filters label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, select, textarea { border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; font: inherit; background: #fff; min-width: 180px; }
textarea { min-height: 90px; width: 100%; }
.btn { border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; background: #fafafa; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 12px; background: #e0f2fe; color: #0369a1; }
.tag.success { background: #dcfce7; color: #166534; }
.tag.warning { background: #fef3c7; color: #92400e; }
.tag.danger { background: #fee2e2; color: #991b1b; }
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-mask.show { display: flex; }
.modal { width: min(920px, 96vw); max-height: 88vh; overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-header, .modal-footer { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-footer { justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); border-bottom: 0; }
.modal-header h3 { margin: 0; }
.modal-header button { border: 0; background: transparent; font-size: 24px; cursor: pointer; }
.modal-body { padding: 18px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-like-grid { gap: 28px 48px; }
.detail { background: #f9fafb; border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.detail span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.detail-item .label { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.detail-item .value { font-size: 16px; color: var(--text); }
.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 12px 0 24px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(15,23,42,.04); }
.stat-label { color: var(--muted); font-size: 13px; display: block; margin-bottom: 14px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-value.warning { color: #f59e0b; }
.stat-value.success { color: #16a34a; }
.form-row { display: grid; gap: 12px; margin-bottom: 14px; }
.order-list { display: grid; gap: 10px; }
.order-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.timeline-list { display: grid; gap: 12px; }
.timeline-item { display: flex; gap: 12px; position: relative; }
.timeline-item::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: -12px; width: 1px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 18px; height: 18px; border-radius: 50%; background: #dbeafe; flex: 0 0 18px; margin-top: 4px; }
.timeline-card { flex: 1; background: #f9fafb; border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.timeline-card-header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.timeline-card-header span, .timeline-card-meta { color: var(--muted); font-size: 12px; }
.timeline-card-body { line-height: 1.55; }
.audit-step { border-left: 3px solid var(--primary); padding: 0 0 12px 10px; margin-bottom: 12px; }
.audit-step strong { display: block; margin-bottom: 4px; }
.audit-step span { display: inline-block; border-radius: 999px; padding: 3px 8px; background: var(--primary-soft); color: var(--primary); font-size: 12px; margin-bottom: 6px; }
.audit-step p { margin: 4px 0; color: var(--muted); font-size: 13px; }
