/* DocFila Marketing Admin — styles.css */
/* Dark theme. Uses CSS custom properties throughout. */

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg:        #0f1115;
  --panel:     #171a21;
  --panel2:    #1c2030;
  --line:      #262b36;
  --line2:     #303848;
  --text:      #e6e9ef;
  --muted:     #8b93a7;
  --brand:     #5b8cff;
  --brand-dim: #3a6aee;
  --ok:        #33d17a;
  --warn:      #f5a623;
  --err:       #ff5c5c;
  --info:      #60b4f5;
  --radius:    12px;
  --radius-sm: 8px;
  --sidebar-w: 220px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
}

/* ── Reset + base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font: 14px/1.6 system-ui, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
code { font-family: monospace; background: var(--panel2); padding: 1px 5px; border-radius: 4px; }
.hidden { display: none !important; }

/* ── Typography helpers ──────────────────────────────────────────────────── */
.muted    { color: var(--muted); }
.small    { font-size: 12px; }
.mono     { font-family: monospace; font-size: 12px; }
.success  { color: var(--ok); }
.error    { color: var(--err); }
.mt-8     { margin-top: 8px; }
.mt-12    { margin-top: 12px; }

/* ── Auth shell ──────────────────────────────────────────────────────────── */
.view.center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.card.auth {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}

.auth-logo {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2px;
}
.auth-logo span { color: var(--brand); }

.onboarding-card {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}
.onboarding-card h2 { margin-top: 4px; }

/* ── Auth tabs ────────────────────────────────────────────────────────────── */
.tab-row { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tab-row .tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.tab-row .tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.auth-panel { display: flex; flex-direction: column; gap: 12px; }
.auth-panel.hidden { display: none; }

.divider {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  position: relative;
}
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--line);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

