:root {
  --ink: #17211b;
  --muted: #718078;
  --muted-2: #9aa59f;
  --line: #e4e9e5;
  --line-strong: #d7ded9;
  --paper: #ffffff;
  --canvas: #f3f5f1;
  --forest: #091711;
  --forest-2: #10271c;
  --lime: #c7f35b;
  --lime-deep: #8bbd16;
  --blue: #4f6ef7;
  --blue-soft: #edf0ff;
  --cyan: #19b7c9;
  --coral: #f05f4d;
  --amber: #e7a126;
  --danger: #dc4655;
  --success: #1b9b67;
  --shadow-sm: 0 2px 8px rgba(24, 45, 33, 0.04);
  --shadow-md: 0 18px 45px rgba(24, 45, 33, 0.1);
  --shadow-lg: 0 35px 80px rgba(0, 0, 0, 0.24);
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar-w: 242px;
  --topbar-h: 72px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
select,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(79, 110, 247, 0.22);
  outline-offset: 2px;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.subtle {
  color: var(--muted);
}

.truncate {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Login */
.login-screen {
  display: grid;
  grid-template-columns: minmax(520px, 1.12fr) minmax(440px, 0.88fr);
  min-height: 100vh;
  background: #f8faf6;
}

.login-visual {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  padding: 42px clamp(42px, 6vw, 92px) 48px;
  color: #f5f8f4;
  background:
    radial-gradient(circle at 75% 28%, rgba(199, 243, 91, 0.2), transparent 24%),
    radial-gradient(circle at 8% 85%, rgba(79, 110, 247, 0.2), transparent 32%),
    var(--forest);
}

.login-visual::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.login-visual::after {
  position: absolute;
  top: 16%;
  right: -15%;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(199, 243, 91, 0.22);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 64px rgba(199, 243, 91, 0.035),
    0 0 0 128px rgba(199, 243, 91, 0.025);
}

.brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: 0.12em;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  background: var(--lime);
  color: var(--forest);
}

.brand-mark::after {
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  content: "";
}

.brand-mark span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(8px, -8px);
}

.login-showcase {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  max-width: 720px;
  padding: 72px 0 40px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  margin-bottom: 26px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 99px;
  color: #cfdbd3;
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(199, 243, 91, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(199, 243, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(199, 243, 91, 0); }
}

.login-showcase h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 610;
  letter-spacing: -0.065em;
  line-height: 1.05;
}

.login-showcase h1 em {
  color: var(--lime);
  font-style: normal;
}

.login-showcase > p {
  max-width: 560px;
  margin: 24px 0 38px;
  color: #aebbb3;
  font-size: 15px;
  line-height: 1.85;
}

.signal-preview {
  position: relative;
  width: min(100%, 640px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.signal-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #d7dfda;
  font-size: 12px;
}

.signal-preview-head strong {
  font-size: 13px;
}

.signal-bars {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 132px;
  padding: 24px 20px 18px;
}

.signal-bars i {
  flex: 1;
  min-width: 8px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(to top, rgba(199, 243, 91, 0.25), var(--lime));
  transform-origin: bottom;
  animation: rise 0.7s cubic-bezier(.2,.8,.2,1) both;
}

.signal-bars i:nth-child(3n) {
  background: linear-gradient(to top, rgba(79, 110, 247, 0.2), #7f95ff);
}

@keyframes rise {
  from { transform: scaleY(0); opacity: 0; }
}

.preview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-stat {
  padding: 15px 18px 17px;
}

.preview-stat + .preview-stat {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-stat span {
  display: block;
  margin-bottom: 5px;
  color: #7f9186;
  font-size: 10px;
}

.preview-stat strong {
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.login-meta {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: #708077;
  font-size: 11px;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 48px clamp(34px, 6vw, 88px);
  background:
    radial-gradient(circle at 90% 10%, rgba(199, 243, 91, 0.16), transparent 24%),
    #f8faf6;
}

.login-card {
  width: min(100%, 430px);
}

.mobile-brand {
  display: none;
  margin-bottom: 42px;
  color: var(--forest);
}

.login-kicker {
  display: block;
  margin-bottom: 12px;
  color: var(--lime-deep);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-card h2 {
  margin: 0;
  color: #102019;
  font-size: 34px;
  font-weight: 660;
  letter-spacing: -0.04em;
}

.login-card > p {
  margin: 13px 0 34px;
  color: var(--muted);
  font-size: 14px;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field > span,
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #34423a;
  font-size: 12px;
  font-weight: 650;
}

.field a {
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
}

.input-wrap {
  position: relative;
}

.input-wrap > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  color: #9ba69f;
  transform: translateY(-50%);
  pointer-events: none;
}

.field input,
.field select,
.field textarea,
.form-control {
  width: 100%;
  min-height: 45px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  transition: 160ms ease;
}

.field input,
.field select,
.form-control {
  padding: 0 13px;
}

.field textarea {
  min-height: 90px;
  padding: 12px 13px;
  resize: vertical;
}

.input-wrap input {
  padding-left: 42px;
}

.input-wrap.has-action input {
  padding-right: 44px;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.form-control:hover {
  border-color: #b8c2bb;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.1);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled,
.form-control:disabled {
  border-color: #e0e5e1;
  background: #f3f5f2;
  color: #79867f;
  cursor: not-allowed;
  opacity: 1;
}

form[aria-busy="true"],
form[data-submitting="true"] {
  cursor: progress;
}

form[aria-busy="true"] :is(input, select, textarea),
form[data-submitting="true"] :is(input, select, textarea) {
  cursor: progress;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.input-action:hover {
  background: var(--canvas);
  color: var(--ink);
}

.form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -2px 0 22px;
  color: var(--muted);
  font-size: 12px;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.check-line input,
.table-check {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--forest);
}

.login-submit {
  display: flex;
  width: 100%;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 11px;
  background: var(--forest);
  color: #fff;
  box-shadow: 0 12px 24px rgba(9, 23, 17, 0.18);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 180ms ease;
}

.login-submit:hover {
  background: #143023;
  transform: translateY(-1px);
}

.login-submit svg {
  width: 16px;
  transition: transform 180ms ease;
}

.login-submit:hover svg {
  transform: translateX(3px);
}

.login-submit:disabled,
.login-submit[aria-busy="true"],
#login-form[aria-busy="true"] .login-submit,
#login-form[data-submitting="true"] .login-submit {
  background: #183126;
  box-shadow: 0 8px 18px rgba(9, 23, 17, 0.13);
  cursor: wait;
  opacity: .78;
  pointer-events: none;
  transform: none;
}

.login-submit[aria-busy="true"]::before,
#login-form[aria-busy="true"] .login-submit::before,
#login-form[data-submitting="true"] .login-submit::before {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid rgba(255,255,255,.32);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: orbit-loading-spin .72s linear infinite;
}

.login-submit[aria-busy="true"] svg,
#login-form[aria-busy="true"] .login-submit svg,
#login-form[data-submitting="true"] .login-submit svg {
  display: none;
}

.workspace-loading-card {
  display: grid;
  justify-items: center;
  text-align: center;
}

.workspace-loading-card .login-kicker {
  margin-top: 22px;
}

.workspace-loading-card > p {
  max-width: 370px;
}

.workspace-loading-orbit {
  position: relative;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(18, 52, 38, .14);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199,243,91,.18), rgba(199,243,91,0) 64%);
}

.workspace-loading-orbit::before {
  position: absolute;
  inset: 7px;
  border: 2px solid rgba(18,52,38,.1);
  border-top-color: var(--lime-deep);
  border-right-color: var(--lime);
  border-radius: inherit;
  content: "";
  animation: orbit-loading-spin 1s linear infinite;
}

.workspace-loading-orbit::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 8px rgba(199,243,91,.15);
  content: "";
  transform: translate(-50%,-50%);
  animation: orbit-loading-pulse 1.4s ease-in-out infinite;
}

