/* ============================================================
   Relay Campaign — Modern SaaS Design System
   Slate + cream palette, blue accent, lime highlights
   Collapsible sidebar layout, balanced density
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ===== Palette ===== */
  --slate-950: #0f1419;
  --slate-900: #1a2029;
  --slate-800: #252d38;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;

  --blue-300: #a8d1ff;
  --blue-400: #5b9cf5;
  --blue-500: #4080d4;
  --blue-600: #3b82f6;

  --green-300: #d0f18d;
  --green-400: #c4ee6d;
  --green-500: #afe73f;
  --green-600: #93c72b;
  --green-700: #7aa821;
  --green-subtle: rgba(175, 231, 63, 0.1);

  --cream: #f8fafc;
  --warm-100: #f1f5f9;
  --warm-200: #e2e8f0;
  --white: #fff;

  /* ===== Semantic roles ===== */
  --bg-page: var(--cream);
  --bg-cool: #f4f5f7;
  --bg-surface: var(--white);
  --bg-muted: var(--warm-100);
  --bg-hover: var(--warm-100);
  --bg-dark: var(--slate-900);
  --bg-darker: var(--slate-950);

  --text-heading: var(--slate-900);
  --text-body: var(--slate-700);
  --text-muted: var(--slate-600);
  --text-faint: var(--slate-500);
  --text-on-dark: var(--slate-100);
  --text-on-dark-muted: var(--slate-400);

  --accent: var(--blue-500);
  --accent-hover: var(--blue-600);
  --accent-subtle: rgba(64, 128, 212, 0.08);

  --border-light: var(--slate-200);
  --border-lighter: var(--warm-200);
  --border-dark: rgba(255, 255, 255, 0.08);
  --border-dark-strong: rgba(255, 255, 255, 0.12);

  /* Status — tuned to palette */
  --status-success: var(--green-700);
  --status-success-bg: var(--green-subtle);
  --status-success-border: rgba(175, 231, 63, 0.3);

  --status-info: var(--blue-500);
  --status-info-bg: var(--accent-subtle);
  --status-info-border: rgba(64, 128, 212, 0.2);

  --status-warn: #b45309;
  --status-warn-bg: #fef3c7;
  --status-warn-border: #fcd34d;

  --status-danger: #b91c1c;
  --status-danger-bg: #fef2f2;
  --status-danger-border: #fecaca;

  /* ===== Sizing ===== */
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 58px;
  --topbar-h: 56px;

  /* ===== Legacy aliases (keeps old templates working) ===== */
  --d-bg: var(--bg-page);
  --d-surface: var(--bg-surface);
  --d-surface-alt: var(--bg-muted);
  --d-surface-hover: var(--bg-hover);
  --d-border: var(--border-light);
  --d-border-strong: var(--slate-300);
  --d-border-subtle: var(--border-lighter);
  --d-text: var(--text-heading);
  --d-text-sec: var(--text-body);
  --d-text-tri: var(--text-faint);
  --d-primary: var(--accent);
  --d-primary-hover: var(--accent-hover);
  --d-primary-lt: var(--accent-subtle);
  --d-primary-lt-2: var(--accent-subtle);
  --d-success: var(--status-success);
  --d-success-lt: var(--status-success-bg);
  --d-warn: var(--status-warn);
  --d-warn-lt: var(--status-warn-bg);
  --d-danger: var(--status-danger);
  --d-danger-lt: var(--status-danger-bg);

  /* ===== Radii ===== */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 14px;

  /* ===== Shadows ===== */
  --shadow-xs: 0 1px 2px rgb(15 20 25 / 0.04);
  --shadow-sm: 0 1px 2px rgb(15 20 25 / 0.04), 0 1px 3px rgb(15 20 25 / 0.06);
  --shadow-md:
    0 4px 8px -2px rgb(15 20 25 / 0.06), 0 2px 4px -1px rgb(15 20 25 / 0.04);
  --shadow-lg:
    0 12px 24px -6px rgb(15 20 25 / 0.08), 0 4px 8px -2px rgb(15 20 25 / 0.05);
  --shadow-ring: 0 0 0 3px rgb(64 128 212 / 0.15);
  --shadow-ring-danger: 0 0 0 3px rgb(185 28 28 / 0.15);

  /* ===== Fonts ===== */
  --f-sans:
    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;

  /* ===== Transitions ===== */
  --trans-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --trans-base: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-body);
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  font-feature-settings: 'cv11', 'ss01';
}

code,
pre,
.mono,
kbd {
  font-family: var(--f-mono);
  font-size: 0.9em;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--trans-fast);
}
a:hover {
  color: var(--accent-hover);
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  margin: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 16px 0;
}

::selection {
  background: var(--green-subtle);
  color: var(--slate-900);
}

