* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
       background: #f2f5f9; color: #1a2433; font-size: 14px; line-height: 1.6; }

.topbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
          background: #123a6b; color: #fff; padding: 10px 18px; }
.brand { font-size: 18px; font-weight: bold; }
.brand span { font-size: 12px; font-weight: normal; opacity: .8; margin-left: 2px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { color: #cfe0f5; text-decoration: none; padding: 5px 12px; border-radius: 6px; font-size: 13px; }
.topbar nav a.on, .topbar nav a:hover { background: rgba(255,255,255,.16); color: #fff; }
.userbox { margin-left: auto; font-size: 11.5px; opacity: .85; display: flex; gap: 10px; align-items: center; }
.userbox .logout { color: #cfe0f5; }

#alerts .alert { padding: 8px 18px; font-size: 13px; border-bottom: 1px solid rgba(0,0,0,.08); }
#alerts .alert.warn { background: #fff3cd; color: #7a5a00; }
#alerts .alert.error { background: #fdeeee; color: #b03030; font-weight: bold; }
#alerts .ats { opacity: .6; font-size: 11px; }

main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 50px; }

.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
            background: #fff; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px;
            box-shadow: 0 1px 3px rgba(20,40,80,.08); }
.controls label { font-size: 12px; color: #556; }
.controls select, .controls input[type=date] {
  padding: 5px 8px; border: 1px solid #c3cdda; border-radius: 6px; font-size: 13px; background: #fff; }
.controls select[multiple] { min-width: 260px; height: 120px; }
.controls .csv { margin-left: auto; font-size: 12.5px; color: #123a6b; text-decoration: none;
                 border: 1px solid #123a6b; border-radius: 6px; padding: 5px 12px; }
.controls .csv:hover { background: #123a6b; color: #fff; }
.controls button { padding: 6px 14px; border: 0; border-radius: 6px; background: #123a6b; color: #fff;
                   font-size: 13px; cursor: pointer; }

.grid { display: grid; gap: 14px; }
.grid.cards4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card { background: #fff; border-radius: 10px; padding: 14px 18px; box-shadow: 0 1px 3px rgba(20,40,80,.08); }
.card .label { font-size: 12px; color: #667; }
.card .value { font-size: 24px; font-weight: bold; color: #123a6b; margin: 2px 0; }
.card .value.neg { color: #b03030; }
.delta { font-size: 11.5px; margin-left: 6px; }
.delta.up { color: #1e7a3c; } .delta.down { color: #b03030; }
.card .sub { font-size: 11px; color: #889; }

.panel { background: #fff; border-radius: 10px; padding: 16px 18px; margin-top: 14px;
         box-shadow: 0 1px 3px rgba(20,40,80,.08); }
.panel h2 { font-size: 15px; color: #123a6b; margin-bottom: 10px; }
.panel .chartbox { position: relative; height: 320px; }
.panel .chartbox.tall { height: 420px; }

table.data { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.data th { background: #123a6b; color: #fff; padding: 6px 9px; text-align: left; white-space: nowrap; }
table.data td { padding: 5px 9px; border-bottom: 1px solid #e4eaf2; }
table.data tr:hover td { background: #f4f7fb; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .pos { color: #1e7a3c; font-weight: bold; }
table.data .neg { color: #b03030; font-weight: bold; }
.tablewrap { overflow-x: auto; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.badge { display: inline-block; border-radius: 4px; padding: 1px 8px; font-size: 11px; color: #fff; }
.badge.budget_up { background: #1c5aa8; } .badge.budget_down { background: #5d6d7e; }
.badge.duplicate { background: #e67e22; } .badge.status_change { background: #888; }

.heatcell { display: inline-block; width: 100%; height: 20px; border-radius: 3px; }
.lifetable td { padding: 2px 3px; }
.lifetable .key { font-size: 12px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

.login-wrap { max-width: 420px; margin: 90px auto; background: #fff; border-radius: 12px;
              padding: 34px; text-align: center; box-shadow: 0 2px 10px rgba(20,40,80,.12); }
.login-wrap h1 { color: #123a6b; font-size: 20px; margin-bottom: 8px; }
.login-wrap p { font-size: 13px; color: #667; margin-bottom: 20px; }
.gbtn { display: inline-block; background: #123a6b; color: #fff; text-decoration: none;
        padding: 11px 26px; border-radius: 8px; font-size: 14px; }
.empty { color: #889; font-size: 13px; padding: 20px; text-align: center; }

.datechip { display: inline-block; background: #eef3fa; color: #123a6b; border-radius: 4px;
            padding: 0 6px; font-size: 10.5px; font-weight: bold; vertical-align: 1px; }
