:root {
  --font-ui: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
  --font-display: "Aptos Display", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --bg: #f3f4f8;
  --bg-soft: #eceef4;
  --panel: #ffffff;
  --panel-soft: #f8f9fc;
  --panel-dark: #151618;
  --panel-dark-2: #1d1f22;
  --ink: #16181d;
  --ink-soft: #69707d;
  --ink-faint: #99a0ad;
  --line: rgba(23, 28, 39, 0.08);
  --line-strong: rgba(23, 28, 39, 0.14);
  --brand: #ff8a2b;
  --brand-deep: #f37316;
  --blue: #2f80ed;
  --blue-soft: rgba(47, 128, 237, 0.14);
  --success: #1fa971;
  --success-soft: rgba(31, 169, 113, 0.14);
  --danger: #d75452;
  --danger-soft: rgba(215, 84, 82, 0.14);
  --shadow-lg: 0 18px 40px rgba(18, 24, 35, 0.08);
  --shadow-md: 0 10px 24px rgba(18, 24, 35, 0.06);
  --shadow-dark: 0 18px 44px rgba(0, 0, 0, 0.32);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.56)),
    linear-gradient(180deg, #eef0f5 0%, var(--bg) 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(47, 128, 237, 0.12), transparent 18%),
    radial-gradient(circle at top left, rgba(255, 138, 43, 0.12), transparent 20%),
    linear-gradient(180deg, #eef0f4 0%, #e8ebf3 100%);
}

.auth-panel {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 420px);
  gap: 24px;
  align-items: stretch;
}

.auth-copy,
.auth-card,
.hero-panel,
.status-card,
.panel,
.modal {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.auth-copy {
  padding: 44px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 252, 0.96)),
    var(--panel);
}

.auth-copy h1,
.hero-panel h1,
.panel h2,
.modal h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

.auth-copy h1 {
  font-size: clamp(2.4rem, 4vw, 4.3rem);
  line-height: 0.94;
  max-width: 10ch;
}

.auth-description,
.hero-description,
.status-card p,
.panel-head p,
.prompt-meta,
.prompt-preview,
.mini-table-meta,
.menu-copy small,
.brand-block span {
  color: var(--ink-soft);
}

.auth-description {
  max-width: 680px;
  margin: 18px 0 0;
  font-size: 1.03rem;
  line-height: 1.72;
}

.auth-card {
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 246, 251, 0.94)),
    var(--panel);
}

.auth-card-head {
  display: grid;
  gap: 6px;
  margin-bottom: 22px;
}

.auth-card-head strong {
  font-size: 1.2rem;
}

.auth-submit,
.ghost-button {
  width: 100%;
}

.auth-highlights {
  display: grid;
  gap: 16px;
  margin-top: 30px;
  max-width: 580px;
}

