:root {
  --navy: #0c1222;
  --navy-2: #141c2e;
  --gold: #c9a227;
  --gold-2: #e0b93a;
  --ink: #1a1f2b;
  --muted: #5c6575;
  --line: #e6e9f0;
  --bg: #f4f6fa;
  --card: #ffffff;
  --ok: #1b7f5a;
  --danger: #b42318;
  --warn: #b54708;
  --info: #175cd3;
  --shadow: 0 10px 30px rgba(12, 18, 34, .08);
  --radius: 14px;
  --sidebar: var(--navy);
  --accent: var(--gold);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  color: #e8edf7;
  padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 12px; }
.brand img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #fff; }
.brand strong { display: block; font-size: 15px; letter-spacing: .02em; }
.brand span { color: #9aa6b8; font-size: 11px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; color: #c9d2e3; font-size: 14px;
}
.nav a:hover, .nav a.active { background: rgba(201,162,39,.16); color: #fff; }
.nav .sec { margin: 16px 8px 8px; font-size: 11px; color: #7d8aa0; letter-spacing: .12em; text-transform: uppercase; }
.main { min-width: 0; }
.topbar {
  height: 64px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.search {
  flex: 1; max-width: 420px; position: relative;
}
.search input {
  width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px 10px 38px; background: #f7f8fc;
}
.top-actions { display: flex; align-items: center; gap: 12px; }
.bell { position: relative; width: 40px; height: 40px; border: 0; background: #f3f5fa; border-radius: 50%; cursor: pointer; }
.bell .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: #e11d48; border-radius: 50%; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 600; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who small { color: var(--muted); display: block; }
.content { padding: 24px; }
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.page-title h1 { margin: 0; font-size: 26px; }
.page-title p { margin: 4px 0 0; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(4, 1fr); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: 1.4fr .8fr; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat b { font-size: 28px; }
.stat span { color: var(--muted); font-size: 13px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer; font-weight: 600;
  background: var(--accent); color: #1a1403;
}
.btn.secondary { background: #eef1f6; color: var(--ink); }
.btn.danger { background: #fde8e6; color: var(--danger); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .04em; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #e7f8ef; color: var(--ok); }
.badge.warn { background: #fff4e5; color: var(--warn); }
.badge.danger { background: #fde8e6; color: var(--danger); }
.badge.info { background: #e7effc; color: var(--info); }
.form { display: grid; gap: 12px; }
.form.grid-2 { grid-template-columns: 1fr 1fr; }
label { font-size: 13px; color: var(--muted); display: grid; gap: 6px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
}
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(1200px 500px at 10% -10%, #1f4e79 0%, transparent 50%), var(--navy);
}
.auth-card { width: min(460px, 92vw); background: #fff; border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.flash { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.flash.error { background: #fde8e6; color: var(--danger); }
.flash.success { background: #e7f8ef; color: var(--ok); }
.office-card { text-align: center; }
.office-card .logo-box { height: 72px; display: grid; place-items: center; margin-bottom: 8px; }
.office-card .logo-box img { max-height: 64px; }
.dropdown {
  position: absolute; right: 0; top: 48px; width: 340px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); display: none; overflow: hidden;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown .item { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.toast {
  position: fixed; right: 18px; bottom: 18px; background: var(--navy); color: #fff;
  padding: 12px 16px; border-radius: 10px; display: none; z-index: 50;
}
.modal-bg { position: fixed; inset: 0; background: rgba(12,18,34,.45); display: none; place-items: center; z-index: 40; }
.modal-bg.open { display: grid; }
.modal { background: #fff; border-radius: 16px; padding: 20px; width: min(520px, 92vw); }
.hero { padding: 80px 8vw; color: #fff; }
.hero h1 { font-size: 48px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 32px; }
.sheet { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
#grid { min-width: 100%; }
.builder { display: grid; grid-template-columns: 240px 1fr; gap: 16px; min-height: 520px; }
.palette { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.palette .field {
  padding: 10px; border: 1px dashed var(--line); border-radius: 8px; margin-bottom: 8px; cursor: grab; background: #f8fafc;
}
.canvas { background: #fff; border-radius: 12px; padding: 18px; border: 1px solid var(--line); min-height: 500px; }
.pdf-card { display: grid; gap: 8px; }
.pdf-thumb {
  height: 160px; background: linear-gradient(#fff, #eef2f7); border: 1px solid var(--line);
  border-radius: 10px; display: grid; place-items: center; color: #9aa3b2; font-weight: 700;
}
@media (max-width: 1100px) {
  .grid.stats, .grid.two { grid-template-columns: 1fr 1fr; }
  .layout { grid-template-columns: 80px 1fr; }
  .brand span, .brand strong, .nav a span, .nav .sec { display: none; }
}
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; overflow: auto; }
  .grid.stats, .grid.two, .form.grid-2, .builder { grid-template-columns: 1fr; }
}
