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

:root {
  --teal-900: #0b4f49;
  --teal-700: #0b7a6e;
  --teal-600: #0e8f80;
  --teal-500: #14a594;
  --teal-300: #7fd6c9;
  --teal-100: #d7f3ee;
  --teal-50: #eefaf7;
  --ink-900: #10231f;
  --ink-700: #34504a;
  --ink-500: #6b817c;
  --ink-300: #a9bab6;
  --line: #e3ece9;
  --surface: #ffffff;
  --bg: #f4f9f8;
  --series-1: #0e8f80;
  --series-2: #eb6834;
  --series-3: #2a78d6;
  --good: #12804a;
  --good-bg: #e3f6ec;
  --warn: #9a5b00;
  --warn-bg: #fff3dc;
  --bad: #b42318;
  --bad-bg: #fde8e6;
  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 35, 31, 0.04), 0 8px 24px rgba(14, 143, 128, 0.07);
  --shadow-lg: 0 18px 40px rgba(14, 143, 128, 0.16);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-700); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-500); }
.hidden { display: none !important; }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-900); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
  display: grid; place-items: center; color: #fff; box-shadow: 0 6px 14px rgba(14, 143, 128, 0.3);
}
.brand-text strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.brand-text span { display: block; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-500); font-weight: 600; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  white-space: nowrap; text-decoration: none; color: var(--ink-700); font-weight: 600; font-size: 13.5px;
  padding: 8px 14px; border-radius: 999px; transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--teal-50); color: var(--teal-700); }
.nav a.active { background: var(--teal-100); color: var(--teal-900); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.month-select {
  appearance: none; border: 1px solid var(--line); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230b7a6e' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding: 8px 34px 8px 14px; border-radius: 999px; font-weight: 600; color: var(--teal-900); cursor: pointer;
}
.month-select:focus-visible, .btn:focus-visible, .input:focus-visible { outline: 3px solid var(--teal-300); outline-offset: 1px; }

/* ---------------- Buttons ---------------- */
.btn {
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: 999px; padding: 9px 18px;
  font-weight: 700; font-size: 13.5px; cursor: pointer; transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--teal-500), var(--teal-700)); color: #fff; box-shadow: 0 6px 16px rgba(14, 143, 128, 0.28); }
.btn-primary:hover { box-shadow: 0 10px 22px rgba(14, 143, 128, 0.36); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--teal-900); }
.btn-ghost:hover { background: var(--teal-50); }
.btn-danger { background: #fff; border-color: #f3c7c2; color: var(--bad); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 50%; }

/* ---------------- Layout ---------------- */
.page { max-width: 1320px; margin: 0 auto; padding: 24px 24px 64px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
section.block { margin-top: 30px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--teal-600); font-weight: 700; font-size: 12.5px; }
.eyebrow::before { content: ''; width: 26px; height: 2px; background: var(--teal-500); border-radius: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h2.title { font-size: 24px; font-weight: 800; line-height: 1.2; }
h2.title em { font-style: normal; color: var(--teal-600); }
h3.card-title { font-size: 15px; font-weight: 700; }
.section-head p { margin: 4px 0 0; color: var(--ink-500); max-width: 560px; }

.card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 20px 22px;
  box-shadow: var(--shadow); border: 1px solid rgba(227, 236, 233, 0.7);
  min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-sub { color: var(--ink-500); font-size: 12.5px; margin-top: 2px; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 30px 32px;
  background:
    radial-gradient(circle at 92% 18%, rgba(255, 255, 255, 0.22) 0 70px, transparent 71px),
    radial-gradient(circle at 98% 92%, rgba(255, 255, 255, 0.12) 0 120px, transparent 121px),
    linear-gradient(120deg, #0b7a6e 0%, #14a594 55%, #4cc3b1 100%);
  color: #fff; box-shadow: var(--shadow-lg);
}
.hero::after {
  content: '+'; position: absolute; right: 36px; top: 14px; font-size: 64px; font-weight: 300; opacity: 0.25;
}
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.hero h1 { font-size: 30px; font-weight: 800; line-height: 1.15; }
.hero h1 span { display: block; font-size: 15px; font-weight: 600; opacity: 0.85; letter-spacing: 0; margin-bottom: 6px; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.18); font-size: 12.5px; font-weight: 600; backdrop-filter: blur(6px);
}
.hero-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.hero-kpi {
  background: rgba(255, 255, 255, 0.95); color: var(--ink-900); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: 0 8px 18px rgba(11, 79, 73, 0.14);
}
.hero-kpi .label { font-size: 12px; font-weight: 600; color: var(--ink-500); display: flex; align-items: center; gap: 6px; }
.hero-kpi .value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.hero-kpi .hint { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.kpi-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); }

/* ---------------- KPI target cards ---------------- */
.kpi-card { position: relative; }
.kpi-card .k-label { font-weight: 700; font-size: 13.5px; }
.kpi-card .k-channel { font-size: 11.5px; color: var(--ink-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.kpi-card .k-value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 10px 0 2px; }
.kpi-card .k-target { font-size: 12.5px; color: var(--ink-500); }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-neutral { background: var(--teal-50); color: var(--teal-700); }
.meter { height: 8px; background: var(--teal-50); border-radius: 999px; overflow: hidden; margin-top: 14px; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal-500), var(--teal-700)); }

/* ---------------- Charts ---------------- */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 170px; }
.chart-box.lg { height: 330px; }
.chart-box.tall { height: 420px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-700); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 3px; border-radius: 2px; width: 14px; vertical-align: 3px; }
.table-toggle { font-size: 12px; }
details.data-table summary { cursor: pointer; color: var(--teal-700); font-weight: 600; font-size: 12.5px; margin-top: 8px; }
details.data-table .tbl-wrap { max-height: 260px; overflow: auto; margin-top: 8px; }

