:root {
  --navy: #2b4059;
  --navy-2: #24384e;
  --ink: #172033;
  --muted: #697386;
  --line: #e5e9f0;
  --bg: #f3f5f9;
  --card: #ffffff;
  --brand: #dd2830;
  --brand-dark: #b91f27;
  --brand-soft: #fff0f1;
  --blue: #2368b6;
  --blue-soft: #edf5ff;
  --green: #138a5b;
  --green-soft: #eaf8f1;
  --amber: #b66a00;
  --amber-soft: #fff5e5;
  --shadow: 0 8px 28px rgba(31, 47, 70, .07);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
.hidden { display: none !important; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(390px,.8fr);
  background: #f3f5f9;
}
.auth-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px,5vw,68px);
  color: #fff;
  background:
    radial-gradient(circle at 84% 16%, rgba(238,72,82,.2), transparent 28%),
    radial-gradient(circle at 14% 74%, rgba(74,140,214,.18), transparent 34%),
    linear-gradient(135deg,#0e192b,#172b48 62%,#213f65);
}
.auth-visual:after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  right: -180px;
  bottom: -240px;
  border: 52px solid rgba(255,255,255,.045);
  border-radius: 50%;
}
.auth-brand { display: flex; gap: 13px; align-items: center; position: relative; z-index: 1; }
.auth-brand strong { display: block; font-size: 20px; }
.auth-brand small { display: block; color: #aebdd0; font-size: 11px; }
.auth-copy { max-width: 720px; position: relative; z-index: 1; }
.auth-copy h1 { margin: 12px 0 20px; font-size: clamp(36px,5vw,68px); line-height: 1.12; letter-spacing: -2.2px; }
.auth-copy p { max-width: 620px; margin: 0; color: #c6d2e1; font-size: clamp(13px,1.2vw,17px); line-height: 1.85; }
.auth-security { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.auth-security span { padding: 6px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 20px; color: #b9c8d9; background: rgba(255,255,255,.045); font-size: 10.5px; }
.auth-panel { display: grid; place-items: center; padding: 28px; background: #f7f9fc; }
.login-card { width: min(390px,100%); padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 22px 55px rgba(27,45,70,.1); }
.login-card h2 { margin: 7px 0 5px; font-size: 26px; letter-spacing: -.6px; }
.login-card > p { margin: 0 0 24px; color: var(--muted); font-size: 12px; }
.login-field { display: block; margin-bottom: 15px; color: #526078; font-size: 11.5px; font-weight: 700; }
.login-field input { width: 100%; height: 44px; margin-top: 6px; padding: 0 12px; border: 1px solid #dfe4ec; border-radius: 10px; background: #fff; color: var(--ink); outline: none; }
.login-field input:focus { border-color: #8aabda; box-shadow: 0 0 0 3px rgba(35,104,182,.1); }
.login-submit { width: 100%; min-height: 44px; margin-top: 3px; }
.login-error { margin: 0 0 10px; padding: 9px 10px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11.5px; }
.login-help { margin-top: 17px; padding-top: 14px; border-top: 1px solid #eef1f5; color: #8490a2; font-size: 10.5px; line-height: 1.7; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 248px;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 10% 5%, rgba(255,255,255,.12), transparent 28%),
    linear-gradient(180deg, #314963 0%, #22354a 100%);
  transition: transform .22s ease;
}
.brand { display: flex; gap: 9px; align-items: center; padding: 0 7px 22px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .3px; }
.brand small { display: block; color: #aeb9c9; font-size: 11px; margin-top: 2px; }
.brand-logo {
  width: 106px;
  height: 36px;
  flex: none;
  object-fit: contain;
  padding: 2px 4px;
  border-radius: 8px;
  background: #fff;
}
.auth-logo { width: 144px; height: 46px; padding: 3px 5px; border-radius: 9px; }
.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #ed3b43, #bd1b23);
  box-shadow: 0 8px 18px rgba(221,40,48,.28);
  overflow: hidden;
}
.brand-mark span {
  position: absolute;
  left: 9px;
  width: 20px;
  height: 4px;
  border-radius: 4px;
  background: #fff;
  transform: rotate(-20deg);
}
.brand-mark span:nth-child(1) { top: 11px; width: 14px; }
.brand-mark span:nth-child(2) { top: 17px; }
.brand-mark span:nth-child(3) { top: 23px; width: 15px; margin-left: 5px; }

.nav { flex: 1; overflow: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-label {
  margin: 14px 12px 6px;
  color: #7e8ca1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
}
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #c8d1df;
  padding: 10px 12px;
  margin: 2px 0;
  text-align: left;
  transition: .15s ease;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(221,40,48,.96), rgba(190,28,36,.96));
  color: #fff;
  box-shadow: 0 7px 20px rgba(221,40,48,.2);
}
.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  font-size: 14px;
}
.nav-item.active .nav-icon { background: rgba(255,255,255,.16); }
.sidebar-footer {
  position: relative;
  margin: 16px 6px 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}
.account-block { display: flex; align-items: center; gap: 9px; }
.account-avatar { width: 33px; height: 33px; display: grid; place-items: center; flex: none; border-radius: 10px; color: #fff; background: linear-gradient(145deg,#e23d45,#b91f27); font-size: 12px; font-weight: 800; }
.account-copy { min-width: 0; flex: 1; }
.account-copy b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.account-copy small { display: block; margin-top: 1px; color: #8997aa; font-size: 10.5px; }
.account-menu-btn { width: 26px; height: 26px; border: 0; border-radius: 7px; color: #aeb9c9; background: rgba(255,255,255,.06); }
.account-menu { position: absolute; left: 8px; right: 8px; bottom: 70px; z-index: 10; overflow: hidden; border: 1px solid #34455e; border-radius: 10px; background: #17253a; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.account-menu button { width: 100%; padding: 9px 11px; border: 0; border-bottom: 1px solid rgba(255,255,255,.06); background: transparent; color: #dbe3ee; text-align: left; font-size: 11px; }
.account-menu button:last-child { border-bottom: 0; }
.account-menu button:hover { background: rgba(255,255,255,.07); }
.account-menu button.danger { color: #ff9da2; }
.sync-status { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(255,255,255,.07); color: #8290a4; font-size: 9.5px; }
.status-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #40d89b; box-shadow: 0 0 0 4px rgba(64,216,155,.1); }

.main-shell { width: calc(100% - 248px); margin-left: 248px; }
.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.topbar-title h1 { margin: 0; font-size: 21px; letter-spacing: -.3px; }
.topbar-title p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.scope-control { display: flex; gap: 7px; align-items: center; margin-left: auto; }
.scope-control label { color: var(--muted); font-size: 11px; }
.scope-control select {
  height: 36px;
  max-width: 190px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 28px 0 10px;
  color: var(--ink);
  background: #fff;
}
.scope-control select:disabled { color: #697386; background: #f6f8fb; cursor: not-allowed; }
.top-actions { display: flex; gap: 8px; }
.btn {
  min-height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 7px 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: .15s ease;
}
.btn:hover { border-color: #c9d1dd; box-shadow: 0 3px 10px rgba(35,48,66,.06); }
.btn-primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-light { color: #35506f; background: #f6f8fb; }
.btn-soft { color: var(--blue); background: var(--blue-soft); border-color: #dcebff; }
.btn-danger { color: #b5222b; background: #fff; border-color: #f1c5c8; }
.btn-sm { min-height: 31px; padding: 4px 9px; font-size: 12px; }
.icon-btn {
  width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.filterbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 8px 28px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
}
.range-group {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #eef1f6;
}
.range-group button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
  flex: none;
}
.range-group button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(31,47,70,.08); font-weight: 700; }
.date-fields { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.date-fields input {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  color: var(--ink);
  background: #fff;
}
.scope-chip {
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 700;
}
.content { padding: 22px 28px 36px; max-width: 1580px; margin: 0 auto; }
.page { display: none; animation: fadeIn .2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-heading h2 { margin: 0; font-size: 18px; }
.page-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.page-heading .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-header h3 { margin: 0; font-size: 15px; }
.card-header p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.card-body { padding: 14px 18px 18px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.span-2 { grid-column: span 2; }

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0,1.25fr) minmax(280px,.75fr);
  gap: 24px;
  align-items: center;
  padding: 26px 28px;
  margin-bottom: 14px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 10%, rgba(86,153,224,.25), transparent 32%),
    linear-gradient(120deg, #111d31 0%, #1c3454 62%, #225385 100%);
  border-radius: 20px;
  box-shadow: 0 14px 32px rgba(16,27,45,.16);
}
.hero:after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  bottom: -135px;
  border: 26px solid rgba(255,255,255,.05);
  border-radius: 50%;
}
.hero h2 { margin: 6px 0 8px; font-size: clamp(22px,2.2vw,32px); letter-spacing: -.6px; }
.hero p { margin: 0; max-width: 680px; color: #ccd7e6; font-size: 13px; }
.hero-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.hero .btn-light { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.hero .btn-light:hover { background: rgba(255,255,255,.2); }
.hero-number {
  justify-self: end;
  min-width: 250px;
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(8px);
}
.hero-number small { display: block; color: #c7d3e2; }
.hero-number strong { display: block; margin: 3px 0; font-size: 34px; letter-spacing: -.8px; }
.hero-number .progress { height: 6px; margin-top: 12px; border-radius: 20px; background: rgba(255,255,255,.13); overflow: hidden; }
.hero-number .progress i { display: block; height: 100%; border-radius: inherit; background: #ff5960; }

.kpi { padding: 16px 17px; min-height: 119px; }
.kpi-top { display: flex; justify-content: space-between; gap: 8px; }
.kpi-label { color: var(--muted); font-size: 12px; }
.kpi-badge { border-radius: 20px; padding: 2px 7px; font-size: 10.5px; font-weight: 700; height: fit-content; }
.kpi-badge.up { color: var(--green); background: var(--green-soft); }
.kpi-badge.down { color: var(--brand); background: var(--brand-soft); }
.kpi-badge.neutral { color: var(--blue); background: var(--blue-soft); }
.kpi-value { margin-top: 7px; font-size: 27px; line-height: 1.2; font-weight: 800; letter-spacing: -.6px; }
.kpi-value small { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.kpi-foot { margin-top: 7px; color: #8a94a5; font-size: 11px; }

.section-grid { display: grid; gap: 14px; grid-template-columns: minmax(0,1.45fr) minmax(310px,.75fr); margin-top: 14px; }
.chart-wrap { overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: 11px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; }
.insight-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.insight {
  flex: 1 1 180px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f9fc;
  color: #43516a;
  font-size: 11.5px;
}
.insight b { display: block; color: var(--ink); font-size: 13px; }

.rank-list { display: grid; gap: 8px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f2f6; }
.rank-row:last-child { border-bottom: 0; }
.rank-no { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; background: #f1f3f7; color: #697386; font-size: 11px; font-weight: 800; }
.rank-row:nth-child(1) .rank-no { color: #fff; background: var(--brand); }
.rank-main { min-width: 0; flex: 1; }
.rank-main b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-main small { display: block; color: var(--muted); font-size: 10.5px; }
.rank-value { font-weight: 800; font-size: 13px; }

.task-list { display: grid; gap: 8px; }
.task {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 11px;
  border: 1px solid #eef1f5;
  border-radius: 11px;
  background: #fcfdff;
}
.task-priority { width: 6px; align-self: stretch; border-radius: 8px; background: var(--amber); flex: none; }
.task-priority.danger { background: var(--brand); }
.task-priority.info { background: var(--blue); }
.task-main { min-width: 0; flex: 1; }
.task-main b { display: block; font-size: 12.5px; }
.task-main small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.task a { font-size: 11px; font-weight: 700; white-space: nowrap; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.search {
  min-width: 210px;
  height: 37px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 11px;
  background: #fff;
}
.toolbar select {
  height: 37px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 28px 0 10px;
  background: #fff;
}
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 12px;
}
.tab.active { border-color: #f0c4c7; color: var(--brand); background: var(--brand-soft); font-weight: 700; }

.entry-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(260px,.55fr); gap: 14px; }
.form-card { padding: 20px; }
.form-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; }
.form-head h3 { margin: 0; font-size: 17px; }
.form-head p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.field { min-width: 0; }
.field.full { grid-column: 1/-1; }
.field label { display: block; margin-bottom: 5px; color: #536078; font-size: 11.5px; font-weight: 700; }
.field label em { color: var(--brand); font-style: normal; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 39px;
  border: 1px solid #dfe4ec;
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: .15s;
}
.field textarea { min-height: 86px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #8aabda; box-shadow: 0 0 0 3px rgba(35,104,182,.1); }
.field-hint { margin-top: 4px; color: #929bab; font-size: 10.5px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.helper-card { padding: 18px; background: linear-gradient(160deg,#f8fbff,#fff); }
.helper-card h3 { margin: 0 0 12px; font-size: 14px; }
.steps { display: grid; gap: 12px; }
.step { display: flex; gap: 10px; }
.step-no { width: 25px; height: 25px; display: grid; place-items: center; flex: none; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 800; }
.step b { display: block; font-size: 12px; }
.step small { display: block; margin-top: 1px; color: var(--muted); font-size: 10.5px; }
.recent-list { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.recent-list h4 { margin: 0 0 9px; font-size: 12px; }
.recent-item { padding: 8px 0; border-bottom: 1px solid #eef1f5; }
.recent-item:last-child { border-bottom: 0; }
.recent-item b { display: block; font-size: 11.5px; }
.recent-item small { display: block; color: var(--muted); font-size: 10.5px; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 12px;
  text-align: left;
  white-space: nowrap;
  color: #6f7a8d;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  letter-spacing: .2px;
}
td { padding: 11px 12px; border-bottom: 1px solid #f0f2f6; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfe; }
td strong { font-size: 12px; }
.cell-sub { display: block; margin-top: 1px; color: var(--muted); font-size: 10.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; gap: 4px; white-space: nowrap; }
.row-actions button { border: 0; background: transparent; color: var(--blue); padding: 3px 4px; font-size: 11px; }
.row-actions button.danger { color: var(--brand); }
.empty { padding: 34px 16px; color: var(--muted); text-align: center; }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }
.pill { display: inline-block; padding: 2px 7px; border-radius: 20px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.pill.green { color: var(--green); background: var(--green-soft); }
.pill.blue { color: var(--blue); background: var(--blue-soft); }
.pill.orange { color: var(--amber); background: var(--amber-soft); }
.pill.red { color: var(--brand); background: var(--brand-soft); }
.pill.gray { color: #697386; background: #f0f2f5; }

.channel-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.channel-card { padding: 15px; }
.channel-card-top { display: flex; align-items: flex-start; gap: 10px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 11px; background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.channel-card h3 { margin: 0; font-size: 13.5px; }
.channel-card .meta { margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.channel-card-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #eef1f5; }
.channel-card-stats div { min-width: 0; }
.channel-card-stats b { display: block; font-size: 13px; }
.channel-card-stats small { display: block; color: var(--muted); font-size: 10px; }
.channel-card-actions { display: flex; gap: 5px; margin-top: 12px; }

.analysis-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.analysis-grid .wide { grid-column: 1/-1; }
.mini-metric { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #eef1f5; }
.mini-metric:last-child { border-bottom: 0; }
.mini-metric span { color: var(--muted); font-size: 11.5px; }
.mini-metric b { font-size: 14px; }
.progress-row { margin: 12px 0; }
.progress-row-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 11.5px; }
.progress-row-head b { font-weight: 700; }
.progress-track { height: 7px; border-radius: 20px; background: #eef1f5; overflow: hidden; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#dd2830,#ee666c); }

.boss-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.boss-summary .kpi { min-height: 104px; }
.boss-status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 20px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.boss-status.ok { color: var(--green); background: var(--green-soft); }
.boss-status.bad { color: var(--brand); background: var(--brand-soft); }
.boss-status.mid { color: var(--amber); background: var(--amber-soft); }
.boss-status.done { color: var(--blue); background: var(--blue-soft); }
.compare-delta.plus { color: var(--green); }
.compare-delta.minus { color: var(--brand); }
.dispute-note { max-width: 220px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.boss-filter-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.resolution-box { padding: 12px; border: 1px solid #e4e9f0; border-radius: 11px; background: #fafcff; }
.resolution-box h4 { margin: 0 0 10px; font-size: 13px; }
.resolution-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.resolution-grid .field { margin: 0; }
.resolution-grid .full { grid-column: 1/-1; }
.permission-note { padding: 10px 12px; border-radius: 9px; background: #f3f7fc; color: #536883; font-size: 11px; line-height: 1.7; }
.role-badge { display: inline-flex; padding: 2px 7px; border-radius: 20px; background: var(--blue-soft); color: var(--blue); font-size: 10.5px; font-weight: 700; }
.account-table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.account-form-role-note { margin: -2px 0 12px; }
.password-meter { margin-top: 5px; color: #8b95a5; font-size: 10px; }
.business-type-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.business-type-card { display: flex; flex-direction: column; padding: 16px; }
.business-type-head { display: flex; justify-content: space-between; gap: 10px; }
.business-type-head h3 { margin: 0; font-size: 15px; }
.business-type-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.business-period { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 5px 8px; margin: 13px 0; padding: 9px 10px; border-radius: 9px; background: #f7f9fc; font-size: 10.5px; }
.business-period span { color: var(--muted); }
.business-period b { font-weight: 600; }
.business-type-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; padding-bottom: 12px; border-bottom: 1px solid #edf0f5; }
.business-type-metrics small { display: block; color: var(--muted); font-size: 9.5px; }
.business-type-metrics b { display: block; margin-top: 2px; font-size: 13px; }
.business-type-copy { flex: 1; padding: 11px 0; }
.business-type-copy b { display: block; margin-top: 6px; font-size: 10.5px; }
.business-type-copy p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.business-type-footer { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.file-missing { color: #929cad; font-size: 10px; }

.report-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: 14px; align-items: start; }
.report-preview { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 10px 30px rgba(31,47,70,.07); }
.report-cover { padding: 24px 26px; color: #fff; background: linear-gradient(120deg,#111d31,#21436e); }
.report-cover .eyebrow { color: #ff9197; }
.report-cover h2 { margin: 6px 0 8px; font-size: 23px; letter-spacing: -.4px; }
.report-cover p { margin: 0; color: #cbd6e4; font-size: 11.5px; }
.report-body { padding: 20px 24px 24px; }
.report-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.report-kpi { padding: 11px; border-radius: 10px; background: #f7f9fc; }
.report-kpi small { display: block; color: var(--muted); font-size: 9.5px; }
.report-kpi b { display: block; margin-top: 2px; font-size: 17px; }
.report-section { margin-top: 18px; }
.report-section h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; font-size: 13px; }
.report-section h3 span { color: var(--brand); font-size: 10px; letter-spacing: 1px; }
.report-section p { margin: 0; color: #48566d; font-size: 11.5px; line-height: 1.8; }
.report-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11px; }
.report-table th { padding: 7px; background: #f7f9fc; }
.report-table td { padding: 7px; }
.report-settings { padding: 17px; }
.report-settings h3 { margin: 0 0 12px; font-size: 14px; }
.report-settings .field { margin-bottom: 11px; }
.export-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; margin-top: 12px; }
.export-grid .btn { padding: 8px 6px; font-size: 11px; }
.tip-box { margin-top: 12px; padding: 10px; border-radius: 9px; background: var(--blue-soft); color: #456385; font-size: 10.5px; line-height: 1.6; }

.data-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.data-card { padding: 18px; }
.data-card h3 { margin: 0 0 5px; font-size: 15px; }
.data-card p { margin: 0 0 13px; color: var(--muted); font-size: 11.5px; }
.data-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.quality-list { display: grid; gap: 8px; margin-top: 8px; }
.quality-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef1f5; font-size: 11.5px; }
.quality-item:last-child { border-bottom: 0; }
.quality-item b { color: var(--ink); }

.empty-state { padding: 60px 20px; text-align: center; }
.empty-state h2 { margin: 8px 0 5px; font-size: 20px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10,19,33,.56);
  backdrop-filter: blur(3px);
}
.modal {
  width: min(560px,100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(10,19,33,.3);
}
.modal.wide { width: min(820px,100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.modal-close { width: 30px; height: 30px; border: 0; border-radius: 8px; background: #f3f5f8; color: var(--muted); }
.modal-body { padding: 18px 20px 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 0 20px 20px; }
.import-drop {
  display: block;
  padding: 22px 16px;
  border: 1.5px dashed #cbd5e3;
  border-radius: 12px;
  text-align: center;
  background: #fafcff;
}
.import-drop b { display: block; font-size: 13px; }
.import-drop small { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; }
.import-drop input { display: none; }
.preview-box { margin-top: 12px; padding: 12px; border-radius: 10px; background: #f7f9fc; font-size: 11.5px; }
.preview-box table { margin-top: 8px; font-size: 10.5px; }
.preview-box th, .preview-box td { padding: 5px 6px; }

.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: grid; gap: 8px; }
.toast {
  min-width: 230px;
  max-width: 360px;
  padding: 11px 13px;
  border: 1px solid #dfe5ee;
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(22,35,54,.16);
  color: var(--ink);
  font-size: 12px;
  animation: toastIn .2s ease;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--brand); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sidebar-mask { display: none; }
.file-warning {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 13px 16px;
  border: 1px solid #f1c5c8;
  border-left: 4px solid var(--brand);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(31,47,70,.18);
}
.file-warning b, .file-warning span { display: block; }
.file-warning b { font-size: 13px; }
.file-warning span { margin-top: 3px; color: var(--muted); font-size: 11px; }

@media (max-width: 1180px) {
  .topbar { flex-wrap: wrap; }
  .scope-control { margin-left: 0; }
  .top-actions { margin-left: auto; }
  .channel-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kpi-value { font-size: 23px; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .sidebar-mask.open { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10,19,33,.35); }
  .main-shell { width: 100%; margin-left: 0; }
  .menu-btn { display: inline-grid; place-items: center; }
  .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .section-grid, .entry-layout, .report-layout { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-number { justify-self: stretch; }
  .channel-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .analysis-grid { grid-template-columns: 1fr; }
  .analysis-grid .wide { grid-column: auto; }
  .business-type-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-visual { min-height: 320px; padding: 30px; }
  .auth-copy h1 { font-size: 36px; letter-spacing: -1.4px; }
  .auth-panel { padding: 24px 16px 40px; }
  .topbar { padding: 13px 18px; }
  .filterbar { padding: 8px 18px; overflow-x: auto; }
  .content { padding: 18px 18px 30px; }
}

@media (max-width: 620px) {
  .topbar-title { width: 100%; min-width: 0; }
  .topbar-title h1 { font-size: 18px; }
  .scope-control { width: 100%; }
  .scope-control select { min-width: 0; flex: 1; }
  .scope-control label { display: none; }
  .top-actions { width: 100%; }
  .top-actions .btn { flex: 1; }
  .filterbar { display: grid; gap: 8px; }
  .range-group { overflow-x: auto; }
  .date-fields { justify-content: space-between; }
  .date-fields input { flex: 1; min-width: 0; }
  .scope-chip { margin-left: 0; width: fit-content; }
  .content { padding: 14px 12px 26px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .channel-grid, .report-kpis, .data-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .hero { padding: 20px; border-radius: 16px; }
  .hero h2 { font-size: 23px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .card-header { padding: 14px 14px 0; }
  .card-body { padding: 12px 14px 15px; }
  .report-body { padding: 16px; }
  .report-cover { padding: 20px; }
  .export-grid { grid-template-columns: 1fr; }
  .boss-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .resolution-grid { grid-template-columns: 1fr; }
  .resolution-grid .full { grid-column: auto; }
  .business-type-grid { grid-template-columns: 1fr; }
  .auth-visual { min-height: 270px; }
  .auth-security { display: none; }
  .auth-copy p { display: none; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .filterbar, .toast-root, .modal-mask { display: none !important; }
  .main-shell { width: 100%; margin: 0; }
  .content { padding: 0; max-width: none; }
  .page { display: none !important; }
  #page-report { display: block !important; }
  #page-report .report-layout { display: block; }
  #page-report .report-settings, #page-report .page-heading { display: none; }
  #page-report .report-preview { border: 0; box-shadow: none; }
}
