/* ── Design tokens (from prototype) ─────────────────────── */
:root {
  --bg:        #0D1117;
  --bg2:       #161C26;
  --bg3:       #1E2736;
  --bg4:       #252E40;
  --border:    rgba(255,255,255,.07);
  --border2:   rgba(255,255,255,.12);
  --text:      #E8ECF4;
  --text2:     #8B95A8;
  --text3:     #5A6478;
  --blue:      #3B7EF6;
  --blue-dim:  rgba(59,126,246,.12);
  --blue-glow: rgba(59,126,246,.25);
  --violet:    #7C5CFC;
  --violet-dim:rgba(124,92,252,.12);
  --green:     #22C97A;
  --green-dim: rgba(34,201,122,.12);
  --amber:     #F59E0B;
  --amber-dim: rgba(245,158,11,.12);
  --red:       #EF4444;
  --red-dim:   rgba(239,68,68,.12);
  --cyan:      #06B6D4;
  --cyan-dim:  rgba(6,182,212,.12);
  --radius:    10px;
  --radius-lg: 14px;
  --shadow:    0 4px 24px rgba(0,0,0,.35);
  --sidebar-w: 220px;
  --topbar-h:  54px;
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

/* ── Bootstrap dark overrides ────────────────────────────── */
[data-bs-theme="dark"] {
  --bs-body-bg:           var(--bg);
  --bs-body-color:        var(--text);
  --bs-card-bg:           var(--bg2);
  --bs-card-border-color: var(--border);
  --bs-border-color:      var(--border);
  --bs-secondary-bg:      var(--bg3);
  --bs-tertiary-bg:       var(--bg4);
  --bs-table-bg:          transparent;
  --bs-table-striped-bg:  rgba(255,255,255,.02);
  --bs-table-hover-bg:    var(--bg3);
  --bs-link-color:        var(--blue);
  --bs-link-hover-color:  #6fa8ff;
  --bs-input-bg:          var(--bg3);
  --bs-input-border-color:var(--border2);
  --bs-form-select-bg:    var(--bg3);
}

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

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── App layout ──────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 200;
}

.sidebar-logo {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-height: var(--topbar-h);
}
.sidebar-logo .logo-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--violet) 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 13px; color: #fff;
  flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--text);
  white-space: nowrap;
}
.sidebar-logo .logo-sub {
  font-size: 10px; color: var(--text3); letter-spacing: .04em; text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--bg4); }

.nav-section {
  padding: 14px 18px 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: .08em;
  text-transform: uppercase;
  user-select: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
  cursor: pointer;
  color: var(--text2);
  font-size: 13.5px;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: all .13s;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}
.nav-item:hover {
  background: var(--bg3);
  color: var(--text);
  text-decoration: none;
}
.nav-item.active {
  color: var(--blue);
  background: var(--blue-dim);
  border-left-color: var(--blue);
  font-weight: 500;
}
.nav-item .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
}
.nav-item .nav-badge.danger { background: var(--red); }
.nav-item .nav-badge.warning { background: var(--amber); color: #0d1117; }

.sidebar-bottom {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-bottom .avatar-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff; flex-shrink: 0;
  text-decoration: none;
}
.sidebar-bottom .user-name {
  font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.sidebar-bottom .user-role {
  font-size: 11px; color: var(--text3);
}

/* ── Main area ───────────────────────────────────────────── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 10px;
}
.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 6px 0 0;
  flex-shrink: 0;
}
.topbar-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
  text-decoration: none;
  font-size: .85rem;
  transition: background .12s, color .12s;
  position: relative;
  cursor: pointer;
}
.topbar-icon-btn:hover { background: var(--bg3); color: var(--text); }
.topbar-icon-btn .badge-dot {
  position: absolute;
  top: -3px; right: -3px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--bg2);
}

.topbar-user {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.topbar-user:hover { background: var(--bg3); color: var(--text); }
.topbar-user img {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
}
.topbar-user .u-initials {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #fff;
}

/* ── Content area ────────────────────────────────────────── */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 22px;
}
.content-area::-webkit-scrollbar { width: 5px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
.content-area::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  font-size: .84rem;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: .65rem 1rem;
}
.alert-success  { background: var(--green-dim); border-color: rgba(34,201,122,.25); color: #4ade80; }
.alert-danger   { background: var(--red-dim);   border-color: rgba(239,68,68,.25);  color: #f87171; }
.alert-warning  { background: var(--amber-dim); border-color: rgba(245,158,11,.25); color: #fbbf24; }
.alert-info     { background: var(--blue-dim);  border-color: rgba(59,126,246,.25); color: #93c5fd; }
.btn-close { filter: invert(1) brightness(.6); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: .65rem 1rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text3);
}
.card-body { color: var(--text); padding: 1rem; }
.shadow-sm { box-shadow: 0 2px 12px rgba(0,0,0,.28) !important; }
.border-0 { border: 1px solid var(--border) !important; }

/* ── Tables ──────────────────────────────────────────────── */
.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: var(--bg3);
  font-size: 13px;
  color: var(--text);
  margin-bottom: 0;
}
.table thead tr { border-bottom: 1px solid var(--border); }
.table th,
.table-light,
.table-light th {
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  color: var(--text3) !important;
  background: transparent !important;
  --bs-table-bg: transparent;
  --bs-table-color: var(--text3);
  border-bottom: 1px solid var(--border) !important;
  padding: 8px 12px;
  white-space: nowrap;
}
.table td {
  border-color: var(--border);
  padding: 10px 12px;
  vertical-align: middle;
  color: var(--text);
}
.table tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
}
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--bg3); }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }

/* ── Tag badges (prototype style) ───────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.tag-blue   { background: var(--blue-dim);   color: var(--blue); }
.tag-green  { background: var(--green-dim);  color: var(--green); }
.tag-amber  { background: var(--amber-dim);  color: var(--amber); }
.tag-red    { background: var(--red-dim);    color: var(--red); }
.tag-violet { background: var(--violet-dim); color: var(--violet); }
.tag-cyan   { background: var(--cyan-dim);   color: var(--cyan); }

/* Keep Bootstrap badges working */
.badge {
  font-weight: 500;
  letter-spacing: .01em;
  font-size: .7rem;
  padding: .25em .5em;
  border-radius: 20px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  border-radius: 8px;
  border: none;
  transition: all .13s;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--blue); color: #fff;
  --bs-btn-bg: var(--blue);
  --bs-btn-border-color: var(--blue);
  --bs-btn-hover-bg: #2d6de0;
  --bs-btn-hover-border-color: #2d6de0;
}
.btn-primary:hover { background: #2d6de0; color: #fff; }
.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--blue);
  --bs-btn-color: var(--blue);
  --bs-btn-border-color: var(--border2);
  --bs-btn-hover-bg: var(--blue-dim);
  --bs-btn-hover-color: var(--blue);
  --bs-btn-hover-border-color: var(--blue);
}
.btn-outline-secondary {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  --bs-btn-color: var(--text2);
  --bs-btn-border-color: var(--border);
  --bs-btn-hover-bg: var(--bg4);
  --bs-btn-hover-color: var(--text);
}
.btn-outline-secondary:hover { background: var(--bg4); color: var(--text); border-color: var(--border2); }
.btn-outline-danger {
  background: transparent; border: 1px solid rgba(239,68,68,.3); color: var(--red);
  --bs-btn-hover-bg: var(--red-dim);
  --bs-btn-hover-color: var(--red);
}
.btn-outline-success {
  background: transparent; border: 1px solid rgba(34,201,122,.3); color: var(--green);
  --bs-btn-hover-bg: var(--green-dim);
  --bs-btn-hover-color: var(--green);
}
.btn-outline-warning {
  background: transparent; border: 1px solid rgba(245,158,11,.3); color: var(--amber);
}
.btn-success {
  background: var(--green); color: #0d1117;
  --bs-btn-bg: var(--green);
  --bs-btn-border-color: var(--green);
}
.btn-danger {
  background: var(--red); color: #fff;
  --bs-btn-bg: var(--red);
  --bs-btn-border-color: var(--red);
}
.btn-sm { height: 27px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-dark {
  background: var(--bg3); color: var(--text2); border: 1px solid var(--border);
  --bs-btn-bg: var(--bg3);
  --bs-btn-border-color: var(--border);
}
.btn-dark:hover { background: var(--bg4); color: var(--text); }

.icon-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--bg4);
  border: none;
  color: var(--text2);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: all .13s;
}
.icon-btn:hover { background: var(--blue); color: #fff; }

/* ── Forms ───────────────────────────────────────────────── */
.form-control,
.form-select {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  padding: 8px 12px;
  transition: border .13s;
}
.form-control:focus,
.form-select:focus {
  background: var(--bg3);
  border-color: var(--blue);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--blue-dim);
  outline: none;
}
.form-control::placeholder { color: var(--text3); }
.form-control-sm,
.form-select-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 5px;
}
.form-text { font-size: .75rem; color: var(--text3); }
.form-check-input {
  background-color: var(--bg3);
  border-color: var(--border2);
}
.form-check-input:checked {
  background-color: var(--blue);
  border-color: var(--blue);
}
.form-check-label { font-size: 13px; color: var(--text2); font-weight: 400; }
.input-group-text {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text3);
  font-size: 13px;
}