.auth-highlight {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.auth-field {
  display: grid;
  gap: 8px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 110px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-footnote {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  gap: 18px;
  padding: 18px;
}

.sidebar {
  width: 300px;
  min-width: 300px;
  padding: 18px 16px;
  background:
    radial-gradient(circle at top left, rgba(255, 138, 43, 0.16), transparent 20%),
    linear-gradient(180deg, #111214 0%, #17191d 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 30px;
  box-shadow: var(--shadow-dark);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: width 0.25s ease, min-width 0.25s ease;
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  overflow: hidden;
}

.sidebar.is-collapsed {
  width: 98px;
  min-width: 98px;
}

.sidebar-brand-card,
.sidebar-top,
.menu-item,
.session-menu {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-brand-card {
  padding: 16px 14px;
  border-radius: 24px;
  background:
    radial-gradient(circle at bottom left, rgba(255, 138, 43, 0.16), transparent 36%),
    rgba(255, 255, 255, 0.03);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px;
  border-radius: 24px;
}

.sidebar-toggle,
.session-menu-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  gap: 4px;
}

.sidebar-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #ffa14e);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 24px rgba(255, 138, 43, 0.28);
}

.brand-block strong {
  display: block;
  font-size: 1rem;
}

.brand-block span {
  display: block;
  margin-top: 4px;
  color: rgba(232, 236, 243, 0.72);
}

.sidebar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

.sidebar-nav-head {
  display: grid;
  gap: 4px;
  padding: 2px 4px 0;
}

.sidebar-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.sidebar-subtitle {
  color: rgba(255, 255, 255, 0.44);
  font-size: 0.84rem;
}

.sidebar-label {
  margin: 8px 8px 2px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.session-menu-wrap {
  position: relative;
}

.session-menu-wrap.is-open {
  margin-bottom: 106px;
}

.session-menu-button span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #fff;
  display: block;
}

.session-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(260px, calc(100vw - 48px));
  min-width: 240px;
  padding: 12px;
  border-radius: 18px;
  box-shadow: var(--shadow-dark);
  z-index: 20;
}

.session-menu-email {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  word-break: normal;
  overflow-wrap: anywhere;
}

.session-menu-logout {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  flex: 1;
  align-content: start;
  overflow: auto;
  padding-right: 2px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  width: 100%;
  padding: 0 14px;
  border-radius: 18px;
  color: #fff;
  text-align: left;
  position: relative;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.menu-item::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.menu-item.active {
  background: rgba(255, 138, 43, 0.12);
  border-color: rgba(255, 138, 43, 0.18);
  transform: translateX(2px);
}

.menu-item.active::before {
  background: linear-gradient(180deg, #ffb06f, var(--brand));
}

.menu-item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.menu-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
  font-weight: 800;
  flex-shrink: 0;
}

.menu-copy {
  display: grid;
  gap: 3px;
}

.menu-label {
  font-weight: 700;
  font-size: 0.98rem;
}

.menu-copy small {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.8rem;
}

.menu-item.active .menu-copy small {
  color: rgba(255, 228, 208, 0.86);
}

.sidebar.is-collapsed .brand-block > div,
.sidebar.is-collapsed .sidebar-nav-head,
.sidebar.is-collapsed .menu-copy,
.sidebar.is-collapsed .sidebar-label {
  display: none;
}

  .sidebar.is-collapsed .sidebar-brand-card,
  .sidebar.is-collapsed .sidebar-top,
  .sidebar.is-collapsed .menu-item {
    justify-content: center;
  }

  .sidebar.is-collapsed .session-menu-wrap.is-open {
    margin-bottom: 0;
  }

.sidebar.is-collapsed .sidebar-brand-card {
  padding-inline: 0;
}

.main-content {
  flex: 1;
  padding: 2px;
  display: grid;
  gap: 18px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.82fr);
  gap: 22px;
  padding: 30px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(47, 128, 237, 0.1), transparent 20%),
    linear-gradient(180deg, #f9fafe 0%, #f4f6fb 100%);
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -100px;
  bottom: -90px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 138, 43, 0.18), transparent 70%);
  pointer-events: none;
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.hero-context-chip,
.hero-sync-text,
.panel-summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.hero-context-chip {
  background: rgba(255, 138, 43, 0.12);
  color: var(--brand-deep);
}

.hero-sync-text,
.panel-summary {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-deep);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-panel h1 {
  font-size: clamp(2.6rem, 4vw, 4.1rem);
  line-height: 0.96;
  max-width: 10ch;
}

.hero-description {
  max-width: 720px;
  margin: 14px 0 0;
  font-size: 1.03rem;
  line-height: 1.68;
}

.hero-task-card {
  margin-top: 18px;
  display: grid;
  gap: 6px;
  max-width: 640px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.hero-task-card strong {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.hero-task-card span {
  color: var(--ink);
  line-height: 1.58;
  font-weight: 700;
}

.hero-side,
.topbar-actions,
.action-group,
.form-actions,
.filter-group,
.table-actions,
.chart-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.table-actions {
  justify-content: flex-end;
}

.hero-side {
  display: grid;
  align-content: end;
}

.hero-mini-card {
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 247, 252, 0.92));
  border: 1px solid rgba(255, 138, 43, 0.16);
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.hero-mini-card span {
  color: var(--ink-soft);
  display: block;
  margin-bottom: 10px;
}

.hero-mini-card strong {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  display: block;
}

.hero-mini-card p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.primary-button,
.secondary-button,
.icon-button,
.danger-button,
.ghost-button,
.mini-button,
.filter-chip {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.mini-button:hover,
.filter-chip:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--brand), #ff9b46);
  color: #fff;
  box-shadow: 0 12px 24px rgba(255, 138, 43, 0.24);
}

