@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

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

/* ================================================================
   DESIGN TOKENS — LIGHT MODE (DEFAULT)
   ================================================================ */
:root,
html[data-theme="light"] {
  /* Surfaces */
  --bg:           #F5F5F5;
  --bg2:          #FFFFFF;
  --bg3:          #F9F9F9;
  --bg4:          #FAFAFA;

  /* Borders */
  --border:       #EEEEEE;
  --border2:      #E0E0E0;

  /* Text */
  --text:         #0E0E0E;
  --text2:        #888888;
  --text3:        #BBBBBB;

  /* Brand accent */
  --accent:       #F30304;
  --accent-h:     #CC0203;
  --accent-bg:    rgba(243,3,4,0.07);
  --accent-brd:   rgba(243,3,4,0.22);

  /* Semantic */
  --green:        #00C896;
  --green-bg:     rgba(0,200,150,0.10);
  --red:          #F30304;
  --red-bg:       rgba(243,3,4,0.07);
  --yellow:       #FFB800;
  --yellow-bg:    rgba(255,184,0,0.10);
  --blue:         #4A9EFF;
  --blue-bg:      rgba(74,158,255,0.10);
  --purple:       #9B59B6;
  --purple-bg:    rgba(155,89,182,0.10);
  --orange:       #FF6B6B;
  --orange-bg:    rgba(255,107,107,0.10);

  /* Layout */
  --sidebar-w:    240px;
  --header-h:     64px;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-xs:    4px;

  /* Shadows */
  --shadow-card:  0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg:    0 8px 28px rgba(0,0,0,0.10);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.14);

  /* Topbar */
  --topbar-bg:    #FFFFFF;
  --topbar-border:#EEEEEE;
  --topbar-blur:  rgba(255,255,255,0.92);

  --transition:   150ms ease;
}

/* ================================================================
   DESIGN TOKENS — DARK MODE
   ================================================================ */
html[data-theme="dark"] {
  --bg:           #101010;
  --bg2:          #1a1a1a;
  --bg3:          #222222;
  --bg4:          #2a2a2a;
  --border:       #2a2a2a;
  --border2:      #333333;
  --text:         #F0F0F0;
  --text2:        #888888;
  --text3:        #555555;
  --accent:       #F30304;
  --accent-h:     #CC0203;
  --accent-bg:    rgba(243,3,4,0.12);
  --accent-brd:   rgba(243,3,4,0.30);
  --green:        #00C896;
  --green-bg:     rgba(0,200,150,0.12);
  --red:          #F30304;
  --red-bg:       rgba(243,3,4,0.12);
  --yellow:       #FFB800;
  --yellow-bg:    rgba(255,184,0,0.12);
  --blue:         #4A9EFF;
  --blue-bg:      rgba(74,158,255,0.12);
  --purple:       #9B59B6;
  --purple-bg:    rgba(155,89,182,0.12);
  --orange:       #FF6B6B;
  --orange-bg:    rgba(255,107,107,0.12);
  --shadow-card:  0 2px 12px rgba(0,0,0,0.40);
  --shadow-lg:    0 8px 28px rgba(0,0,0,0.50);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.60);
  --topbar-bg:    #1a1a1a;
  --topbar-border:#2a2a2a;
  --topbar-blur:  rgba(26,26,26,0.92);
}

/* ================================================================
   BASE
   ================================================================ */
html { font-size: 14px; }

