:root {
  --font-sans: "Inter", "Kufam", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --forest: #95215a;
  --forest-hover: #771c4a;
  --forest-ink: #6e1a44;
  --mint: #f4dee8;
  --mint-soft: #faf0f4;
  --mint-border: #e9bfd2;

  --primary: #95215a;
  --primary-hover: #771c4a;
  --secondary: #958bf7;
  --secondary-hover: #7a6ff0;
  --primary-soft: #f7e8ef;
  --secondary-soft: #edeafd;
  --brand-gradient: linear-gradient(135deg, #95215a 0%, #958bf7 100%);

  --success: #0e7a3d;
  --info: #2563eb;
  --danger: #b42318;
  --warning: #b54708;
  --teal: #0e7a5f;
  --orange: #c2410c;

  --page-bg: #f7f6f2;
  --surface: #ffffff;
  --sidebar: #ffffff;
  --white: #ffffff;
  --gray-100: #f3f2ed;
  --gray-200: #e9e6dd;
  --gray-300: #d8d4c7;
  --gray-400: #a8a89c;
  --gray-500: #767d76;
  --gray-600: #5b645e;
  --gray-700: #3f4a44;
  --gray-800: #222c27;
  --gray-900: #131c17;

  --heading: #131c17;
  --body: #3f4a44;
  --muted: #7c8781;
  --border: #e8e4d9;
  --border-soft: #efede5;
  --table-stripe: #faf9f5;
  --table-head: #f3f2ed;

  --radius-card: 14px;
  --radius-control: 10px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(19, 28, 23, 0.05);
  --shadow-lg: 0 8px 24px rgba(19, 28, 23, 0.08);
  --sidebar-w: 288px;
  --topbar-h: 64px;
}

html[data-theme="dark"] {
  --page-bg: #101512;
  --surface: #18211c;
  --sidebar: #141b17;
  --heading: #eef2ee;
  --body: #b9c4bd;
  --muted: #8a968f;
  --border: #26312b;
  --border-soft: #222b26;
  --gray-100: #1c2520;
  --gray-200: #26312b;
  --table-stripe: #18211c;
  --table-head: #1c2520;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--body);
  line-height: 1.6;
  background: var(--page-bg);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--heading);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

h1 { font-size: clamp(1.7rem, 2.4vw, 2.3rem); font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 600; }

p { margin: 0 0 0.9rem; }

a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--forest-hover); }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--forest);
  background: var(--mint-soft);
  border-radius: 6px;
  padding: 0.12em 0.45em;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  color: var(--body);
  border-right: 1px solid var(--border);
  padding: 1.4rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 40;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.35rem 0.4rem;
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.8rem;
  background: var(--forest);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }

.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.sidebar-brand-text strong { font-size: 1.35rem; font-weight: 750; color: var(--heading); letter-spacing: -0.03em; }
.sidebar-brand-text span { font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 2px; }

.sidebar-search-wrap { position: relative; }
.sidebar-search-icon {
  position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; display: flex;
}
.sidebar-search {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--heading);
  border-radius: var(--radius-control);
  padding: 0.6rem 2.8rem 0.6rem 2.4rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .sidebar-search { background: var(--gray-100); }
.sidebar-search::placeholder { color: var(--muted); }
.sidebar-search:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(149, 33, 90, 0.12); }
.sidebar-search-kbd {
  position: absolute; right: 0.7rem; top: 50%; transform: translateY(-50%);
  font-size: 0.75rem; color: var(--muted); font-weight: 600;
}

