/* ============================================================
   Ready1Go CRM — app.css
   Bootstrap 5.3 companion stylesheet
   ============================================================ */

/* ── Google Font: Inter ──────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ───────────────────────────────── */
:root {
  --sidebar-width:   260px;
  --sidebar-bg:      #0f172a;
  --topbar-height:   60px;
  --accent:          #0066ff;
  --accent-dark:     #0052cc;
  --accent-cyan:     #00c8ff;
  --body-bg:         #f1f5f9;
  --card-shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --card-shadow-lg:  0 4px 12px rgba(0,0,0,.10);
  --border-color:    #e2e8f0;
  --text-muted-soft: #94a3b8;
  --sidebar-border:  rgba(255,255,255,.06);
  --transition-fast: all .15s ease;
}

/* ── Base ────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--body-bg);
  color: #1e293b;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography helpers ──────────────────────────────────── */
.fs-7  { font-size: .8125rem !important; }
.fs-8  { font-size: .75rem   !important; }
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.text-accent { color: var(--accent) !important; }
.lh-1  { line-height: 1  !important; }
.lh-sm { line-height: 1.3 !important; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 100;
  overflow: hidden;
  flex-direction: column;
  /* Custom thin scrollbar applied via sidebar-nav child */
}

/* Logo area */
.sidebar-logo {
  padding: 1.25rem 1rem 1.125rem;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.03em;
  background: linear-gradient(90deg, #fff 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  user-select: none;
}

/* Scrollable nav area */
.sidebar-nav {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  padding-bottom: .5rem;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 2px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.2);
}

/* Section labels */
.nav-section-label {
  display: block;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #475569;
  padding: .85rem 1rem .3rem;
  font-weight: 600;
  user-select: none;
}

/* Nav links */
.sidebar .nav-link,
.sidebar-nav .nav-link {
  color: #94a3b8;
  padding: .45rem 1rem;
  border-radius: .375rem;
  margin: .1rem .5rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .875rem;
  font-weight: 500;
  transition: var(--transition-fast);
  border-left: 3px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar .nav-link i,
.sidebar-nav .nav-link i {
  font-size: 1rem;
  width: 1.1rem;
  flex-shrink: 0;
  text-align: center;
}

.sidebar .nav-link:hover,
.sidebar-nav .nav-link:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,.05);
  border-left-color: rgba(255,255,255,.1);
}

.sidebar .nav-link.active,
.sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(0, 102, 255, .15);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar .nav-link.active i,
.sidebar-nav .nav-link.active i {
  color: var(--accent-cyan);
}

/* Bottom user card */
.sidebar-user-card {
  padding: .875rem 1rem;
  border-top: 1px solid var(--sidebar-border);
  background: rgba(0,0,0,.2);
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: .8125rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.3;
}

.sidebar-user-role {
  font-size: .7rem;
  color: #64748b;
  line-height: 1.3;
}

.sidebar-logout-btn {
  color: #475569;
  text-decoration: none;
  font-size: 1rem;
  padding: .25rem;
  border-radius: .25rem;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  color: #ef4444;
  background: rgba(239,68,68,.1);
}

/* Offcanvas sidebar overrides */
.sidebar-offcanvas {
  background: var(--sidebar-bg) !important;
  width: var(--sidebar-width) !important;
  border-right: none !important;
}

.sidebar-offcanvas .offcanvas-header {
  padding: 1.25rem 1rem 1.125rem;
  border-bottom: 1px solid var(--sidebar-border) !important;
}

.sidebar-offcanvas .offcanvas-body {
  padding: 0 !important;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  z-index: 99;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  gap: 1rem;
}

.topbar-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-hamburger {
  color: #64748b;
  border: none;
  background: none;
  padding: .25rem;
  line-height: 1;
  cursor: pointer;
}
.topbar-hamburger:hover { color: #0f172a; }

.topbar-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-color);
  color: #64748b;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0;
}
.topbar-icon-btn:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* Notification badge */
.badge-notif {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  border: 2px solid #fff;
  pointer-events: none;
}

/* Notification dropdown */
.notif-dropdown {
  width: 320px;
  max-height: 480px;
  overflow: hidden;
}

.notif-item {
  color: #374151;
  transition: var(--transition-fast);
  border-bottom: 1px solid #f8fafc;
}
.notif-item:last-of-type { border-bottom: none; }
.notif-item:hover { background: #f8fafc; color: #0f172a; }

.notif-icon-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  flex-shrink: 0;
}

