:root {
  --sidebar-w: 250px;
  --sidebar-bg: #1e2a3a;
}

* { font-family: 'Vazirmatn', Tahoma, sans-serif !important; }

body {
  background: #eef1f6;
  margin: 0;
  min-height: 100vh;
}

/* ---------- Dark theme ---------- */
body.theme-dark { background: #0f141c; color: #e2e8f0; }
body.theme-dark .card,
body.theme-dark .topbar { background: #1a2331 !important; color: #e2e8f0; }
body.theme-dark .table { color: #e2e8f0; }
body.theme-dark .table-light,
body.theme-dark thead.table-light th { background: #232f42 !important; color: #cbd5e1; }
body.theme-dark .list-group-item { background: #1a2331; color: #e2e8f0; border-color: #2b3a52; }
body.theme-dark .form-control,
body.theme-dark .form-select { background: #232f42; color: #e2e8f0; border-color: #33445e; }
body.theme-dark .text-muted { color: #94a3b8 !important; }
body.theme-dark footer { background: #0f141c; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  background-image: linear-gradient(160deg, #1e2a3a 0%, #14202f 100%);
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { letter-spacing: -.5px; }
.sidebar .nav-link { border-radius: 10px; transition: .2s; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff !important; }
.sidebar .nav-link.active { background: var(--bs-primary); }

.main-area { min-height: 100vh; display: flex; flex-direction: column; }
.content { flex: 1; }

.topbar { background: #fff; position: sticky; top: 0; z-index: 100; }
.avatar-circle {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bs-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}

/* ---------- Stat cards ---------- */
.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-ico {
  position: absolute; inset-inline-start: -6px; bottom: -10px;
  font-size: 3.5rem; opacity: .12;
}

/* ---------- Kanban ---------- */
.kanban-board { overflow-x: auto; align-items: flex-start; }
.kanban-col {
  min-width: 240px; max-width: 240px; flex: 0 0 auto;
  background: rgba(0,0,0,.03); border-radius: 12px;
}
body.theme-dark .kanban-col { background: rgba(255,255,255,.04); }
.kanban-drop { min-height: 120px; transition: background .2s; border-radius: 0 0 12px 12px; }
.kanban-drop.drop-hover { background: rgba(13,110,253,.15); outline: 2px dashed var(--bs-primary); }
.lead-card { cursor: grab; transition: transform .15s, box-shadow .15s; }
.lead-card:active { cursor: grabbing; }
.lead-card.dragging { opacity: .4; }
.lead-card:hover { transform: translateY(-2px); }
body.theme-dark .lead-card { background: #232f42; color: #e2e8f0; }

.prio-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-top: 3px; }
.prio-high { background: var(--bs-danger); }
.prio-med { background: var(--bs-warning); }
.prio-low { background: var(--bs-success); }

/* ---------- Modals (custom overlay) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1100; padding: 1rem;
}
.modal-box { width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; }
.modal-lg-box { max-width: 760px; }

.star-pick:hover { transform: scale(1.2); }

/* ---------- Responsive sidebar ---------- */
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 199;
}
@media (max-width: 767.98px) {
  .sidebar {
    position: fixed; inset-inline-start: 0; top: 0; z-index: 200;
    transform: translateX(100%); transition: transform .25s;
  }
  .sidebar.sidebar-open { transform: translateX(0); }
}

/* Smooth Alpine transitions */
[x-cloak] { display: none !important; }