.sidebar-section-label {
  font-size: 0.66rem; letter-spacing: 0.18em; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  padding: 0.6rem 0.6rem 0.1rem;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.15rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.8rem;
  border-radius: var(--radius-control);
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.94rem;
  transition: background 0.14s ease, color 0.14s ease;
  position: relative;
}
.nav-link svg, .nav-icon { width: 1.15rem; height: 1.15rem; flex-shrink: 0; opacity: 0.85; }
.nav-link:hover { background: var(--gray-100); color: var(--heading); }
.nav-link.active { background: var(--mint); color: var(--forest-ink); font-weight: 650; }
.nav-link.active::after {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--forest); margin-left: auto;
}
.nav-link.active .nav-num { display: none; }
.nav-num { display: none; }
.nav-count {
  margin-left: auto; background: var(--mint-soft); border: 1px solid var(--border);
  font-size: 0.72rem; font-weight: 700; border-radius: 7px; padding: 0 0.4rem; color: var(--gray-600);
}
.nav-link.active .nav-count { background: #fff; color: var(--forest); border-color: var(--mint-border); }

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 0.6rem; }
.sidebar-user {
  font-size: 0.85rem; color: var(--muted); padding: 0 0.4rem;
  display: flex; align-items: center; gap: 0.5rem;
}

.help-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1rem 1rem 0.9rem;
  background: #fff;
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .help-card { background: var(--gray-100); }
.help-card h4 { font-size: 0.92rem; margin: 0 0 0.35rem; display: flex; gap: 0.45rem; align-items: flex-start; }
.help-card p { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.6rem; }
.help-card a { font-size: 0.86rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; }

/* ---------- Topbar / content ---------- */
.main-column { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 2rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .topbar { background: rgba(20, 27, 23, 0.92); }

.breadcrumb { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--heading); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--heading); font-weight: 600; }
.topbar-title { font-weight: 600; color: var(--heading); font-size: 0.92rem; }

.topbar-actions { display: flex; align-items: center; gap: 0.7rem; }
.preview-pill {
  background: var(--gray-100); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 0.32rem 0.85rem;
  font-size: 0.78rem; font-weight: 600; color: var(--gray-600);
}
.icon-btn {
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--heading); cursor: pointer;
}
.icon-btn:hover { background: var(--gray-100); }
.avatar {
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: #f8d5dd; color: #7c2d3e;
  display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 750; letter-spacing: 0.02em;
}

.content-wrap { padding: 2.2rem 2.5rem 3rem; max-width: 1460px; width: 100%; margin: 0 auto; }
.content-col { width: min(1120px, 100%); margin: 0 auto; }
.content-col.wide { width: min(1280px, 100%); }

/* ---------- Hero / eyebrow ---------- */
.eyebrow {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.7rem; letter-spacing: 0.2em; font-weight: 700;
  text-transform: uppercase; color: var(--gray-600);
  margin-bottom: 0.7rem;
}
.eyebrow::before { content: ""; width: 1.6rem; height: 2px; background: var(--forest); border-radius: 2px; display: inline-block; }

.page-hero { margin-bottom: 1.6rem; }
.page-hero h1 { margin-bottom: 0.3rem; }
.page-lead { color: var(--muted); margin: 0; font-size: 0.96rem; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.2rem; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card-panel,
.surface-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 1.6rem;
}
.surface-card.flush { padding: 0; overflow: hidden; }
.card-section { padding: 1.6rem; }
.card-section + .card-section { border-top: 1px solid var(--border-soft); }
.card-divider { border: 0; border-top: 1px solid var(--border-soft); margin: 0; }

.step-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.1rem; }
.step-head h2 { margin: 0; }
.step-head .meta { margin-left: auto; font-size: 0.82rem; color: var(--muted); }
.step-num {
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  border: 1px solid var(--border); background: #fff;
  display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 650; color: var(--gray-600); flex-shrink: 0;
}
.count-pill {
  background: var(--gray-100); border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 600; color: var(--muted); padding: 0.2rem 0.7rem;
}

/* ---------- Controls ---------- */
.form-label { display: block; font-weight: 600; color: var(--heading); margin-bottom: 0.45rem; font-size: 0.88rem; }
.form-label .req { color: var(--danger); }

.form-control,
.form-select,
textarea.form-control {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--heading);
  padding: 0.68rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select { background: var(--gray-100); }
