:root {
  --navy: #1a476f;
  --navy-deep: #123354;
  --navy-mid: #245a86;
  --orange: #f37021;
  --orange-dark: #d85e14;
  --ink: #2b2b2b;
  --muted: #5c6570;
  --line: #e2e8ef;
  --bg: #f3f6f9;
  --paper: #ffffff;
  --sidebar: #1a476f;
  --accent: #f37021;
  --accent-2: #1a476f;
  --warn: #c2410c;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(18, 51, 84, 0.08);
  --font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  display: grid;
  grid-template-columns: 260px 1fr;
}
a { color: var(--navy-mid); text-decoration: none; }
a:hover { color: var(--orange); }
.sidebar {
  background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 55%, #163e61 100%);
  color: #f7f9fc;
  min-height: 100vh;
  padding: 1.4rem 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 6px 0 24px rgba(18, 51, 84, 0.18);
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  padding: .15rem .35rem .65rem;
  text-decoration: none;
  color: #fff;
}
.brand:hover { color: #fff; }
.brand__word {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
}
.brand__word em {
  font-style: normal;
  font-size: .72em;
  vertical-align: .18em;
  margin-right: .02em;
}
.brand__rule {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--orange);
  margin: .35rem 0 .28rem;
}
.brand small {
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #c5d4e3;
}
.brand--login { align-items: center; text-align: center; color: var(--navy); }
.brand--login .brand__word { color: var(--navy); }
.brand--login small { color: var(--muted); }
.side-search input {
  width: 100%; padding: .55rem .7rem; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.18); color: #fff;
}
.side-search input::placeholder { color: #9db3c7; }
.sidebar nav { display: flex; flex-direction: column; gap: .12rem; }
.sidebar nav a {
  color: #d7e4ef; padding: .48rem .7rem; border-radius: 8px; text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar nav a.is-active, .sidebar nav a:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.sidebar nav a.is-active {
  border-left-color: var(--orange);
  background: rgba(243, 112, 33, .16);
}
.sidebar__user {
  margin-top: auto;
  font-size: .85rem;
  padding: .85rem .7rem 0;
  border-top: 1px solid rgba(255,255,255,.12);
}
.sidebar__user small { display: block; color: #9db3c7; margin: .15rem 0 .45rem; }
.sidebar__user a { color: var(--orange); }
.main { padding: 1.6rem 2.1rem 3.2rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 {
  margin: 0 0 .3rem;
  font-family: var(--serif);
  font-size: 1.85rem;
  color: var(--navy);
  font-weight: 650;
}
.page-head p, .muted { color: var(--muted); }
.actions { display: flex; gap: .5rem; align-items: flex-start; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: var(--navy);
  padding: .52rem .95rem; border-radius: 8px; cursor: pointer; font: inherit;
  text-decoration: none; font-weight: 600;
}
.btn:hover { text-decoration: none; background: #eef3f8; color: var(--navy); }
.btn--primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn--primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; }
.btn--ghost { margin-top: .75rem; }
.btn--sm { padding: .3rem .55rem; font-size: .85rem; }
.stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.25rem;
}
.stats article {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .95rem 1rem; box-shadow: var(--shadow);
  border-top: 3px solid var(--navy);
}
.stats small { color: var(--muted); display: block; text-transform: uppercase; letter-spacing: .04em; font-size: .7rem; }
.stats strong { font-size: 1.35rem; color: var(--navy); }
.stats .is-warn { border-top-color: var(--orange); background: #fff8f3; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.05rem 1.15rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 .75rem; font-size: 1.02rem; color: var(--navy); font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.list, .timeline { list-style: none; margin: 0; padding: 0; }
.list li, .timeline li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.list small, .timeline small { display: block; color: var(--muted); }
.table-wrap { overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eaf0f6; font-weight: 700; color: var(--navy); }
.pill { display: inline-block; background: #eaf0f6; color: var(--navy); padding: .15rem .5rem; border-radius: 99px; font-size: .8rem; }
.toolbar, .form--inline, .tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; align-items: end; }
.tabs a { padding: .4rem .7rem; border-radius: 99px; background: #eaf0f6; color: var(--navy); text-decoration: none; }
.tabs a.is-active { background: var(--navy); color: #fff; }
.form label, .toolbar label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
input, select, textarea {
  font: inherit; padding: .48rem .58rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(243, 112, 33, .28); border-color: var(--orange); }
textarea { min-height: 80px; width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; margin-bottom: .75rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 1rem 0; padding: .75rem 1rem; }
.check { flex-direction: row !important; align-items: center; gap: .4rem; }
.flash { padding: .65rem .85rem; border-radius: 8px; margin-bottom: 1rem; }
.flash--ok { background: #e8f4ee; }
.flash--err { background: #fde8e8; }
.alert-strip { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.alert-strip span { background: #fff4ec; border: 1px solid #f7c9a8; color: #9a3f0e; padding: .35rem .65rem; border-radius: 99px; font-size: .85rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; color: var(--muted); }
.login-body {
  display: grid; place-items: center; grid-template-columns: 1fr;
  background: radial-gradient(1200px 600px at 50% -10%, #2a6490 0%, var(--navy-deep) 55%, #0c2238 100%);
}
.login-card {
  width: min(440px, 92vw); background: var(--paper); padding: 1.7rem 1.6rem 1.5rem; border-radius: 16px;
  display: flex; flex-direction: column; gap: .85rem; box-shadow: 0 24px 50px rgba(8, 24, 40, .35);
}
.login-card label { display: flex; flex-direction: column; gap: .3rem; }
.hint { font-size: .8rem; color: var(--muted); margin: 0; }
.nav-label {
  display: block; margin: .9rem 0 .28rem; padding: 0 .7rem;
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #8eabc2;
}
.charts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.25rem;
}
.charts canvas { height: 220px !important; }
.chain {
  list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1.25rem;
}
.chain li {
  background: #eaf0f6; padding: .35rem .65rem; border-radius: 99px; font-size: .8rem; color: var(--muted);
}
.chain li.is-done { background: var(--navy); color: #fff; }
.how-to { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem 1rem 2rem; box-shadow: var(--shadow); }
.bar { height: 10px; background: #eaf0f6; border-radius: 99px; overflow: hidden; margin: .5rem 0 1rem; }
.bar span { display: block; height: 100%; background: var(--orange); }
@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .grid-2 { grid-template-columns: 1fr; }
}
