:root {
  --bg: #f3f6fb;
  --panel: rgba(255, 255, 255, .94);
  --text: #172033;
  --muted: #657189;
  --blue: #173f97;
  --blue-dark: #0b2f78;
  --red: #d7232a;
  --line: rgba(23, 63, 151, .14);
  --soft: rgba(23, 63, 151, .07);
  --shadow: 0 22px 60px rgba(20, 45, 98, .13);
  --radius: 24px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; width: 100%; overflow-x: hidden; }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 8% 0%, rgba(215, 35, 42, .13), transparent 26rem), radial-gradient(circle at 92% 8%, rgba(23, 63, 151, .12), transparent 28rem), linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}
a { color: inherit; text-decoration: none; }
.login-body { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 22px; }
.login-shell, .app-shell { width: min(1220px, calc(100% - 32px)); margin: 0 auto; }
.login-shell { width: min(560px, 100%); }
.login-card, .card, .hero-card, .stat-card, .table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.login-card { padding: clamp(24px, 4vw, 38px); }
.login-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.brand-mark { width: 82px; height: 82px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 25px; background: linear-gradient(135deg, var(--blue), var(--red)); color: #fff; font-weight: 900; font-size: 1.45rem; letter-spacing: .04em; box-shadow: 0 16px 34px rgba(23, 63, 151, .22); }
.eyebrow { margin: 0 0 6px; font-size: .77rem; font-weight: 800; letter-spacing: .08em; color: var(--blue); text-transform: uppercase; }
h1, h2, h3 { color: var(--blue-dark); line-height: 1.08; }
h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.55rem); }
h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.1rem); }
h3 { margin: 0 0 12px; font-size: 1.18rem; }
p { color: var(--muted); line-height: 1.55; }
.login-text { margin-top: 4px; }
.muted { color: var(--muted); font-size: .92rem; }
label { display: block; margin: 14px 0 7px; font-weight: 750; color: #33415f; font-size: .93rem; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; background: #fff; color: var(--text); outline: none; font: inherit; }
input:focus, select:focus, textarea:focus { border-color: rgba(23, 63, 151, .44); box-shadow: 0 0 0 4px rgba(23, 63, 151, .08); }
button, .primary-btn, .secondary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 18px; min-height: 44px; border: 1px solid rgba(23, 63, 151, .22); cursor: pointer; font-weight: 850; font-size: .94rem; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
button:hover, .primary-btn:hover, .secondary-btn:hover { transform: translateY(-1px); }
button:disabled { opacity: .65; cursor: not-allowed; }
.primary-btn { background: linear-gradient(135deg, var(--blue), #2458bd); color: #fff; box-shadow: 0 12px 26px rgba(23, 63, 151, .20); }
.secondary-btn { background: #fff; color: var(--blue); }
.full { width: 100%; margin-top: 18px; }
.alert { padding: 13px 15px; border-radius: 16px; margin: 14px 0; color: #8a151a; background: #fff1f2; border: 1px solid #efc6ca; }
.alert.success { color: #15406f; background: #eef6ff; border-color: #cbe0ff; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 24px 0 18px; }
.user-box { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; color: var(--muted); font-size: .9rem; }
.user-name { color: var(--blue-dark); font-weight: 850; }
.user-role { border-radius: 999px; padding: 6px 10px; background: var(--soft); color: var(--blue-dark); font-weight: 750; }
.user-box a { color: var(--red); font-weight: 800; }
.nav { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; }
.nav a { border: 1px solid var(--line); background: rgba(255, 255, 255, .82); color: #28487f; border-radius: 999px; padding: 10px 14px; font-weight: 800; }
.nav a.active, .nav a:hover { color: var(--blue-dark); background: rgba(23, 63, 151, .08); border-color: rgba(23, 63, 151, .28); }
.hero-card { padding: 26px; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.hero-card p { margin-bottom: 0; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats div, .stat-card { min-width: 140px; padding: 18px; }
.hero-stats div { border-radius: 20px; background: #fff; border: 1px solid var(--line); }
.hero-stats strong, .stat-card strong { display: block; color: var(--blue-dark); font-size: 2rem; line-height: 1; }
.hero-stats span, .stat-card span { color: var(--muted); font-size: .88rem; font-weight: 700; }
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { padding: 24px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.range-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.checkline { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.checkline input { width: auto; }
.table-wrap { overflow: auto; padding: 0; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #3b5b93; background: rgba(237, 243, 255, .78); font-size: .8rem; letter-spacing: .045em; text-transform: uppercase; }
tr:hover td { background: rgba(23, 63, 151, .035); }
.section-title { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 15px; }
.search-input { max-width: 280px; }
.folio-pill, .large-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 900; }
.folio-pill { display: inline-flex; border-radius: 999px; padding: 7px 11px; background: var(--soft); color: var(--blue-dark); }
.large-code { font-size: 1.45rem; color: var(--blue-dark); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; font-size: .78rem; font-weight: 850; background: #fff1f2; color: #9f1d24; }
.badge.ok { background: #eef6ff; color: #15406f; }
.empty { padding: 14px; color: var(--muted); background: #fff; border-radius: 16px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { min-width: 190px; }
.filter-form { min-width: 260px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 40; max-width: 420px; padding: 14px 16px; border-radius: 18px; box-shadow: var(--shadow); background: #0f2f77; color: #fff; font-weight: 800; }
.toast.error { background: #991b1b; }
@media (max-width: 900px) { .topbar, .hero-card, .section-title { flex-direction: column; align-items: stretch; } .user-box { justify-content: flex-start; } .grid.two, .grid.three, .form-grid { grid-template-columns: 1fr; } .search-input, .filter-form { max-width: none; width: 100%; } .inline-form { flex-direction: column; align-items: stretch; } }
@media (max-width: 560px) { .login-shell, .app-shell { width: min(100%, calc(100% - 22px)); } .login-brand { flex-direction: column; align-items: flex-start; } .brand-mark { width: 72px; height: 72px; } .card, .hero-card, .login-card { border-radius: 20px; padding: 20px; } .range-grid { grid-template-columns: 1fr; } button, .primary-btn, .secondary-btn { width: 100%; } }