kbd {
  padding: 2px 6px;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 11px;
  box-shadow: inset 0 -1px 0 var(--border-light);
}

/* ============================================================
   APP SHELL — Sidebar + Topbar + Main
   ============================================================ */

.rc-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns var(--trans-base);
}
.rc-shell--collapsed {
  grid-template-columns: var(--sidebar-w-collapsed) 1fr;
}

/* ===== Sidebar ===== */
.rc-sidebar {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--border-dark);
}

.rc-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: var(--topbar-h);
  padding: 0 14px;
  border-bottom: 1px solid var(--border-dark);
}
.rc-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-on-dark);
  text-decoration: none;
  letter-spacing: -0.01em;
  overflow: hidden;
  white-space: nowrap;
}
.rc-sidebar-brand:hover {
  color: var(--text-on-dark);
  text-decoration: none;
}
.rc-sidebar-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--green-500);
  color: var(--slate-950);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.rc-shell--collapsed .rc-sidebar-brand span {
  display: none;
}

.rc-sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--text-on-dark-muted);
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-fast);
  flex-shrink: 0;
}
.rc-sidebar-toggle:hover {
  background: var(--border-dark-strong);
  color: var(--text-on-dark);
}
.rc-shell--collapsed .rc-sidebar-toggle {
  transform: rotate(180deg);
}

/* Navigation */
.rc-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rc-sidebar-section {
  padding: 10px 10px 4px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-on-dark-muted);
  white-space: nowrap;
  overflow: hidden;
}
.rc-shell--collapsed .rc-sidebar-section {
  opacity: 0;
  height: 4px;
  padding: 0;
}

.rc-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  color: var(--text-on-dark-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--r-sm);
  transition: all var(--trans-fast);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.rc-sidebar-link i {
  font-size: 15px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  color: var(--text-on-dark-muted);
  transition: color var(--trans-fast);
}
.rc-sidebar-link:hover {
  background: var(--border-dark);
  color: var(--text-on-dark);
  text-decoration: none;
}
.rc-sidebar-link:hover i {
  color: var(--text-on-dark);
}

.rc-sidebar-link--active {
  background: var(--border-dark-strong);
  color: var(--white);
}
.rc-sidebar-link--active i {
  color: var(--green-500);
}
.rc-sidebar-link--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: var(--green-500);
  border-radius: 0 2px 2px 0;
}

.rc-shell--collapsed .rc-sidebar-link {
  justify-content: center;
  padding: 8px 0;
}
.rc-shell--collapsed .rc-sidebar-link span {
  display: none;
}

/* Tooltip for collapsed sidebar */
.rc-shell--collapsed .rc-sidebar-link:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--slate-900);
  color: var(--text-on-dark);
  padding: 5px 9px;
  border-radius: var(--r-sm);
  font-size: 12px;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-dark-strong);
  z-index: 100;
  pointer-events: none;
}

/* Sidebar footer / user */
.rc-sidebar-foot {
  border-top: 1px solid var(--border-dark);
  padding: 10px;
}
.rc-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  color: var(--text-on-dark-muted);
  text-decoration: none;
  transition: all var(--trans-fast);
  position: relative;
}
.rc-sidebar-user:hover {
  background: var(--border-dark);
  color: var(--text-on-dark);
  text-decoration: none;
}
.rc-sidebar-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-500));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.rc-sidebar-user-meta {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  overflow: hidden;
}
.rc-sidebar-user-name {
  color: var(--text-on-dark);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-sidebar-user-email {
  font-size: 11px;
  color: var(--text-on-dark-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-shell--collapsed .rc-sidebar-user-meta,
.rc-shell--collapsed .rc-sidebar-user-action {
  display: none;
}

/* ===== Content Area ===== */
.rc-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.rc-topbar {
  height: var(--topbar-h);
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.rc-topbar-crumb {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rc-topbar-crumb-sep {
  color: var(--text-faint);
}
.rc-topbar-crumb-current {
  color: var(--text-heading);
  font-weight: 600;
}
.rc-topbar-spacer {
  flex: 1;
}

.rc-main {
  padding: 28px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
}

/* ===== Mobile ===== */
@media (max-width: 900px) {
  .rc-shell {
    grid-template-columns: 1fr;
  }
  .rc-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--trans-base);
    box-shadow: var(--shadow-lg);
  }
  .rc-shell--mobile-open .rc-sidebar {
    transform: translateX(0);
  }
  .rc-shell--mobile-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgb(15 20 25 / 0.35);
    z-index: 150;
    backdrop-filter: blur(2px);
  }
  .rc-mobile-toggle {
    display: inline-flex !important;
  }
  .rc-main {
    padding: 20px 16px;
  }
  .rc-topbar {
    padding: 0 16px;
  }
}
.rc-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-body);
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ============================================================
   COMMAND BAR (page header)
   ============================================================ */

.cc-command-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.cc-command-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.cc-command-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.cc-command-title i {
  color: var(--text-muted);
  font-size: 20px;
}
.cc-command-sub {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}
.cc-command-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================
   CARDS
   ============================================================ */

.cc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition:
    box-shadow var(--trans-base),
    border-color var(--trans-base);
}
.cc-card--light {
  background: var(--bg-muted);
}