.form-control::placeholder { color: #a3aca6; }
.form-control:focus,
.form-select:focus {
  outline: none; border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(149, 33, 90, 0.12);
}

.form-check { display: flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; color: var(--body); cursor: pointer; }
.form-check-input { width: 1.05rem; height: 1.05rem; accent-color: var(--forest); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: 0.65rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; }

/* Choice cards (radio) */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 720px) { .choice-grid { grid-template-columns: 1fr; } }
.choice-card {
  display: flex; gap: 0.8rem; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.1rem; cursor: pointer; background: #fff;
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}
html[data-theme="dark"] .choice-card { background: var(--gray-100); }
.choice-card:hover { border-color: var(--mint-border); }
.choice-card.selected { border-color: var(--forest); background: var(--mint-soft); box-shadow: 0 0 0 1px var(--forest); }
.choice-card input[type="radio"] { accent-color: var(--forest); margin-top: 0.25rem; width: 1.05rem; height: 1.05rem; }
.choice-card strong { display: block; font-size: 0.92rem; color: var(--heading); }
.choice-card small { color: var(--muted); font-size: 0.82rem; }
.choice-icon {
  width: 2rem; height: 2rem; border-radius: 8px; background: var(--gray-100);
  display: grid; place-items: center; flex-shrink: 0; color: var(--gray-600);
}
.choice-card.selected .choice-icon { background: #fff; color: var(--forest); }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.switch .track {
  width: 2.5rem; height: 1.45rem; border-radius: 999px;
  background: #dfe0d8; position: relative; transition: background 0.15s; flex-shrink: 0;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--forest); }
.switch input:checked + .track::after { transform: translateX(1.05rem); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(149,33,90,0.2); }
.switch-label { font-size: 0.88rem; color: var(--body); }

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border); border-radius: 12px;
  background: #fcfbf8; padding: 1.6rem; text-align: center;
}
html[data-theme="dark"] .dropzone { background: var(--gray-100); }
.dropzone-icon {
  width: 2.6rem; height: 2.6rem; border-radius: 10px; background: #fff;
  border: 1px solid var(--border); display: grid; place-items: center; margin: 0 auto 0.7rem; color: var(--gray-600);
}
.divider-or { display: flex; align-items: center; gap: 0.8rem; color: var(--muted); font-size: 0.82rem; margin: 0.4rem 0; }
.divider-or::before, .divider-or::after { content: ""; height: 1px; background: var(--border); flex: 1; }

/* Tabs */
.tabs { display: flex; gap: 1.4rem; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; }
.tab-btn {
  background: none; border: 0; padding: 0.7rem 0.1rem; font-size: 0.9rem; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-sans);
}
.tab-btn:hover { color: var(--heading); }
.tab-btn.active { color: var(--forest-ink); border-bottom-color: var(--forest); }
.tab-panel[hidden] { display: none !important; }

/* Buttons & chips */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  border: 1px solid transparent; border-radius: var(--radius-control);
  padding: 0.62rem 1.05rem; font-family: var(--font-sans);
  font-weight: 600; font-size: 0.9rem; cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.14s, box-shadow 0.14s;
  text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--forest); color: #fff; box-shadow: 0 1px 2px rgba(149,33,90,0.25); }
.btn-primary:hover { background: var(--forest-hover); color: #fff; }
.btn-secondary { background: var(--forest); color: #fff; }
.btn-secondary:hover { background: var(--forest-hover); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--heading); box-shadow: var(--shadow); }
.btn-ghost:hover { background: var(--gray-100); color: var(--heading); border-color: var(--gray-300); }
.btn-link { background: transparent; color: var(--forest); padding-left: 0.2rem; padding-right: 0.2rem; }
.btn-link:hover { color: var(--forest-hover); }
.btn-block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border-radius: var(--radius-pill); padding: 0.32rem 0.75rem;
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid transparent; font-family: var(--font-sans);
  background: var(--gray-100); color: var(--gray-700);
}
.chip-primary { background: var(--primary-soft); color: var(--forest); }
.chip-secondary { background: var(--secondary-soft); color: var(--secondary); }
.chip-outline { background: transparent; border-color: var(--border); color: var(--body); }

