/* =====================================================
   COOKIE CRUMBLES CRM — Main Stylesheet
   Dark Navy + Emerald Theme
   ===================================================== */

:root {
  --bg-base:       #0f172a;
  --bg-surface:    #1e293b;
  --bg-elevated:   #334155;
  --bg-hover:      #3f4f6a;
  --primary:       #10b981;
  --primary-dark:  #059669;
  --primary-light: #34d399;
  --text:          #f8fafc;
  --text-muted:    #94a3b8;
  --text-dim:      #64748b;
  --border:        #334155;
  --border-light:  #475569;
  --danger:        #ef4444;
  --danger-dark:   #dc2626;
  --warning:       #f59e0b;
  --info:          #3b82f6;
  --radius:        8px;
  --radius-lg:     12px;
  --radius-xl:     16px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.3);
  --sidebar-w:     240px;
  --transition:    0.18s ease;
}

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

html { font-size: 15px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* =====================================================
   TYPOGRAPHY
   ===================================================== */
h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }
p  { color: var(--text-muted); }

.text-muted   { color: var(--text-muted) !important; }
.text-dim     { color: var(--text-dim) !important; }
.text-primary { color: var(--primary) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info    { color: var(--info) !important; }
.text-sm      { font-size: 0.85rem; }
.text-xs      { font-size: 0.75rem; }
.text-lg      { font-size: 1.15rem; }
.text-xl      { font-size: 1.35rem; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }

/* =====================================================
   LAYOUT — AUTHENTICATED PAGES
   ===================================================== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.2;
}
.sidebar-logo .logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 8px 10px 4px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.nav-item.active {
  background: rgba(16,185,129,0.12);
  color: var(--primary);
}

.nav-item svg, .nav-item .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

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

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #000;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

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

.user-profile-mini:hover { background: var(--bg-elevated); }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
}
.avatar.lg { width: 44px; height: 44px; font-size: 1rem; }
.avatar.xl { width: 56px; height: 56px; font-size: 1.2rem; }

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

.topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
}

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

.search-input-wrap svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 16px; height: 16px;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition);
}

.search-input::placeholder { color: var(--text-dim); }
.search-input:focus { border-color: var(--primary); }

.page-content {
  padding: 28px;
  flex: 1;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--primary);
  color: #000;
}
.btn-primary:hover { background: var(--primary-dark); color: #000; }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-light); }

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

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: var(--danger-dark); color: white; }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* =====================================================
   CARDS
   ===================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-lg { padding: 28px; }

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

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* =====================================================
   STAT CARDS
   ===================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-icon.emerald { background: rgba(16,185,129,0.12); color: var(--primary); }
.stat-icon.blue    { background: rgba(59,130,246,0.12); color: var(--info); }
.stat-icon.amber   { background: rgba(245,158,11,0.12); color: var(--warning); }
.stat-icon.purple  { background: rgba(167,139,250,0.12); color: #a78bfa; }
.stat-icon.red     { background: rgba(239,68,68,0.12); color: var(--danger); }

.stat-icon svg { width: 20px; height: 20px; }

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 3px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =====================================================
   TABLES
   ===================================================== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

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

thead th {
  background: var(--bg-elevated);
  padding: 11px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.025); }

tbody td {
  padding: 13px 16px;
  font-size: 0.875rem;
  color: var(--text);
  vertical-align: middle;
}

.td-muted { color: var(--text-muted) !important; }

/* =====================================================
   BADGES / TAGS
   ===================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-emerald { background: rgba(16,185,129,0.15); color: var(--primary); }
.badge-blue    { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-amber   { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-purple  { background: rgba(167,139,250,0.15); color: #a78bfa; }
.badge-red     { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-gray    { background: rgba(100,116,139,0.2); color: var(--text-muted); }

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

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16,185,129,0.1); }

.form-textarea { resize: vertical; min-height: 90px; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

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

.form-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 5px;
}

.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 5px;
}

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}

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

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(12px);
  transition: transform var(--transition);
  box-shadow: var(--shadow);
}

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

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}

.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  border: none; background: none;
}

.modal-close:hover { background: var(--bg-elevated); color: var(--text); }

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

/* =====================================================
   TABS
   ===================================================== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  display: flex; align-items: center; gap: 7px;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn svg { width: 15px; height: 15px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* =====================================================
   KANBAN BOARD (Deal Flow)
   ===================================================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-column {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 400px;
}

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

.kanban-col-title {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-col-count {
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--bg-elevated);
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}

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

.dot-blue   { background: var(--info); }
.dot-amber  { background: var(--warning); }
.dot-emerald{ background: var(--primary); }
.dot-red    { background: var(--danger); }

.kanban-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.kanban-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.kanban-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.kanban-card-client {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.deal-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
}

/* =====================================================
   ACTIVITY LOG
   ===================================================== */
.activity-list { display: flex; flex-direction: column; gap: 0; }

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

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

.activity-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.activity-dot svg { width: 14px; height: 14px; }

.activity-content { flex: 1; }
.activity-text { font-size: 0.875rem; color: var(--text); line-height: 1.5; }
.activity-time { font-size: 0.75rem; color: var(--text-dim); margin-top: 3px; }

/* =====================================================
   EMPTY STATES
   ===================================================== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px; height: 48px;
  color: var(--text-dim);
  margin: 0 auto 14px;
  display: block;
}

.empty-state h3 {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.825rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* =====================================================
   ALERTS / TOASTS
   ===================================================== */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  box-shadow: var(--shadow);
  transform: translateY(16px);
  opacity: 0;
  transition: all 0.25s ease;
  max-width: 340px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--primary); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: 20px;
}

.login-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 48px; height: 48px;
  background: var(--primary);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

.login-logo-text { text-align: left; }
.login-logo-name { font-weight: 800; font-size: 1.25rem; color: var(--text); }
.login-logo-sub  { font-size: 0.75rem; color: var(--text-muted); }

.login-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.login-sub   { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 28px; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 0.75rem;
}
.divider::before, .divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border);
}

/* =====================================================
   PAGE HEADERS
   ===================================================== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 { margin-bottom: 3px; }

/* =====================================================
   CLIENT DETAIL
   ===================================================== */
.client-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.client-hero-info { flex: 1; }
.client-hero-info h2 { margin-bottom: 4px; }
.client-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.meta-item svg { width: 14px; height: 14px; color: var(--text-dim); }

/* =====================================================
   PORTFOLIO TABLE
   ===================================================== */
.portfolio-total {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* =====================================================
   NOTES
   ===================================================== */
.note-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.note-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}

.note-author {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600;
}

.note-time { font-size: 0.75rem; color: var(--text-dim); }
.note-text { font-size: 0.875rem; color: var(--text); line-height: 1.6; }

/* =====================================================
   DOCUMENT LIST
   ===================================================== */
.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.doc-item:last-child { border-bottom: none; }
.doc-item:hover { background: rgba(255,255,255,0.02); }

.doc-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: rgba(59,130,246,0.12);
  color: var(--info);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.doc-icon svg { width: 18px; height: 18px; }
.doc-name { font-size: 0.875rem; font-weight: 500; }
.doc-meta { font-size: 0.75rem; color: var(--text-dim); }

/* =====================================================
   UTILITIES
   ===================================================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* =====================================================
   LOADING SPINNER
   ===================================================== */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-page {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; gap: 12px; color: var(--text-muted);
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .kanban-board { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--transition); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .kanban-board { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
  .login-container { padding: 28px 20px; }
}
