/* ── MZ Digital Panel · Design System ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600;700&family=Onest:wght@300;400;500;600&display=swap');

:root {
  --bg:        #070810;
  --surface:   #0d0f1a;
  --card:      #111425;
  --card2:     #161930;
  --border:    #1e2235;
  --border2:   #252a42;
  --accent:    #6E9BFF;
  --accent2:   #3FE0C5;
  --grad:      linear-gradient(135deg, #6E9BFF 0%, #3FE0C5 100%);
  --grad-btn:  linear-gradient(135deg, #5a89ff 0%, #2ecfb5 100%);
  --text:      #e8eaf0;
  --text2:     #a0a8c0;
  --muted:     #4a5270;
  --danger:    #ff4d6d;
  --danger-bg: rgba(255,77,109,.12);
  --warn:      #f59e0b;
  --warn-bg:   rgba(245,158,11,.12);
  --ok:        #22c55e;
  --ok-bg:     rgba(34,197,94,.12);
  --info:      #6E9BFF;
  --info-bg:   rgba(110,155,255,.12);
  --sidebar-w: 240px;
  --header-h:  60px;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 12px rgba(0,0,0,.3);
  --transition: .18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Onest', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5 { font-family: 'Bricolage Grotesque', sans-serif; }

a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ── Scrollbar ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ══════════════════════════════════════════════════════════════════════ */
/*  LOGIN PAGE                                                            */
/* ══════════════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(110,155,255,.15) 0%, transparent 60%), var(--bg);
  padding: 1.5rem;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2rem;
}
.login-logo-mark {
  width: 40px; height: 40px;
  background: var(--grad);
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700; font-size: 1.1rem;
  color: #fff;
}
.login-logo-text { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.1rem; }
.login-logo-text span { background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.login-title { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem; }
.login-sub { color: var(--text2); font-size: .9rem; margin-bottom: 2rem; }

.login-error {
  background: var(--danger-bg);
  border: 1px solid rgba(255,77,109,.3);
  color: var(--danger);
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1rem;
  display: none;
}
.login-error.show { display: block; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field label { font-size: .8rem; font-weight: 500; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; }

.input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .7rem 1rem;
  color: var(--text);
  font-size: .95rem;
  width: 100%;
  transition: border-color var(--transition);
  outline: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--muted); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  padding: .7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 4px 16px rgba(110,155,255,.3);
}
.btn-primary:hover { opacity: .9; box-shadow: 0 6px 20px rgba(110,155,255,.4); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

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

.btn-ghost { color: var(--text2); }
.btn-ghost:hover { color: var(--text); background: var(--border); border-radius: var(--radius-sm); }

.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(255,77,109,.2); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: .45rem .85rem; font-size: .82rem; border-radius: 6px; }
.btn-icon { padding: .6rem; width: 38px; height: 38px; border-radius: var(--radius-sm); }
.btn-full { width: 100%; }

.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════════════ */
/*  APP SHELL                                                             */
/* ══════════════════════════════════════════════════════════════════════ */
.app { display: flex; min-height: 100dvh; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
}
.sidebar-logo-mark {
  width: 36px; height: 36px;
  background: var(--grad);
  border-radius: 9px;
  display: grid; place-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700; font-size: 1rem; color: #fff;
  flex-shrink: 0;
}
.sidebar-logo-text { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: .95rem; }
.sidebar-logo-text small { display: block; font-size: .7rem; font-weight: 400; color: var(--muted); font-family: 'Onest', sans-serif; }

.sidebar-nav { flex: 1; padding: .75rem .5rem; overflow-y: auto; }

.nav-section { margin-bottom: 1.25rem; }
.nav-section-label {
  font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 0 .75rem; margin-bottom: .35rem;
}