.workspace-loading-status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  margin: -15px 0 22px;
  padding: 0 11px;
  border: 1px solid #e0e7e1;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: 10px;
}

.workspace-loading-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime-deep);
  content: "";
  animation: orbit-status-pulse 1.4s ease-in-out infinite;
}

@keyframes orbit-loading-spin { to { transform: rotate(360deg); } }

@keyframes orbit-loading-pulse {
  0%, 100% { opacity: .45; transform: translate(-50%,-50%) scale(.82); }
  50% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

@keyframes orbit-status-pulse {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}

.form-error {
  display: none;
  margin: -8px 0 14px;
  color: var(--danger);
  font-size: 12px;
}

.form-error.visible {
  display: block;
}

/* Application shell */
.app-shell {
  min-height: 100vh;
  background: var(--canvas);
}

.sidebar {
  position: fixed;
  z-index: 50;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-w);
  flex-direction: column;
  padding: 24px 14px 16px;
  overflow: hidden auto;
  background:
    radial-gradient(circle at 20% 5%, rgba(199, 243, 91, 0.08), transparent 18%),
    var(--forest);
  color: #c6d0ca;
  transition: transform 220ms ease;
}

.sidebar .brand {
  margin: 0 10px 28px;
  color: #fff;
}

.brand-sub {
  display: block;
  margin-top: 2px;
  color: #65756c;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-label {
  margin: 0 12px 8px;
  color: #5d6d64;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  gap: 11px;
  margin: 3px 0;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #93a199;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: 170ms ease;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.nav-item:hover {
  background: rgba(255,255,255,.055);
  color: #e6ece8;
}

.nav-item.active {
  background: rgba(199, 243, 91, 0.12);
  color: var(--lime);
  font-weight: 650;
}

.nav-item.active::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 17px;
  border-radius: 0 4px 4px 0;
  background: var(--lime);
  content: "";
}

.nav-badge {
  min-width: 20px;
  margin-left: auto;
  padding: 2px 5px;
  border-radius: 99px;
  background: rgba(240, 95, 77, 0.18);
  color: #ff897b;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-status {
  margin: 10px 3px 0;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

.sidebar-status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #c3cec7;
  font-size: 10px;
}

.sidebar-status-top span:last-child {
  color: var(--lime);
}

.mini-progress,
.progress-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.09);
}

.mini-progress i,
.progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
}

.sidebar-status p {
  margin: 8px 0 0;
  color: #5f7066;
  font-size: 9px;
  line-height: 1.5;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 8px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-profile .avatar {
  width: 32px;
  height: 32px;
  background: #d9f68c;
  color: var(--forest);
  font-size: 10px;
}

.sidebar-profile strong,
.sidebar-profile small {
  display: block;
}

.sidebar-profile strong {
  color: #e8eee9;
  font-size: 10px;
}

.sidebar-profile small {
  margin-top: 2px;
  color: #5f7066;
  font-size: 8px;
}

.sidebar-profile button {
  display: grid;
  width: 28px;
  height: 28px;
  margin-left: auto;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #66776d;
  cursor: pointer;
}

.sidebar-profile button:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}

.sidebar-profile svg {
  width: 14px;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-w);
}

.topbar {
  position: sticky;
  z-index: 35;
  top: 0;
  display: flex;
  height: var(--topbar-h);
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 3vw, 42px);
  border-bottom: 1px solid rgba(215, 222, 217, 0.78);
  background: rgba(243, 245, 241, 0.88);
  backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 14px;
}

.mobile-menu {
  display: none !important;
}

.breadcrumb strong,
.breadcrumb span {
  display: block;
}

.breadcrumb strong {
  font-size: 13px;
}

.breadcrumb span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

.topbar-actions {
  gap: 9px;
}

.command-button {
  display: flex;
  width: min(22vw, 250px);
  min-width: 190px;
  height: 37px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.72);
  color: var(--muted-2);
  font-size: 10px;
  cursor: pointer;
}

.command-button:hover {
  border-color: #cbd3cd;
  background: #fff;
}

.command-button svg {
  width: 14px;
}

.command-key {
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #8f9a93;
  background: var(--canvas);
  font-size: 8px;
}

.icon-button {
  position: relative;
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.72);
  color: #56635c;
  cursor: pointer;
}

.icon-button:hover {
  background: #fff;
  color: var(--ink);
}

.icon-button svg {
  width: 16px;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: var(--coral);
}

.quick-report {
  display: inline-flex;
  min-height: 37px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: var(--forest);
  color: #fff;
  font-size: 10px;
  font-weight: 680;
  cursor: pointer;
}

.quick-report:hover {
  background: #143023;
}

.quick-report svg {
  width: 14px;
}

.content-area {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 30px clamp(22px, 3vw, 42px) 50px;
}

.page-enter {
  animation: pageIn 300ms cubic-bezier(.2,.75,.25,1) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(7px); }
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: #819087;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 34px);
  font-weight: 650;
  letter-spacing: -0.045em;
}

.page-description {
  max-width: 680px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.page-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: #334039;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
  transition: 160ms ease;
}