.notif-text {
  font-size: .8125rem;
  font-weight: 500;
  color: #374151;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-time {
  font-size: .7rem;
  color: #94a3b8;
  margin-top: 1px;
}

/* User button in topbar */
.topbar-user-btn {
  color: #374151 !important;
}
.topbar-user-btn:hover { color: #0f172a !important; }

.topbar-username {
  font-size: .8125rem;
  font-weight: 600;
  color: #374151;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  min-height: 100vh;
  background: var(--body-bg);
}

/* ============================================================
   AVATAR CIRCLE
   ============================================================ */
.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.avatar-circle.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-circle.sm { width: 28px; height: 28px; font-size: .65rem; }
.avatar-circle.xl { width: 72px; height: 72px; font-size: 1.4rem; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

.page-header h2,
.page-header .page-header-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.page-header .page-header-sub {
  font-size: .875rem;
  color: #64748b;
  margin: .15rem 0 0;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  border: none !important;
  box-shadow: var(--card-shadow);
  border-radius: .75rem;
}

.card:hover {
  box-shadow: var(--card-shadow-lg);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: .9375rem;
  color: #0f172a;
}

.card-body { padding: 1.25rem; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: #fff;
  border-radius: .75rem;
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition-fast);
}

.stat-card:hover { box-shadow: var(--card-shadow-lg); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: .625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  opacity: .9;
}

.stat-icon.primary { background: rgba(0,102,255,.1); color: var(--accent); }
.stat-icon.success { background: rgba(34,197,94,.1);  color: #22c55e; }
.stat-icon.warning { background: rgba(245,158,11,.1); color: #f59e0b; }
.stat-icon.danger  { background: rgba(239,68,68,.1);  color: #ef4444; }
.stat-icon.info    { background: rgba(0,200,255,.1);  color: var(--accent-cyan); }
.stat-icon.purple  { background: rgba(139,92,246,.1); color: #8b5cf6; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.stat-label {
  font-size: .8125rem;
  color: #64748b;
  font-weight: 500;
  margin-top: .15rem;
}

.stat-delta {
  font-size: .75rem;
  font-weight: 600;
  margin-top: .2rem;
}
.stat-delta.up   { color: #22c55e; }
.stat-delta.down { color: #ef4444; }

/* ============================================================
   SCORE BAR (lead scoring)
   ============================================================ */
.score-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  position: relative;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s ease;
  background: #94a3b8;
}

.score-bar-fill.score-good   { background: #22c55e; }
.score-bar-fill.score-medium { background: #f59e0b; }
.score-bar-fill.score-poor   { background: #ef4444; }

/* Score number display */
.score-num {
  font-size: .75rem;
  font-weight: 700;
  padding: .15rem .4rem;
  border-radius: .25rem;
  white-space: nowrap;
}
.score-num.score-good   { background: #dcfce7; color: #16a34a; }
.score-num.score-medium { background: #fef9c3; color: #b45309; }
.score-num.score-poor   { background: #fee2e2; color: #dc2626; }

/* ============================================================
   STATUS BADGES  (.badge-status)
   ============================================================ */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: .01em;
  white-space: nowrap;
}

.badge-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}

/* Lead / contact statuses */
.badge-status.new        { background: #f1f5f9; color: #475569; }
.badge-status.contacted  { background: #eff6ff; color: #2563eb; }
.badge-status.qualified  { background: #ecfdf5; color: #059669; }
.badge-status.proposal   { background: #fffbeb; color: #d97706; }
.badge-status.closed     { background: #f1f5f9; color: #64748b; }

/* Deal / contract statuses */
.badge-status.won        { background: #dcfce7; color: #16a34a; }
.badge-status.lost       { background: #fee2e2; color: #dc2626; }
.badge-status.signed     { background: #dcfce7; color: #16a34a; }
.badge-status.cancelled  { background: #fee2e2; color: #dc2626; }
.badge-status.pending    { background: #fef9c3; color: #92400e; }

/* Campaign / outreach statuses */
.badge-status.active     { background: #dcfce7; color: #16a34a; }
.badge-status.draft      { background: #f1f5f9; color: #64748b; }
.badge-status.paused     { background: #fef3c7; color: #b45309; }
.badge-status.sent       { background: #eff6ff; color: #1d4ed8; }

/* ============================================================
   PRIORITY BADGES
   ============================================================ */
.priority-urgent {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: .25rem;
  background: #fef2f2; color: #dc2626;
  border: 1px solid #fecaca;
  font-size: .72rem; font-weight: 600;
}
.priority-high {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: .25rem;
  background: #fffbeb; color: #d97706;
  border: 1px solid #fde68a;
  font-size: .72rem; font-weight: 600;
}
.priority-medium {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: .25rem;
  background: #eff6ff; color: #2563eb;
  border: 1px solid #bfdbfe;
  font-size: .72rem; font-weight: 600;
}
.priority-low {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: .25rem;
  background: #f0fdf4; color: #16a34a;
  border: 1px solid #bbf7d0;
  font-size: .72rem; font-weight: 600;
}

/* ============================================================
   TABLES
   ============================================================ */
.table {
  margin-bottom: 0;
  font-size: .875rem;
  color: #374151;
}

.table thead th {
  background: #f8fafc;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
  border-bottom: 2px solid var(--border-color) !important;
  padding: .75rem 1rem;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
  padding: .7rem 1rem;
  border-color: #f1f5f9;
}

.table tbody tr {
  transition: background .1s ease;
}

.table tbody tr:hover {
  background: #f8fafc;
}

/* Clickable table rows */
.table tbody tr[data-href] {
  cursor: pointer;
}

/* ============================================================
   FORMS / INPUTS
   ============================================================ */
.form-control,
.form-select {
  border-color: var(--border-color);
  font-size: .875rem;
  border-radius: .5rem;
  color: #1e293b;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 .2rem rgba(0,102,255,.15);
  outline: none;
}

.form-control::placeholder { color: #94a3b8; }

.form-label {
  font-size: .8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .35rem;
}

.input-group-text {
  background: #f8fafc;
  border-color: var(--border-color);
  color: #94a3b8;
  font-size: .875rem;
}

.form-text {
  font-size: .75rem;
  color: #94a3b8;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-size: .875rem;
  font-weight: 600;
  border-radius: .5rem;
  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.btn-primary:active {
  background: #003d99;
  border-color: #003d99;
}

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

.btn-sm { font-size: .8rem; padding: .3rem .7rem; border-radius: .375rem; }
.btn-lg { font-size: .9375rem; padding: .65rem 1.5rem; }

/* Icon-only button */
.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .5rem;
  flex-shrink: 0;
}
.btn-icon.sm { width: 28px; height: 28px; border-radius: .375rem; }

/* ============================================================
   KANBAN BOARD
   ============================================================ */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
  min-height: calc(100vh - 200px);
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}
.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.kanban-col {
  flex: 0 0 280px;
  background: #e8edf2;
  border-radius: .75rem;
  padding: .75rem;
  min-height: 200px;
  transition: background .15s ease, border .15s ease;
}

.kanban-col.dragover {
  background: #dbeafe;
  border: 2px dashed var(--accent);
}

.kanban-col-header {
  font-weight: 700;
  font-size: .8125rem;
  padding: .4rem .5rem .6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
  color: #374151;
}

.kanban-col-count {
  background: rgba(0,0,0,.1);
  color: #374151;
  font-size: .7rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kanban-card {
  background: #fff;
  border-radius: .5rem;
  padding: .75rem;
  margin-bottom: .5rem;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  border-left: 3px solid transparent;
  user-select: none;
}
.kanban-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--card-shadow-lg);
}
.kanban-card.dragging {
  opacity: .5;
  transform: rotate(2deg) scale(.98);
}

.kanban-card-title {
  font-size: .8125rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: .35rem;
  line-height: 1.3;
}

.kanban-card-meta {
  font-size: .72rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.activity-feed { list-style: none; padding: 0; margin: 0; }

.activity-item {
  display: flex;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.activity-item:last-child { border-bottom: none; }

.activity-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}

.activity-text { font-size: .8125rem; color: #374151; line-height: 1.4; }
.activity-time { font-size: .72rem; color: #94a3b8; margin-top: .15rem; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { list-style: none; padding: 0; margin: 0; }

.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1.25rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: .3125rem;
  top: .5rem;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}
.timeline-item:last-child::before { display: none; }

.timeline-dot {
  position: absolute;
  left: 0;
  top: .25rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-dot.success { background: #22c55e; box-shadow: 0 0 0 2px #22c55e; }
.timeline-dot.warning { background: #f59e0b; box-shadow: 0 0 0 2px #f59e0b; }
.timeline-dot.danger  { background: #ef4444; box-shadow: 0 0 0 2px #ef4444; }
.timeline-dot.muted   { background: #94a3b8; box-shadow: 0 0 0 2px #94a3b8; }

.timeline-title { font-size: .8125rem; font-weight: 600; color: #1e293b; }
.timeline-body  { font-size: .8rem;  color: #64748b; margin-top: .15rem; }
.timeline-time  { font-size: .72rem; color: #94a3b8; margin-top: .15rem; }

/* ============================================================
   SEQUENCE / OUTREACH BUILDER
   ============================================================ */
.sequence-timeline {
  display: flex;
  gap: 0;
  align-items: center;
  overflow-x: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.sequence-step-card {
  flex: 0 0 180px;
  background: #fff;
  border-radius: .5rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  position: relative;
  box-shadow: var(--card-shadow);
  transition: var(--transition-fast);
}
.sequence-step-card:hover { box-shadow: var(--card-shadow-lg); }

.sequence-step-num {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sequence-connector {
  flex: 0 0 40px;
  height: 2px;
  background: var(--border-color);
  position: relative;
}
.sequence-connector::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: var(--border-color);
}

/* ============================================================
   CHART CONTAINER
   ============================================================ */
.chart-container {
  position: relative;
}

/* ============================================================
   FLASH ALERTS
   ============================================================ */
.alert {
  border-radius: .625rem;
  font-size: .875rem;
  border-left-width: 4px;
}
.alert-success { border-left-color: #22c55e; }
.alert-danger  { border-left-color: #ef4444; }
.alert-warning { border-left-color: #f59e0b; }
.alert-info    { border-left-color: #3b82f6; }

/* ============================================================
   TOASTS
   ============================================================ */
.toast {
  border: none;
  border-radius: .625rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 280px;
}

.toast-header {
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-weight: 600;
  font-size: .875rem;
  border-radius: .625rem .625rem 0 0;
}

/* ============================================================
   DROPDOWN MENUS
   ============================================================ */
.dropdown-menu {
  border-radius: .625rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  border: 1px solid var(--border-color);
  padding: .4rem;
  font-size: .875rem;
}

.dropdown-item {
  border-radius: .375rem;
  padding: .45rem .75rem;
  font-size: .875rem;
  color: #374151;
  transition: var(--transition-fast);
}
.dropdown-item:hover { background: #f8fafc; color: #0f172a; }
.dropdown-item.text-danger:hover { background: #fef2f2; }

.dropdown-header {
  font-size: .75rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .4rem .75rem;
}

.dropdown-divider { border-color: var(--border-color); margin: .3rem 0; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { gap: .2rem; }

.page-link {
  border-radius: .375rem !important;
  border-color: var(--border-color);
  color: #374151;
  font-size: .8125rem;
  padding: .35rem .65rem;
  transition: var(--transition-fast);
}
.page-link:hover { background: #f1f5f9; color: var(--accent); border-color: var(--border-color); }
.page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent);
}
.page-item.disabled .page-link { color: #cbd5e1; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

.modal-title {
  font-weight: 700;
  font-size: 1.0625rem;
  color: #0f172a;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
}

/* ============================================================
   AUTH LAYOUT
   ============================================================ */
.auth-body {
  background: var(--body-bg);
  min-height: 100vh;
}

.auth-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Left branding panel */
.auth-brand {
  flex: 0 0 42%;
  background: linear-gradient(145deg, #050d1f 0%, #0a1628 40%, #0f172a 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 3.5rem;
  position: relative;
  overflow: hidden;
}

/* Decorative circles */
.auth-brand::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,102,255,.12) 0%, transparent 70%);
  pointer-events: none;
}

.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,255,.08) 0%, transparent 70%);
  pointer-events: none;
}

.auth-brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #fff;
  line-height: 1;
}

.auth-brand-version {
  font-size: .7rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: .05em;
}

.auth-brand-tagline {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 1.5rem 0 .75rem;
  color: #e2e8f0;
}

.auth-brand-tagline-accent {
  color: var(--accent-cyan);
}

.auth-brand-desc {
  font-size: .875rem;
  color: #64748b;
  line-height: 1.6;
  max-width: 340px;
}

/* Feature bullets */
.auth-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.auth-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  padding: .6rem 0;
  border-top: 1px solid rgba(255,255,255,.05);
}
.auth-feature-list li:first-child { border-top: none; }

.auth-feature-icon {
  width: 32px;
  height: 32px;
  border-radius: .5rem;
  background: rgba(0,102,255,.18);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  flex-shrink: 0;
}

.auth-feature-list strong {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.3;
}
.auth-feature-list span {
  display: block;
  font-size: .75rem;
  color: #64748b;
  margin-top: .1rem;
}

.auth-brand-footer {
  margin-top: auto;
  padding-top: 2rem;
  font-size: .75rem;
  color: #475569;
}
.auth-brand-stat {
  font-weight: 700;
  color: var(--accent-cyan);
  font-size: .875rem;
}

/* Right card area */
.auth-card-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  background: #f8fafc;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  padding: 2.25rem 2rem;
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 .2rem rgba(0,102,255,.15);
}

.auth-card .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  padding: .6rem 1.5rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.auth-card .btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,102,255,.3);
}

.auth-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: .25rem;
}

.auth-card-sub {
  font-size: .875rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.empty-state-icon {
  font-size: 3rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}
.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .5rem;
}
.empty-state-desc {
  font-size: .875rem;
  color: #94a3b8;
  max-width: 320px;
  margin: 0 auto .75rem;
}

/* ============================================================
   SEARCH / FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.filter-bar .form-control,
.filter-bar .form-select {
  font-size: .8125rem;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.search-input-wrap .bi {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: .875rem;
  pointer-events: none;
}
.search-input-wrap .form-control {
  padding-left: 2.25rem;
}

/* ============================================================
   SETTINGS / PROFILE PAGE
   ============================================================ */
.settings-sidebar-nav .nav-link {
  color: #374151;
  padding: .5rem .875rem;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: var(--transition-fast);
  border-left: 3px solid transparent;
  text-decoration: none;
}
.settings-sidebar-nav .nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.settings-sidebar-nav .nav-link.active {
  background: #eff6ff;
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   RESPONSIVE — MOBILE/TABLET (< 992px)
   ============================================================ */
@media (max-width: 991.98px) {

  /* Hide fixed desktop sidebar; use offcanvas */
  nav.sidebar.d-none.d-lg-flex {
    display: none !important;
  }

  /* Topbar spans full width */
  .topbar {
    left: 0;
  }

  /* Main content no left margin */
  .main-content {
    margin-left: 0;
  }

  /* Auth layout stacks vertically */
  .auth-brand {
    flex: none;
    width: 100%;
    padding: 2rem;
    display: none !important; /* hidden on mobile, only md+ */
  }

  .auth-card-wrap {
    padding: 1.5rem 1rem;
  }

  /* Kanban: allow horizontal scroll */
  .kanban-board {
    padding-bottom: .75rem;
  }

  /* Tables: allow horizontal scroll */
  .table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 575.98px) {
  .topbar { padding: 0 1rem; }
  .topbar-title { font-size: .9375rem; }
  .main-content .container-fluid { padding-left: .875rem !important; padding-right: .875rem !important; }
  .page-header { margin-bottom: 1rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .stat-value { font-size: 1.375rem; }
}

/* ============================================================
   UTILITIES / MISCELLANEOUS
   ============================================================ */

/* Truncate helpers */
.text-2line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hover effect for clickable list items */
.list-hover-item {
  transition: background .1s ease;
  cursor: pointer;
}
.list-hover-item:hover { background: #f8fafc; }

/* Vertical divider */
.vr-sm {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  display: inline-block;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e8edf2 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.5s infinite;
  border-radius: .375rem;
}
@keyframes skeleton-shine {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Focus-visible ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Subtle dividers */
.divider-text {
  position: relative;
  text-align: center;
  color: #94a3b8;
  font-size: .75rem;
  margin: 1rem 0;
}
.divider-text::before,
.divider-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 1.5rem);
  height: 1px;
  background: var(--border-color);
}
.divider-text::before { left: 0; }
.divider-text::after  { right: 0; }

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Selection color */
::selection { background: rgba(0,102,255,.15); color: inherit; }
