/* ==========================================================================
   Reclaim — Bike Operations dashboard
   --------------------------------------------------------------------------
   Single stylesheet for the whole app. Dark theme, driven by the design
   tokens in :root. Sections below, in order:

     1.  Design tokens
     2.  Reset & base
     3.  App layout
     4.  Sidebar
     5.  Topbar
     6.  Content & page header
     7.  Buttons
     8.  Stat cards
     9.  Chart cards
     10. Bar chart
     11. Donut
     12. Recent rows
     13. Badges
     14. Filter bar
     15. Table
     16. Pagination
     17. Modals
     18. Forms
     19. Detail view
     20. Toasts
     21. Analytics page
     22. Settings page
     23. Login page
     24. Scrollbar & selection
     25. Responsive
   ========================================================================== */


/* 1. Design tokens
   ========================================================================== */
:root {
  /* Surfaces */
  --bg:         #1E2025;
  --bg2:        #252830;
  --bg3:        #2C303A;
  --bg4:        #343840;

  /* Borders */
  --border:     rgba(255, 255, 255, 0.07);
  --border2:    rgba(255, 255, 255, 0.13);

  /* Text */
  --t1:         #ECEDF0;
  --t2:         #8B8E99;
  --t3:         #555A66;

  /* Accent (lime) */
  --accent:     #C8F060;
  --accent2:    #A8D840;
  --accent-d:   rgba(200, 240, 96, 0.12);
  --accent-d2:  rgba(200, 240, 96, 0.06);

  /* Status colors */
  --red:        #FF6B5B;
  --red-bg:     rgba(255, 107, 91, 0.13);
  --amber:      #F5A623;
  --amber-bg:   rgba(245, 166, 35, 0.13);
  --blue:       #60A8F0;
  --blue-bg:    rgba(96, 168, 240, 0.13);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Type & motion */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
}


/* 2. Reset & base
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--t1);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button,
select,
input,
textarea {
  font-family: var(--font);
  outline: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Inline icon defaults (shared by most stroked SVGs in buttons). */
.ic {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}


/* 3. App layout
   ========================================================================== */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto;
  min-height: 100vh;
}


/* 4. Sidebar
   ========================================================================== */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 16px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.logo-mark svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #0C0C0B;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-text {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--t1);
}

.logo-text span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--t3);
}

.nav-section {
  padding: 4px 12px;
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t3);
}

.nav-item {
  position: relative;
  width: 100%;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  color: var(--t2);
  background: transparent;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .15s var(--ease);
}

.nav-item svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--bg3);
  color: var(--t1);
}

.nav-item.active {
  background: var(--accent-d);
  color: var(--accent);
  font-weight: 500;
}

.nav-item.active svg {
  stroke: var(--accent);
}

.nav-badge {
  margin-left: auto;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  background: var(--accent);
  color: #0C0C0B;
  border-radius: 20px;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-md);
}

.sidebar-user-meta {
  min-width: 0;
  flex: 1;
}

.user-ava {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-d);
  border: 1px solid var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--t3);
}

.sidebar-logout {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--t3);
  border-radius: var(--r-sm);
  flex-shrink: 0;
  transition: all .15s;
}

.sidebar-logout svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-logout:hover {
  background: var(--bg3);
  color: var(--red);
}


/* 5. Topbar
   ========================================================================== */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--t3);
}

.breadcrumb span {
  color: var(--t1);
}

.search-wrap {
  position: relative;
  margin: 0;
}

.search-input {
  width: 240px;
  padding: 7px 12px 7px 34px;
  font-size: 13px;
  color: var(--t1);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all .2s var(--ease);
}

.search-input::placeholder {
  color: var(--t3);
}

.search-input:focus {
  width: 300px;
  background: var(--bg4);
  border-color: var(--accent);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--t3);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--t2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .15s;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  background: var(--bg3);
  border-color: var(--border2);
  color: var(--t1);
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border: 1.5px solid var(--bg2);
  border-radius: 50%;
}


/* 6. Content & page header
   ========================================================================== */
.content {
  flex: 1;
  padding: 32px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-head-left h1 {
  margin-bottom: 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--t1);
}

.page-head-left p {
  font-size: 13px;
  color: var(--t2);
}

.page-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}


/* 7. Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .15s var(--ease);
}

.btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.btn-accent {
  background: var(--accent);
  color: #0C0C0B;
}

.btn-accent:hover {
  background: var(--accent2);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--border2);
}

.btn-ghost:hover {
  background: var(--bg3);
  color: var(--t1);
  border-color: var(--border2);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(255, 90, 74, 0.2);
}

.btn-danger:hover {
  background: rgba(255, 90, 74, 0.2);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}


/* 8. Stat cards
   ========================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  position: relative;
  display: block;
  padding: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  cursor: pointer;
  transition: all .2s var(--ease);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-d2), transparent 70%);
  transition: opacity .3s;
}

.stat-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card.featured {
  border-color: rgba(200, 240, 96, 0.2);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stat-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.stat-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--t2);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-card.featured .stat-icon {
  background: var(--accent-d);
  border-color: rgba(200, 240, 96, 0.2);
}

.stat-card.featured .stat-icon svg {
  stroke: var(--accent);
}

.stat-trend {
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 20px;
}

.trend-up {
  background: rgba(200, 240, 96, 0.12);
  color: var(--accent);
}

.trend-down {
  background: var(--red-bg);
  color: var(--red);
}

.stat-val {
  margin-bottom: 5px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--t1);
}

.stat-card.featured .stat-val {
  color: var(--accent);
}

.stat-label {
  font-size: 12px;
  color: var(--t2);
}

.stat-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--t3);
}


/* 9. Chart cards
   ========================================================================== */
.charts-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.card {
  padding: 22px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  transition: border-color .2s;
}

.card:hover {
  border-color: var(--border2);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
}

.card-meta {
  font-size: 11px;
  color: var(--t3);
}


/* 10. Bar chart
   ========================================================================== */
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bar-row:last-child {
  margin-bottom: 0;
}

.bar-lbl {
  width: 130px;
  font-size: 12px;
  text-align: right;
  color: var(--t2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 4px;
  background: var(--bg4);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .8s var(--ease);
}

.bar-n {
  width: 18px;
  font-size: 12px;
  font-weight: 500;
  text-align: right;
  color: var(--t1);
  flex-shrink: 0;
}

.bar-divider {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}


/* 11. Donut
   ========================================================================== */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 12px;
  color: var(--t2);
  border-radius: 6px;
  transition: background .15s;
}

.legend-item:hover {
  background: var(--bg3);
}

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

.legend-n {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--t1);
}


/* 12. Recent rows
   ========================================================================== */
.rec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s;
}

.rec-row:last-child {
  border-bottom: none;
}

.rec-row:hover .rec-model {
  color: var(--accent);
}

.rec-model {
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 500;
  transition: color .15s;
}

.rec-defect {
  font-size: 11px;
  color: var(--t3);
}

.empty-note {
  padding: 24px 0;
  font-size: 13px;
  text-align: center;
  color: var(--t3);
}


/* 13. Badges
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 20px;
  flex-shrink: 0;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.b-defect {
  background: rgba(245, 166, 35, 0.12);
  color: var(--amber);
}
.b-defect::before {
  background: var(--amber);
}

.b-polite {
  background: rgba(200, 240, 96, 0.10);
  color: var(--accent);
}
.b-polite::before {
  background: var(--accent);
}

.b-neutral {
  background: rgba(136, 136, 132, 0.15);
  color: #888884;
}
.b-neutral::before {
  background: #888884;
}

.b-agg {
  background: var(--red-bg);
  color: var(--red);
}
.b-agg::before {
  background: var(--red);
}


/* 14. Filter bar
   ========================================================================== */
.filter-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}

.fgroup {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fgroup label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
}

.fgroup select {
  padding: 8px 28px 8px 12px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--t1);
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888884' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color .15s;
}

.fgroup select:focus {
  border-color: var(--accent);
  outline: none;
}


/* 15. Table
   ========================================================================== */
.table-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.table-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}

.table-title {
  font-size: 14px;
  font-weight: 600;
}

.table-meta {
  font-size: 12px;
  color: var(--t3);
}

.table-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

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

thead th {
  padding: 10px 22px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--t3);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

thead th.sortable {
  cursor: pointer;
  user-select: none;
}

thead th.sortable:hover {
  color: var(--t1);
}

thead th.sort-active {
  color: var(--accent);
}

tbody td {
  padding: 13px 22px;
  font-size: 13px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  cursor: pointer;
  transition: background .12s;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--bg3);
}

input[type=checkbox] {
  accent-color: var(--accent);
}

.row-id {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--t3);
}

.order-id {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--t2);
}

.order-missing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--red);
  background: var(--red-bg);
  border-radius: 20px;
}

.row-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity .15s;
}

tbody tr:hover .row-actions {
  opacity: 1;
}

.row-btn {
  padding: 4px 10px;
  font-family: var(--font);
  font-size: 11px;
  color: var(--t2);
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}

.row-btn:hover {
  background: var(--bg4);
  color: var(--t1);
}

.row-btn.danger:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: transparent;
}