/* ── Dropdowns ───────────────────────────────────────────── */
.dropdown-menu {
  background: var(--bg2);
  border: 1px solid var(--border2);
  box-shadow: 0 12px 36px rgba(0,0,0,.5);
  font-size: 13px;
  border-radius: 9px;
  padding: .35rem;
}
.dropdown-item {
  color: var(--text2);
  border-radius: 6px;
  padding: .45rem .75rem;
  font-family: var(--font-body);
}
.dropdown-item:hover { background: var(--bg3); color: var(--text); }
.dropdown-item:active { background: var(--blue-dim); color: var(--blue); }
.dropdown-item.text-danger { color: var(--red) !important; }
.dropdown-item.text-danger:hover { background: var(--red-dim); }
.dropdown-divider { border-color: var(--border); margin: .3rem 0; }

/* ── Modals ──────────────────────────────────────────────── */
.modal-content {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.modal-header, .modal-footer { border-color: var(--border); }
.modal-title { font-family: var(--font-head); font-weight: 600; font-size: 16px; color: var(--text); }
.modal-backdrop.show { opacity: .6; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { gap: 3px; }
.pagination .page-link {
  background: var(--bg2);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: .78rem;
  border-radius: 6px !important;
  padding: .3rem .65rem;
}
.pagination .page-link:hover { background: var(--bg3); color: var(--text); border-color: var(--border2); }
.pagination .page-item.disabled .page-link { opacity: .3; }
.pagination .page-item.active .page-link { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ── Kanban ──────────────────────────────────────────────── */
.kanban-col {
  min-width: 240px; width: 240px; flex-shrink: 0;
}
.kanban-col-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; margin-bottom: 8px;
}
.col-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.col-title {
  font-size: 12px; font-weight: 600; color: var(--text2);
  text-transform: uppercase; letter-spacing: .05em; flex: 1;
}
.col-count {
  font-size: 11px; color: var(--text3);
  background: var(--bg3); padding: 1px 7px; border-radius: 10px;
}
.kcard {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: all .13s;
}
.kcard:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* ── WhatsApp chat ───────────────────────────────────────── */
.chat-bg { background: #060c14 !important; }

/* ── Avatar circles ──────────────────────────────────────── */
.avatar-circle {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

/* ── Priority borders ────────────────────────────────────── */
.border-left-alta  { border-left: 3px solid var(--red)   !important; }
.border-left-media { border-left: 3px solid var(--amber) !important; }
.border-left-baja  { border-left: 3px solid var(--green) !important; }

/* ── Stats cards ─────────────────────────────────────────── */
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.stat-card .s-val {
  font-family: var(--font-head);
  font-size: 24px; font-weight: 600; color: var(--text);
}
.stat-card .s-lbl { font-size: 11px; color: var(--text3); margin-top: 2px; }
.stat-card .s-delta { font-size: 11px; color: var(--green); margin-top: 4px; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px; gap: 10px; color: var(--text3);
  text-align: center;
}
.empty-state .empty-icon { font-size: 2.5rem; opacity: .35; margin-bottom: 6px; }

/* ── Utilities ───────────────────────────────────────────── */
.fs-xs { font-size: .72rem; }
.cursor-pointer { cursor: pointer; }
.text-muted { color: var(--text2) !important; }
.text-dim { color: var(--text3) !important; }
.font-monospace { font-size: .82rem; }
.fw-semibold { font-weight: 500 !important; }
.font-head { font-family: var(--font-head); }

/* ── Login page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.login-brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 2rem;
}
.login-brand .logo-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 15px; color: #fff;
}
.login-brand .logo-label {
  font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--text);
}

/* ── Sidebar overlay (mobile) ────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 199;
}
.sidebar-overlay.show { display: block; }

/* ── Scrollbar global ────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── Dark mode class overrides (templates use Bootstrap light classes) ── */
.bg-white   { background: var(--bg3)  !important; }
.bg-light   { background: var(--bg3)  !important; }
.bg-body    { background: var(--bg)   !important; }
.text-dark  { color: var(--text)      !important; }
.text-body  { color: var(--text)      !important; }
/* WhatsApp preview panels */
[style*="background:#e5ddd5"],
[style*="background: #e5ddd5"] { background: #0d1a24 !important; }
[style*="background:white"],
[style*="background: white"]   { background: var(--bg2) !important; }
/* Badge warning contrast */
.badge.bg-warning { color: #0d1117 !important; }
/* card-header bg-warning */
.card-header.bg-warning { background: var(--amber-dim) !important; color: var(--amber) !important; border-color: rgba(245,158,11,.2) !important; }
/* bg-light badges */
.badge.bg-light { background: var(--bg4) !important; color: var(--text2) !important; border-color: var(--border2) !important; }
/* container-fluid compat (templates still use it, we just let content-area handle padding) */
.container-fluid { padding: 0; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100%;
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
    z-index: 200;
  }
  .sidebar.show {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,.6);
  }
  .topbar-hamburger { display: flex !important; }
  .content-area { padding: 14px 16px; }
  /* Kanban: narrower columns on tablet */
  .kanban-col { min-width: 210px; width: 210px; }
}

@media (max-width: 767.98px) {
  /* Content */
  .content-area { padding: 10px 12px; }

  /* Topbar */
  .topbar { padding: 0 12px; }
  .topbar-user-name { display: none; }

  /* Kanban: narrow columns on mobile */
  .kanban-col { min-width: 180px; width: 180px; }
  .kcard { padding: 10px 12px; }

  /* Stats cards: smaller numbers */
  .stat-card .s-val { font-size: 20px; }

  /* Tables: make cells compact */
  .table-sm td, .table-sm th { padding: .3rem .4rem; font-size: .8rem; }

  /* Login card: tighter padding on small screens */
  .login-card { padding: 1.75rem 1.25rem; }

  /* Page headings: smaller */
  h4.fw-bold, h4.mb-0.fw-bold { font-size: 1.1rem; }

  /* Bubbles: wider on mobile */
  .bubble { max-width: 88%; }

  /* Empty state: reduce padding */
  .empty-state { padding: 36px 20px; }

  /* Filters: stack items */
  .filter-row .col-6 { flex: 0 0 100%; max-width: 100%; }

  /* Inline select max-width: allow full width */
  select.form-select[style*="max-width"] { max-width: 100% !important; }
  select.form-select[style*="min-width"] { min-width: 0 !important; width: 100% !important; }

  /* Pagination: smaller */
  .pagination .page-link { padding: .2rem .5rem; font-size: .72rem; }
}

@media (max-width: 575.98px) {
  /* Content */
  .content-area { padding: 8px 10px; }

  /* Buttons that are too wide */
  .btn-group.w-100 .btn { font-size: .78rem; padding: .3rem .5rem; }

  /* Card header: smaller text */
  .card-header { font-size: .88rem; padding: .6rem .9rem; }

  /* Badges: ensure wrap */
  .d-flex.gap-2.flex-wrap { gap: .4rem !important; }

  /* Kanban col: minimum usable */
  .kanban-col { min-width: 160px; width: 160px; }

  /* Table action buttons: icon only */
  .table .btn-sm { padding: .2rem .35rem; font-size: .78rem; }
}

/* ── Global utility classes ───────────────────────── */
.badge-tag { cursor: pointer; user-select: none; transition: opacity .15s; }
.badge-tag:hover { opacity: .75; }
