/* ============================================================
   Wevanta PMS – Premium Design System
   ============================================================ */

/* ── CSS Variables (Dark Theme Default) ──────────────────── */
:root {
  --bg-primary:    #0d0d1a;
  --bg-secondary:  #12122b;
  --bg-card:       #161630;
  --bg-hover:      #1e1e40;
  --bg-input:      #1a1a35;
  --bg-sidebar:    #0f0f24;
  --bg-topbar:     rgba(13,13,26,.92);

  --border:        rgba(99,102,241,.15);
  --border-light:  rgba(255,255,255,.06);

  --accent:        #6366f1;
  --accent-light:  #818cf8;
  --accent-glow:   rgba(99,102,241,.25);
  --accent-2:      #8b5cf6;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #3b82f6;

  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;
  --text-accent:   #a5b4fc;

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --shadow:        0 4px 24px rgba(0,0,0,.4);
  --shadow-accent: 0 4px 24px rgba(99,102,241,.25);
  --shadow-card:   0 2px 12px rgba(0,0,0,.3);

  --transition:    all .2s cubic-bezier(.4,0,.2,1);
  --font:          'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;

  --sidebar-w:     260px;
  --topbar-h:      64px;
}

[data-theme="light"] {
  --bg-primary:    #f8fafc;
  --bg-secondary:  #f1f5f9;
  --bg-card:       #ffffff;
  --bg-hover:      #f1f5f9;
  --bg-input:      #ffffff;
  --bg-sidebar:    #1e1b4b;
  --bg-topbar:     rgba(248,250,252,.92);

  --border:        rgba(99,102,241,.18);
  --border-light:  rgba(0,0,0,.07);

  --text-primary:  #1e293b;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --text-accent:   #6366f1;

  --shadow:        0 4px 24px rgba(0,0,0,.08);
  --shadow-card:   0 2px 12px rgba(0,0,0,.06);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}

