@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --navy: #0b1630;
  --navy-2: #122044;
  --blue: #2f6bff;
  --blue-soft: #e8efff;
  --bg: #eef3fb;
  --card: #ffffff;
  --text: #12203a;
  --muted: #6b7a99;
  --line: #e4ebf5;
  --green: #12b76a;
  --orange: #f79009;
  --purple: #7a5af8;
  --cyan: #0ea5e9;
  --pink: #ee46bc;
  --red: #f04438;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(18, 32, 58, 0.06);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0b1630 0%, #102048 100%);
  color: #fff;
  padding: 22px 16px 18px;
}
.brand { font-size: 28px; font-weight: 800; letter-spacing: .12em; }
.brand-sub { font-size: 11px; color: #9bb0d6; letter-spacing: .12em; text-transform: uppercase; margin: 2px 0 22px; }
.userbox { display: none; }

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d5def0;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.nav a:hover, .nav a.active { background: var(--blue); color: #fff; }
.sidebar-foot {
  margin-top: 28px;
  padding: 16px 8px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  color: #8ea0c6;
  font-size: 10px;
  letter-spacing: .14em;
  line-height: 1.6;
  text-transform: uppercase;
}

.main { flex: 1; padding: 22px 26px 40px; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.slogan { color: #7b8bab; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.search {
  flex: 1;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 13px;
}
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who b { display: block; }
.who span { color: var(--muted); font-size: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #122044; color: #fff; display: grid; place-items: center; font-weight: 800;
}

h1 { font-size: 30px; margin: 0 0 4px; }
.lead { color: var(--muted); margin: 0 0 18px; }

.kpi-grid, .cards, .cash-grid, .cash-cards, .report-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi, .card, .report-card, .cash-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid #f0f4fb;
}
.kpi-ico {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 800; margin-bottom: 10px; color: #fff;
}
.ico-blue { background: #2f6bff; }
.ico-green { background: #12b76a; }
.ico-orange { background: #f79009; }
.ico-purple { background: #7a5af8; }
.ico-cyan { background: #0ea5e9; }
.ico-pink { background: #ee46bc; }
.kpi-label, .card span, .cash-card .label, .report-card .label {
  color: var(--muted); font-size: 12px; font-weight: 700;
}
.kpi-value, .card b, .cash-card .value, .report-card .value {
  display: block; font-size: 22px; font-weight: 800; margin-top: 6px; color: var(--text);
}
.kpi-note { color: var(--muted); font-size: 12px; margin-top: 4px; }

.panel, .report-section, .cash-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid #f0f4fb;
}
.section-title { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-weight: 800; margin: 8px 0 10px; }

.dash-3 { display: grid; grid-template-columns: 1.1fr 1.1fr .9fr; gap: 14px; margin-bottom: 16px; }
.dash-3b { display: grid; grid-template-columns: 1.2fr 1fr .8fr; gap: 14px; }

.donut-wrap { display: flex; gap: 18px; align-items: center; }
.donut {
  width: 132px; height: 132px; border-radius: 50%;
  display: grid; place-items: center;
}
.donut-inner {
  width: 78px; height: 78px; background: #fff; border-radius: 50%;
  display: grid; place-items: center; text-align: center; font-weight: 800;
}
.legend { font-size: 13px; color: var(--muted); line-height: 1.8; }
.legend b { color: var(--text); }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; }
.bar {
  flex: 1; background: #2f6bff; border-radius: 8px 8px 4px 4px; min-height: 6px;
}
.bar-lab { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 11px; }

.quick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin: 14px 0 18px; }
.quick a {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 10px; text-decoration: none; color: var(--text);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow);
}
.quick a:hover { border-color: #2f6bff; color: #2f6bff; }

table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; background: #f8fbff; }

input, select, textarea {
  padding: 10px 12px; border: 1px solid #d7e0ee; border-radius: 12px;
  font: inherit; width: 100%; margin: 4px 0 10px; background: #fff; color: var(--text);
}
button, .btn {
  background: var(--blue); color: #fff; border: 0; border-radius: 12px;
  padding: 10px 14px; cursor: pointer; text-decoration: none; display: inline-block; font-weight: 700; font-size: 13px;
}
button:hover, .btn:hover { filter: brightness(1.05); }
.btn-secondary { background: #e8efff; color: #1d4ed8; }
.btn-danger { background: var(--red); color: #fff; }

.formgrid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hint { color: var(--muted); font-size: 13px; }
.flash { padding: 12px 14px; border-radius: 12px; background: #fff7ed; border: 1px solid #fdba74; margin-bottom: 14px; color: #9a3412; }
.success, .ready { padding: 12px; background: #ecfdf3; border: 1px solid #86efac; border-radius: 12px; color: #166534; }
.blocked { padding: 12px; background: #fff7ed; border-radius: 12px; }

.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.badge.ok { background: #ecfdf3; color: #067647; }
.badge.pending { background: #fff7ed; color: #b54708; }
.badge.done { background: #eef4ff; color: #175cd3; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: #0b1630; }
.login { width: 400px; background: #fff; padding: 32px; border-radius: 22px; }
.login h1 { letter-spacing: .16em; }

.cash-card.total { background: #122044; color: #fff; }
.cash-card.total .value, .cash-card.total .label { color: #fff; }

@media (max-width: 1200px) {
  .kpi-grid, .cards, .quick { grid-template-columns: repeat(3, 1fr); }
  .dash-3, .dash-3b { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .layout { display: block; }
  .sidebar { width: 100%; }
  .kpi-grid, .cards, .quick { grid-template-columns: 1fr 1fr; }
  .formgrid, .evidence-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .kpi-grid, .cards, .quick { grid-template-columns: 1fr; }
  .main { padding: 14px; }
}

.menu-btn { display: none; }
.tabbar { display: none; }
.sidebar-mask { display: none; }

@media (max-width: 820px) {
  .layout { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(82vw, 280px);
    z-index: 50; transform: translateX(-105%);
    transition: transform .2s ease; overflow: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask.show {
    display: block; position: fixed; inset: 0; background: rgba(11,22,48,.45);
    z-index: 40;
  }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: 0; border-radius: 12px;
    background: #122044; color: #fff; font-size: 20px;
  }
  .topbar { position: sticky; top: 0; z-index: 20; background: #eef3fb; padding-bottom: 8px; }
  .slogan { font-size: 10px; max-width: 42%; }
  .hide-phone, .who-text { display: none !important; }
  .main { padding: 12px 12px 92px; }
  .kpi-grid, .cards, .quick, .cash-grid, .report-cards { grid-template-columns: 1fr 1fr; }
  .dash-3, .dash-3b, .formgrid { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
  table { font-size: 12px; }
  .tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0;
    background: #0b1630; z-index: 30;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
    box-shadow: 0 -8px 24px rgba(11,22,48,.2);
  }
  .tabbar a {
    color: #d5def0; text-decoration: none; text-align: center;
    font-size: 11px; font-weight: 700; flex: 1; padding: 6px 2px;
  }
  .tabbar a span { display: block; margin-top: 2px; }
  .actions .btn, .actions button, .tabbar + * { }
  button, .btn { min-height: 42px; }
}
@media (max-width: 520px) {
  .kpi-grid, .cards, .quick { grid-template-columns: 1fr; }
}

.phone-actions { display: none; }
@media (max-width: 820px) {
  .phone-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px;
  }
  .phone-actions .btn { text-align: center; font-size: 16px; padding: 16px 10px; }
  .quick { display: none; }
}

/* contrast lock */
body, .main, .panel, .card, table { color: #F3F6FF; }