.btn:hover {
  border-color: #bdc6c0;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn:disabled,
.btn[aria-disabled="true"],
.icon-button:disabled,
.quick-report:disabled,
.row-action:disabled,
button[aria-busy="true"] {
  box-shadow: none;
  cursor: not-allowed;
  opacity: .56;
  pointer-events: none;
  transform: none;
}

.btn[aria-busy="true"],
form[aria-busy="true"] .btn[type="submit"],
form[data-submitting="true"] .btn[type="submit"] {
  cursor: wait;
}

.btn[aria-busy="true"]::before,
form[aria-busy="true"] .btn[type="submit"]::before,
form[data-submitting="true"] .btn[type="submit"]::before {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: orbit-loading-spin .72s linear infinite;
}

form[aria-busy="true"] .btn[type="submit"],
form[data-submitting="true"] .btn[type="submit"] {
  opacity: .68;
  pointer-events: none;
}

form[aria-busy="true"] .btn[type="submit"] svg,
form[data-submitting="true"] .btn[type="submit"] svg {
  display: none;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn-primary {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
}

.btn-primary:hover {
  border-color: #153125;
  background: #153125;
}

.btn-lime {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--forest);
}

.btn-danger {
  border-color: #f4ced2;
  background: #fff5f6;
  color: var(--danger);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-sm {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 9px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef1ed;
}

.segmented button {
  min-height: 29px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(24,45,33,.08);
  font-weight: 650;
}

/* Shared cards */
.panel,
.kpi-card,
.summary-card,
.team-card,
.settings-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3,
.panel-head h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.panel-body {
  padding: 20px;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
}

.panel-link svg {
  width: 12px;
}

.layout-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.span-12 { grid-column: span 12; }
.span-9 { grid-column: span 9; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

.badge,
.status-pill,
.platform-pill,
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  white-space: nowrap;
}

.badge,
.status-pill,
.platform-pill {
  padding: 4px 7px;
  border-radius: 99px;
  font-size: 8px;
  font-weight: 650;
}

.badge::before,
.status-pill::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.badge-success,
.status-active {
  background: #eaf8f1;
  color: var(--success);
}

.badge-warning,
.status-warning {
  background: #fff6e4;
  color: #c17b0d;
}

.badge-danger,
.status-risk {
  background: #fff0f2;
  color: var(--danger);
}

.badge-neutral,
.status-paused {
  background: #f0f2f0;
  color: #7d8882;
}

.platform-tiktok {
  background: #eaf9fb;
  color: #0c8998;
}

.platform-youtube {
  background: #fff0f0;
  color: #d93737;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 650;
}

.delta.positive { color: var(--success); }
.delta.negative { color: var(--danger); }

/* Dashboard */
.dashboard-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  min-height: 148px;
  align-items: center;
  gap: 30px;
  overflow: hidden;
  padding: 26px 30px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 82% 40%, rgba(199,243,91,.14), transparent 21%),
    linear-gradient(112deg, #0b1a13, #102a1d);
  color: #fff;
  box-shadow: 0 18px 40px rgba(8, 23, 16, 0.15);
}

.dashboard-hero::after {
  position: absolute;
  right: -55px;
  width: 265px;
  height: 265px;
  border: 1px solid rgba(199,243,91,.18);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 45px rgba(199,243,91,.025), 0 0 0 90px rgba(199,243,91,.018);
}

.hero-copy,
.hero-target {
  position: relative;
  z-index: 1;
}

.hero-copy .eyebrow {
  color: #82978a;
}

.hero-copy h2 {
  margin: 0;
  font-size: clamp(23px, 2.2vw, 32px);
  font-weight: 590;
  letter-spacing: -0.04em;
}

.hero-copy h2 span {
  color: var(--lime);
}

.hero-copy p {
  max-width: 610px;
  margin: 10px 0 0;
  color: #9eafa4;
  font-size: 10px;
  line-height: 1.7;
}

.hero-signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 19px;
}

.hero-signal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c6d1ca;
  font-size: 9px;
}

.hero-signal i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
}

.hero-signal.warning i { background: var(--amber); }
.hero-signal.danger i { background: var(--coral); }

.hero-target {
  width: 220px;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 13px;
  background: rgba(255,255,255,.055);
  backdrop-filter: blur(12px);
}

.hero-target-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #94a69b;
  font-size: 8px;
}

.hero-target strong {
  display: block;
  margin-bottom: 9px;
  font-size: 20px;
  font-weight: 620;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.hero-target .progress-bar {
  background: rgba(255,255,255,.1);
}

.hero-target-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: #819287;
  font-size: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.kpi-card {
  position: relative;
  min-height: 126px;
  overflow: hidden;
  padding: 17px 18px;
  transition: 180ms ease;
}

.kpi-card:hover {
  border-color: #d4dbd6;
  box-shadow: 0 8px 25px rgba(24,45,33,.07);
  transform: translateY(-2px);
}

.kpi-card::after {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(79,110,247,.055);
  content: "";
}

.kpi-card:nth-child(2)::after { background: rgba(25,183,201,.06); }
.kpi-card:nth-child(3)::after { background: rgba(199,243,91,.12); }
.kpi-card:nth-child(4)::after { background: rgba(240,95,77,.06); }

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
}

.kpi-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
}