.cc-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cc-card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cc-card-ico {
  color: var(--text-muted);
  font-size: 15px;
}
.cc-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}
.cc-card-body {
  padding: 18px;
}
.cc-card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--f-sans);
  color: var(--text-body);
  background: var(--bg-muted);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--trans-fast);
  letter-spacing: -0.005em;
  white-space: nowrap;
  height: 32px;
}
.cc-btn:hover {
  background: var(--slate-200);
  color: var(--text-heading);
  text-decoration: none;
}
.cc-btn:active {
  transform: translateY(0.5px);
}
.cc-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-ring);
}
.cc-btn:disabled,
.cc-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.cc-btn--primary {
  color: var(--white);
  background: var(--blue-500);
  border-color: transparent;
  font-weight: 500;
}
.cc-btn--primary:hover {
  color: var(--white);
  background: var(--blue-600);
}

.cc-btn--dark {
  color: var(--white);
  background: var(--slate-900);
  border-color: transparent;
  font-weight: 500;
}
.cc-btn--dark:hover {
  color: var(--white);
  background: var(--slate-800);
}

.cc-btn--danger {
  color: var(--white);
  background: var(--status-danger);
  border-color: transparent;
}
.cc-btn--danger:hover {
  color: var(--white);
  background: #991b1b;
}
.cc-btn--danger:focus-visible {
  box-shadow: var(--shadow-ring-danger);
}

.cc-btn--ghost {
  border-color: transparent;
  background: transparent;
}
.cc-btn--ghost:hover {
  background: var(--bg-muted);
  border-color: transparent;
}

.cc-btn--sm {
  padding: 3px 9px;
  font-size: 12px;
  gap: 4px;
  height: 26px;
}
.cc-btn--lg {
  padding: 9px 16px;
  font-size: 14px;
  height: 38px;
}

/* ============================================================
   FORMS
   ============================================================ */

.cc-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-body);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.cc-req {
  color: var(--status-danger);
  font-weight: 500;
}

.cc-input,
.cc-select {
  width: 100%;
  padding: 7px 11px;
  font-size: 13.5px;
  font-family: var(--f-sans);
  color: var(--text-heading);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  outline: none;
  transition: all var(--trans-fast);
  height: 34px;
}
textarea.cc-input {
  height: auto;
  min-height: 80px;
  line-height: 1.5;
}
.cc-input::placeholder {
  color: var(--text-faint);
}
.cc-input:hover,
.cc-select:hover {
  border-color: var(--slate-300);
}
.cc-input:focus,
.cc-select:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-ring);
}
.cc-input[disabled],
.cc-select[disabled] {
  background: var(--bg-muted);
  color: var(--text-faint);
  cursor: not-allowed;
}

.cc-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.cc-check {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.cc-check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-body);
  cursor: pointer;
  user-select: none;
}

.cc-form-group {
  margin-bottom: 14px;
  flex: 1;
  min-width: 0;
}
.cc-form-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cc-form-row > .cc-form-group {
  margin-bottom: 0;
}

/* ============================================================
   TABLES
   ============================================================ */

.cc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.cc-table thead {
  background: var(--bg-muted);
}
.cc-table th {
  padding: 9px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.cc-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-lighter);
  vertical-align: middle;
  color: var(--text-body);
}
.cc-table tbody tr {
  transition: background var(--trans-fast);
}
.cc-table tbody tr:hover {
  background: var(--bg-muted);
}
.cc-table tbody tr:last-child td {
  border-bottom: none;
}
.cc-table strong {
  color: var(--text-heading);
  font-weight: 500;
}

/* ============================================================
   BADGES & STATUS
   ============================================================ */