.secondary-button,
.icon-button,
.mini-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.danger-button {
  background: #fff;
  border-color: rgba(215, 84, 82, 0.16);
  color: var(--danger);
}

.filter-chip {
  min-height: 40px;
  background: #fff;
  border-color: var(--line);
  color: var(--ink-soft);
}

.filter-chip.active {
  background: rgba(255, 138, 43, 0.1);
  border-color: rgba(255, 138, 43, 0.18);
  color: var(--brand-deep);
}

.section-block {
  display: grid;
  gap: 18px;
}

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

.analytics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.status-card {
  padding: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 248, 252, 0.96));
}

.status-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.status-head span:first-child {
  color: var(--ink-soft);
  font-weight: 700;
}

.status-kicker {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.status-card-total .status-kicker {
  background: rgba(255, 138, 43, 0.1);
  color: var(--brand-deep);
}

.status-card-active .status-kicker {
  background: var(--success-soft);
  color: var(--success);
}

.status-card-inactive .status-kicker {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-card strong {
  display: block;
  margin: 18px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1;
}

.panel {
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 248, 252, 0.96));
}

#analyticsSection .chart-panel,
#usagesSection .chart-panel {
  background: linear-gradient(180deg, rgba(24, 26, 29, 0.98), rgba(19, 21, 24, 0.98));
  border-color: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-dark);
}

#analyticsSection .chart-panel h2,
#usagesSection .chart-panel h2,
#analyticsSection .chart-panel .panel-head p,
#usagesSection .chart-panel .panel-head p,
#analyticsSection .chart-panel .bar-head,
#usagesSection .chart-panel .bar-head,
#analyticsSection .chart-panel .mini-table-meta,
#usagesSection .chart-panel .mini-table-meta,
#analyticsSection .chart-panel .mini-table-title,
#usagesSection .chart-panel .mini-table-title,
#analyticsSection .chart-panel .timeline-labels,
#usagesSection .chart-panel .timeline-labels {
  color: #f4f5f7;
}

#analyticsSection .chart-panel .panel-head p,
#usagesSection .chart-panel .panel-head p,
#analyticsSection .chart-panel .mini-table-meta,
#usagesSection .chart-panel .mini-table-meta,
#analyticsSection .chart-panel .timeline-labels,
#usagesSection .chart-panel .timeline-labels {
  color: rgba(255, 255, 255, 0.62);
}

#analyticsSection .chart-panel .mini-table-item,
#usagesSection .chart-panel .mini-table-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

#analyticsSection .chart-panel .mini-table-tag,
#usagesSection .chart-panel .mini-table-tag {
  background: rgba(47, 128, 237, 0.18);
  color: #8dc0ff;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
}

.panel-head.compact {
  align-items: start;
}

.panel-controls {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.search-box {
  display: grid;
  gap: 8px;
  min-width: 340px;
}

.search-input-wrap {
  position: relative;
}

.search-box span,
.prompt-form label span:first-child {
  font-size: 0.9rem;
  font-weight: 700;
}

.search-box input,
.prompt-form input,
.prompt-form textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
}

.search-box input {
  padding-right: 88px;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff7f0;
  color: var(--brand-deep);
  font-size: 0.8rem;
  font-weight: 700;
}

.search-box input:focus,
.prompt-form input:focus,
.prompt-form textarea:focus,
.password-toggle:focus {
  outline: 2px solid rgba(47, 128, 237, 0.16);
  border-color: rgba(47, 128, 237, 0.28);
}

.prompt-form textarea {
  min-height: 320px;
  resize: vertical;
}

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff3eb;
  border: 1px solid rgba(255, 138, 43, 0.18);
}

.alert.success {
  background: rgba(31, 169, 113, 0.08);
  border-color: rgba(31, 169, 113, 0.14);
}

.alert.error {
  background: rgba(215, 84, 82, 0.08);
  border-color: rgba(215, 84, 82, 0.14);
}

