:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-muted: #eef4f3;
  --text: #1f2933;
  --muted: #667085;
  --border: #d8dee5;
  --primary: #2f6f73;
  --primary-dark: #24595c;
  --accent: #b7791f;
  --danger: #b42318;
  --success: #287a4b;
  --warning: #a15c07;
  --radius: 8px;
  --shadow: 0 10px 25px rgba(31, 41, 51, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #163538; color: white; padding: 24px 18px; }
.brand { font-size: 1.25rem; font-weight: 800; margin-bottom: 28px; }
.nav { display: grid; gap: 8px; }
.nav a, .nav button {
  border: 0;
  border-radius: var(--radius);
  color: white;
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.nav a:hover, .nav a.active, .nav button:hover { background: rgba(255, 255, 255, 0.12); }
.main { padding: 28px; min-width: 0; }
.container { max-width: 1180px; margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; }
.page-title { margin: 0; font-size: 1.75rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.metric { font-size: 1.9rem; font-weight: 800; margin: 4px 0; }
.muted { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 10px; text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  min-height: 38px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface-muted); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: white; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.82rem;
  background: var(--surface-muted);
  color: var(--text);
}
.badge-status { background: #e6f3f0; color: var(--primary-dark); }
.badge-status.APPROVED_FOR_PRINT, .badge-status.DELIVERED { background: #e8f5ee; color: var(--success); }
.badge-status.WAITING_APPROVAL, .badge-status.PRINTING { background: #fff4df; color: var(--warning); }
.badge-status.CANCELLED { background: #fde8e6; color: var(--danger); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.form-group { display: grid; gap: 6px; margin-bottom: 12px; }
label { font-weight: 650; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  min-height: 40px;
  padding: 9px 11px;
  font: inherit;
}
.textarea { min-height: 96px; resize: vertical; }
.alert { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); margin: 12px 0; }
.alert-warning { background: #fff8e8; border-color: #f3c36b; color: #6f4300; }
.alert-success { background: #eaf7ef; border-color: #9bd0b3; color: #155c34; }
.alert-error { background: #fdeceb; border-color: #f3a6a0; color: #8f1d14; }
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(12, 20, 28, 0.45);
  padding: 18px;
  z-index: 20;
}
.modal-content { width: min(760px, 100%); max-height: 90vh; overflow: auto; background: white; border-radius: var(--radius); padding: 20px; }
.hidden { display: none !important; }
.loading { opacity: 0.65; pointer-events: none; }
.empty-state { padding: 28px; color: var(--muted); text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 40; box-shadow: var(--shadow); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr repeat(2, minmax(160px, 220px)); margin-bottom: 14px; }
.approval-page { max-width: 780px; margin: 0 auto; padding: 24px; }
.approval-title { font-size: 2rem; margin-bottom: 4px; }
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; padding: 16px; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 18px; }
  .page-header { align-items: stretch; flex-direction: column; }
  .filters { grid-template-columns: 1fr; }
}