.cc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  letter-spacing: 0.01em;
  line-height: 1.6;
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.cc-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.cc-status i {
  font-size: 9px;
}
.cc-status--active {
  color: var(--status-success);
}
.cc-status--inactive {
  color: var(--text-faint);
}
.cc-status--warning {
  color: var(--status-warn);
}
.cc-status--danger {
  color: var(--status-danger);
}
.cc-status--draft {
  color: var(--text-faint);
}
.cc-status--scheduled {
  color: var(--status-info);
}
.cc-status--sending {
  color: var(--status-warn);
}
.cc-status--sent {
  color: var(--status-success);
}
.cc-status--failed {
  color: var(--status-danger);
}
.cc-status--paused {
  color: var(--text-faint);
}
.cc-status--cancelled {
  color: var(--text-faint);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.rc-empty {
  padding: 56px 32px;
  text-align: center;
  border: 1px dashed var(--border-light);
  border-radius: var(--r-lg);
  background: var(--bg-muted);
}
.rc-empty > i {
  display: block;
  font-size: 36px;
  color: var(--text-faint);
  margin-bottom: 14px;
  line-height: 1;
}
.rc-empty .cc-btn i {
  font-size: inherit;
  display: inline;
  margin: 0;
  color: inherit;
  line-height: inherit;
}
.rc-empty h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0 0 6px;
}
.rc-empty p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 18px;
}

/* ============================================================
   HELPERS
   ============================================================ */

.cc-text-muted {
  color: var(--text-muted);
  font-size: 12.5px;
}
.cc-text-tri {
  color: var(--text-faint);
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */

.rc-flash-container {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alert {
  border: 1px solid;
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.alert-success {
  background: var(--status-success-bg);
  border-color: var(--status-success-border);
  color: var(--status-success);
}
.alert-danger {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  color: var(--status-danger);
}
.alert-warning {
  background: var(--status-warn-bg);
  border-color: var(--status-warn-border);
  color: var(--status-warn);
}
.alert-info {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  color: var(--status-info);
}

.btn-close {
  background: none;
  border: none;
  color: currentColor;
  opacity: 0.5;
  font-size: 16px;
  padding: 0;
  margin-left: auto;
  cursor: pointer;
  line-height: 1;
}
.btn-close:hover {
  opacity: 1;
}

/* ============================================================
   MODALS
   ============================================================ */

.cc-modal {
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl) !important;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cc-modal-h {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
}
.cc-modal-ico {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cc-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}
.cc-modal-sub {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.cc-modal-body {
  padding: 18px;
}
.cc-modal-f {
  padding: 12px 18px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-muted);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-content {
  border: none !important;
  border-radius: var(--r-xl);
}
.modal-backdrop.show {
  opacity: 0.35;
}

.dropdown-menu {
  border: 1px solid var(--border-light);
  border-radius: var(--r-md) !important;
  box-shadow: var(--shadow-md);
  padding: 4px;
  font-size: 13px;
  margin-top: 4px !important;
}
.dropdown-item {
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-body);
  display: flex;
  align-items: center;
  gap: 10px;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--bg-muted);
  color: var(--text-heading);
}
.dropdown-item i {
  color: var(--text-faint);
  font-size: 14px;
  width: 16px;
  text-align: center;
}
.dropdown-divider {
  margin: 4px 0;
  border-color: var(--border-light);
}

/* ============================================================
   EDITOR
   ============================================================ */

.cc-editor {
  padding: 18px;
  min-height: 300px;
  background: var(--bg-surface);
  outline: none;
  font-size: 14px;
  line-height: 1.55;
  font-family: var(--f-sans);
  color: var(--text-body);
}
.cc-editor:focus {
  outline: none;
}

/* ============================================================
   DASHBOARD STATS
   ============================================================ */

.rc-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.rc-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  transition: all var(--trans-base);
}
.rc-stat-card:hover {
  border-color: var(--slate-300);
  box-shadow: var(--shadow-sm);
}
.rc-stat-label {
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.rc-stat-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-feature-settings: 'tnum' 1;
  font-family: var(--f-sans);
}
.rc-stat-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 6px;
}
.rc-stat-sub a {
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.rc-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-page);
  position: relative;
}
.rc-login-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(
      circle at 25% 15%,
      rgba(64, 128, 212, 0.06) 0%,
      transparent 45%
    ),
    radial-gradient(
      circle at 75% 85%,
      rgba(175, 231, 63, 0.08) 0%,
      transparent 45%
    );
  pointer-events: none;
}
.rc-login-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(15, 20, 25, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 20, 25, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    black 20%,
    transparent 70%
  );
  pointer-events: none;
}

.rc-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px 32px 28px;
  position: relative;
  z-index: 1;
}
.rc-login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  color: var(--text-heading);
}
.rc-login-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--slate-900);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-500);
  font-size: 18px;
}
.rc-login-heading {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}
.rc-login-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ============================================================
   PAGE LOAD ANIMATION
   ============================================================ */

@keyframes rc-fade-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.rc-main > * {
  animation: rc-fade-in 220ms ease-out;
}

/* ============================================================
   SCROLLBARS (subtle)
   ============================================================ */

.rc-sidebar-nav::-webkit-scrollbar {
  width: 6px;
}
.rc-sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.rc-sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-dark-strong);
  border-radius: 3px;
}
.rc-sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--slate-600);
}