/* ---------------- Tables ---------------- */
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-500); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl td.c, .tbl th.c { text-align: center; }
.score { display: inline-block; min-width: 42px; padding: 3px 8px; border-radius: 8px; font-weight: 700; text-align: center; }

/* ---------------- Profile ---------------- */
.profile-card { display: flex; flex-direction: column; gap: 12px; }
.profile-top { display: flex; align-items: center; gap: 14px; }
.profile-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); flex: none; }
.profile-top .big { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.profile-top .lbl { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink-500); }
.share-bar { height: 6px; border-radius: 999px; background: var(--teal-50); overflow: hidden; }
.share-bar span { display: block; height: 100%; background: var(--series-1); border-radius: 999px; }
.top-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.top-list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--bg); border-radius: 12px; font-size: 13px; }
.top-list li b { font-variant-numeric: tabular-nums; }
.rank { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: var(--teal-700); font-size: 11px; font-weight: 800; margin-right: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* ---------------- Stat rows ---------------- */
.stat-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.stat-row:last-child { border-bottom: 0; }
.stat-row .v { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------------- Forms ---------------- */
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; transition: border-color 0.15s;
}
.input:focus { border-color: var(--teal-500); }
textarea.input { resize: vertical; min-height: 64px; line-height: 1.5; }
label.field { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
label.field small { font-weight: 500; color: var(--ink-500); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.param-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.param-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 12px; background: var(--bg); }
.param-row span { font-size: 13px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper input { width: 52px; text-align: center; padding: 6px; border-radius: 10px; border: 1px solid var(--line); }
.stepper button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; color: var(--teal-700); }

/* ---------------- Upload ---------------- */
.dropzone {
  border: 2px dashed var(--teal-300); border-radius: var(--radius-lg); background: linear-gradient(180deg, #fff, var(--teal-50));
  padding: 40px 24px; text-align: center; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.dropzone.drag { background: var(--teal-100); border-color: var(--teal-600); }
.dropzone .dz-icon { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 12px; display: grid; place-items: center; background: #fff; color: var(--teal-600); box-shadow: var(--shadow); }
.file-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.file-item + .file-item { margin-top: 10px; }
.file-item .fi-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); flex: none; }
.file-item .fi-body { flex: 1; min-width: 0; }
.file-item .fi-name { font-weight: 700; word-break: break-all; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { padding: 2px 9px; border-radius: 999px; background: var(--teal-50); color: var(--teal-900); font-size: 11.5px; font-weight: 600; }

/* ---------------- Export ---------------- */
.slot { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff; }
.slot + .slot { margin-top: 12px; }
.slot-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.slot-head b { font-size: 13.5px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.checklist .dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 800; }
.dot.ok { background: var(--good-bg); color: var(--good); }
.dot.no { background: var(--warn-bg); color: var(--warn); }

/* ---------------- Empty / loading / toast ---------------- */
.empty { text-align: center; padding: 60px 20px; }
.empty .dz-icon { margin: 0 auto 14px; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-600); }
.skeleton { background: linear-gradient(90deg, #edf4f2 0%, #f7fbfa 50%, #edf4f2 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius-lg); }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-ghost .spinner { border-color: var(--teal-100); border-top-color: var(--teal-600); }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-wrap { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 50; }
.toast { background: var(--ink-900); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); max-width: 380px; font-size: 13px; animation: up .2s ease-out; }
.toast.error { background: var(--bad); }
.toast.ok { background: var(--teal-700); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.notice { padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 500; }
.notice.info { background: var(--teal-50); color: var(--teal-900); }

/* ---------------- Login ---------------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  position: relative; overflow: hidden; padding: 48px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.18) 0 120px, transparent 121px),
    radial-gradient(circle at 10% 90%, rgba(255,255,255,.12) 0 180px, transparent 181px),
    linear-gradient(135deg, #0b7a6e, #14a594 60%, #5fcbb9);
}
.login-art h1 { font-size: 40px; font-weight: 800; line-height: 1.1; max-width: 440px; }
.login-art p { max-width: 420px; opacity: .9; font-size: 15px; }
.login-script { font-size: 34px; font-style: italic; font-weight: 300; opacity: .85; }
.login-form { display: grid; place-items: center; padding: 32px; background: #fff; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; font-weight: 800; }
.login-lock { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); margin-bottom: 14px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 96px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--teal-50); color: var(--teal-700); font-weight: 600; font-size: 12px; padding: 5px 10px; border-radius: 8px; cursor: pointer; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; color: var(--ink-900); text-decoration: none; }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--teal-500), var(--teal-700)); color: #fff; font-size: 12px; font-weight: 800; }
.role-badge { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }

.wd-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; margin-top: 12px; }
.wd-chips .chip { text-align: center; }
.sticky { position: sticky; top: 84px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .hero-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-4, .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .nav a { padding: 8px 10px; }
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  .page { padding: 16px 16px 48px; }
  .hero { padding: 22px 18px; border-radius: 22px; }
  .hero h1 { font-size: 23px; }
  .hero-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2, .g-3, .g-5, .form-grid, .param-grid { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi-card { padding: 14px; }
  .kpi-card .k-value { font-size: 22px; }
  .kpi-card .card-head { flex-direction: column-reverse; gap: 6px; }
  .hero::after { display: none; }
  .sticky { position: static; }
  .span-2 { grid-column: auto; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { min-height: 0; padding: 24px 28px 28px; gap: 18px; }
  .login-script { display: none; }
  .login-art h1 { font-size: 28px; }
  .chart-box { height: 240px; }
}