a { color: var(--accent-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
img { max-width:100%; height:auto; display:block; }
button, input, select, textarea { font-family: var(--font); }
::selection { background: var(--accent); color: #fff; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-light); }

/* ── Layout ───────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  transition: margin-left .3s;
}

.page-wrapper {
  padding: 28px 32px;
  max-width: 1600px;
}

@media (max-width: 1024px) {
  .main-content { margin-left: 0; }
  .page-wrapper { padding: 20px 16px; }
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700;
  box-shadow: var(--shadow-accent);
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  display: flex; flex-direction: column;
}
.sidebar-logo .logo-name {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary); line-height: 1.2;
}
.sidebar-logo .logo-tagline {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-section {
  margin-bottom: 4px;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 12px 20px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-radius: 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  margin: 1px 10px;
  border-radius: var(--radius-sm);
}

.sidebar-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: .8;
}

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

.sidebar-link.active {
  background: var(--accent-glow);
  color: var(--text-primary);
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.sidebar-link.active i { opacity: 1; }

.sidebar-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  line-height: 1.6;
}

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

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-user:hover { background: var(--bg-hover); }
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  z-index: 900;
  transition: left .3s;
}

.topbar-search {
  flex: 1;
  max-width: 380px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 16px 9px 40px;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  transition: var(--transition);
}

.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.topbar-search .search-icon {
  position: absolute;
  left: 13px;
  top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  font-size: 16px;
}
.topbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-topbar);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: .7; }
}

/* ── Avatar ───────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-initials {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  font-size: 12px;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}

.card:hover { border-color: rgba(99,102,241,.3); }
.card-sm { padding: 16px; }
.card-flat { border-radius: var(--radius); }

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

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.accent::before { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.stat-card.success::before { background: linear-gradient(90deg, var(--success), #059669); }
.stat-card.warning::before { background: linear-gradient(90deg, var(--warning), #d97706); }
.stat-card.danger::before  { background: linear-gradient(90deg, var(--danger),  #dc2626); }
.stat-card.info::before    { background: linear-gradient(90deg, var(--info),    #2563eb); }

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}
.stat-icon.accent  { background: rgba(99,102,241,.15);  color: var(--accent); }
.stat-icon.success { background: rgba(16,185,129,.15);  color: var(--success); }
.stat-icon.warning { background: rgba(245,158,11,.15);  color: var(--warning); }
.stat-icon.danger  { background: rgba(239,68,68,.15);   color: var(--danger); }
.stat-icon.info    { background: rgba(59,130,246,.15);  color: var(--info); }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  display: flex; align-items: center; gap: 4px;
}
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); color:#fff; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-light); background: var(--bg-hover); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; transform: translateY(-1px); }

.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { background: #d97706; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 9px; }

.btn:disabled { opacity: .5; pointer-events: none; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  transition: var(--transition);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.6; }

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }

.form-row {
  display: grid;
  gap: 16px;
}
.form-row.col-2 { grid-template-columns: 1fr 1fr; }
.form-row.col-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* Project / task statuses */
.badge-active      { background: rgba(16,185,129,.15);  color: #10b981; }
.badge-completed   { background: rgba(99,102,241,.15);  color: #818cf8; }
.badge-on-hold     { background: rgba(245,158,11,.15);  color: #f59e0b; }
.badge-cancelled   { background: rgba(239,68,68,.15);   color: #ef4444; }
.badge-pending     { background: rgba(100,116,139,.15); color: #94a3b8; }
.badge-in-progress { background: rgba(59,130,246,.15);  color: #60a5fa; }
.badge-review      { background: rgba(139,92,246,.15);  color: #a78bfa; }
.badge-planning    { background: rgba(245,158,11,.15);  color: #fbbf24; }
.badge-backlog     { background: rgba(100,116,139,.12); color: #64748b; }
.badge-todo        { background: rgba(100,116,139,.15); color: #94a3b8; }
.badge-testing     { background: rgba(20,184,166,.15);  color: #2dd4bf; }
.badge-done        { background: rgba(16,185,129,.15);  color: #10b981; }
/* Bug statuses */
.badge-open        { background: rgba(239,68,68,.12);   color: #fca5a5; }
.badge-closed      { background: rgba(100,116,139,.15); color: #94a3b8; }
.badge-resolved    { background: rgba(16,185,129,.15);  color: #34d399; }
.badge-wont-fix    { background: rgba(100,116,139,.12); color: #64748b; }
/* Priorities */
.badge-critical    { background: rgba(239,68,68,.15);   color: #ef4444; }
.badge-high        { background: rgba(249,115,22,.15);  color: #fb923c; }
.badge-medium      { background: rgba(245,158,11,.15);  color: #fbbf24; }
.badge-low         { background: rgba(100,116,139,.15); color: #94a3b8; }
/* Task types */
.badge-feature     { background: rgba(59,130,246,.15);  color: #60a5fa; }
.badge-bug         { background: rgba(239,68,68,.12);   color: #fca5a5; }
.badge-improvement { background: rgba(16,185,129,.12);  color: #34d399; }
.badge-task        { background: rgba(139,92,246,.12);  color: #c4b5fd; }
.badge-chore       { background: rgba(100,116,139,.12); color: #94a3b8; }
/* Approval statuses */
.badge-approved    { background: rgba(16,185,129,.15);  color: #10b981; }
.badge-rejected    { background: rgba(239,68,68,.15);   color: #ef4444; }
.badge-revision    { background: rgba(245,158,11,.15);  color: #fbbf24; }
/* Roles */
.badge-super-admin      { background: rgba(239,68,68,.12);   color: #fca5a5; }
.badge-project-manager  { background: rgba(99,102,241,.12);  color: #818cf8; }
.badge-developer        { background: rgba(59,130,246,.12);  color: #60a5fa; }
.badge-designer         { background: rgba(236,72,153,.12);  color: #f9a8d4; }
.badge-qa-tester        { background: rgba(20,184,166,.12);  color: #2dd4bf; }
.badge-client           { background: rgba(245,158,11,.12);  color: #fbbf24; }
/* Announcement types */
.badge-info        { background: rgba(59,130,246,.12);  color: #60a5fa; }
.badge-success     { background: rgba(16,185,129,.12);  color: #34d399; }
.badge-warning     { background: rgba(245,158,11,.12);  color: #fbbf24; }
.badge-danger      { background: rgba(239,68,68,.12);   color: #fca5a5; }
/* Fallback */
.badge-default     { background: var(--bg-hover); color: var(--text-muted); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 13px 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background .15s;
}

.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table td { padding: 13px 16px; color: var(--text-primary); vertical-align: middle; }

/* ── Progress ─────────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--bg-hover);
}

.progress-ring-fill {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset .6s cubic-bezier(.4,0,.2,1);
}

/* ── Kanban ───────────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 200px);
}

.kanban-column {
  min-width: 280px;
  max-width: 280px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 1;
}

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

.kanban-col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.kanban-col-count {
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.kanban-cards {
  padding: 12px;
  flex: 1;
  overflow-y: auto;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: grab;
  transition: var(--transition);
  position: relative;
}

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

.kanban-card.dragging {
  opacity: .6;
  cursor: grabbing;
  transform: rotate(2deg) scale(1.02);
}

.kanban-card.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.kanban-add-btn {
  margin: 8px 12px 12px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
  width: calc(100% - 24px);
}
.kanban-add-btn:hover { border-color: var(--accent); color: var(--accent-light); background: var(--accent-glow); }

/* ── Notifications Dropdown ───────────────────────────────── */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  z-index: 9999;
  overflow: hidden;
}

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

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background .15s;
  cursor: pointer;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(99,102,241,.05); }
.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 10px;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: 6px;
}

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  min-width: 300px;
  max-width: 420px;
  pointer-events: all;
  animation: slideInRight .3s cubic-bezier(.4,0,.2,1);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    .toast-icon { color: var(--info); }

.toast-body { flex: 1; }
.toast-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.toast-msg   { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.toast-close {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer; padding: 2px;
  display: flex; align-items: center;
  font-size: 14px;
  transition: color .15s;
}
.toast-close:hover { color: var(--text-primary); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

.toast.removing { animation: slideOutRight .3s forwards; }

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-light); }
.breadcrumb .separator { color: var(--border); font-size: 10px; }
.breadcrumb .current { color: var(--text-primary); font-weight: 500; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .2s;
}
.modal-overlay.show { opacity: 1; }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95) translateY(10px);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.show .modal-box { transform: scale(1) translateY(0); }

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

.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

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

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; opacity: .3; margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 13.5px; }

/* ── Skeleton Loader ──────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-hover) 25%,
    var(--bg-input) 50%,
    var(--bg-hover) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shine 1.4s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shine {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent-light); border-bottom-color: var(--accent); font-weight: 600; }

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

/* ── Glassmorphism Cards (special) ───────────────────────── */
.glass-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  padding: 24px;
}

/* ── Gradient text ────────────────────────────────────────── */
.text-gradient {
  background: linear-gradient(135deg, var(--accent-light), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Auth Page ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-glow {
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .12;
  pointer-events: none;
}
.auth-glow-1 { background: var(--accent); top: -150px; left: -150px; }
.auth-glow-2 { background: var(--accent-2); bottom: -200px; right: -100px; }

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.auth-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 800;
  box-shadow: var(--shadow-accent);
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── Alert ────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert-error   { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.25);  color: #fca5a5; }
.alert-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.25); color: #6ee7b7; }
.alert-info    { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.25); color: #93c5fd; }
.alert-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); color: #fcd34d; }

/* ── Dropdown ─────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 180px;
  z-index: 9999;
  overflow: hidden;
  animation: dropIn .2s cubic-bezier(.4,0,.2,1);
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .12s;
  text-decoration: none;
}

.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger:hover { background: rgba(239,68,68,.1); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Utilities ────────────────────────────────────────────── */
.flex   { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent  { color: var(--accent-light); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.w-100 { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .form-row.col-2, .form-row.col-3 { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .topbar { left: 0; padding: 0 16px; }
  .kanban-board { flex-direction: column; }
  .kanban-column { min-width: 100%; max-width: 100%; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-title { font-size: 18px; }
}

/* ════════════════════════════════════════════════════════════
   Mobile App Experience
   ════════════════════════════════════════════════════════════ */

/* ── Sidebar: hidden off-screen on mobile ─────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1001;
    box-shadow: none;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 6px 0 32px rgba(0,0,0,.55);
  }
}

/* ── Sidebar backdrop overlay ─────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1000;
  animation: fadeInBd .2s ease;
}
.sidebar-backdrop.show { display: block; }

@keyframes fadeInBd {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Bottom Navigation Bar ────────────────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(58px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-topbar);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 900;
  align-items: stretch;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  padding: 8px 4px 6px;
  border: none;
  background: none;
  cursor: pointer;
  transition: color .15s, transform .1s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.bottom-nav-item i { font-size: 21px; line-height: 1; }
.bottom-nav-item .label { font-size: 9.5px; }

.bottom-nav-item.active {
  color: var(--accent-light);
}

.bottom-nav-item.active i {
  filter: drop-shadow(0 0 5px var(--accent-glow));
}

.bottom-nav-item:active { transform: scale(.9); }

.bottom-nav-badge {
  position: absolute;
  top: 5px;
  right: calc(50% - 18px);
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  line-height: 1.5;
  border: 1.5px solid var(--bg-topbar);
}

/* ── Show bottom nav on mobile ────────────────────────────── */
@media (max-width: 1024px) {
  .mobile-bottom-nav { display: flex; }

  .main-content {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  .toast-container {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    left: 12px;
    align-items: stretch;
  }

  .toast {
    min-width: unset;
    max-width: 100%;
    width: 100%;
    animation: slideInUp .3s cubic-bezier(.4,0,.2,1);
  }

  @keyframes slideInUp {
    from { transform: translateY(60px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
}

/* ── Topbar on mobile ─────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar {
    left: 0;
    padding: 0 12px;
    gap: 8px;
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  }

  .main-content { padding-top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); }

  /* Collapse search to icon-only on small screens */
  .topbar-search { display: none; }

  /* Notification dropdown – full width */
  .notif-dropdown {
    position: fixed !important;
    top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    max-height: calc(100dvh - var(--topbar-h) - 70px);
    overflow-y: auto;
  }

  /* Modal – slide up from bottom on mobile */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-box {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 92dvh;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
  }

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

  /* Prevent iOS zoom on input focus */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Better touch targets */
  .sidebar-link  { min-height: 44px; }
  .dropdown-item { padding: 12px 14px; min-height: 44px; }
  .btn           { min-height: 44px; }

  /* Remove hover lifts (feel wrong on touch) */
  .stat-card:hover   { transform: none; }
  .btn-primary:hover { transform: none; }
  .btn-success:hover { transform: none; }
  .btn-danger:hover  { transform: none; }
  .kanban-card:hover { transform: none; }
}

@media (max-width: 480px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .page-header > .btn,
  .page-header > div > .btn {
    width: 100%;
    justify-content: center;
  }

  .tabs {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; }

  .tab-btn { padding: 10px 12px; font-size: 13px; }
}

/* ── iOS momentum scrolling ───────────────────────────────── */
.sidebar-body,
.kanban-board,
.table-wrapper,
.notif-dropdown,
.modal-box {
  -webkit-overflow-scrolling: touch;
}

/* ── Remove tap highlight globally ───────────────────────── */
a, button, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

/* ── Touch-action: no double-tap delay ───────────────────── */
button, a, .btn, .sidebar-link, .tab-btn, .dropdown-item {
  touch-action: manipulation;
}