.invite-banner {
  background: var(--panel2);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

/* ── Google button ─────────────────────────────────────────────────────────── */
.google-btn {
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.google-btn:hover { background: var(--line2); }

/* ── Inputs ─────────────────────────────────────────────────────────────────── */
input, textarea, select {
  background: #0c0e13;
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font: inherit;
  width: 100%;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
}
input:disabled, textarea:disabled, select:disabled {
  opacity: .5;
  cursor: not-allowed;
}
textarea { resize: vertical; min-height: 100px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%238b93a7' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input[type="color"] { padding: 4px; cursor: pointer; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
}
button:disabled { opacity: .55; cursor: not-allowed; }
button.primary   { background: var(--brand); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--brand-dim); }
button.secondary { background: var(--panel2); color: var(--text); border: 1px solid var(--line2); }
button.secondary:hover:not(:disabled) { background: var(--line2); }
button.secondary.active { border-color: var(--brand); color: var(--brand); }
button.danger    { background: #3a1515; color: var(--err); border: 1px solid #5a2020; }
button.danger:hover:not(:disabled) { background: #4a1f1f; }
button.link-btn  { background: none; color: var(--muted); padding: 4px 8px; font-weight: 400; }
button.link-btn:hover { color: var(--text); }
button.full-width { width: 100%; }
button.small-btn  { padding: 5px 10px; font-size: 12px; }
.ai-btn { color: var(--brand); border-color: var(--brand); }

/* ── App shell ──────────────────────────────────────────────────────────────── */
.nav-toggle { display: none; }
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  font-size: 17px;
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--line);
}
.brand b { color: var(--brand); }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px;
  flex: 1;
  gap: 2px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  transition: background .12s, color .12s;
}
.sidebar-nav a:hover  { background: var(--panel2); color: var(--text); }
.sidebar-nav a.active { background: #232a40; color: var(--brand); }
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.user-info { display: flex; flex-direction: column; overflow: hidden; }
.org-name  { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Main area ───────────────────────────────────────────────────────────────── */
.main-area {
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.page-content {
  padding: 28px 32px;
  max-width: 1100px;
  width: 100%;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-loading {
  display: grid;
  place-items: center;
  height: 200px;
}

/* ── Spinner ─────────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 32px; height: 32px;
  border: 3px solid var(--line2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Compose card / section card ─────────────────────────────────────────────── */
.compose-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.compose-card:last-child { margin-bottom: 0; }
.compose-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 10px; }

/* ── Form helpers ────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--muted); }
.form-group:last-child { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.compose-msg { font-size: 13px; margin-top: 10px; min-height: 20px; }
.compose-msg.success { color: var(--ok); }
.compose-msg.error   { color: var(--err); }
.info-banner {
  background: #1a2035;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  color: var(--info);
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--panel2);
  color: var(--muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.badge.published, .badge.connected, .badge.active   { color: var(--ok);   background: #0d2b1a; }
.badge.scheduled, .badge.sending, .badge.pending    { color: var(--warn);  background: #2b2010; }
.badge.failed, .badge.canceled, .badge.expired, .badge.revoked { color: var(--err); background: #2b1010; }
.badge.draft    { color: var(--muted); background: var(--panel2); }
.badge.owner    { color: var(--brand); background: #141e3a; }
.badge.admin    { color: #b083f0; background: #1e1030; }
.badge.editor   { color: var(--info);  background: #0e2035; }
.badge.viewer   { color: var(--muted); }
.badge.muted    { color: var(--muted); }

/* ── List + items ────────────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  gap: 12px;
}
.item.selectable { cursor: pointer; }
.item.selectable:hover { border-color: var(--brand); }

/* ── Calendar ────────────────────────────────────────────────────────────────── */
.cal-label { font-weight: 600; min-width: 180px; text-align: center; }
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.filter-bar label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }

/* Month grid */
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.month-header {
  background: var(--panel2);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px;
  text-transform: uppercase;
}
.month-cell {
  background: var(--panel);
  min-height: 90px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.month-cell.empty { background: #0c0e13; }
.month-cell.today { background: #141a2e; }
.cell-date { font-size: 12px; font-weight: 600; color: var(--muted); }
.month-cell.today .cell-date { color: var(--brand); }
.more-badge { font-size: 10px; color: var(--muted); }

.item-chip {
  font-size: 10px;
  border-radius: 4px;
  padding: 2px 5px;
  cursor: pointer;
  display: flex;
  gap: 4px;
  background: var(--panel2);
  border: 1px solid var(--line);
}
.item-chip.scheduled { border-left: 3px solid var(--warn); }
.item-chip.published { border-left: 3px solid var(--ok); }
.item-chip.failed    { border-left: 3px solid var(--err); }
.item-chip.canceled  { border-left: 3px solid var(--muted); opacity: .6; }
.chip-time { color: var(--muted); }

/* Week grid */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.week-col {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 200px;
  display: flex;
  flex-direction: column;
}
.week-col.today { border-color: var(--brand); }
.week-day-header {
  background: var(--panel2);
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.week-col.today .week-day-header { color: var(--brand); }
.week-day-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.week-item {
  font-size: 11px;
  border-radius: 4px;
  padding: 5px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--panel2);
  border: 1px solid var(--line);
}
.week-item.scheduled { border-left: 3px solid var(--warn); }
.week-item.published { border-left: 3px solid var(--ok); }
.week-item.failed    { border-left: 3px solid var(--err); }
.week-item.canceled  { opacity: .6; }

/* Detail panel */
.detail-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: grid;
  place-items: center;
  z-index: 200;
}
.detail-inner {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  width: min(480px, 90vw);
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
}
.close-btn {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

/* ── Detail table ────────────────────────────────────────────────────────────── */
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table td { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.detail-table td:first-child { color: var(--muted); width: 100px; }
.error-text { color: var(--err); font-size: 12px; }

/* ── Toast ───────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13px;
  z-index: 9999;
  box-shadow: var(--shadow);
  white-space: nowrap;
  animation: fade-in .2s ease;
}
.toast.error { border-color: var(--err); color: var(--err); }
@keyframes fade-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }

/* ── Compose layout ─────────────────────────────────────────────────────────── */
.compose-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.compose-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.schedule-row { display: flex; gap: 16px; }
.radio-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-label input { width: auto; }
.channel-picker { display: flex; flex-direction: column; gap: 8px; }
.channel-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line2);
  cursor: pointer;
  background: var(--panel2);
  transition: border-color .12s;
}
.channel-chip:has(input:checked) { border-color: var(--brand); }
.channel-chip.disabled { opacity: .5; cursor: not-allowed; }
.channel-chip input { width: auto; }
.ch-icon { font-weight: 700; font-size: 13px; }

/* Tailor tabs */
.tailor-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tailor-tabs .tab {
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
}
.tailor-tabs .tab.active { border-color: var(--brand); color: var(--brand); }
.tailor-panel { display: none; }
.tailor-panel.active { display: block; }
.tailor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.char-counter { font-size: 11px; color: var(--muted); margin-top: 4px; }
.char-counter.warn { color: var(--warn); }
.char-counter.over { color: var(--err); font-weight: 700; }

/* AI panel */
.ai-panel {
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 10px;
}
.ai-results { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ai-draft {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.ai-draft-header { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.ai-draft-text { font-size: 13px; white-space: pre-wrap; color: var(--text); }

/* ── Campaign item ───────────────────────────────────────────────────────────── */
.campaign-item { flex-wrap: wrap; gap: 8px; }
.campaign-main { flex: 1; min-width: 0; }
.campaign-subject { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.campaign-stats { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.campaign-actions { display: flex; align-items: center; gap: 8px; }

/* ── Audience / import panel ─────────────────────────────────────────────────── */
.audience-item b { font-size: 14px; }
.import-section { padding: 12px 0; border-bottom: 1px solid var(--line); }
.import-section:last-child { border-bottom: none; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.csv-preview { margin-top: 10px; }
.csv-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.csv-table th, .csv-table td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.csv-table th { background: var(--panel2); color: var(--muted); }

/* ── Channels ────────────────────────────────────────────────────────────────── */
.channel-item { gap: 12px; flex-wrap: wrap; }
.ch-icon-lg { font-size: 18px; font-weight: 700; width: 28px; text-align: center; }

/* Connect card */
.connect-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.connect-card summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  user-select: none;
}
.connect-card summary::-webkit-details-marker { display: none; }
.connect-card[open] summary { margin-bottom: 16px; }
.connect-form { display: flex; flex-direction: column; gap: 0; }

/* OAuth grid */
.oauth-grid { display: flex; flex-direction: column; gap: 12px; }
.oauth-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.oauth-btn {
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--text);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.oauth-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ── Analytics ───────────────────────────────────────────────────────────────── */
.analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-icon { font-size: 20px; }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--muted); }

/* CSS bar chart */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; }
.bar-label { font-size: 13px; color: var(--text); }
.bar-track { position: relative; background: var(--panel2); border-radius: 4px; height: 24px; display: flex; align-items: center; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 4px; transition: width .4s ease; min-width: 2px; }
.bar-value { position: absolute; right: 8px; font-size: 11px; font-weight: 700; color: var(--text); }
.bar-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }

.analytics-post-item { flex-wrap: wrap; gap: 8px; }
.analytics-post-main { flex: 1; min-width: 200px; display: flex; gap: 10px; align-items: flex-start; }
.analytics-post-stats { display: flex; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

.empty-state { text-align: center; padding: 40px; color: var(--muted); }

/* ── Team ────────────────────────────────────────────────────────────────────── */
.member-item b { font-size: 14px; }
.small-select { width: auto; padding: 5px 28px 5px 8px; font-size: 12px; }

/* ── Billing ─────────────────────────────────────────────────────────────────── */
.billing-plan-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.plan-label { font-size: 12px; color: var(--brand); font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.plan-price { font-size: 28px; font-weight: 700; }
.usage-grid { display: flex; flex-direction: column; gap: 0; }
.usage-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.usage-row:last-child { border-bottom: none; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.plan-option {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-option-label { font-weight: 700; }
.plan-option-price { font-size: 20px; font-weight: 700; color: var(--brand); }
.plan-features { padding-left: 16px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; flex: 1; }

/* ── Settings ────────────────────────────────────────────────────────────────── */
/* (uses compose-card + form-group — no additional rules needed) */

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .compose-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .app-shell { grid-template-columns: 1fr; }
  .nav-toggle {
    display: block;
    position: fixed;
    top: 12px; left: 12px;
    z-index: 101;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    width: 40px; height: 40px;
    font-size: 18px;
    cursor: pointer;
  }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform .25s;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.5); }
  .main-area { min-height: 100vh; }
  .page-content { padding: 20px 16px; }
  .month-grid { font-size: 10px; }
  .week-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .analytics-cards { grid-template-columns: repeat(2,1fr); }
}

/* ── Scrollbar ───────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 3px; }

/* ── 2026 console polish ─────────────────────────────────────────────────────
   Overrides above without changing page contracts. */
:root {
  --bg: #101112;
  --panel: #181a1d;
  --panel2: #202329;
  --line: #2a2e35;
  --line2: #3a404a;
  --text: #f2f2ed;
  --muted: #9aa19b;
  --brand: #2fb7a3;
  --brand-dim: #269987;
  --ok: #45c47c;
  --warn: #e7ad45;
  --err: #ee6a5f;
  --info: #7db4e6;
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar-w: 244px;
  --shadow: 0 16px 40px rgba(0,0,0,.28);
}

body {
  background:
    linear-gradient(180deg, #141618 0%, #101112 48%, #0d0f10 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 72%);
}

h2 { font-size: 22px; letter-spacing: 0; }
h3 { letter-spacing: 0; }

.card,
.compose-card,
.connect-card,
.stat-card,
.plan-option,
.billing-plan-card,
.item,
.filter-bar,
.week-col,
.detail-inner {
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, white 8%);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset;
}

.card.auth,
.onboarding-card {
  width: min(430px, 100%);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 24px 70px rgba(0,0,0,.38);
}

.auth-logo {
  font-size: 24px;
  letter-spacing: 0;
}

.auth-logo span,
.brand b,
.plan-option-price,
.page-header h2::after {
  color: var(--brand);
}

input,
textarea,
select {
  min-height: 38px;
  background: #111316;
  border-color: rgba(255,255,255,.11);
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
}

textarea { line-height: 1.5; }
input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,183,163,.14);
}

button {
  min-height: 36px;
  border-radius: 6px;
  letter-spacing: 0;
}

button.primary {
  background: var(--brand);
  color: #06100e;
}

button.primary:hover:not(:disabled) { background: #37cdb7; }
button.secondary,
.google-btn,
.oauth-btn {
  background: #20242a;
  border: 1px solid rgba(255,255,255,.1);
}

button.danger {
  background: rgba(238,106,95,.12);
  color: var(--err);
  border: 1px solid rgba(238,106,95,.28);
}

.app-shell {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.sidebar {
  background: rgba(20,22,24,.94);
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(255,255,255,.08);
}

.brand {
  min-height: 68px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 16px;
  border-bottom-color: rgba(255,255,255,.08);
}

.sidebar-nav {
  padding: 12px 10px;
  gap: 4px;
}

.sidebar-nav a {
  min-height: 38px;
  gap: 11px;
  padding: 9px 10px;
  color: #aeb5ae;
}

.sidebar-nav a svg {
  width: 17px;
  height: 17px;
  color: #747c79;
  flex: 0 0 auto;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,.055);
  color: var(--text);
}

.sidebar-nav a.active {
  background: rgba(47,183,163,.13);
  color: var(--brand);
}

.sidebar-nav a.active svg { color: var(--brand); }

.sidebar-footer {
  border-top-color: rgba(255,255,255,.08);
  padding: 14px;
}

.main-area {
  background: rgba(255,255,255,.015);
}

.page-content {
  width: min(1280px, 100%);
  padding: 34px 38px;
}

.page-header {
  min-height: 44px;
  margin-bottom: 22px;
}

.page-header h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.page-header h2::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  background: var(--brand);
  border-radius: 99px;
}

.compose-card,
.connect-card {
  padding: 20px;
  margin-bottom: 14px;
}

.compose-label {
  color: #b3bab5;
  letter-spacing: .04em;
}

.form-grid.compact-grid {
  grid-template-columns: minmax(220px, 1fr) 140px;
}

.item {
  min-height: 58px;
  padding: 14px 16px;
  transition: border-color .15s, background .15s, transform .15s;
}

.item.selectable:hover,
.item:hover {
  border-color: rgba(47,183,163,.42);
  background: #1d2024;
}

.badge {
  min-height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.07);
}

.badge.published,
.badge.connected,
.badge.active {
  color: #6ee19a;
  background: rgba(69,196,124,.12);
}

.badge.scheduled,
.badge.sending,
.badge.pending {
  color: #f0c266;
  background: rgba(231,173,69,.13);
}

.badge.failed,
.badge.canceled,
.badge.expired,
.badge.revoked {
  color: #ff938b;
  background: rgba(238,106,95,.12);
}

.badge.owner {
  color: var(--brand);
  background: rgba(47,183,163,.13);
}

.badge.admin {
  color: #d6a46d;
  background: rgba(214,164,109,.12);
}

.badge.editor {
  color: #9bc6ed;
  background: rgba(125,180,230,.12);
}

.compose-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: 18px;
}

.channel-chip {
  background: #20242a;
  border-color: rgba(255,255,255,.1);
}

.channel-chip:has(input:checked) {
  border-color: var(--brand);
  background: rgba(47,183,163,.1);
}

.tailor-tabs .tab.active,
button.secondary.active {
  background: rgba(47,183,163,.1);
}

.info-banner,
.invite-banner {
  background: rgba(47,183,163,.09);
  border-color: rgba(47,183,163,.36);
  color: #a6e8de;
}

.month-grid,
.week-grid {
  isolation: isolate;
}

.month-header,
.week-day-header {
  background: #20242a;
}

.month-cell,
.week-col {
  background: rgba(24,26,29,.95);
}

.month-cell.empty {
  background: rgba(17,19,22,.8);
}

.month-cell.today,
.week-col.today {
  background: rgba(47,183,163,.07);
}

.stat-value,
.plan-price {
  letter-spacing: 0;
}

.toast {
  background: #20242a;
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}

@media (max-width: 900px) {
  .page-content { padding: 26px 22px; }
  .compose-layout { grid-template-columns: 1fr; }
  .form-grid.compact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .page-content { padding: 72px 16px 20px; }
}
