* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Segoe UI", Arial, sans-serif;
  background: #f4f6f9; color: #1c2733; font-size: 14px;
}
header {
  background: #1f3a5f; color: #fff; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px;
}
header h1 { font-size: 17px; margin: 0; font-weight: 600; }
nav button {
  background: none; border: none; color: #c9d6e8; font-size: 14px;
  padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent;
}
nav button.active { color: #fff; border-bottom-color: #ffb74d; }
nav button:hover { color: #fff; }
main { padding: 18px 22px; max-width: 1400px; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; }

.cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.card {
  background: #fff; border-radius: 8px; padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); flex: 1; min-width: 200px;
}
.card .lbl { color: #6b7a8d; font-size: 12px; text-transform: uppercase; }
.card .val { font-size: 22px; font-weight: 600; margin-top: 4px; }
.card.gap .val { color: #c62828; }
.card.ok .val { color: #2e7d32; }
.card .sub { font-size: 12px; color: #8a97a5; margin-top: 4px; }

.panel {
  background: #fff; border-radius: 8px; padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 18px;
}
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .charts { grid-template-columns: 1fr; } }
.chart-box { height: 280px; position: relative; }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 6px 8px; border-bottom: 1px solid #e5eaf0; text-align: left; }
th { background: #f0f3f7; font-weight: 600; position: sticky; top: 0; }
tr:hover td { background: #f7fafd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.expanded-detail td { background: #fbfcfe; padding: 12px 18px; }
.neg { color: #c62828; }
.pos { color: #2e7d32; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; }
.badge.off { background: #e3f2fd; color: #1565c0; }
.badge.noff { background: #fff3e0; color: #e65100; }
.badge.src { background: #eceff1; color: #546e7a; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end;
  margin-bottom: 12px; }
.filters label { font-size: 12px; color: #6b7a8d; display: block; }
input, select, textarea {
  padding: 6px 8px; border: 1px solid #cdd6e0; border-radius: 5px;
  font-size: 13px; font-family: inherit;
}
button.btn {
  background: #1f3a5f; color: #fff; border: none; padding: 7px 14px;
  border-radius: 5px; cursor: pointer; font-size: 13px;
}
button.btn:hover { background: #2a4d7d; }
button.btn.sec { background: #e8edf3; color: #1c2733; }
button.btn.sec:hover { background: #d9e1ea; }
button.btn.danger { background: #c62828; }
button.btn.small { padding: 3px 9px; font-size: 12px; }
.pager { margin-top: 10px; display: flex; gap: 8px; align-items: center; }

.drop {
  border: 2px dashed #9db2c8; border-radius: 8px; padding: 30px;
  text-align: center; color: #5b6b7d; background: #fafcfe;
}
.drop.over { border-color: #1f3a5f; background: #eef4fb; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.formrow { display: flex; gap: 10px; align-items: end; flex-wrap: wrap;
  margin-bottom: 10px; }
.hint { font-size: 12px; color: #8a97a5; }
#loginOverlay {
  position: fixed; inset: 0; background: rgba(15,30,50,.75);
  display: none; align-items: center; justify-content: center; z-index: 99;
}
#loginOverlay .box { background: #fff; border-radius: 10px; padding: 30px;
  width: 320px; }
.toast {
  position: fixed; bottom: 20px; right: 20px; background: #1f3a5f;
  color: #fff; padding: 12px 18px; border-radius: 6px; z-index: 100;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); display: none;
}
.muted { color: #97a4b2; }
.month-row { cursor: pointer; }
.secrow td, td.secrow { background: #eef2f7; }
.subtabs { display: flex; gap: 4px; margin-bottom: 12px; }
.subtab {
  padding: 6px 16px; border: none; border-radius: 6px 6px 0 0;
  background: #dde4ec; color: #4a5a6d; cursor: pointer; font-size: 13px;
}
.subtab.active { background: #fff; color: #1f3a5f; font-weight: 600; }
.subpage { display: none; }
.subpage.active { display: block; }
#stTable table { font-size: 12px; }
#stTable td:first-child { min-width: 220px; }
.chk { margin-bottom: 8px; }