.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: .875rem; font-weight: 500;
  transition: all var(--transition);
  cursor: pointer; width: 100%; text-align: left;
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: var(--border); color: var(--text); }
.nav-item.active {
  background: rgba(110,155,255,.12);
  color: var(--accent);
}
.nav-item.active .nav-icon { color: var(--accent); }
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; }
.nav-item.active .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem; font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 99px;
  min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: .75rem .5rem;
  border-top: 1px solid var(--border);
}
.nav-item.nav-wa:hover { color: #25d366; background: rgba(37,211,102,.08); }
.nav-item.nav-wa .nav-icon { fill: currentColor; stroke: none; }
.sidebar-version { font-size: .62rem; color: var(--muted); text-align: center; padding: .4rem .75rem 0; letter-spacing: .04em; }

/* ── Main content ────────────────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100dvh; }

.header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 50;
}

.header-left { display: flex; align-items: center; gap: 1rem; }
.page-title { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.1rem; font-weight: 700; }

.header-right { display: flex; align-items: center; gap: .5rem; }

.avatar {
  width: 34px; height: 34px;
  background: var(--grad);
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: .8rem; color: #fff;
  cursor: pointer;
}

.content { flex: 1; padding: 1.75rem 1.5rem; max-width: 1200px; width: 100%; }

/* ── Mobile sidebar overlay ──────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99;
}

/* ══════════════════════════════════════════════════════════════════════ */
/*  DASHBOARD                                                             */
/* ══════════════════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad);
}
.kpi-label { font-size: .75rem; font-weight: 500; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }
.kpi-value { font-family: 'Bricolage Grotesque', sans-serif; font-size: 2rem; font-weight: 700; line-height: 1; }
.kpi-sub { font-size: .75rem; color: var(--muted); margin-top: .35rem; }
.kpi-icon {
  position: absolute; top: 1rem; right: 1rem;
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1rem;
}

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: .95rem; }
.card-body { padding: 1.25rem; }

/* ── Section header ──────────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap; gap: .75rem;
}
.section-title { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.25rem; font-weight: 700; }
.section-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ── Status badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 99px;
  font-size: .75rem; font-weight: 600;
  white-space: nowrap;
}
.badge-ok     { background: var(--ok-bg);     color: var(--ok); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warn   { background: var(--warn-bg);   color: var(--warn); }
.badge-info   { background: var(--info-bg);   color: var(--info); }
.badge-muted  { background: var(--border);    color: var(--text2); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: .6rem 1rem;
  text-align: left;
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.025); }
tbody td { padding: .85rem 1rem; font-size: .9rem; vertical-align: middle; }

/* ── List items ──────────────────────────────────────────────────────── */
.list-item {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: rgba(255,255,255,.02); }

.list-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
}

.list-info { flex: 1; min-width: 0; }
.list-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub  { font-size: .78rem; color: var(--text2); }

.list-end { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: .4; line-height: 1; }
.empty-icon svg { width: 2.5rem; height: 2.5rem; display: block; }
.empty-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1rem; color: var(--text2); margin-bottom: .35rem; }
.empty-sub { font-size: .85rem; }

/* ── Search & Filter bar ─────────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap .input { padding-left: 2.4rem; }

.select {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem 1rem;
  color: var(--text);
  font-size: .875rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.select:focus { border-color: var(--accent); }

/* ══════════════════════════════════════════════════════════════════════ */
/*  MODALS                                                                */
/* ══════════════════════════════════════════════════════════════════════ */
dialog {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  color: var(--text);
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  width: min(500px, 96vw);
  max-height: 90dvh;
  overflow-y: auto;
}
dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--card);
}
.modal-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.05rem; }
.modal-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: .75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

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

textarea.input { resize: vertical; min-height: 80px; }

/* ══════════════════════════════════════════════════════════════════════ */
/*  COBROS MODULE                                                         */
/* ══════════════════════════════════════════════════════════════════════ */
.cobros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.cobro-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  transition: all var(--transition);
}
.cobro-card:hover { border-color: var(--border2); }
.cobro-card.pagado { border-left: 3px solid var(--ok); }
.cobro-card.pendiente { border-left: 3px solid var(--warn); }
.cobro-card.vencido { border-left: 3px solid var(--danger); }

