/* Schanic theme A: Signature light. Change brand colors here only. */
:root {
  --brand: #F04A23;
  --brand-dark: #C93513;
  --brand-tint: #FDECEA;
  --ink: #111111;
  --muted: #6b7280;
  --line: #eeeeee;
  --surface: #F7F7F7;
  --bg: #ffffff;
  --ok: #1E6B3A;
  --ok-bg: #E6F4EA;
  --bad: #B42318;
  --bad-bg: #FEE4E2;
  --radius: 10px;
  --sidebar-w: 240px;
  --font: 'Montserrat', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 24px; font-weight: 800; margin: 0; }
h2 { font-size: 17px; font-weight: 700; margin: 0 0 14px; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--brand-tint); outline-offset: 1px; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); border-right: 1px solid var(--line); padding: 20px 14px; position: fixed; inset: 0 auto 0 0; background: #fff; z-index: 30; transition: transform .2s ease; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; padding: 0 6px; }
.brand img { width: 34px; height: 34px; }
.brand b { display: block; font-size: 18px; font-weight: 800; line-height: 1.1; }
.brand small { display: block; font-size: 9px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); color: #444; font-weight: 500; margin-bottom: 4px; }
.nav a:hover { background: var(--surface); }
.nav a.active { background: var(--brand-tint); color: var(--brand-dark); font-weight: 700; }
.nav i { font-size: 20px; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 20; }
.menu-btn { display: none; background: none; border: 0; font-size: 26px; cursor: pointer; padding: 0; color: var(--ink); }
.topbar-title { font-weight: 700; }
.user { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.role-tag { background: var(--brand-tint); color: var(--brand-dark); font-weight: 700; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.content { padding: 24px; max-width: 1100px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.backdrop, .bottom-nav { display: none; }

/* Components */
.card { border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; background: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius); border: 1px solid #ddd; background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.btn:hover { background: var(--surface); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { color: var(--bad); border-color: #F3C4BE; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; display: inline-block; }
.badge-pending { background: var(--brand-tint); color: #B8300F; }
.badge-approved { background: var(--ok-bg); color: var(--ok); }
.badge-rejected { background: var(--bad-bg); color: var(--bad); }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 500; }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--bad-bg); color: var(--bad); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; display: block; color: #555; font-size: 13px; }
.stat b { display: block; font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.stat.hl { background: var(--brand-tint); }
.stat.active { outline: 2px solid var(--brand); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 10px; border-bottom: 1px solid #f5f5f5; }
.tbl .link { color: var(--brand); font-weight: 700; }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: var(--radius); font: inherit; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); outline: 3px solid var(--brand-tint); }
.field .error { display: block; color: var(--bad); font-size: 12px; margin-top: 4px; }

.dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--brand-tint); padding: 16px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 32px; }
.login-card .brand { justify-content: center; margin-bottom: 8px; }
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 20px; }
.login-card .field { margin-bottom: 14px; }
.demo-hint { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* Mobile */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
  .main { margin-left: 0; }
  .menu-btn { display: block; }
  .topbar { padding: 12px 16px; }
  .user .name { display: none; }
  .content { padding: 16px 16px 90px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 10px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 20; }
  .bottom-nav a { flex: 1; text-align: center; padding: 8px 0; font-size: 11px; color: #777; }
  .bottom-nav a i { display: block; font-size: 22px; }
  .bottom-nav a.active { color: var(--brand); font-weight: 700; }

  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
  .tbl td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; text-align: right; }
  .tbl td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
}