/* Alerts */
.alert { border-radius: var(--radius-control); padding: 0.85rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; font-size: 0.9rem; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert-danger { background: #fef1f0; color: var(--danger); border-color: #f5c6c0; }
.alert-success { background: #eaf6ee; color: var(--success); border-color: #b9dfc4; }
.alert-warning { background: #fff7e6; color: #8a6400; border-color: #ffe0a3; }

blockquote, .callout {
  margin: 0; padding: 0.9rem 1rem;
  border-left: 3px solid var(--forest);
  background: var(--mint-soft);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  color: var(--gray-700); font-size: 0.88rem;
}

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
html[data-theme="dark"] .table-wrap { background: var(--surface); }
table.dataTable, .orevan-table { width: 100% !important; border-collapse: collapse; font-size: 0.9rem; }
.orevan-table thead th, table.dataTable thead th {
  background: var(--table-head) !important;
  color: var(--gray-600) !important; font-weight: 600; font-size: 0.78rem;
  border-bottom: 1px solid var(--border) !important;
  padding: 0.75rem 1rem !important; text-align: left; white-space: nowrap;
}
.orevan-table tbody td, table.dataTable tbody td {
  border-bottom: 1px solid var(--border-soft); padding: 0.85rem 1rem !important; color: var(--body);
  vertical-align: middle; background: #fff;
}
html[data-theme="dark"] .orevan-table tbody td { background: var(--surface); }
.orevan-table tbody tr:last-child td { border-bottom: 0; }
.orevan-table tbody tr:hover td { background: #fcfbf7; }
html[data-theme="dark"] .orevan-table tbody tr:hover td { background: var(--gray-100); }

div.dt-buttons .dt-button, .dt-button {
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: var(--radius-control) !important; color: var(--heading) !important;
  padding: 0.45rem 0.8rem !important; margin: 0 0.25rem 0.75rem 0 !important;
}

/* Preview */
.preview-frame { width: 100%; min-height: 280px; border: 1px solid var(--border); border-radius: var(--radius-control); background: #fff; }
.preview-shell { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.preview-shell iframe { border: 0; width: 100%; min-height: 420px; display: block; }

/* Home stats — bordered strip like screenshot */
.stat-strip {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin: 1.8rem 0 0;
}
.stat-cell { padding: 1.1rem 1.4rem 1rem; border-left: 1px solid var(--border); }
.stat-cell:first-child { border-left: 0; padding-left: 0; }
.stat-cell .top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 0.86rem; margin-bottom: 0.5rem; }
.stat-cell .num { font-size: 2.4rem; font-weight: 700; color: var(--heading); line-height: 1; letter-spacing: -0.03em; }
.stat-cell .sub { font-size: 0.82rem; color: var(--muted); margin-top: 0.55rem; }
@media (max-width: 900px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } .stat-cell { border-left: 0; border-top: 1px solid var(--border); padding-left: 0; } }

/* legacy stat-grid kept working */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.85rem; margin-top: 1rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.stat-label { font-size: 0.76rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat-card strong, .stat-value { font-size: 1.45rem; color: var(--heading); font-weight: 700; }

.meta-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem 1.25rem; margin: 0; }
.meta-list dt { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.meta-list dd { margin: 0.15rem 0 0; color: var(--heading); }

.toast {
  position: fixed; top: 1rem; right: 1rem; z-index: 1000;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-control); padding: 0.75rem 1rem; box-shadow: var(--shadow-lg);
}

.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;
}

.simple-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.simple-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border-soft); }
.simple-list li:last-child { border-bottom: 0; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border-soft); }
.list-row:last-child { border-bottom: 0; }

.audience-summary { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.audience-list { margin: 0; padding-left: 1.1rem; font-size: 0.88rem; }
.chip-warn { background: #fff6e5; color: #8a6400; border: 1px solid #ffe0a3; }
.quill-host { min-height: 180px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-control); }
.quill-host .ql-editor { min-height: 160px; }
.ql-toolbar.ql-snow { border: 1px solid var(--border) !important; border-bottom: 0 !important; border-radius: 10px 10px 0 0; background: #fcfbf8; }
.quill-host.ql-container.ql-snow, .quill-host .ql-container { border-radius: 0 0 10px 10px; }

/* Status badges */
.status-badge {
  display: inline-flex; align-items: center; padding: 0.22rem 0.6rem;
  border-radius: 7px; font-size: 0.75rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--gray-100); color: var(--gray-600);
  white-space: nowrap; text-transform: capitalize;
}
.status-queued, .status-sending { background: #e8f0fe; color: #1a56db; border-color: #c3d6fb; }
.status-sent { background: var(--mint); color: var(--forest); border-color: var(--mint-border); }
.status-failed { background: #fef1f0; color: var(--danger); border-color: #f5c6c0; }
.status-draft { background: var(--gray-100); color: var(--gray-600); }
.status-scheduled { background: #fff4d6; color: #8a6400; border-color: #f5d98b; }
.status-cancelled { background: var(--gray-200); color: var(--gray-500); }
.status-skipped { background: #f3eef7; color: #6a1b9a; border-color: #e1bee7; }

/* Audience / validation */
.compose-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 1.4rem; align-items: start; }
.validation-sidebar, .validation-sidebar-inline { position: sticky; top: calc(var(--topbar-h) + 1rem); display: flex; flex-direction: column; gap: 1rem; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow); overflow: hidden; }
.side-card-head { padding: 1rem 1.2rem; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; gap: 0.55rem; font-weight: 650; color: var(--heading); font-size: 0.92rem; }
.side-card-body { padding: 1.2rem; }
.side-card-foot { padding: 0.9rem 1.2rem; border-top: 1px solid var(--border-soft); text-align: center; font-size: 0.85rem; }
.side-card-foot a { font-weight: 600; }

.audience-preview { border: 0; border-radius: 0; padding: 0; background: transparent; }
.audience-preview-header { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.65rem; }
.audience-preview-list { font-size: 0.9rem; max-height: 180px; overflow: auto; }
.audience-preview-invalid { margin-top: 0.65rem; padding-top: 0.65rem; border-top: 1px solid var(--border); font-size: 0.85rem; }
.validation-panel { margin-top: 0; min-height: 120px; }
.validation-panel.is-loading { opacity: 0.65; }
.validation-sidebar-head { border-radius: 10px; padding: 0.85rem 0.95rem; margin-bottom: 0.85rem; border: 1px solid var(--border); background: var(--gray-100); }
.validation-sidebar-head strong { display: block; font-size: 0.88rem; }
.validation-sidebar-head p { margin: 0.15rem 0 0; font-size: 0.82rem; }
.validation-sidebar-head.validation-ok { background: var(--mint-soft); border-color: var(--mint-border); color: var(--forest); }
.validation-sidebar-head.validation-bad { background: #fef1f0; border-color: #f5c6c0; color: var(--danger); }
.validation-sidebar-head.validation-empty { background: var(--gray-100); color: var(--gray-600); }
.validation-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-bottom: 0.85rem; border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; }
.validation-stats > div { padding: 0.65rem 0.4rem; display: flex; flex-direction: column; gap: 0.1rem; text-align: center; background: #fff; }
.validation-stats > div + div { border-left: 1px solid var(--border-soft); }
.validation-stats span { font-size: 0.68rem; text-transform: capitalize; letter-spacing: 0; color: var(--muted); font-weight: 500; }
.validation-stats strong { font-size: 1.3rem; color: var(--heading); }
.validation-sources { font-size: 0.8rem; margin-bottom: 0.85rem; color: var(--muted); }
.validation-section h3 { margin: 0 0 0.4rem; font-size: 0.88rem; }
.validation-issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; max-height: 240px; overflow: auto; }
.validation-issues li { border: 1px solid var(--border); border-radius: var(--radius-control); padding: 0.5rem 0.6rem; background: #fff; }
.validation-issue-meta { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.2rem; }

/* Inbox / template cards */
.inbox-mock { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.inbox-mock-head { background: var(--gray-100); padding: 0.6rem 1rem; font-size: 0.68rem; letter-spacing: 0.12em; font-weight: 700; color: var(--muted); }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.template-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.template-card-media { background: var(--mint-soft); padding: 1.2rem; }
.template-card-media .preview-shell, .template-card-media iframe, .template-card-media img { border-radius: 8px; }
.template-card-body { padding: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.template-card-body h3 { margin: 0; }
.template-card-body p { color: var(--muted); font-size: 0.88rem; margin: 0; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.checklist li { display: flex; align-items: center; gap: 0.7rem; font-size: 0.9rem; }
.checklist li a { margin-left: auto; color: var(--muted); }
.checklist .done { color: var(--forest); }

.promo-card { background: var(--mint-soft); border: 1px solid var(--mint-border); border-radius: var(--radius-card); overflow: hidden; }
.promo-card img { width: 100%; height: 190px; object-fit: cover; display: block; }
.promo-card-body { padding: 1.3rem; }
.promo-card-body .kicker { font-size: 0.68rem; letter-spacing: 0.18em; font-weight: 700; color: var(--forest); }
.promo-card-body h3 { font-size: 1.5rem; line-height: 1.2; margin: 0.5rem 0; }

.page-foot { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.82rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #1a9e50; display: inline-block; margin-right: 0.4rem; }

/* Guest / login */
.guest-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--page-bg); }
.guest-card { width: min(430px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 2rem 1.9rem; }
.guest-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.6rem; margin-bottom: 1.5rem; }
.guest-logo { width: min(200px, 65vw); height: auto; }
.guest-brand h1 { margin: 0; font-size: 1.6rem; }
.guest-brand p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.brand-bar { height: 4px; width: 100%; border-radius: var(--radius-pill); background: var(--brand-gradient); margin-bottom: 1.5rem; }

/* FilePond */
.filepond--panel-root { background-color: var(--mint-soft) !important; border-radius: var(--radius-control) !important; }
.filepond--drop-label { color: var(--body) !important; }

/* Mobile */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(19, 28, 23, 0.45); z-index: 35; }
.menu-toggle { display: none; }
@media (max-width: 1100px) {
  .compose-layout { grid-template-columns: 1fr; }
  .validation-sidebar, .validation-sidebar-inline { position: static; }
  .content-wrap { padding: 1.4rem 1.1rem 2.5rem; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); transform: translateX(-105%); transition: transform 0.22s ease; box-shadow: var(--shadow-lg); }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .app-shell.sidebar-open .sidebar-backdrop { display: block; }
  .menu-toggle { display: inline-flex; }
}

.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.35rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.w-100 { width: 100%; }
.text-muted { color: var(--muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: #8a6400 !important; }

.action-grid { display: grid; gap: 0.75rem; }
.action-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.15rem; border-radius: var(--radius-card);
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); color: var(--heading);
}
.action-card:hover { border-color: var(--mint-border); box-shadow: var(--shadow-lg); }
.list-clean { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.list-item { display: block; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: var(--heading); }
.list-item:hover { background: var(--mint-soft); border-color: var(--mint-border); }
.pre-block { font-family: var(--font-mono); background: #131c17; color: #eef2ee; border-radius: var(--radius-card); padding: 1rem 1.15rem; overflow: auto; }