.cobro-name { font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.cobro-amount { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.4rem; font-weight: 700; margin: .4rem 0; }
.cobro-actions { margin-top: .75rem; display: flex; gap: .5rem; }

/* ── Month nav ───────────────────────────────────────────────────────── */
.month-nav {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem;
}
.month-label { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.1rem; font-weight: 700; min-width: 160px; text-align: center; }

/* ══════════════════════════════════════════════════════════════════════ */
/*  PIPELINE MODULE                                                       */
/* ══════════════════════════════════════════════════════════════════════ */
.kanban {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 400px;
  align-items: flex-start;
}

.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.kanban-col-header {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.kanban-col-title { font-weight: 700; font-size: .85rem; display: flex; align-items: center; gap: .5rem; }
.kanban-count {
  background: var(--border);
  color: var(--text2);
  font-size: .7rem; font-weight: 700;
  padding: .1rem .5rem;
  border-radius: 99px;
}
.kanban-cards { padding: .75rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }

.kanban-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem;
  cursor: pointer;
  transition: all var(--transition);
}
.kanban-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.kanban-card-name { font-weight: 600; font-size: .875rem; margin-bottom: .25rem; }
.kanban-card-sub { font-size: .78rem; color: var(--text2); }
.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: .6rem; }

/* ══════════════════════════════════════════════════════════════════════ */
/*  TAREAS MODULE                                                         */
/* ══════════════════════════════════════════════════════════════════════ */
.tarea-item {
  display: flex; align-items: flex-start; gap: .85rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.tarea-item:last-child { border-bottom: none; }
.tarea-item:hover { background: rgba(255,255,255,.02); }

.tarea-check {
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: .1rem;
}
.tarea-check:hover { border-color: var(--ok); }
.tarea-check.done { border-color: var(--ok); background: var(--ok); }
.tarea-check.done svg { color: #fff; }

.tarea-body { flex: 1; min-width: 0; }
.tarea-title { font-weight: 500; font-size: .9rem; }
.tarea-title.done { text-decoration: line-through; color: var(--muted); }
.tarea-meta { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; flex-wrap: wrap; }
.tarea-client { font-size: .75rem; color: var(--text2); }
.tarea-due { font-size: .75rem; color: var(--muted); }
.tarea-due.overdue { color: var(--danger); }

/* ══════════════════════════════════════════════════════════════════════ */
/*  SOPORTE MODULE                                                        */
/* ══════════════════════════════════════════════════════════════════════ */
.ticket-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: .75rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: flex-start; gap: 1rem;
}
.ticket-card:hover { border-color: var(--border2); transform: translateY(-1px); }

.ticket-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--info-bg);
  display: grid; place-items: center;
  flex-shrink: 0; color: var(--info);
}
.ticket-info { flex: 1; }
.ticket-title { font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
.ticket-meta { font-size: .78rem; color: var(--text2); display: flex; gap: .75rem; flex-wrap: wrap; }

/* ── Toast notifications ─────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: .5rem;
  z-index: 1000;
}
.toast {
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: .8rem 1.1rem;
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: .6rem;
  animation: slideIn .2s ease;
  max-width: 320px;
}
.toast.ok     { border-left: 3px solid var(--ok);     color: var(--ok); }
.toast.danger { border-left: 3px solid var(--danger); color: var(--danger); }
.toast.info   { border-left: 3px solid var(--accent); color: var(--accent); }
@keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

/* ── Loading spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem;
}

/* ── Grad text ───────────────────────────────────────────────────────── */
.grad-text { background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* ══════════════════════════════════════════════════════════════════════ */
/*  RESPONSIVE                                                            */
/* ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .main { margin-left: 0; padding-bottom: 70px; }

  .content { padding: 1rem; }

  .header { padding: 0 1rem; }

  /* Bottom nav */
  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 90;
    height: 64px;
  }
  .bottom-nav-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .2rem;
    color: var(--muted);
    font-size: .65rem; font-weight: 500;
    cursor: pointer;
    transition: color var(--transition);
    position: relative;
  }
  .bottom-nav-item svg { width: 22px; height: 22px; }
  .bottom-nav-item.active { color: var(--accent); }
  .bottom-nav-badge {
    position: absolute; top: 6px; right: calc(50% - 18px);
    background: var(--danger); color: #fff;
    font-size: .55rem; font-weight: 700;
    padding: .05rem .35rem; border-radius: 99px;
  }

  .kanban { flex-direction: column; }
  .kanban-col { width: 100%; }

  .form-row { grid-template-columns: 1fr; }

  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* Desktop — hide bottom nav */
@media (min-width: 769px) {
  .bottom-nav { display: none; }
}