.kpi-card:nth-child(2) .kpi-icon { background: #e8f8fa; color: #1593a2; }
.kpi-card:nth-child(3) .kpi-icon { background: #eff8d9; color: #71930d; }
.kpi-card:nth-child(4) .kpi-icon { background: #fff0ed; color: var(--coral); }

.kpi-icon svg { width: 14px; }

.kpi-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.kpi-value strong {
  font-size: clamp(22px, 2vw, 29px);
  font-weight: 650;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.kpi-value-note {
  color: var(--success);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 8px;
}

.trend-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.trend-replay {
  gap: 5px;
  border-color: var(--line);
  background: #f8faf8;
  color: var(--muted);
}

.trend-replay:hover {
  border-color: #cfd8d2;
  background: #fff;
  color: var(--ink);
}

.trend-replay:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.trend-replay svg {
  width: 12px;
  height: 12px;
}

.chart-wrap {
  position: relative;
  height: 248px;
  padding: 0 3px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin: 0 0 8px 4px;
  color: var(--muted);
  font-size: 8px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
}

.chart-legend span:last-child i { background: var(--lime-deep); }

.trend-chart {
  display: block;
  width: 100%;
  height: 238px;
  overflow: visible;
}

.chart-label {
  fill: #9aa49e;
  font-family: inherit;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.chart-label-right {
  fill: #7f936f;
}

.chart-date-label {
  fill: var(--muted-2);
}

.chart-grid-line {
  stroke: #ebefec;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-line-blue,
.chart-line-lime,
.chart-line-glow {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-line-blue {
  stroke: var(--blue);
  stroke-width: 2.6;
}

.chart-line-lime {
  stroke: var(--lime-deep);
  stroke-width: 2.25;
}

.chart-line-glow {
  opacity: 0;
  stroke: var(--blue);
  stroke-width: 8;
  filter: url(#trendLineGlow);
}

.chart-area {
  fill: url(#trendAreaBlue);
}

.chart-area-wipe {
  transform-box: fill-box;
  transform-origin: left center;
}

.chart-endpoint {
  fill: #fff;
  stroke-width: 2.25;
  vector-effect: non-scaling-stroke;
}

.chart-endpoint-blue { stroke: var(--blue); }
.chart-endpoint-lime { stroke: var(--lime-deep); }

.chart-traveler {
  opacity: 0;
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px rgba(74, 109, 255, .72));
}

.chart-empty-message {
  position: absolute;
  inset: 29px 56px 28px;
  display: grid;
  place-content: center;
  gap: 5px;
  border-radius: 13px;
  background: linear-gradient(120deg, rgba(249,251,249,.8), rgba(255,255,255,.94));
  color: var(--muted);
  text-align: center;
}

.chart-empty-message strong {
  color: var(--ink);
  font-size: 11px;
}

.chart-empty-message span {
  font-size: 9px;
}

.chart-is-empty .trend-chart {
  opacity: .42;
}

.donut-area {
  display: grid;
  grid-template-columns: 145px 1fr;
  align-items: center;
  gap: 18px;
  min-height: 255px;
}

.donut {
  position: relative;
  width: 138px;
  height: 138px;
  border-radius: 50%;
  background: conic-gradient(var(--cyan) 0 58%, var(--coral) 58% 91%, #dfe5e1 91% 100%);
}

.donut::after {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.donut-center {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.donut-center strong {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.donut-center span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.distribution-list {
  display: grid;
  gap: 17px;
}

.distribution-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: center;
}

.distribution-item span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
}

.distribution-item span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.distribution-item strong {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.distribution-item .progress-bar {
  grid-column: 1 / -1;
  height: 3px;
  background: #edf0ed;
}

.distribution-item .progress-bar i { background: var(--cyan); }

.distribution-item:nth-child(2) .progress-bar i { background: var(--coral); }
.distribution-item:nth-child(3) .progress-bar i { background: #c8d0cb; }

.ranking-list,
.task-list,
.alert-list,
.activity-list {
  display: grid;
}

.ranking-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  padding: 7px 0;
  border-bottom: 1px solid #eef1ef;
}

.ranking-item:last-child,
.task-item:last-child,
.alert-item:last-child,
.activity-item:last-child {
  border-bottom: 0;
}

.rank-number {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 7px;
  background: #f0f2f0;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.ranking-item:first-child .rank-number {
  background: #eef7d7;
  color: #66840c;
}

.account-mini {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.account-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  font-size: 9px;
  font-weight: 750;
}

.account-mini strong,
.account-mini small {
  display: block;
}

.account-mini strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-mini small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8px;
}

.rank-value {
  text-align: right;
}

.rank-value strong,
.rank-value small {
  display: block;
}

.rank-value strong {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.rank-value small {
  margin-top: 3px;
  color: var(--success);
  font-size: 8px;
}

.task-item,
.alert-item,
.activity-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 0;
  border-bottom: 1px solid #eef1ef;
}

.task-check {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: transparent;
  cursor: pointer;
}

.task-check:hover {
  border-color: var(--success);
  color: var(--success);
}

.task-check svg { width: 12px; }

.task-copy,
.alert-copy,
.activity-copy {
  min-width: 0;
  flex: 1;
}

.task-copy strong,
.task-copy small,
.alert-copy strong,
.alert-copy small,
.activity-copy strong,
.activity-copy small {
  display: block;
}

.task-copy strong,
.alert-copy strong,
.activity-copy strong {
  font-size: 9px;
  line-height: 1.4;
}

.task-copy small,
.alert-copy small,
.activity-copy small {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8px;
}

.due-tag {
  padding: 4px 7px;
  border-radius: 7px;
  background: #fff5e5;
  color: #b5740f;
  font-size: 8px;
}

/* Tables and accounts */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.account-summary-grid {
  grid-template-columns: repeat(5, minmax(0,1fr));
}

.summary-card {
  display: flex;
  min-height: 84px;
  align-items: center;
  gap: 13px;
  padding: 15px;
}

.summary-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--blue);
}

.summary-icon svg { width: 16px; }
.summary-card:nth-child(2) .summary-icon { background: #eaf8f1; color: var(--success); }
.summary-card:nth-child(3) .summary-icon { background: #fff6e6; color: var(--amber); }
.summary-card:nth-child(4) .summary-icon { background: #fff0f2; color: var(--danger); }
.summary-card:nth-child(5) .summary-icon { background: #f0f2f1; color: #66736c; }

.summary-copy span,
.summary-copy strong {
  display: block;
}

.summary-copy span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
}

.summary-copy strong {
  font-size: 19px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.toolbar-search {
  position: relative;
  width: min(320px, 32vw);
}

.toolbar-search svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 14px;
  color: var(--muted-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.toolbar-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 33px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fafbf9;
  font-size: 10px;
}

.toolbar-search input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79,110,247,.08);
}

.toolbar-select {
  height: 36px;
  padding: 0 29px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fafbf9;
  color: #536159;
  font-size: 9px;
  cursor: pointer;
}

.toolbar-select:hover {
  border-color: #c3ccc6;
  background-color: #fff;
}

.toolbar-select:focus {
  border-color: var(--blue);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(79,110,247,.08);
}

.sort-control {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
}

.sort-control-label {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.sort-control .toolbar-select,
#account-sort {
  min-width: 116px;
}

.filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.filter-clear,
.filter-actions .btn {
  white-space: nowrap;
}

.filter-clear[hidden],
.filter-actions[hidden],
.filter-feedback[hidden] {
  display: none !important;
}

.filter-feedback {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
}

.filter-chip {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid #dce4de;
  border-radius: 999px;
  background: #f6f9f5;
  color: #526259;
  white-space: nowrap;
}

.toolbar-spacer { flex: 1; }

.results-count {
  color: var(--muted);
  font-size: 9px;
}

.table-shell {
  width: 100%;
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
}

.data-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #f8faf7;
  color: #77847c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  height: 62px;
  padding: 8px 12px;
  border-bottom: 1px solid #edf0ee;
  color: #36433c;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 140ms ease;
}

.data-table tbody tr:hover {
  background: #f8faf7;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .sticky-col {
  position: sticky;
  z-index: 1;
  left: 0;
  background: inherit;
}

.data-table th.sticky-col {
  z-index: 3;
  background: #f8faf7;
}

.account-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-cell .account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 8px;
}

.account-cell strong,
.account-cell small {
  display: block;
}

.account-cell strong {
  max-width: 145px;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
}

.account-cell small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
}

.owner-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.owner-cell .avatar {
  width: 22px;
  height: 22px;
  background: #e8edff;
  color: var(--blue);
  font-size: 9px;
}

.amount {
  color: #25332b;
  font-weight: 650;
}

.note-cell {
  display: block;
  max-width: 120px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.row-actions {
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.data-table tr:hover .row-actions,
.row-actions:focus-within {
  opacity: 1;
}

.row-action {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: #eef1ef;
  color: #5e6b64;
  cursor: pointer;
}

.row-action:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.row-action svg { width: 12px; }

.table-footer {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.pagination {
  display: flex;
  gap: 4px;
}

.pagination button {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.pagination button.active {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
}

.pagination button:disabled {
  cursor: default;
  opacity: 1;
}

/* Shared viral topics */
.topic-panel { overflow: hidden; }
.topic-toolbar { gap: 7px; }
.topic-toolbar .toolbar-search { width: min(340px, 28vw); }
.topic-toolbar .toolbar-select { max-width: 132px; }
.topic-table { min-width: 1380px; }
.topic-table th:nth-child(1),
.topic-table td:nth-child(1) { width: 58px; text-align: center; }
.topic-table th:nth-child(2),
.topic-table td:nth-child(2) { width: 330px; }
.topic-table th:nth-child(4),
.topic-table td:nth-child(4) { width: 125px; }
.topic-table th:last-child,
.topic-table td:last-child { width: 170px; }

.topic-index {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: #f0f3ef;
  color: #6c7a71;
  font-size: 9px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.topic-title-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.topic-title-cell > i {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: #fff0ed;
  color: var(--coral);
}

.topic-title-cell > i svg { width: 15px; }
.topic-title-cell > span { min-width: 0; }
.topic-title-cell strong,
.topic-title-cell small { display: block; }
.topic-title-cell strong {
  max-width: 265px;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
}
.topic-title-cell small { margin-top: 4px; color: var(--muted); font-size: 9px; }

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
}
.source-link:hover { text-decoration: underline; }
.source-link svg { width: 13px; }

.topic-views {
  color: #34423a;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.topic-views.hot { color: #c56e10; }
.topic-views.mega { color: var(--danger); }

.heat-pill,
.topic-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.heat-mega { background: #fff0f2; color: var(--danger); }
.heat-high { background: #fff6e4; color: #b36d08; }
.heat-promising { background: #eef1ff; color: var(--blue); }
.heat-watch { background: #f0f2f0; color: #77837c; }
.topic-tracking { background: #eef5ff; color: #3871ba; }
.topic-ready { background: #eef8d9; color: #66870d; }
.topic-producing { background: #fff4dd; color: #ae6c08; }
.topic-used { background: #eaf8f1; color: var(--success); }
.topic-archived { background: #f0f2f0; color: #77837c; }

.topic-people span,
.topic-people small { display: flex; align-items: center; }
.topic-people span { gap: 6px; color: var(--ink); font-weight: 650; }
.topic-people small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.topic-people .avatar {
  width: 22px;
  height: 22px;
  background: #e8edff;
  color: var(--blue);
  font-size: 8px;
}

.topic-actions { min-width: 150px; opacity: 1; }
.claim-topic {
  min-width: 45px;
  height: 27px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: var(--forest);
  color: var(--lime);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.claim-topic:hover { background: #183526; }
.row-action.danger:hover { background: #fff0f2; color: var(--danger); }

.topic-form-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  padding: 12px 13px;
  border: 1px solid #e4e9e5;
  border-radius: 10px;
  background: #f8faf7;
  color: var(--muted);
  font-size: 10px;
}
.topic-form-hint svg { width: 14px; color: var(--coral); }

.delete-topic-preview {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf7;
}
.delete-topic-preview strong { color: var(--ink); font-size: 11px; line-height: 1.5; }
.delete-topic-preview span { color: var(--muted); font-size: 10px; }

.empty-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  padding: 40px;
  text-align: center;
}

.empty-orbit {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border: 1px solid #dce2de;
  border-radius: 50%;
}

.empty-orbit::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lime);
  content: "";
  transform: translate(-50%,-50%);
}

.empty-state h3 {
  margin: 0 0 7px;
  font-size: 13px;
}

.empty-state p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 9px;
}

.filter-empty-state,
#account-filter-empty .empty-state,
#topic-filter-empty .empty-state {
  min-height: 220px;
  padding: 30px 22px;
}

.filter-empty-state {
  display: grid;
  place-items: center;
  text-align: center;
}

.filter-empty-state h3 {
  margin: 0 0 7px;
  font-size: 13px;
}

.filter-empty-state p {
  max-width: 360px;
  margin: 0 auto 15px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.filter-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Reports */
.report-spotlight {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  overflow: hidden;
  padding: 24px 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(112deg, #4f6ef7, #6d7df3);
  color: #fff;
  box-shadow: 0 15px 34px rgba(79,110,247,.2);
}

.report-spotlight::after {
  position: absolute;
  right: -35px;
  bottom: -60px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 38px rgba(255,255,255,.04);
}

.report-spotlight > * {
  position: relative;
  z-index: 1;
}

.report-spotlight h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 620;
  letter-spacing: -.03em;
}

.report-spotlight p {
  max-width: 650px;
  margin: 8px 0 0;
  color: rgba(255,255,255,.72);
  font-size: 10px;
  line-height: 1.7;
}

.report-progress {
  display: flex;
  min-width: 225px;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 13px;
  background: rgba(255,255,255,.1);
}

.report-ring {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--lime) 0 75%, rgba(255,255,255,.13) 75%);
}

.report-ring::after {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #586ff0;
  content: "";
}

.report-ring strong {
  position: relative;
  z-index: 1;
  font-size: 11px;
}

.report-progress span,
.report-progress strong {
  display: block;
}

.report-progress span {
  color: rgba(255,255,255,.65);
  font-size: 8px;
}

.report-progress > div > strong {
  margin-top: 4px;
  font-size: 13px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4,1fr);
}

.report-metric-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.report-filter-toolbar {
  flex-wrap: wrap;
}

.report-filter-toolbar .toolbar-search {
  flex: 1 1 250px;
  width: auto;
}

.report-date-filter {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
  color: var(--muted);
  font-size: 8px;
}

.report-date-filter input {
  width: 112px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.report-history-table { min-width: 980px; }

.report-cell-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8px;
}

.report-quality-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.report-quality-grid .quality-item { border-bottom: 0; }

.report-draft-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid #e4e9e5;
  border-radius: 10px;
  background: #f8faf7;
  color: var(--muted);
  font-size: 9px;
}

.report-draft-state > span,
.report-draft-state > div { display: flex; align-items: center; gap: 7px; }
.report-draft-state svg { width: 14px; }
.report-draft-state .btn { height: 30px; padding: 0 10px; }

.report-note-detail {
  padding: 12px;
  border-radius: 9px;
  background: #f4f6f3;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.metric-strip-item {
  padding: 18px 20px;
}

.metric-strip-item + .metric-strip-item {
  border-left: 1px solid var(--line);
}

.metric-strip-item span,
.metric-strip-item strong,
.metric-strip-item small {
  display: block;
}

.metric-strip-item span {
  color: var(--muted);
  font-size: 8px;
}

.metric-strip-item strong {
  margin-top: 7px;
  font-size: 19px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.metric-strip-item small {
  margin-top: 5px;
  color: var(--success);
  font-size: 8px;
}

.quality-item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 60px;
  padding: 9px 0;
  border-bottom: 1px solid #eef1ef;
}

.quality-item:last-child { border-bottom: 0; }

.quality-icon,
.alert-icon,
.activity-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: #eaf8f1;
  color: var(--success);
}

.quality-icon.warning,
.alert-icon.warning { background: #fff6e4; color: var(--amber); }
.quality-icon.danger,
.alert-icon.danger { background: #fff0f2; color: var(--danger); }
.quality-icon svg,
.alert-icon svg,
.activity-icon svg { width: 14px; }

.quality-copy strong,
.quality-copy small {
  display: block;
}

.quality-copy strong { font-size: 9px; }
.quality-copy small { margin-top: 4px; color: var(--muted); font-size: 8px; }

/* Calendar */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 14px;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-nav h3 {
  min-width: 118px;
  margin: 0;
  font-size: 14px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px,1fr));
  min-width: 800px;
}

.calendar-weekday {
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8faf7;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.calendar-weekday:nth-child(7) { border-right: 0; }

.calendar-day {
  min-height: 124px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:nth-last-child(-n+7) { border-bottom: 0; }
.calendar-day.muted-day { background: #fafbf9; color: #b0b8b3; }
.calendar-day.today { background: #fbfdf6; }

.day-number {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  margin-bottom: 7px;
  border-radius: 7px;
  color: #56635b;
  font-size: 10px;
  font-weight: 650;
}

.today .day-number {
  background: var(--forest);
  color: var(--lime);
}

.calendar-event {
  display: block;
  width: 100%;
  margin-bottom: 5px;
  padding: 7px;
  overflow: hidden;
  border: 0;
  border-left: 2px solid var(--blue);
  border-radius: 6px;
  background: var(--blue-soft);
  color: #4056b8;
  font-size: 10px;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.calendar-event.tiktok { border-left-color: var(--cyan); background: #eaf9fb; color: #147e8a; }
.calendar-event.youtube { border-left-color: var(--coral); background: #fff0f0; color: #bd4040; }
.calendar-event.review { border-left-color: var(--amber); background: #fff7e7; color: #9e6814; }

/* Team and settings */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.team-card {
  padding: 17px;
  transition: 180ms ease;
}

.team-card:hover {
  border-color: #cfd7d1;
  transform: translateY(-2px);
}

.team-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-person .avatar {
  width: 38px;
  height: 38px;
  background: #e9edff;
  color: var(--blue);
  font-size: 10px;
}

.team-person strong,
.team-person small {
  display: block;
}

.team-person strong { font-size: 11px; }
.team-person small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.team-score {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 6px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.team-score span,
.team-score strong {
  display: block;
  text-align: center;
}

.team-score span { color: var(--muted); font-size: 9px; }
.team-score strong { margin-top: 4px; font-size: 11px; font-variant-numeric: tabular-nums; }

.settings-layout {
  display: grid;
  grid-template-columns: 230px minmax(0,1fr);
  gap: 16px;
}

.settings-nav {
  padding: 9px;
}

.settings-nav button {
  display: flex;
  width: 100%;
  min-height: 39px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  text-align: left;
  cursor: pointer;
}

.settings-nav button.active {
  background: #f0f3ef;
  color: var(--ink);
  font-weight: 650;
}

.settings-nav button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.segmented button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.settings-nav svg { width: 14px; }

.settings-card {
  overflow: hidden;
}

.settings-section {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.settings-section:last-child { border-bottom: 0; }

.settings-section h3 {
  margin: 0 0 6px;
  font-size: 12px;
}

.settings-section > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 0 14px;
}

.form-grid .full { grid-column: 1 / -1; }

.switch-row {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #eef1ef;
}

.switch-row:last-child { border-bottom: 0; }

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row strong { font-size: 9px; }
.switch-row small { margin-top: 4px; color: var(--muted); font-size: 8px; }

.switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 auto;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #cfd6d1;
  cursor: pointer;
  transition: 180ms ease;
}

.switch span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.16);
  content: "";
  transition: 180ms ease;
}

.switch input:checked + span { background: var(--forest); }
.switch input:checked + span::after { transform: translateX(16px); }

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border: 1px solid #f0cbd0;
  border-radius: 10px;
  background: #fffafb;
}

.danger-zone strong,
.danger-zone small { display: block; }
.danger-zone strong { color: #a53643; font-size: 9px; }
.danger-zone small { margin-top: 4px; color: #a7797e; font-size: 8px; }

.settings-admin-badge,
.settings-state-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #dce4df;
  border-radius: 99px;
  background: #f8faf8;
  color: var(--forest);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.settings-admin-badge svg { width: 13px; }

.settings-content { min-width: 0; }

.settings-local-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 16px 20px 0;
  padding: 11px 13px;
  border: 1px solid #dbe5ef;
  border-radius: 9px;
  background: #f6f9fc;
  color: #557083;
  font-size: 9px;
  line-height: 1.65;
}

.settings-local-notice svg { width: 14px; flex: 0 0 auto; margin-top: 1px; }

.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.settings-section-head h3,
.settings-section-head p { margin: 0; }
.settings-section-head p { margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.settings-section-head + .form-grid { margin-top: 0; }

.field-help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 400;
  line-height: 1.45;
}

.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}

.settings-summary-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbf9;
}

.settings-summary-grid span,
.settings-summary-grid strong,
.settings-summary-grid small { display: block; }
.settings-summary-grid span { color: var(--muted); font-size: 8px; }
.settings-summary-grid strong { margin-top: 7px; color: var(--ink); font-size: 18px; }
.settings-summary-grid small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.settings-summary-grid.compact { margin-top: 16px; }

.settings-table-section { padding: 0; }
.settings-member-table { min-width: 920px; }
.settings-member-table .owner-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }

.member-role,
.member-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 99px;
  background: #f0f3ef;
  color: #607068;
  font-size: 8px;
  font-weight: 650;
}

.member-role.admin { background: #eaf0ff; color: #3d5cc8; }
.member-status i { width: 6px; height: 6px; border-radius: 50%; background: #2a9b68; }
.member-status.inactive { background: #f2f2f2; color: #888; }
.member-status.inactive i { background: #aaa; }

.member-actions { display: flex; align-items: center; gap: 5px; }
.member-actions button {
  padding: 5px 7px;
  border: 0;
  border-radius: 6px;
  background: #f2f5f2;
  color: #4f6258;
  font-size: 8px;
  cursor: pointer;
}
.member-actions button:hover { background: #e8eee9; color: var(--forest); }
.member-actions .danger-text { color: var(--danger); }

.permission-grid,
.option-manager-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
}

.permission-grid article,
.option-manager-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfb;
}

.permission-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.permission-head > svg {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 9px;
  background: #edf2ef;
  color: var(--forest);
}

.permission-head strong,
.permission-head small,
.option-manager-head strong,
.option-manager-head small { display: block; }
.permission-head strong, .option-manager-head strong { font-size: 10px; }
.permission-head small, .option-manager-head small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.permission-grid ul { margin: 14px 0 0; padding-left: 18px; color: var(--muted); font-size: 9px; line-height: 1.9; }

.option-manager-head { display: flex; justify-content: space-between; align-items: center; }
.option-chip-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 76px; margin: 14px 0; align-content: flex-start; }
.option-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 5px 0 9px;
  border: 1px solid #dfe6e1;
  border-radius: 99px;
  background: #fff;
  color: #485a51;
  font-size: 8px;
}
.option-chip button { width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; background: #edf1ee; color: #718078; cursor: pointer; line-height: 16px; }
.option-chip button:hover { background: #fbe9eb; color: var(--danger); }
.inline-add-form { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.inline-add-form input { min-width: 0; height: 36px; padding: 0 10px; border: 1px solid #d9e0db; border-radius: 8px; background: #fff; font: inherit; font-size: 9px; outline: 0; }
.inline-add-form input:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(7,20,15,.07); }

.field-rule-list { border-top: 1px solid var(--line); }
.field-rule-row {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #edf1ee;
  cursor: pointer;
}
.field-rule-row strong,
.field-rule-row small { display: block; }
.field-rule-row strong { font-size: 9px; }
.field-rule-row small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.required-toggle { display: inline-flex; align-items: center; gap: 7px; color: #57675f; font-size: 8px; }
.required-toggle input { accent-color: var(--forest); }
.locked-field { display: inline-flex; align-items: center; gap: 6px; color: #708077; font-size: 8px; }
.locked-field svg { width: 12px; }

.notification-rule {
  padding: 15px 0;
  border-top: 1px solid #edf1ee;
}
.notification-rule:last-child { border-bottom: 1px solid #edf1ee; }
.notification-rule-main { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.notification-rule-main strong,
.notification-rule-main small { display: block; }
.notification-rule-main strong { font-size: 9px; }
.notification-rule-main small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.rule-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: #eef3ff; color: var(--blue); }
.rule-icon.warning { background: #fff5e7; color: #bb7a1e; }
.rule-icon.danger { background: #fff0f1; color: var(--danger); }
.rule-icon svg { width: 15px; }
.rule-controls { display: flex; gap: 8px; }
.rule-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0 44px;
  padding: 6px 9px;
  border-radius: 7px;
  background: #f5f7f5;
  color: var(--muted);
  font-size: 8px;
}
.rule-controls .rule-control + .rule-control { margin-left: 0; }
.rule-control input { width: 55px; height: 26px; padding: 0 6px; border: 1px solid #d8dfda; border-radius: 6px; background: #fff; font: inherit; font-size: 9px; }
.digest-time-field { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: #4e5e55; font-size: 9px; }
.digest-time-field input { height: 34px; padding: 0 9px; border: 1px solid #d8dfda; border-radius: 7px; background: #fff; font: inherit; }

.security-switch-card {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbf9;
}
.security-switch-card strong,
.security-switch-card small { display: block; }
.security-switch-card strong { font-size: 9px; }
.security-switch-card small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.5; }

.audit-list { border-top: 1px solid var(--line); }
.audit-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 58px; border-bottom: 1px solid #edf1ee; }
.audit-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: #f0f3ef; color: var(--forest); }
.audit-icon svg { width: 13px; }
.audit-row strong,
.audit-row small { display: block; }
.audit-row strong { font-size: 9px; }
.audit-row small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.audit-row time { color: var(--muted); font-size: 8px; white-space: nowrap; }
.empty-settings { padding: 22px; color: var(--muted); font-size: 9px; text-align: center; }

.form-inline-note,
.reset-impact-copy {
  margin: 4px 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f7f5;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}
.form-inline-note { display: flex; align-items: flex-start; gap: 7px; }
.form-inline-note svg { width: 13px; flex: 0 0 auto; }
.login-session-note { color: var(--muted); font-size: 9px; }

/* Overlays, drawer, modal */
.overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 12, 8, 0.48);
  backdrop-filter: blur(4px);
  animation: fadeIn 160ms ease both;
}

@keyframes fadeIn { from { opacity: 0; } }

.overlay-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: default;
}

.modal {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: modalIn 220ms cubic-bezier(.2,.8,.2,1) both;
}

.modal-sm { width: min(100%, 430px); }
.modal-lg { width: min(100%, 780px); }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
}

.modal-head {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 14px;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 8px;
}

.close-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: #f1f3f0;
  color: var(--muted);
  cursor: pointer;
}

.close-button:hover { color: var(--ink); background: #e8ece8; }
.close-button svg { width: 14px; }

.modal-body { padding: 22px; }
.modal-foot {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 0 22px;
  border-top: 1px solid var(--line);
  background: #fafbf9;
}

.drawer-wrap {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}

.drawer {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 560px);
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  background: #fff;
  box-shadow: -24px 0 70px rgba(0,0,0,.18);
  animation: drawerIn 240ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes drawerIn { from { transform: translateX(100%); } }

.drawer-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  flex: 0 0 auto;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}

.drawer-head h2 { margin: 0; font-size: 14px; }
.drawer-head p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.drawer > form {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.drawer-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 22px;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.drawer .modal-foot {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -10px 24px rgba(10,30,20,.045);
}

.detail-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  padding: 18px;
  border-radius: 14px;
  background: var(--forest);
  color: #fff;
}

.detail-hero .account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  font-size: 13px;
}

.detail-hero h3 { margin: 0; font-size: 14px; }
.detail-hero p { margin: 5px 0 0; color: #84958a; font-size: 8px; }
.detail-hero .platform-pill { margin-left: auto; }

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 9px;
  margin: 14px 0;
}

.detail-stat {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbf9;
}

.detail-stat span,
.detail-stat strong { display: block; }
.detail-stat span { color: var(--muted); font-size: 8px; }
.detail-stat strong { margin-top: 6px; font-size: 14px; font-variant-numeric: tabular-nums; }

.detail-section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.detail-section h4 { margin: 0 0 13px; font-size: 10px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 13px 20px;
}

.info-item span,
.info-item strong { display: block; }
.info-item span { color: var(--muted); font-size: 8px; }
.info-item strong { margin-top: 4px; font-size: 9px; font-weight: 600; }

.mini-chart-box {
  height: 145px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafbf9;
}

.mini-chart-box svg { width: 100%; height: 100%; }

.search-modal { width: min(100%, 630px); align-self: flex-start; margin-top: 10vh; }
.search-input-big {
  position: relative;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.search-input-big svg {
  position: absolute;
  top: 50%;
  left: 28px;
  width: 17px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-input-big input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border: 0;
  outline: none;
  font-size: 13px;
}

.search-results { padding: 10px; }
.search-result {
  display: flex;
  width: 100%;
  min-height: 51px;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-result:hover { background: #f2f5f1; }
.search-result svg { width: 15px; color: var(--muted); }
.search-result strong,
.search-result small { display: block; }
.search-result strong { font-size: 10px; }
.search-result small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.search-result kbd { margin-left: auto; color: var(--muted-2); font-size: 8px; }

.notification-popover {
  position: fixed;
  z-index: 80;
  top: 63px;
  right: 28px;
  width: min(370px, calc(100vw - 30px));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-md);
  animation: modalIn 180ms ease both;
}

.notification-popover .panel-head { min-height: 54px; }
.notification-popover .alert-list { padding: 4px 16px 10px; }

.toast-region {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  min-width: 260px;
  max-width: 380px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 11px;
  background: var(--forest);
  color: #fff;
  box-shadow: 0 15px 35px rgba(0,0,0,.22);
  font-size: 10px;
  pointer-events: auto;
  animation: toastIn 240ms ease both;
}

.toast svg { width: 15px; color: var(--lime); }
.toast.error svg { color: #ff8f9a; }

/* Readability and touch refinements */
.hero-copy p,
.detail-hero p,
.info-item strong,
.activity-copy strong,
.activity-copy small,
.search-result small,
.quality-copy small,
.task-copy small {
  font-size: 11px;
}

.hero-signal,
.hero-target-head,
.hero-target-foot,
.kpi-top,
.kpi-foot,
.chart-legend,
.detail-stat span,
.info-item span,
.detail-section h4 {
  font-size: 10px;
}

.toast { font-size: 11px; }

@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

.mobile-scrim {
  display: none;
}

/* Responsive */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .account-summary-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .team-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .topic-toolbar { flex-wrap: wrap; }
  .topic-toolbar .toolbar-search { width: min(360px, 45vw); }
  .span-8, .span-7 { grid-column: span 12; }
  .span-4, .span-5 { grid-column: span 6; }
  .dashboard-hero { min-height: 160px; }
  .report-metric-strip { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .report-metric-strip .metric-strip-item:nth-child(4) { border-left: 0; border-top: 1px solid var(--line); }
  .report-metric-strip .metric-strip-item:nth-child(5),
  .report-metric-strip .metric-strip-item:nth-child(6) { border-top: 1px solid var(--line); }
}

@media (max-width: 960px) {
  :root { --sidebar-w: 224px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .mobile-brand { display: inline-flex; }
  .login-panel { padding: 44px 24px; }
  .sidebar { transform: translateX(-100%); box-shadow: 18px 0 50px rgba(0,0,0,.22); }
  .sidebar.open { transform: translateX(0); }
  .mobile-scrim {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(4,12,8,.45);
  }
  .workspace { margin-left: 0; }
  .mobile-menu { display: grid !important; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow: auto; }
  .settings-nav button { width: auto; min-width: max-content; }
  .settings-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
  .topbar { padding: 0 15px; }
  .command-button { display: none; }
  .quick-report span { display: none; }
  .quick-report { width: 37px; padding: 0; justify-content: center; }
  .btn,
  .icon-button,
  .quick-report,
  .close-button,
  .input-action,
  .row-action,
  .pagination button,
  .member-actions button,
  .toolbar-select,
  .toolbar-search input,
  .report-date-filter,
  .segmented button {
    min-height: 44px;
  }
  .icon-button,
  .quick-report,
  .close-button,
  .input-action,
  .row-action,
  .pagination button {
    width: 44px;
    height: 44px;
  }
  .row-action,
  .pagination button { min-width: 44px; }
  .input-action { right: 1px; }
  .input-wrap.has-action input { padding-right: 50px; }
  .toolbar-select,
  .toolbar-search input,
  .report-date-filter { height: 44px; }
  .content-area { padding: 22px 15px 40px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; overflow: auto; }
  .page-actions .btn { flex: 0 0 auto; }
  .dashboard-hero { grid-template-columns: 1fr; padding: 23px; }
  .trend-panel .panel-head {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 15px;
  }
  .trend-controls {
    width: 100%;
    justify-content: space-between;
  }
  .trend-panel .panel-body { padding: 15px 12px; }
  .chart-wrap { height: 228px; }
  .trend-chart { height: 218px; }
  .trend-chart .chart-label { font-size: 11px; }
  .chart-legend { flex-wrap: wrap; }
  .hero-target { width: 100%; }
  .kpi-grid,
  .summary-grid,
  .team-grid { grid-template-columns: 1fr 1fr; }
  .span-9, .span-8, .span-7, .span-6, .span-5, .span-4, .span-3 { grid-column: span 12; }
  .donut-area { grid-template-columns: 130px 1fr; }
  .table-toolbar { flex-wrap: wrap; }
  .toolbar-search { width: 100%; }
  .topic-toolbar .toolbar-search { width: 100%; }
  .topic-toolbar .toolbar-select { max-width: none; flex: 1 1 140px; }
  .sort-control { flex: 1 1 140px; }
  .sort-control .toolbar-select { width: 100%; }
  .filter-actions,
  .filter-feedback {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }
  .toolbar-spacer { display: none; }
  .report-spotlight { grid-template-columns: 1fr; }
  .report-progress { min-width: 0; }
  .metric-strip { grid-template-columns: repeat(2,1fr); }
  .report-metric-strip { grid-template-columns: repeat(2,1fr); }
  .metric-strip-item:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .metric-strip-item:nth-child(4) { border-top: 1px solid var(--line); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .detail-stats { grid-template-columns: 1fr 1fr; }
  .drawer { width: 100%; }
  .drawer-body { -webkit-overflow-scrolling: touch; }
  .drawer .modal-foot {
    min-height: 72px;
    padding: 10px 15px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .drawer .modal-foot .btn {
    min-width: 0;
    flex: 1 1 0;
  }
  .row-actions { opacity: 1; }
  .data-table { font-size: 11px; }
  .permission-grid,
  .option-manager-grid { grid-template-columns: 1fr; }
  .settings-section-head { align-items: stretch; flex-direction: column; }
  .settings-section-head > .btn { align-self: flex-start; }
  .rule-controls { flex-wrap: wrap; }
  .report-date-filter { flex: 1 1 150px; }
  .report-date-filter input { width: 100%; }
  .report-clear-filter { flex: 1 1 120px; }
  .report-quality-grid { grid-template-columns: 1fr; gap: 0; }
  .report-quality-grid .quality-item { border-bottom: 1px solid #eef1ef; }
  .report-quality-grid .quality-item:last-child { border-bottom: 0; }
  .report-draft-state { align-items: flex-start; flex-direction: column; }
  .empty-state { min-height: 240px; padding: 30px 20px; }
  .filter-empty-state,
  #account-filter-empty .empty-state,
  #topic-filter-empty .empty-state { min-height: 190px; padding: 25px 18px; }
}

@media (max-width: 480px) {
  .login-card h2 { font-size: 29px; }
  .kpi-grid,
  .summary-grid,
  .team-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 115px; }
  .trend-controls { align-items: stretch; }
  .trend-controls .segmented { flex: 1; }
  .trend-controls .segmented button { flex: 1; padding: 0 7px; }
  .trend-replay { white-space: nowrap; }
  .chart-empty-message { inset: 24px 42px 30px; }
  .donut-area { grid-template-columns: 1fr; justify-items: center; }
  .distribution-list { width: 100%; }
  .metric-strip { grid-template-columns: 1fr; }
  .report-metric-strip { grid-template-columns: 1fr; }
  .metric-strip-item + .metric-strip-item { border-top: 1px solid var(--line); border-left: 0; }
  .modal-body,
  .drawer-body { padding: 17px; }
  .modal-head,
  .modal-foot,
  .drawer-head { padding-left: 17px; padding-right: 17px; }
  .info-grid,
  .detail-stats { grid-template-columns: 1fr; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
  .settings-summary-grid { grid-template-columns: 1fr 1fr; }
  .settings-section { padding: 18px 15px; }
  .settings-local-notice { margin: 12px 12px 0; }
  .field-rule-row { align-items: flex-start; flex-direction: column; gap: 10px; padding: 13px 0; }
  .notification-rule-main { grid-template-columns: 32px minmax(0,1fr) auto; }
  .rule-control { margin-left: 0; }
  .audit-row { grid-template-columns: 28px minmax(0,1fr); padding: 9px 0; }
  .audit-row time { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