body {
  font-family: 'Montserrat', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ================================================================
   LAYOUT
   ================================================================ */
.layout { display: flex; min-height: 100vh; }

/* ================================================================
   SIDEBAR — always dark regardless of theme toggle
   ================================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: #111111;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: var(--header-h);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 30px; height: 30px;
  background: #F30304;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

.sidebar-logo .logo-text {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logo .logo-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  background: #F30304;
  color: #ffffff;
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.sidebar-section {
  padding: 12px 0;
  flex: 1;
}

.sidebar-section-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 6px 20px 4px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  margin: 1px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,0.60);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  border-left: 3px solid transparent;
}

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

.nav-item.active {
  background: rgba(243,3,4,0.15);
  color: #ffffff;
  font-weight: 600;
  border-left-color: #F30304;
  margin-left: 10px;
  padding-left: 17px;
}

.nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 12px 10px;
  flex-shrink: 0;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition);
}

.user-card:hover { background: rgba(255,255,255,0.07); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #F30304;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-info { flex: 1; min-width: 0; }
.user-info .user-name {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-info .user-role {
  font-size: 10px;
  color: rgba(255,255,255,0.40);
  font-weight: 500;
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ================================================================
   TOPBAR
   ================================================================ */
.topbar {
  height: var(--header-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--topbar-border);
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.topbar-spacer { flex: 1; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
}

.notif-btn:hover { background: var(--bg3); color: var(--text); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #F30304;
  border: 2px solid var(--topbar-bg);
}

/* ================================================================
   PAGE CONTENT
   ================================================================ */
.page-content {
  padding: 28px;
  flex: 1;
}

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

.page-header-left h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-header-left p {
  font-size: 13px;
  color: var(--text2);
  margin-top: 4px;
  font-weight: 400;
}

/* ================================================================
   STAT CARDS
   ================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 4px solid var(--sc-color, #F30304);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  box-shadow: 0 4px 20px var(--sc-shadow, rgba(243,3,4,0.10));
  transition: transform 0.20s ease, box-shadow 0.20s ease;
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px var(--sc-shadow, rgba(243,3,4,0.18));
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--sc-color, #F30304);
  letter-spacing: -0.04em;
  line-height: 1;
  font-family: 'Montserrat', sans-serif;
}

.stat-change {
  font-size: 11px;
  color: var(--text2);
  margin-top: 8px;
  font-weight: 500;
}

/* Colour helpers — set via inline style="--sc-color:X;--sc-shadow:Y" */
/* Predefined classes for convenience */
.sc-red    { --sc-color: #F30304; --sc-shadow: rgba(243,3,4,0.12); }
.sc-green  { --sc-color: #00C896; --sc-shadow: rgba(0,200,150,0.12); }
.sc-yellow { --sc-color: #FFB800; --sc-shadow: rgba(255,184,0,0.12); }
.sc-blue   { --sc-color: #4A9EFF; --sc-shadow: rgba(74,158,255,0.12); }
.sc-orange { --sc-color: #FF6B6B; --sc-shadow: rgba(255,107,107,0.12); }
.sc-purple { --sc-color: #9B59B6; --sc-shadow: rgba(155,89,182,0.12); }
.sc-teal   { --sc-color: #00BCD4; --sc-shadow: rgba(0,188,212,0.12); }
.sc-gray   { --sc-color: #888888; --sc-shadow: rgba(0,0,0,0.08); }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
  font-weight: 400;
}

.card-body { padding: 24px; }

/* ================================================================
   TABLES
   ================================================================ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
}

thead tr { border-bottom: 1px solid var(--border); }

thead th {
  background: #F9F9F9;
  padding: 11px 18px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

html[data-theme="dark"] thead th { background: var(--bg3); }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #FEFAFA; }
html[data-theme="dark"] tbody tr:hover { background: var(--bg3); }

tbody td {
  padding: 13px 18px;
  color: var(--text2);
  vertical-align: middle;
}

.cell-primary { color: var(--text); font-weight: 600; font-size: 13px; }
.cell-sub { font-size: 11px; color: var(--text3); margin-top: 2px; font-weight: 400; }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-family: 'Montserrat', sans-serif;
}

.badge-active    { background: rgba(0,200,150,0.12); color: #00C896; }
.badge-trial     { background: rgba(255,184,0,0.12);  color: #FFB800; }
.badge-suspended { background: rgba(243,3,4,0.10);    color: #F30304; }
.badge-cancelled { background: rgba(0,0,0,0.06);      color: var(--text3); }
.badge-superadmin{ background: rgba(243,3,4,0.10);    color: #F30304; }
.badge-admin     { background: rgba(74,158,255,0.12); color: #4A9EFF; }
.badge-manager   { background: rgba(0,200,150,0.12);  color: #00C896; }
.badge-staff     { background: rgba(0,0,0,0.06);      color: var(--text2); }
.badge-gray      { background: rgba(0,0,0,0.06);      color: var(--text2); }

html[data-theme="dark"] .badge-cancelled,
html[data-theme="dark"] .badge-staff,
html[data-theme="dark"] .badge-gray {
  background: rgba(255,255,255,0.08);
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
  line-height: 1;
  letter-spacing: -0.01em;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: #F30304;
  color: #ffffff;
  border-color: #F30304;
}
.btn-primary:hover { background: #CC0203; border-color: #CC0203; color: #ffffff; }

.btn-secondary {
  background: #ffffff;
  color: #F30304;
  border-color: #F30304;
}
.btn-secondary:hover { background: rgba(243,3,4,0.05); color: #F30304; }
html[data-theme="dark"] .btn-secondary { background: var(--bg3); }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }

.btn-danger {
  background: rgba(243,3,4,0.08);
  color: #F30304;
  border-color: rgba(243,3,4,0.25);
}
.btn-danger:hover { background: #F30304; color: #ffffff; }

.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-lg  { padding: 11px 22px; font-size: 14px; }
.btn-icon { padding: 8px; }

/* ================================================================
   FORMS
   ================================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.form-label.required::after { content: ' *'; color: #F30304; }

.form-control {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  border-color: #F30304;
  box-shadow: 0 0 0 3px rgba(243,3,4,0.10);
}

.form-control::placeholder { color: var(--text3); }
select.form-control option { background: var(--bg2); }

.form-error { font-size: 11px; color: #F30304; margin-top: 5px; font-weight: 500; }
.form-hint  { font-size: 11px; color: var(--text3); margin-top: 4px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
}

.alert-success { background: rgba(0,200,150,0.10);  color: #00C896; border-color: rgba(0,200,150,0.25); }
.alert-error   { background: rgba(243,3,4,0.08);    color: #F30304; border-color: rgba(243,3,4,0.22); }
.alert-warning { background: rgba(255,184,0,0.10);  color: #FFB800; border-color: rgba(255,184,0,0.25); }
.alert-info    { background: rgba(74,158,255,0.10); color: #4A9EFF; border-color: rgba(74,158,255,0.25); }

.alert .alert-close {
  margin-left: auto;
  cursor: pointer;
  opacity: 0.7;
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}
.alert .alert-close:hover { opacity: 1; }

/* ================================================================
   MODALS
   ================================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-modal);
  animation: modalIn 200ms ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(-12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-title { font-size: 15px; font-weight: 700; color: var(--text); }

.modal-close {
  background: none; border: none;
  color: var(--text3); font-size: 20px;
  cursor: pointer; padding: 4px; line-height: 1;
  border-radius: 4px; transition: all var(--transition);
  font-family: sans-serif;
}
.modal-close:hover { background: var(--bg3); color: var(--text); }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px 20px;
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--border);
}

/* ================================================================
   FILTER BAR / SEARCH
   ================================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.search-input-wrap svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
  width: 14px; height: 14px;
}

.search-input-wrap .form-control { padding-left: 34px; }

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}

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

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text2);
  transition: all var(--transition);
  font-family: 'Montserrat', sans-serif;
}

.page-btn:hover { background: var(--bg3); color: var(--text); }
.page-btn.active { background: #F30304; color: #ffffff; border-color: #F30304; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-icon {
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  background: var(--bg3);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
}

.empty-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-desc  { font-size: 13px; color: var(--text2); margin-bottom: 20px; }

/* ================================================================
   DROPDOWN
   ================================================================ */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + 6px);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 168px;
  z-index: 300;
  overflow: hidden;
}

.dropdown-menu.open { display: block; animation: dropIn 180ms ease; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Montserrat', sans-serif;
}

.dropdown-item:hover { background: var(--bg3); color: var(--text); }
.dropdown-item.danger:hover { background: rgba(243,3,4,0.08); color: #F30304; }

.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ================================================================
   UTILITY
   ================================================================ */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

.flex          { display: flex; }
.flex-1        { flex: 1; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4  { margin-top: 16px; }
.mb-4  { margin-bottom: 16px; }
.w-full { width: 100%; }

.text-muted    { color: var(--text3); }
.text-secondary{ color: var(--text2); }
.text-success  { color: #00C896; }
.text-danger   { color: #F30304; }
.text-warning  { color: #FFB800; }
.text-accent   { color: var(--accent); }
.text-sm       { font-size: 12px; }
.font-mono     { font-family: 'Courier New', monospace; font-size: 12px; }
.font-bold     { font-weight: 700; }

/* ================================================================
   ACTIVITY FEED
   ================================================================ */
.activity-feed { display: flex; flex-direction: column; }

.activity-item {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #F30304;
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-content { flex: 1; }
.activity-action { font-size: 13px; color: var(--text); font-weight: 500; }
.activity-meta   { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ================================================================
   PLAN CARDS
   ================================================================ */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.plan-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
}

.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.plan-name  { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.plan-price {
  font-size: 30px;
  font-weight: 800;
  color: #F30304;
  letter-spacing: -0.04em;
  line-height: 1;
}
.plan-price span { font-size: 13px; font-weight: 400; color: var(--text2); }

.plan-features { list-style: none; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }

.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}

.plan-features li::before {
  content: '';
  width: 16px; height: 16px;
  background: rgba(0,200,150,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300C896' stroke-width='3'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 10px;
  background-repeat: no-repeat;
  background-position: center;
}

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  min-width: 280px;
  max-width: 400px;
  animation: toastIn 250ms ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast.success { border-left: 3px solid #00C896; }
.toast.error   { border-left: 3px solid #F30304; }

/* ================================================================
   AUTH PAGES
   ================================================================ */
.auth-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111111;
  position: relative;
  overflow: hidden;
}

.auth-bg::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243,3,4,0.07) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.auth-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.auth-card {
  background: #1c1c1c;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 36px;
}

.auth-logo .logo-icon {
  width: 40px; height: 40px;
  background: #F30304;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
}

.auth-logo .logo-text {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.auth-title    { font-size: 22px; font-weight: 700; color: #ffffff; margin-bottom: 6px; letter-spacing: -0.02em; }
.auth-subtitle { font-size: 13px; color: rgba(255,255,255,0.45); margin-bottom: 28px; font-weight: 400; }

/* Auth form inputs on dark background */
.auth-card .form-control {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #ffffff;
}

.auth-card .form-control:focus {
  border-color: #F30304;
  box-shadow: 0 0 0 3px rgba(243,3,4,0.18);
}

.auth-card .form-control::placeholder { color: rgba(255,255,255,0.30); }
.auth-card .form-label { color: rgba(255,255,255,0.70); }

/* ================================================================
   PROGRESS BAR
   ================================================================ */
.progress { height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.progress-bar { height: 100%; background: #F30304; border-radius: 2px; transition: width 0.4s ease; }

/* ================================================================
   WELCOME BANNER
   ================================================================ */
.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

.welcome-greeting {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.welcome-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.welcome-company {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.welcome-date {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}

.plan-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
}
.plan-pill.sc-blue   { background: var(--blue-bg);   color: var(--blue);   border: 1px solid rgba(74,158,255,0.25); }
.plan-pill.sc-green  { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(0,200,150,0.25); }
.plan-pill.sc-purple { background: var(--purple-bg); color: var(--purple); border: 1px solid rgba(155,89,182,0.25); }
.plan-pill.sc-orange { background: var(--orange-bg); color: var(--orange); border: 1px solid rgba(255,107,107,0.25); }
.plan-pill.sc-gray   { background: var(--bg3);       color: var(--text2);  border: 1px solid var(--border); }
.plan-pill.sc-red    { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(243,3,4,0.20); }

.welcome-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ================================================================
   CONTACT AVATAR (small, in tables)
   ================================================================ */
.contact-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ================================================================
   CONTACT STATUS BADGES
   ================================================================ */
.badge-contact-lead     { background: var(--bg3);       color: var(--text2);  border: 1px solid var(--border); }
.badge-contact-prospect { background: var(--blue-bg);   color: var(--blue);   border: 1px solid rgba(74,158,255,0.25); }
.badge-contact-customer { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(0,200,150,0.25); }
.badge-contact-churned  { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(243,3,4,0.20); }

/* ================================================================
   CAMPAIGN STATUS BADGES
   ================================================================ */
.badge-campaign-draft     { background: var(--bg3);       color: var(--text2);  border: 1px solid var(--border); }
.badge-campaign-scheduled { background: var(--blue-bg);   color: var(--blue);   border: 1px solid rgba(74,158,255,0.25); }
.badge-campaign-sending   { background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(255,184,0,0.25); }
.badge-campaign-sent      { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(0,200,150,0.25); }
.badge-campaign-cancelled { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(243,3,4,0.20); }

/* ================================================================
   RATE BAR (open rate / click rate in campaigns table)
   ================================================================ */
.rate-bar-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}
.rate-bar {
  width: 60px;
  height: 5px;
  border-radius: 3px;
  background: var(--border2);
  position: relative;
  overflow: hidden;
}
.rate-bar::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--rate, 0%);
  background: inherit;
  border-radius: 3px;
}
.rate-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  min-width: 30px;
}

/* ================================================================
   TASK LIST WIDGET
   ================================================================ */
.task-list {
  display: flex;
  flex-direction: column;
  padding: 0 0 8px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--bg3); }

.task-check {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
}
.task-check input { display: none; }
.task-checkmark {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border2);
  border-radius: 4px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.task-check input:checked + .task-checkmark {
  background: var(--green);
  border-color: var(--green);
}
.task-check input:checked + .task-checkmark::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta  { display: flex; align-items: center; gap: 5px; margin-top: 3px; }

.priority-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.priority-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.task-overdue {
  color: var(--red);
  font-weight: 600;
}

/* ================================================================
   APPOINTMENT WIDGET
   ================================================================ */
.appt-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.appt-item:last-child { border-bottom: none; }
.appt-item:hover { background: var(--bg3); }

.appt-date-block {
  width: 40px;
  height: 42px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-brd);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.appt-day { font-size: 9px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; line-height: 1; }
.appt-num { font-size: 16px; font-weight: 800; color: var(--accent); line-height: 1.1; }

.appt-body  { flex: 1; min-width: 0; }
.appt-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-meta  { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 11px; color: var(--text2); font-weight: 500; }
.appt-meta svg { color: var(--text3); }

.appt-today-pill {
  font-size: 9px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ================================================================
   THEME TOGGLE BUTTON (in topbar)
   ================================================================ */
#themeToggle {
  width: 36px; height: 36px;
  border-radius: 8px;
  padding: 0;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  #sidebarToggle { display: flex !important; }
}

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }
