/* ============================================================
   admin.css  –  Darko Apps Admin Dashboard
   Light & clean style inspired by modern financial dashboards
   ============================================================ */

:root {
  /* Brand accent */
  --accent:          #7c3aed;
  --accent-light:    #ede9fe;
  --accent-hover:    #6d28d9;
  --pink:            #ec4899;
  --green:           #22c55e;
  --green-light:     #dcfce7;
  --red:             #ef4444;
  --red-light:       #fee2e2;
  --yellow:          #f59e0b;
  --yellow-light:    #fef3c7;
  --blue:            #3b82f6;
  --blue-light:      #dbeafe;

  /* Surfaces */
  --bg:              #f4f6fb;
  --sidebar-bg:      #ffffff;
  --card-bg:         #ffffff;
  --input-bg:        #f8f9fc;
  --hover-bg:        #f1f3f9;

  /* Text */
  --text-primary:    #111827;
  --text-secondary:  #6b7280;
  --text-muted:      #9ca3af;

  /* Borders */
  --border:          #e5e7eb;
  --border-focus:    var(--accent);

  /* Shadows */
  --shadow-card:     0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --shadow-md:       0 4px 20px rgba(0,0,0,.08);
  --shadow-lg:       0 8px 32px rgba(0,0,0,.12);

  /* Dimensions */
  --sidebar-width:   240px;
  --header-height:   60px;
  --status-height:   36px;

  /* Radius */
  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       16px;
}

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

body {
  font-family: 'Inter', 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  height: 100vh;
  display: grid;
  grid-template-rows: var(--header-height) 1fr var(--status-height);
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-areas:
    "header  header"
    "sidebar main"
    "status  status";
  overflow: hidden;
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 5px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover  { background: var(--text-muted); }

/* ─── Header ────────────────────────────────────────────────── */
.admin-header {
  grid-area: header;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 0.85rem;
  z-index: 20;
  box-shadow: 0 1px 0 var(--border);
}

.admin-logo {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  letter-spacing: -.02em;
}

.admin-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(124,58,237,.3);
}

.admin-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.22rem 0.6rem;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.admin-header-spacer { flex: 1; }

/* Header buttons */
.btn-header {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.btn-header-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-header-secondary:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: #d1d5db;
}

.btn-header-primary {
  background: var(--accent);
  color: #fff;
}
.btn-header-primary:hover { background: var(--accent-hover); }

.btn-header-success {
  background: var(--green);
  color: #fff;
}
.btn-header-success:hover { background: #16a34a; }

/* ─── Sidebar ───────────────────────────────────────────────── */
.admin-sidebar {
  grid-area: sidebar;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  padding: 1rem 0.5rem 0.4rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all .15s;
  border: 1px solid transparent;
  user-select: none;
}

.sidebar-item:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  border-color: transparent;
}

.sidebar-item.active .sidebar-icon { opacity: 1; }

.sidebar-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link {
  text-decoration: none;
  background: var(--yellow-light);
  color: #92400e;
  border-color: transparent !important;
}
.sidebar-link:hover {
  background: #fde68a;
  color: #78350f;
}

/* ─── Main content ──────────────────────────────────────────── */
.admin-main {
  grid-area: main;
  overflow-y: auto;
  padding: 1.75rem 2rem;
  background: var(--bg);
}

/* ─── Editor sections ───────────────────────────────────────── */
.editor-section { max-width: 840px; }

.editor-section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  letter-spacing: -.025em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.editor-section-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.editor-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
  border: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.editor-card:focus-within {
  border-color: rgba(124,58,237,.2);
  box-shadow: var(--shadow-card), 0 0 0 3px rgba(124,58,237,.06);
}

.editor-card-title {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ─── Form elements ─────────────────────────────────────────── */
.form-row   { display: grid; grid-template-columns: 1fr 1fr;     gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.form-group:last-child { margin-bottom: 0; }

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .01em;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
  padding: 0.55rem 0.85rem;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

.form-group textarea { min-height: 85px; }

/* Toggle / checkbox */
.form-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}
.form-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ─── List items ─────────────────────────────────────────────── */
.list-item {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.65rem;
  transition: border-color .15s, box-shadow .15s;
}
.list-item:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.list-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.list-item-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1rem;
  flex-shrink: 0;
}

.list-item-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  flex: 1;
}

.list-item-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* Feature drag-and-drop */
.feature-drag-row { transition: opacity 0.15s; }
.feature-drag-row .drag-handle {
  cursor: grab;
  color: var(--gray);
  font-size: 1.2rem;
  padding: 0 0.3rem;
  user-select: none;
  flex-shrink: 0;
}
.feature-drag-row .drag-handle:active { cursor: grabbing; }
.feature-drag-row.drag-over {
  outline: 2px dashed var(--purple, #7c3aed);
  border-radius: 6px;
  background: #f5f0ff;
}

/* Icon buttons */
.btn-icon {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all .15s;
  color: var(--text-muted);
  font-family: inherit;
}
.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.btn-icon.danger:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

/* ─── Add / Save buttons ─────────────────────────────────────── */
.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.1rem;
  border: 1.5px dashed #d1d5db;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
}
.btn-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Save section button */
.btn-add[onclick*="saveSection"] {
  margin-top: 0.5rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: 0 2px 8px rgba(124,58,237,.25);
}
.btn-add[onclick*="saveSection"]:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(124,58,237,.35);
  color: #fff;
}

/* ─── Category editor ───────────────────────────────────────── */
.category-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  overflow: hidden;
  background: #fff;
}

.category-header {
  background: var(--bg);
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1.5px solid var(--border);
  color: var(--text-secondary);
}

.category-body { padding: 0.85rem; }

.option-row {
  display: grid;
  grid-template-columns: 2fr 2fr 80px 80px auto;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 0.5rem;
}
.option-row input { margin-bottom: 0; }

/* ─── Tabs ───────────────────────────────────────────────────── */
.editor-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1.25rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  width: fit-content;
  box-shadow: var(--shadow-card);
}

.editor-tab {
  padding: 0.42rem 1.1rem;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all .15s;
}
.editor-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(124,58,237,.3);
}
.editor-tab:not(.active):hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

/* ─── Status bar ────────────────────────────────────────────── */
.admin-status {
  grid-area: status;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.saved   { background: var(--green); }
.status-dot.unsaved { background: var(--yellow); }
.status-dot.error   { background: var(--red); }

#statusText { color: var(--text-secondary); font-weight: 600; }

.admin-status kbd {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* ─── Toast notifications ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 3rem;
  right: 1.5rem;
  background: var(--text-primary);
  color: #fff;
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.toast.show    { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 4px solid var(--green); }
.toast.info    { border-left: 4px solid var(--blue); }
.toast.warning { border-left: 4px solid var(--yellow); }

/* ─── Dashboard full-screen mode ────────────────────────────── */
.admin-main.dashboard-mode {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Dashboard ─────────────────────────────────────────────── */
.dash-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}

.dash-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.03em;
  margin-bottom: 0.25rem;
}

.dash-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.dash-meta {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  text-align: right;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.dash-meta-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.dash-meta-value {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── KPI stat cards ── */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  flex-shrink: 0;
}

.dash-stat-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  cursor: default;
}
.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.dash-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.dash-stat-purple::before { background: linear-gradient(90deg, var(--accent), var(--pink)); }
.dash-stat-blue::before   { background: linear-gradient(90deg, var(--blue), #60a5fa); }
.dash-stat-green::before  { background: linear-gradient(90deg, var(--green), #4ade80); }
.dash-stat-orange::before { background: linear-gradient(90deg, var(--yellow), #fb923c); }

.dash-stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.dash-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -.04em;
  margin-bottom: 0.3rem;
}

.dash-stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.dash-stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Two-column layout ── */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dash-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
  border: 1px solid transparent;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.dash-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* Badges */
.dash-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
}
.dash-badge-green  { background: var(--green-light);  color: #166534; }
.dash-badge-yellow { background: var(--yellow-light); color: #92400e; }
.dash-badge-red    { background: var(--red-light);    color: #991b1b; }
.dash-badge-purple { background: var(--accent-light); color: var(--accent); }

/* Progress bar */
.dash-progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.dash-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  border-radius: 99px;
  transition: width .5s ease;
}

/* Section status list */
.dash-sections-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dash-section-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background .12s;
}
.dash-section-row:hover { background: var(--hover-bg); }

.dash-section-status {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}
.dash-section-status.ok   { background: var(--green-light); color: #166534; }
.dash-section-status.warn { background: var(--yellow-light); color: #92400e; }

.dash-section-icon { font-size: 0.95rem; width: 20px; text-align: center; flex-shrink: 0; }

.dash-section-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.dash-section-edit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  transition: background .12s;
  font-family: inherit;
  opacity: 0;
}
.dash-section-row:hover .dash-section-edit { opacity: 1; }
.dash-section-edit:hover { background: var(--accent-light); }

/* Quick actions grid */
.dash-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0;
}

.dash-action-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all .15s;
  text-align: left;
}
.dash-action-btn:hover {
  background: var(--accent-light);
  border-color: rgba(124,58,237,.25);
  color: var(--accent);
}

.dash-action-icon { font-size: 1.1rem; flex-shrink: 0; }

.dash-primary-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  box-shadow: 0 2px 8px rgba(124,58,237,.25);
  margin-top: 1rem;
}
.dash-primary-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(124,58,237,.35);
}

.dash-secondary-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  background: #fff;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  margin-top: 0.5rem;
}
.dash-secondary-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: #d1d5db;
}

/* ─── Dashboard visitor bars ─────────────────────────────────── */
.dash-stat-teal::before { background: linear-gradient(90deg, #0ea5e9, #06b6d4); }

.dash-no-data {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.dash-vis-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.25rem; }

.dash-vis-row {
  display: grid;
  grid-template-columns: 24px 1fr 1fr 32px;
  align-items: center;
  gap: 0.5rem;
}

.dash-vis-icon { font-size: 1rem; text-align: center; }

.dash-flag {
  width: 20px; height: 15px;
  object-fit: cover; border-radius: 2px;
  border: 1px solid #e5e7eb;
}

.dash-vis-label {
  font-size: 0.82rem; font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.dash-vis-bar-wrap { background: var(--bg); border-radius: 99px; height: 8px; overflow: hidden; }

.dash-vis-bar {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  transition: width .4s ease;
}

.dash-vis-bar-geo { background: linear-gradient(90deg, #0ea5e9, #06b6d4); }

.dash-vis-count { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-align: right; }

/* ─── Analytics page ──────────────────────────────────────────── */
.admin-main.analytics-mode { padding: 1.5rem 2rem; }
.admin-main.analytics-mode .editor-section { max-width: none; width: 100%; }

/* header */
.anl-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem;
}
.anl-header-left { display: flex; flex-direction: column; gap: .15rem; }
.anl-header-right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* period tabs */
.anl-period-bar { display: flex; gap: .35rem; flex-wrap: wrap; }
.anl-period-btn {
  padding: .3rem .8rem; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--card-bg); font-size: .8rem; font-weight: 500; cursor: pointer;
  color: var(--text-muted); transition: all .15s;
}
.anl-period-btn:hover { border-color: var(--accent); color: var(--accent); }
.anl-period-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* grid layout */
.anl-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem;
}
.anl-grid-3 {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin-top: 1rem;
}
.anl-grid-4 {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1rem; margin-top: 1rem;
}
.anl-full { margin-top: 1rem; }

/* KPI row */
.anl-kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; margin-top: 1rem; }

.anl-kpi-orders {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  border-color: transparent !important;
}
.anl-kpi-orders .anl-kpi-val { color: #fff; }
.anl-kpi-orders .anl-kpi-lbl { color: rgba(255,255,255,.8); }

.anl-kpi {
  background: var(--card-bg); border-radius: var(--radius-sm);
  padding: 1rem 1.1rem; text-align: center;
  border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
}

.anl-kpi-val {
  font-size: 2rem; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.04em; line-height: 1;
}

.anl-kpi-lbl {
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
}

/* event count badge */
.anl-period-label {
  font-size: .76rem; color: var(--text-muted);
  margin-top: .2rem; font-style: italic;
}

.anl-bar-list { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.25rem; }

.anl-bar-row {
  display: grid;
  grid-template-columns: 22px 1fr 90px 36px 32px;
  align-items: center; gap: 0.4rem;
}

.anl-bar-icon { font-size: .95rem; text-align: center; }

.anl-bar-label {
  font-size: 0.82rem; font-weight: 500;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.anl-bar-wrap { background: var(--bg); border-radius: 99px; height: 8px; overflow: hidden; }

.anl-bar {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  transition: width .4s;
}

.anl-bar-geo { background: linear-gradient(90deg, #0ea5e9, #06b6d4); }

.anl-bar-pct { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); text-align: right; }
.anl-bar-count { font-size: 0.76rem; font-weight: 600; color: var(--text-muted); text-align: right; }

/* ─── Ideas Board (KanbanFlow Corporate Clean) ──────────────────────────────── */

.admin-main.board-mode { padding: 0; overflow: hidden; }

/* ─── Split editor (50 % form | 50 % live preview) ─────────────────────────── */

.admin-main.split-mode {
  padding: 0;
  overflow: hidden;
}

.editor-split {
  display: flex;
  height: 100%;
}

.editor-split-form {
  flex: 0 0 50%;
  overflow-y: auto;
  padding: 1.75rem 1.5rem;
  border-right: 1px solid var(--border);
}

.editor-split-form .editor-section {
  max-width: none;
}

.editor-split-preview {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.editor-split-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .45rem .9rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: .5rem;
}

.editor-split-bar-label {
  font-weight: 600;
  font-size: .82rem;
  color: var(--text-primary);
}

.editor-split-preview iframe {
  flex: 1;
  border: none;
  width: 100%;
}

.kb-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem 1.25rem 0;
  overflow: hidden;
}

.kb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.kb-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.03em;
}

.kb-btn-add-col {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--accent);
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  transition: background 0.12s;
  white-space: nowrap;
}
.kb-btn-add-col:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ── Board scroll area ── */
.kb-board {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  padding-bottom: 1.25rem;
  min-height: 0;
}
.kb-board::-webkit-scrollbar { height: 5px; }
.kb-board::-webkit-scrollbar-thumb { background: #d0d4de; border-radius: 3px; }

/* ── Column ── */
.kb-col {
  width: 276px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 195px);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.kb-col.kb-drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

.kb-col-header {
  padding: 10px 12px 9px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

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

.kb-col-title {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  flex: 1;
  min-width: 0;
  font-family: inherit;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.12s;
}
.kb-col-title:hover, .kb-col-title:focus { background: var(--bg); }

.kb-col-count {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 20px;
  flex-shrink: 0;
}

.kb-col-del {
  background: none;
  border: none;
  color: #c0c6d8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1;
  opacity: 0;
}
.kb-col:hover .kb-col-del { opacity: 1; }
.kb-col-del:hover { background: var(--bg); color: var(--text-muted); }

/* ── Cards container ── */
.kb-cards {
  padding: 7px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  min-height: 40px;
}
.kb-cards::-webkit-scrollbar { width: 3px; }
.kb-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Card ── */
.kb-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: grab;
  transition: border-color 0.12s, box-shadow 0.12s;
  animation: kbCardIn 0.18s ease;
  position: relative;
}
@keyframes kbCardIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kb-card:hover { border-color: #d0d4de; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.kb-card:active { cursor: grabbing; }
.kb-card.kb-dragging { opacity: 0.2; }

/* priority left strip */
.kb-card[data-prio="high"]::before   { content:''; position:absolute; left:0; top:6px; bottom:6px; width:3px; border-radius:0 2px 2px 0; background:#ef4444; }
.kb-card[data-prio="medium"]::before { content:''; position:absolute; left:0; top:6px; bottom:6px; width:3px; border-radius:0 2px 2px 0; background:#f59e0b; }
.kb-card[data-prio="low"]::before    { content:''; position:absolute; left:0; top:6px; bottom:6px; width:3px; border-radius:0 2px 2px 0; background:#10b981; }
.kb-card[data-prio="high"],
.kb-card[data-prio="medium"],
.kb-card[data-prio="low"] { padding-left: 15px; }

/* placeholder */
.kb-placeholder {
  min-height: 48px;
  border: 1px dashed #b3a5f5 !important;
  border-radius: var(--radius-sm);
  background: rgba(124,58,237,0.025);
  box-shadow: none !important;
  cursor: default !important;
  animation: none !important;
}

/* card-top: priority indicator + short ID */
.kb-card-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
}
.kb-prio-row { display: flex; align-items: center; gap: 4px; }
.kb-prio-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.kb-prio-lbl { font-size: 0.61rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.kb-card-id { font-size: 0.6rem; color: #c0c6d8; margin-left: auto; }

.kb-card-title {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  outline: none;
  cursor: text;
  word-break: break-word;
  min-height: 1.4em;
}
.kb-card-title:empty::before { content: attr(data-placeholder); color: var(--text-muted); font-weight: 400; }

.kb-card-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 5px;
  outline: none;
  cursor: text;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kb-card-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.kb-label-chip {
  display: inline-block;
  font-size: 0.61rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  opacity: 0.85;
  border: 2px solid transparent;
  transition: all 0.12s;
}
.kb-label-chip:hover, .kb-label-chip.kb-chip-active { opacity: 1; border-color: rgba(0,0,0,0.15); }

.kb-card-tags { display: flex; gap: 4px; align-items: center; }

.kb-prio-tag {
  font-size: 0.61rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kb-footer-space { flex: 1; }

.kb-card-actions {
  display: flex;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.12s;
}
.kb-card:hover .kb-card-actions { opacity: 1; }

.kb-card-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #c0c6d8;
  font-size: 0.75rem;
  padding: 2px 5px;
  border-radius: 4px;
  transition: all 0.1s;
  font-family: inherit;
}
.kb-card-btn:hover { background: var(--bg); color: var(--text-muted); }
.kb-card-btn.danger:hover { background: #fee2e2; color: var(--red); }

/* ── Add card button ── */
.kb-add-card-btn {
  width: 100%;
  padding: 7px 12px;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.77rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s;
  flex-shrink: 0;
  font-family: inherit;
}
.kb-add-card-btn:hover { background: var(--bg); color: var(--accent); }

/* ── Ghost add-column button ── */
.kb-ghost-col {
  width: 220px;
  flex-shrink: 0;
  align-self: flex-start;
  padding: 10px 14px;
  border: 1px dashed #d0d4de;
  border-radius: 10px;
  background: rgba(255,255,255,0.7);
  color: var(--text-muted);
  font-size: 0.79rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
  font-family: inherit;
}
.kb-ghost-col:hover { background: #ffffff; border-style: solid; border-color: var(--accent); color: var(--accent); }

/* ── Card detail modal ── */
.kb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,17,23,0.4);
  z-index: 900;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 50px 20px;
}
@keyframes kbFadeIn { from { opacity: 0; } to { opacity: 1; } }

.kb-modal {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 560px;
  max-width: 100%;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  animation: kbSlideUp 0.16s ease;
  position: relative;
}
@keyframes kbSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kb-modal::-webkit-scrollbar { width: 4px; }
.kb-modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.kb-modal-head {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.kb-modal-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.kb-modal-title-area { flex: 1; min-width: 0; }

.kb-modal-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  line-height: 1.4;
  word-break: break-word;
  min-height: 1.4em;
}
.kb-modal-title:empty::before { content: 'Card title…'; color: #c0c6d8; }

.kb-modal-col-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kb-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.12s;
}
.kb-modal-close:hover { background: var(--bg); color: var(--text-primary); }

.kb-modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; }

.kb-modal-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.kb-modal-desc {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.82rem;
  color: var(--text-primary);
  outline: none;
  min-height: 72px;
  line-height: 1.6;
  cursor: text;
  transition: border-color 0.12s, background 0.12s;
  font-family: inherit;
  width: 100%;
  display: block;
}
.kb-modal-desc:focus { border-color: var(--accent); background: #fff; }
.kb-modal-desc:empty::before { content: 'Add a description…'; color: #c0c6d8; }

.kb-labels-row { display: flex; flex-wrap: wrap; gap: 6px; }

.kb-priority-row { display: flex; gap: 8px; }

.kb-prio-btn {
  flex: 1;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg);
  color: var(--text-muted);
  transition: all 0.12s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.kb-prio-btn:hover { border-color: #d0d4de; }
.kb-prio-low  { background: #f0fdf4 !important; color: #10b981 !important; border-color: #6ee7b7 !important; }
.kb-prio-med  { background: #fffbeb !important; color: #f59e0b !important; border-color: #fcd34d !important; }
.kb-prio-high { background: #fef2f2 !important; color: #ef4444 !important; border-color: #fca5a5 !important; }

.kb-modal-del-btn {
  padding: 5px 10px;
  background: #fff0f2;
  color: #d93550;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s;
  font-family: inherit;
  flex-shrink: 0;
  align-self: flex-start;
}
.kb-modal-del-btn:hover { background: #ffd6db; }

/* ── Board2 extras (column dropdown, filter bar, card meta, modal meta) ── */

/* Column ⋯ button + dropdown */
.kb-col-more {
  background: none; border: none; color: #c0c6d8;
  padding: 2px 6px; border-radius: 4px; font-size: 1rem;
  cursor: pointer; transition: all 0.12s; line-height: 1;
  opacity: 0; position: relative;
}
.kb-col:hover .kb-col-more { opacity: 1; }
.kb-col-more:hover { background: var(--bg); color: var(--text-muted); }
.kb-col-dropdown {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  z-index: 400; min-width: 155px;
  animation: kbDropIn 0.12s ease;
}
@keyframes kbDropIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.kb-col-dropdown button {
  display: flex; align-items: center; gap: 7px;
  width: 100%; padding: 6px 10px;
  border: none; background: transparent;
  font-size: 0.77rem; color: var(--text-secondary);
  border-radius: 4px; text-align: left; cursor: pointer;
  transition: background 0.1s; font-family: inherit;
}
.kb-col-dropdown button:hover { background: var(--bg); }
.kb-col-dropdown .kb-dd-danger { color: var(--red); }
.kb-col-dropdown .kb-dd-danger:hover { background: #fee2e2; }
.kb-col-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 3px 0; }

/* Topbar extras */
.kb-board-name {
  font-size: 0.86rem; font-weight: 600; color: var(--text-primary);
  background: transparent; border: none; outline: none;
  padding: 4px 7px; border-radius: 4px; min-width: 80px; font-family: inherit;
  transition: background 0.12s;
}
.kb-board-name:hover, .kb-board-name:focus { background: var(--bg); }
.kb-hdiv { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; }
.kb-avatars { display: flex; align-items: center; }
.kb-av {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; font-size: 0.6rem; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-left: -5px; flex-shrink: 0; cursor: pointer;
}
.kb-avatars .kb-av:first-child { margin-left: 0; }

.kb-sync-badge {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid transparent;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s;
}
.kb-sync-local  { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; }
.kb-sync-saving { background: #fefce8; color: #a16207; border-color: #fde68a; }
.kb-sync-ok     { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.kb-sync-err    { background: #fff1f2; color: #e11d48; border-color: #fecdd3; }

.kb-hbtn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 500;
  border: 1px solid var(--border); cursor: pointer;
  transition: all 0.12s; background: transparent;
  color: var(--text-muted); font-family: inherit;
}
.kb-hbtn:hover { background: var(--bg); color: var(--text-secondary); border-color: #d0d4de; }

/* Filter bar */
.kb-fbar {
  height: 38px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 12px; gap: 5px; flex-shrink: 0;
}
.kb-flabel { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 2px; }
.kb-fchip {
  padding: 2px 9px; border-radius: 20px; font-size: 0.7rem; font-weight: 500;
  background: #fff; color: var(--text-muted); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.kb-fchip:hover { border-color: #d0d4de; color: var(--text-secondary); }
.kb-fchip.on { background: var(--accent-light); color: var(--accent); border-color: #c4b5fd; }
.kb-fbar-spacer { flex: 1; }
.kb-search-input {
  padding: 4px 8px 4px 10px; border: 1px solid var(--border); border-radius: 20px;
  font-size: 0.74rem; outline: none; width: 150px;
  background: #fff; color: var(--text-primary); font-family: inherit;
  transition: all 0.12s;
}
.kb-search-input:focus { border-color: var(--accent); width: 190px; }
.kb-card-count { font-size: 0.68rem; color: var(--text-muted); margin-left: 4px; }

/* Card metadata badges */
.kb-card-av {
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 0.52rem; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kb-card-due { font-size: 0.6rem; color: var(--text-muted); }
.kb-card-due.overdue { color: var(--red); }
.kb-card-check-badge { font-size: 0.6rem; color: var(--text-muted); display: flex; align-items: center; gap: 2px; }

/* Modal meta grid */
.kb-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kb-meta-lbl { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 6px; }
.kb-meta-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* Priority selector buttons in modal */
.kb-prio-sel-btn {
  padding: 3px 9px; border-radius: 20px; font-size: 0.7rem; font-weight: 600;
  border: 1px solid var(--border); cursor: pointer;
  background: var(--bg); color: var(--text-muted);
  transition: all 0.12s; display: flex; align-items: center; gap: 4px; font-family: inherit;
}
.kb-prio-sel-btn:hover { border-color: #d0d4de; }
.kb-psel-high { background: #fef2f2 !important; color: #ef4444 !important; border-color: #fca5a5 !important; }
.kb-psel-med  { background: #fffbeb !important; color: #f59e0b !important; border-color: #fcd34d !important; }
.kb-psel-low  { background: #f0fdf4 !important; color: #10b981 !important; border-color: #6ee7b7 !important; }

/* Assignee buttons */
.kb-assign-row { display: flex; flex-wrap: wrap; gap: 4px; }
.kb-assign-btn {
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 0.58rem; font-weight: 700; color: #fff;
  border: 2px solid transparent; cursor: pointer;
  transition: all 0.12s; display: flex; align-items: center; justify-content: center;
  opacity: 0.4;
}
.kb-assign-btn:hover { opacity: 0.8; }
.kb-assign-btn.sel { opacity: 1; border-color: rgba(0,0,0,.2); }

/* Due date */
.kb-due-input {
  padding: 4px 9px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.76rem;
  color: var(--text-primary); background: var(--bg);
  outline: none; cursor: pointer; transition: border-color 0.12s; font-family: inherit;
}
.kb-due-input:focus { border-color: var(--accent); background: #fff; }

/* Checklist */
.kb-check-prog-wrap { margin-bottom: 8px; }
.kb-check-pct-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.kb-check-pct { font-size: 0.68rem; color: var(--text-muted); }
.kb-check-bar { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.kb-check-fill { height: 100%; background: var(--green); border-radius: 2px; transition: width 0.3s; }
.kb-check-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.kb-check-item:last-of-type { border-bottom: none; }
.kb-check-cb { width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.kb-check-text { font-size: 0.79rem; color: var(--text-primary); flex: 1; outline: none; background: transparent; border: none; cursor: text; font-family: inherit; }
.kb-check-text.done { text-decoration: line-through; color: var(--text-muted); }
.kb-check-del { background: none; border: none; color: #c0c6d8; font-size: 0.72rem; padding: 2px 4px; border-radius: 3px; cursor: pointer; opacity: 0; transition: opacity 0.12s; }
.kb-check-item:hover .kb-check-del { opacity: 1; }
.kb-check-del:hover { background: #fee2e2; color: var(--red); }
.kb-add-check { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 0; background: none; border: none; color: var(--text-muted); font-size: 0.76rem; cursor: pointer; transition: color 0.12s; font-family: inherit; }
.kb-add-check:hover { color: var(--accent); }

/* Activity */
.kb-act-item { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; }
.kb-act-av { width: 22px; height: 22px; border-radius: 50%; font-size: 0.56rem; font-weight: 700; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.kb-act-text { font-size: 0.77rem; color: var(--text-secondary); line-height: 1.4; }
.kb-act-text strong { font-weight: 600; color: var(--text-primary); }
.kb-act-time { font-size: 0.64rem; color: #c0c6d8; margin-top: 1px; }
.kb-comment-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; }
.kb-comment-input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 0.78rem; color: var(--text-primary); outline: none; resize: none; min-height: 32px; line-height: 1.4; transition: border-color 0.12s; font-family: inherit; }
.kb-comment-input:focus { border-color: var(--accent); background: #fff; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-height) 1fr var(--status-height);
    grid-template-areas:
      "header"
      "main"
      "status";
  }
  .admin-sidebar { display: none; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .option-row { grid-template-columns: 1fr 1fr; }
  .dash-stats-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid-2 { grid-template-columns: 1fr; }
  .dash-map-layout { flex-direction: column; }
  .dash-map-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 1rem; border-right: none; border-bottom: 1px solid var(--border); border-radius: var(--radius-md) var(--radius-md) 0 0; }
}

/* ─── World Map Card ────────────────────────────────────────────── */
.dash-map-card {
  flex: 1;
  min-height: 0;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.dash-map-layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.dash-map-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1.25rem;
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: #fafbfc;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  overflow-y: auto;
}

.dash-map-sidebar-section {
  margin-bottom: 1.25rem;
}

.dash-map-sidebar-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.dash-map-stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.dash-map-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.04em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.dash-map-updated {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.dash-map-refresh-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: opacity .15s;
}
.dash-map-refresh-btn:hover { opacity: .7; }

.dash-map-body {
  flex: 1;
  position: relative;
  overflow: visible;
  min-height: 400px;
}

/* Map SVG fills its parent */
#world-map-container,
#world-map-container .jvm-container,
#world-map-container svg {
  height: 100% !important;
  width: 100% !important;
}

/* Override jsvectormap tooltip */
.jvm-tooltip {
  background: #1e293b !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  font-family: inherit !important;
  font-size: 0.8rem !important;
  padding: 4px 10px !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.2) !important;
}

/* Markers layer */
.wm-markers-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wm-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wm-marker-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #1e293b;
  color: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  white-space: nowrap;
  margin-bottom: 4px;
}

.wm-marker-flag {
  width: 18px; height: 13px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.wm-marker-name {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: .8;
  line-height: 1.1;
}

.wm-marker-count {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -.03em;
}

.wm-marker-dot {
  width: 7px; height: 7px;
  background: #7c3aed;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #7c3aed;
}

/* ─── Inquiries ─────────────────────────────────────────────────────────── */
.inq-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: .75rem;
}
.inq-unread {
  border-left: 3px solid #2563eb;
}
.inq-card-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .35rem;
}
.inq-name {
  font-weight: 700;
  font-size: .95rem;
}
.inq-badge {
  font-size: .72rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .15rem .55rem;
}
.inq-date {
  font-size: .75rem;
  color: var(--text-muted);
  margin-left: auto;
}
.inq-read-tag {
  font-size: .75rem;
  color: var(--text-muted);
}
.inq-email {
  display: block;
  font-size: .82rem;
  color: #2563eb;
  margin-bottom: .45rem;
  text-decoration: none;
}
.inq-email:hover { text-decoration: underline; }
.inq-msg {
  font-size: .85rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  margin: 0;
}