.table-wrap {
  overflow: auto;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pagination-summary,
.pagination-current {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.pagination-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 138, 43, 0.28);
  background: rgba(255, 255, 255, 0.96);
}

.pagination-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

thead th {
  position: sticky;
  top: 0;
  background: rgba(243, 245, 249, 0.98);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

tbody tr:hover {
  background: rgba(47, 128, 237, 0.04);
}

.prompt-cell {
  min-width: 320px;
}

.prompt-title {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 700;
}

.prompt-meta {
  display: block;
  margin-bottom: 10px;
  font-size: 0.84rem;
}

.prompt-preview {
  max-width: 560px;
  font-size: 0.92rem;
  line-height: 1.6;
}

.status-pill {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.status-pill.active {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.inactive {
  background: var(--danger-soft);
  color: var(--danger);
}

.mini-button {
  min-height: 38px;
  padding: 0 14px;
}

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 34px;
}

#analyticsSection .chart-panel .empty-state,
#usagesSection .chart-panel .empty-state {
  color: rgba(255, 255, 255, 0.62);
}

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

.timeline-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
}

.chart-panel {
  min-height: 320px;
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-item {
  display: grid;
  gap: 8px;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  font-size: 0.92rem;
}

.bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 138, 43, 0.1);
  overflow: hidden;
}

.neutral .bar-track {
  background: rgba(47, 128, 237, 0.14);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #ffb264);
}

.neutral .bar-fill {
  background: linear-gradient(90deg, var(--blue), #53a1ff);
}

.timeline-chart {
  min-height: 260px;
}

.timeline-svg {
  width: 100%;
  height: 260px;
  display: block;
}

.timeline-grid-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.timeline-area {
  fill: rgba(47, 128, 237, 0.14);
}

.timeline-line {
  fill: none;
  stroke: #57a7ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline-point {
  fill: #151618;
  stroke: #57a7ff;
  stroke-width: 3;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.82rem;
}

.mini-table {
  display: grid;
  gap: 12px;
}

.mini-table-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.mini-table-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.mini-table-title {
  font-weight: 700;
}

.mini-table-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 138, 43, 0.1);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 18, 22, 0.48);
  display: grid;
  place-items: center;
  padding: 24px;
  backdrop-filter: blur(8px);
}

.modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 246, 251, 0.96));
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.icon-button {
  width: 48px;
  padding: 0;
  font-size: 1.3rem;
}

.prompt-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 16px;
}

.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(248, 249, 252, 0.92);
}

.toggle-field input {
  width: 22px;
  height: 22px;
  min-height: auto;
}

@media (max-width: 1240px) {
  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .auth-panel,
  .hero-panel,
  .analytics-panels,
  .timeline-layout {
    grid-template-columns: 1fr;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 12px;
    gap: 12px;
  }

  .panel-head,
  .form-actions {
    display: grid;
  }

  .panel-controls {
    justify-items: stretch;
  }

  .panel-controls,
  .search-box {
    min-width: 0;
  }

  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .auth-shell {
    padding: 18px;
  }

  .auth-copy,
  .auth-card {
    padding: 24px;
  }

  .auth-copy h1 {
    max-width: none;
  }

  .sidebar,
  .sidebar.is-collapsed {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: relative;
    top: 0;
  }

  .sidebar.is-collapsed .brand-block > div,
  .sidebar.is-collapsed .sidebar-nav-head,
  .sidebar.is-collapsed .menu-copy,
  .sidebar.is-collapsed .sidebar-label {
    display: initial;
  }

  .sidebar.is-collapsed .sidebar-brand-card,
  .sidebar.is-collapsed .sidebar-top,
  .sidebar.is-collapsed .menu-item {
    justify-content: flex-start;
  }

  .main-content {
    padding: 16px 0 0;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .pagination {
    align-items: flex-start;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 14px;
  }

  tbody tr {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }

  tbody tr:hover {
    background: rgba(255, 255, 255, 0.96);
  }

  td {
    display: grid;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }

  td.empty-state {
    text-align: left;
    display: block;
  }

  td.empty-state::before {
    display: none;
  }

  .table-actions {
    justify-content: flex-start;
  }

  .hero-panel,
  .panel,
  .modal,
  .status-card {
    border-radius: 24px;
  }
}