/* 16. Pagination
   ========================================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 22px;
  border-top: 1px solid var(--border);
}

.pg-info {
  font-size: 12px;
  color: var(--t2);
}

.pg-btns {
  display: flex;
  gap: 4px;
}

.pg-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  font-family: var(--font);
  font-size: 12px;
  color: var(--t2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .15s;
}

.pg-btn:hover {
  background: var(--bg3);
  color: var(--t1);
}

.pg-btn.active {
  font-weight: 600;
  background: var(--accent);
  color: #0C0C0B;
  border-color: var(--accent);
}

.pg-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* 17. Modals
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  transition: opacity .2s var(--ease);
}

.overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  position: relative;
  width: 100%;
  max-height: 90vh;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl);
  overflow-y: auto;
  transform: scale(.95) translateY(16px);
  transition: transform .25s var(--ease);
}

.overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-sm { max-width: 440px; }
.modal-md { max-width: 620px; }
.modal-lg { max-width: 780px; }

.modal-notify-pos {
  position: absolute;
  top: 60px;
  right: 24px;
  max-width: 340px;
  transform: none;
}

.overlay.open .modal-notify-pos {
  transform: none;
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--t2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .15s;
}

.modal-close:hover {
  background: var(--bg3);
  color: var(--t1);
}

.modal-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.modal-body {
  padding: 24px;
}

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

.modal-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--t2);
}

.modal-text strong {
  color: var(--t1);
}

.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.notif-row:last-child {
  border-bottom: none;
}

.notif-row:hover {
  background: var(--bg3);
}

.notif-bullet {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}

.notif-t {
  font-size: 13px;
  font-weight: 500;
}

.notif-s {
  margin-top: 2px;
  font-size: 11px;
  color: var(--t3);
}

.bulk-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bulk-btn {
  width: 100%;
  justify-content: flex-start;
}


/* 18. Forms
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--t2);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--t1);
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  transition: border-color .15s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  background: var(--bg4);
  border-color: var(--accent);
  outline: none;
}

.form-textarea {
  min-height: 120px;
  line-height: 1.6;
  resize: vertical;
}

.form-select {
  padding-right: 32px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888884' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

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

.form-hint {
  font-size: 11px;
  color: var(--t3);
}

.char-count {
  font-size: 11px;
  text-align: right;
  color: var(--t3);
}

.email-editor-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  border-radius: var(--r-md) var(--r-md) 0 0;
}

.tb-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--t2);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}

.tb-btn:hover {
  background: var(--bg4);
  color: var(--t1);
}

.tb-sep {
  width: 1px;
  margin: 4px;
  align-self: stretch;
  background: var(--border2);
}

.email-body {
  min-height: 160px;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.7;
  color: var(--t1);
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  outline: none;
}


/* 19. Detail view
   ========================================================================== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-field {
  padding: 12px 14px;
  background: var(--bg3);
  border-radius: var(--r-md);
}

.detail-field-label {
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
}

.detail-field-val {
  font-size: 13px;
  color: var(--t1);
}

.detail-preview-label {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t2);
}

.email-preview {
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--t2);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  white-space: pre-wrap;
  word-wrap: break-word;
}


/* 20. Toasts
   ========================================================================== */
#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;
  min-width: 260px;
  max-width: 360px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--t1);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transform: translateX(400px);
  transition: transform .3s var(--ease);
}

.toast.show {
  transform: translateX(0);
}

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

.toast-success .toast-dot { background: var(--accent); }
.toast-error   .toast-dot { background: var(--red); }
.toast-info    .toast-dot { background: var(--blue); }

.toast-close-btn {
  margin-left: auto;
  padding: 0 2px;
  font-size: 16px;
  line-height: 1;
  color: var(--t3);
  background: none;
  border: none;
  cursor: pointer;
}


/* 21. Analytics page
   ========================================================================== */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.big-number {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--accent);
}

.big-number-unit {
  font-size: 18px;
  color: var(--t2);
}

.analytics-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--t2);
}

.monthly-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 120px;
  margin-top: 4px;
}

.mc-col {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.mc-val {
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
}

.mc-fill {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  transition: height .6s var(--ease);
}

.monthly-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.mc-lbl {
  flex: 1;
  font-size: 9px;
  text-align: center;
  color: var(--t3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* 22. Settings page
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav-item {
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
  color: var(--t2);
  background: transparent;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .15s;
}

.settings-nav-item.active {
  background: var(--accent-d);
  color: var(--accent);
}

.settings-nav-item:hover:not(.active) {
  background: var(--bg3);
  color: var(--t1);
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.settings-save-bar {
  margin-top: 16px;
}

.settings-saved {
  margin-bottom: 16px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-info .tl {
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 500;
}

.toggle-info .ts {
  font-size: 12px;
  color: var(--t2);
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input {
  width: 0;
  height: 0;
  opacity: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 11px;
  cursor: pointer;
  transition: .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: var(--t3);
  border-radius: 50%;
  transition: .2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent-d);
  border-color: rgba(200, 240, 96, 0.3);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: var(--accent);
}


/* 23. Login page
   ========================================================================== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 0%, rgba(200, 240, 96, 0.06), transparent 60%), var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 32px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-title {
  margin-bottom: 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.login-sub {
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--t2);
}

.login-btn {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
}

.login-error {
  margin-bottom: 16px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid rgba(255, 90, 74, 0.2);
  border-radius: var(--r-md);
}


/* 24. Scrollbar & selection
   ========================================================================== */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg4);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border2);
}

::selection {
  background: rgba(200, 240, 96, 0.2);
  color: var(--accent);
}


/* 25. Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-row,
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}
