@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --navy: #1B2A4A;
  --navy-dark: #121D35;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --border: #E3E6EC;
  --text: #1F2430;
  --muted: #6B7285;
  --amber: #D98E2B;
  --amber-light: #FBEBD3;
  --green: #2E7D53;
  --green-light: #E1F1E7;
  --red: #C4453C;
  --red-light: #FBE6E4;
  --blue: #2E5C9A;
  --blue-light: #E4EBF6;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(18, 29, 53, 0.06), 0 1px 1px rgba(18, 29, 53, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.mono { font-family: 'IBM Plex Mono', monospace; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
a { color: var(--blue); text-decoration: none; }

/* ---------- Auth page ---------- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(160deg, var(--navy-dark), var(--navy) 60%);
}
.auth-card {
  background: var(--surface);
  padding: 40px;
  border-radius: 12px;
  width: 340px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.auth-mark {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 0.15em;
  font-size: 13px;
  margin-bottom: 6px;
}
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.auth-sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { font-size: 13px; font-weight: 500; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Shell / layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  flex-shrink: 0;
}
.brand { font-weight: 700; font-size: 16px; margin-bottom: 28px; padding-left: 4px; }
.brand span { display: block; font-weight: 400; font-size: 11px; letter-spacing: 0.12em; color: #9AA6C4; text-transform: uppercase; margin-top: 2px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  color: #C7CEE2;
  padding: 9px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13.5px;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active { background: var(--amber); color: var(--navy-dark); font-weight: 600; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 14px; margin-top: 14px; }
.me { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.signout { font-size: 12px; color: #9AA6C4; }
.signout:hover { color: #fff; }

.content { flex: 1; padding: 28px 36px 60px; max-width: 1180px; }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.page-header h1 { margin: 0 0 4px; font-size: 22px; }
.back-link { font-size: 13px; font-weight: 500; }

.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}
.stat-chip-alert { background: var(--amber-light); border-color: #ECC98A; color: #8A5A0F; }

/* ---------- Summary strip ---------- */
.summary-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  min-width: 140px;
}
.summary-name { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.summary-nums { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); }
.summary-nums strong { color: var(--text); font-size: 14px; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filter-bar input[type="text"], .filter-bar select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  background: var(--surface);
  font-family: inherit;
}
.filter-bar input[type="text"] { min-width: 220px; }
.check-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-block;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-secondary { background: var(--surface); color: var(--navy); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--navy); }
.btn-ghost { background: transparent; color: var(--muted); padding: 9px 10px; }
.btn-block { width: 100%; text-align: center; }
.btn-link { background: none; border: none; color: var(--blue); font-size: 12.5px; cursor: pointer; padding: 0; font-weight: 500; }
.btn-link-danger { background: none; border: none; color: var(--red); font-size: 12.5px; cursor: pointer; padding: 0; font-weight: 500; }

/* ---------- Table ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.req-table { width: 100%; border-collapse: collapse; }
.req-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #FAFBFC;
}
.req-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.req-table tbody tr { cursor: pointer; }
.req-table tbody tr:hover { background: #FAFBFC; }
.req-table tbody tr:last-child td { border-bottom: none; }
.empty-row { text-align: center; color: var(--muted); padding: 40px !important; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-lg { padding: 6px 14px; font-size: 12.5px; }
.badge-new { background: var(--blue-light); color: var(--blue); }
.badge-assigned { background: #EDE7F6; color: #5B3E9E; }
.badge-progress { background: var(--amber-light); color: #8A5A0F; }
.badge-waiting { background: #FDE8D2; color: #A15E12; }
.badge-review { background: #E4EBF6; color: #2E5C9A; }
.badge-done { background: var(--green-light); color: var(--green); }
.badge-rejected { background: var(--red-light); color: var(--red); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 12px; font-size: 15px; }
.card h3.sub { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 18px 0 8px; }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; font-size: 13.5px; }

/* ---------- Forms ---------- */
.stacked-form { display: flex; flex-direction: column; gap: 10px; }
.stacked-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.form-row { display: flex; gap: 10px; }
.form-row label { flex: 1; }
input[type="text"], input[type="password"], input[type="email"], input[type="file"], textarea, select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
}
textarea { resize: vertical; }
.inline-form { display: flex; gap: 8px; margin-bottom: 14px; }
.inline-form textarea { flex: 1; }
.inline-form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.form-row-wrap { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.form-row-wrap input, .form-row-wrap select { flex: 1; min-width: 140px; }

/* ---------- Alerts ---------- */
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; font-weight: 500; }
.alert-error { background: var(--red-light); color: var(--red); }
.alert-ok { background: var(--green-light); color: var(--green); }

/* ---------- Detail page ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.detail-side .card h2 { margin-bottom: 10px; }

.doc-list { list-style: none; padding: 0; margin: 0 0 14px; }
.doc-list li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 13px; }
.doc-list li:last-child { border-bottom: none; }

.note-list { list-style: none; padding: 0; margin: 0; }
.note-list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.note-list li:last-child { border-bottom: none; }
.note-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.note-body { font-size: 13.5px; }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.timeline li { padding: 0 0 14px 16px; position: relative; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); border: 2px solid var(--surface); }
.timeline time { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card-wide { grid-column: 1 / -1; }
.mini-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.mini-table th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.mini-table td { padding: 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
.row-actions { display: flex; gap: 10px; align-items: center; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
code { background: #F1F2F5; padding: 1px 5px; border-radius: 4px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
details summary { font-size: 12.5px; color: var(--blue); cursor: pointer; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; }
  .sidebar nav { flex-direction: row; }
  .sidebar-footer { display: none; }
  .content { padding: 20px; }
  .detail-grid, .settings-grid { grid-template-columns: 1fr; }
}
