:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172033;
  background: #f5f7fb;
  --ink: #172033;
  --muted: #62708a;
  --line: #dce3ef;
  --surface: #ffffff;
  --brand: #2258d8;
  --brand-soft: #e9efff;
  --danger: #a62d36;
  --radius: 14px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f5f7fb; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #8eb3ff; outline-offset: 2px; }

.skip-link { position: fixed; inset: 8px auto auto 8px; transform: translateY(-160%); padding: 8px 12px; color: #fff; background: var(--brand); border-radius: 8px; z-index: 10; }
.skip-link:focus { transform: translateY(0); }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card, .panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgb(36 52 82 / 8%); }
.login-card { width: min(100%, 420px); padding: 32px; }
.eyebrow { display: block; color: var(--brand); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.55rem, 4vw, 2rem); }
h2 { margin-bottom: 6px; font-size: 1.2rem; }
.muted { color: var(--muted); line-height: 1.55; }
.form { display: grid; gap: 14px; margin-top: 24px; }
label { display: grid; gap: 6px; color: #33415d; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 10px; color: var(--ink); background: #fff; border: 1px solid #b9c5d8; border-radius: 8px; }
textarea { min-height: 88px; resize: vertical; }
.primary, .secondary, .danger { min-height: 40px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; }
.primary { color: #fff; background: var(--brand); }
.secondary { color: #213a72; background: #fff; border-color: #9eb0cf; }
.danger { color: #fff; background: var(--danger); }
button:disabled { cursor: not-allowed; opacity: .58; }
.message { min-height: 1.25em; margin: 0; color: var(--danger); }

.shell { min-height: 100dvh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 22px; padding: 24px 16px; color: #edf3ff; background: #14264e; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 800; }
.brand img { width: 30px; height: 30px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar a { display: block; padding: 10px 12px; color: #d9e4ff; text-decoration: none; border-radius: 8px; }
.sidebar a[aria-current="page"], .sidebar a:hover { color: #fff; background: rgb(255 255 255 / 14%); }
.operator { margin-top: auto; color: #c5d5f7; font-size: .9rem; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 70px; padding: 16px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.content { max-width: 1240px; padding: 28px; margin: 0 auto; }
.heading { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 22px; }
.heading h1 { margin: 0 0 6px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.card { padding: 18px; box-shadow: none; }
.metric { color: var(--brand); font-size: 1.8rem; font-weight: 800; }
.metric-label { color: var(--muted); font-size: .88rem; }
.panel { padding: 18px; margin-top: 16px; box-shadow: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.toolbar > label { flex: 1 1 180px; }
.list { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(110px, .7fr)) auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row strong, .request-title { overflow-wrap: anywhere; }
.cell-label { display: block; color: var(--muted); font-size: .74rem; margin-bottom: 3px; }
.status { display: inline-flex; width: fit-content; padding: 3px 7px; color: #21456e; background: #e8f0fb; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.status.pending_finance, .status.returned { color: #744b00; background: #fff1d5; }
.status.approved, .status.active { color: #12653b; background: #ddf6e7; }
.status.suspended, .status.expired, .status.disabled { color: #8c2831; background: #fde8ea; }
.request { display: grid; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.request:first-child { border-top: 0; }
.request-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; color: #465774; font-size: .9rem; }
.request-actions, .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.details div { padding: 10px; background: #f7f9fd; border-radius: 8px; overflow-wrap: anywhere; }
.empty { padding: 22px 0; color: var(--muted); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { gap: 12px; padding: 12px 16px; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .sidebar nav a { white-space: nowrap; }
  .operator { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row, .inline-form, .details { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .content, .topbar { padding: 18px; }
  .heading { display: block; }
  .heading .primary { margin-top: 12px; }
  .cards, .row, .inline-form, .details { grid-template-columns: 1fr; }
  .row { gap: 7px; }
}
