@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --c0: #fff;
  --c25: #FAFAF9;
  --c50: #F5F5F4;
  --c100: #EFEEEC;
  --c200: #E7E5E4;
  --c300: #D6D3D1;
  --c400: #A8A29E;
  --c500: #78716C;
  --c600: #57534E;
  --c700: #44403C;
  --c800: #292524;
  --c900: #1C1917;
  --brand: #1E3A8A;
  --brand-h: #1E40AF;
  --ok: #15803D;
  --ok-bg: #DCFCE7;
  --ok-t: #15803D;
  --wa: #B45309;
  --wa-bg: #FEF3C7;
  --wa-t: #B45309;
  --er: #B91C1C;
  --er-bg: #FEE2E2;
  --er-t: #B91C1C;
  --in: #334155;
  --in-bg: #E2E8F0;
  --in-t: #334155;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --sh-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --sh-md: 0 2px 8px rgba(0, 0, 0, .07), 0 1px 2px rgba(0, 0, 0, .04);
  --sh-lg: 0 8px 24px rgba(0, 0, 0, .10), 0 2px 4px rgba(0, 0, 0, .06);
  --r: 6px;
  --R: 10px;
  --sb: 260px;
  --tb: 64px;
  --trans: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-bg: #111827;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(255, 255, 255, 0.12);
}

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

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

a {
  text-decoration: none;
  color: inherit
}

/* ── SHELL ── */
.shell {
  display: grid;
  grid-template-columns: var(--sb) 1fr;
  min-height: 100vh;
  transition: var(--trans)
}

.sb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 90;
  display: none;
  opacity: 0;
  transition: opacity .3s
}

.sb {
  background: var(--c900);
  color: rgba(255, 255, 255, .78);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: var(--trans);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sb::-webkit-scrollbar {
  display: none;
}

.sb-brand {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sb-brand-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sb-toggle {
  background: transparent;
  border: 0;
  color: var(--c400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--r);
  transition: var(--trans);
  order: 10;
  margin-left: auto;
}



.sb-brand .mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sb-brand .mark .sb-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.sb-brand .name {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  transition: opacity .3s
}

.sb-brand .name em {
  font-style: normal;
  font-weight: 400;
  opacity: .6;
  margin-left: 3px
}

.sb-proj {
  padding: 12px 16px;
  margin: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--R);
  transition: var(--trans);
  display: flex;
  align-items: center;
  gap: 12px;
}

.proj-icon {
  display: none;
  width: 20px;
  height: 20px;
  color: #fff;
  opacity: 0.7;
}

.shell.collapsed .proj-icon {
  display: block;
}


.sb-proj .lbl {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .4);
  margin-bottom: 4px
}

.sb-proj .val {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: space-between
}

.sb-proj-content {
  width: 100%;
  min-width: 0;
}

.sb-proj-form {
  width: 100%;
}

.sb-proj-select-wrap {
  position: relative;
  width: 100%;
}

.sb-proj-select {
  width: 100%;
  appearance: none;
  background: rgba(255, 255, 255, 0.06);
  color: #1E3A8A;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 30px 7px 10px;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color .18s, background-color .18s;
}

.sb-proj-select:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.sb-proj-select:focus {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
}

.sb-proj-chevron {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px !important;
  height: 14px !important;
  color: rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.sb-proj-state {
  font-size: 10px;
  color: rgba(255, 255, 255, .45);
  margin-top: 4px;
}

.sb-group {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  padding: 24px 20px 8px;
  transition: var(--trans)
}

.sb nav {
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px
}

.sb a,
.sb button.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, .7);
  cursor: pointer;
  transition: var(--trans);
  border: 0;
  background: 0;
  width: 100%;
  text-align: left;
  position: relative
}

.sb a:hover,
.sb button.nav-btn:hover {
  background: var(--sidebar-hover);
  color: #fff
}

.sb a.active,
.sb button.nav-btn.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600
}

.sb a.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: var(--brand);
  border-radius: 0 4px 4px 0
}

.sb a .pill {
  margin-left: auto;
  font-size: 11px;
  font-family: var(--mono);
  background: var(--brand);
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600
}

.sb-user-wrap {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sb-user-wrap .logout {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--c400);
  font-size: 13px;
  transition: color .2s;
}

.sb-user-wrap .logout:hover {
  color: #fff;
}

.sb-user {
  display: flex;
  align-items: center;
  gap: 12px;
}


.sb-user .av {
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2)
}

.sb-user .who {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  transition: opacity .3s
}

.sb-user .who span {
  display: block;
  color: rgba(255, 255, 255, .45);
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px
}

.sb-user .logout {
  margin-left: auto;
  cursor: pointer;
  opacity: .5;
  transition: var(--trans);
  color: rgba(255, 255, 255, 0.7)
}

.sb-user .logout:hover {
  opacity: 1;
  color: var(--er)
}

.sb-user .logout i {
  width: 18px;
  height: 18px
}

/* Sidebar toggle buttons */
.sb-toggle,
.sb-close,
.menu-trigger {
  background: rgba(255, 255, 255, 0.05);
  border: 0;
  color: rgba(255, 255, 255, .6);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans);
  flex-shrink: 0;
}

.sb-toggle:hover,
.sb-close:hover {
  background: rgba(255, 255, 255, .15);
  color: #fff;
}

.sb-close {
  display: none;
}

.menu-trigger {
  color: var(--c600);
  display: none;
  width: 38px;
  height: 38px;
  background: var(--c100);
}

.menu-trigger:hover {
  background: var(--c200);
  color: var(--c900);
}

.sb i {
  width: 20px;
  height: 20px;
}

/* Collapsed state */
.shell.collapsed {
  --sb: 80px;
}

.shell.collapsed .sb-brand {
  flex-direction: column;
  justify-content: center;
  padding: 16px 0;
  gap: 16px;
}

.shell.collapsed .sb-toggle {
  order: 0;
  margin: 0;
}

.shell.collapsed .sb-brand-main {
  justify-content: center;
}

.shell.collapsed .sb-brand .name,
.shell.collapsed .sb-proj-content,
.shell.collapsed .sb-group,
.shell.collapsed .sb nav a span,
.shell.collapsed .sb-user-wrap .logout span,
.shell.collapsed .sb-user .who {
  display: none;
}

.shell.collapsed .sb-toggle i {
  transform: none;
}


.shell.collapsed .sb-proj {
  margin: 12px 8px;
  padding: 12px 0;
  display: flex;
  justify-content: center;
}

.shell.collapsed .sb-proj .val {
  justify-content: center;
}

.shell.collapsed .sb nav {
  padding: 4px 8px;
}

.shell.collapsed .sb nav a {
  justify-content: center;
  padding: 12px 0;
  margin: 2px 0;
}

.shell.collapsed .sb nav a .pill {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  padding: 1px 4px;
}

.shell.collapsed .sb-toggle i {
  transform: rotate(180deg);
}

.shell.collapsed .sb-user-wrap {
  align-items: center;
  padding: 20px 0;
}

.shell.collapsed .sb-user-wrap .logout {
  margin: 0;
  justify-content: center;
}

.shell.collapsed .sb-user-wrap .logout span,
.shell.collapsed .sb-user .who {
  display: none;
}

.shell.collapsed .sb-user {
  justify-content: center;
}

.shell.collapsed .sb-user .av {
  width: 36px;
  height: 36px;
  font-size: 12px;
}



/* ── MAIN ── */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0
}

.tb {
  background: #fff;
  border-bottom: 1px solid var(--c200);
  height: var(--tb);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20
}

.tb .bc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c500)
}

.tb .bc .sep {
  opacity: .5
}

.tb .bc .cur {
  color: var(--c800);
  font-weight: 500
}

.tb .srch {
  flex: 1;
  max-width: 360px;
  margin-left: auto;
  position: relative
}

.tb .srch input {
  width: 100%;
  height: 30px;
  border: 1px solid var(--c300);
  border-radius: var(--r);
  padding: 0 10px 0 30px;
  background: var(--c50);
  font-size: 13px;
  outline: none;
  font-family: var(--font)
}

.tb .srch input:focus {
  background: #fff;
  border-color: var(--brand)
}

.tb .srch svg,
.tb .srch i {
  position: absolute;
  left: 8px;
  top: 7px;
  opacity: .45
}

.tb .srch i {
  width: 14px;
  height: 14px
}

.tb .chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--c200);
  border-radius: var(--r);
  font-size: 11px;
  cursor: pointer
}

.tb .chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E
}

.pg {
  padding: 22px 26px
}

/* ── PAGE HEAD ── */
.ph {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px
}

.ph h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em
}

.ph .sub {
  font-size: 12px;
  color: var(--c500);
  margin-top: 3px
}

.ph .acts {
  display: flex;
  gap: 8px
}

/* ── BUTTONS ── */
.btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s, border-color .12s;
  white-space: nowrap
}

.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px
}

.btn-p {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand)
}

.btn-p:hover {
  background: var(--brand-h);
  border-color: var(--brand-h)
}

.btn-s {
  background: #fff;
  color: var(--c800);
  border-color: var(--c300)
}

.btn-s:hover {
  background: var(--c50)
}

.btn-g {
  background: transparent;
  color: var(--c800);
  border-color: transparent
}

.btn-g:hover {
  background: var(--c100)
}

.btn-d {
  background: #fff;
  color: var(--er);
  border-color: #FECACA
}

.btn-d:hover {
  background: #FEF2F2
}

.btn-sm {
  height: 27px;
  font-size: 12px;
  padding: 0 10px
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed
}

/* ── FORM ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px
}

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--c600)
}

.inp,
.sel,
textarea.inp {
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid var(--c300);
  border-radius: var(--r);
  background: #fff;
  color: var(--c800);
  height: 34px;
  outline: none;
  width: 100%
}

.inp:focus,
.sel:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, .1)
}

.inp.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums
}

textarea.inp {
  height: auto;
  resize: vertical
}

.inp-pre {
  display: flex;
  border: 1px solid var(--c300);
  border-radius: var(--r);
  overflow: hidden;
  height: 34px;
  background: #fff
}

.inp-pre:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, .1)
}

.inp-pre .px {
  background: var(--c50);
  padding: 0 9px;
  display: flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--c500);
  border-right: 1px solid var(--c200);
  white-space: nowrap
}

.inp-pre input {
  flex: 1;
  border: 0;
  padding: 0 9px;
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  font-variant-numeric: tabular-nums;
  background: transparent
}

.hint {
  font-size: 11px;
  color: var(--c400)
}

.err-msg {
  font-size: 11px;
  color: var(--er)
}

.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px
}

.g3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px
}

.g4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px
}

/* ── CARD ── */
.card {
  background: #fff;
  border: 1px solid var(--c200);
  border-radius: var(--R);
  box-shadow: var(--sh-sm)
}

.card-hd {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c200);
  display: flex;
  align-items: center;
  justify-content: space-between
}

.card-hd h3 {
  font-size: 13px;
  font-weight: 600
}

.card-hd .meta {
  font-size: 11px;
  color: var(--c500)
}

.card-bd {
  padding: 16px
}

.card-bd.flush {
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── TABLE ── */
.tbl {
  width: 100%;
  border-collapse: collapse
}

.tbl th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--c500);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 9px 14px;
  border-bottom: 1px solid var(--c200);
  background: var(--c50)
}

.tbl td {
  padding: 9px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--c200);
  vertical-align: middle
}

.tbl tr:last-child td {
  border-bottom: 0
}

.tbl tbody tr:hover td {
  background: var(--c50)
}

.tbl .r,
.tbl th.r {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono)
}

.tbl .mono {
  font-family: var(--mono)
}

.tbl .muted {
  color: var(--c400)
}

/* ── BADGE ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--r)
}

.badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0
}

.b-ok {
  background: var(--ok-bg);
  color: var(--ok-t)
}

.b-wa {
  background: var(--wa-bg);
  color: var(--wa-t)
}

.b-er {
  background: var(--er-bg);
  color: var(--er-t)
}

.b-in {
  background: var(--in-bg);
  color: var(--in-t)
}

.b-ne {
  background: var(--c100);
  color: var(--c600)
}

/* ── KPI CARD ── */
.kpi {
  background: #fff;
  border: 1px solid var(--c200);
  border-radius: var(--R);
  padding: 14px 16px
}

.kpi .lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c500)
}

.kpi .val {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 600;
  color: var(--c900);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em
}

.kpi .dl {
  font-size: 11px;
  font-weight: 500;
  margin-top: 4px;
  font-family: var(--mono)
}

.kpi .dl.pos {
  color: var(--ok)
}

.kpi .dl.neg {
  color: var(--er)
}

.kpi .dl.neu {
  color: var(--c400)
}

/* ── TOAST ── */
/* Notificaciones globales. z-index por encima de modales/overlays (.over = 100)
   para que los mensajes (incluidos los de error) siempre sean visibles, aunque
   haya un modal abierto. */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 24px;
  border-radius: 8px;
  background: #1e1b18;
  color: #fff;
  font-size: 13px;
  transform: translateY(100px);
  opacity: 0;
  transition: .3s;
  z-index: 2000;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background: #ef4444;
}

.toast.success {
  background: #10b981;
}

/* ── MODAL ── */
.over {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 9, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  overflow: hidden
}

.modal {
  background: #fff;
  border-radius: var(--R);
  box-shadow: var(--sh-lg);
  width: 480px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  margin: 0;
  display: flex;
  flex-direction: column
}

.modal>form {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.modal.lg {
  width: 720px
}

.modal.xl {
  width: 940px
}

.modal-hd {
  padding: 14px 18px;
  border-bottom: 1px solid var(--c200);
  display: flex;
  align-items: center;
  justify-content: space-between
}

.modal-hd h3 {
  font-size: 14px;
  font-weight: 600
}

.modal-bd {
  padding: 18px;
  overflow: auto;
  min-height: 0
}

.modal-ft {
  padding: 11px 18px;
  border-top: 1px solid var(--c200);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--c25);
  border-radius: 0 0 var(--R) var(--R)
}

/* ── TABS ── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--c200);
  margin-bottom: 16px
}

.tabs .tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .12s
}

.tabs .tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand)
}

.tabs .tab:hover {
  color: var(--c700)
}

/* ── ALERT ── */
.alert {
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start
}

.alert-warn {
  background: var(--wa-bg);
  color: var(--wa);
  border: 1px solid #FDE68A
}

.alert-err {
  background: var(--er-bg);
  color: var(--er);
  border: 1px solid #FECACA
}

.alert-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #BBF7D0
}

.alert-info {
  background: var(--in-bg);
  color: var(--in);
  border: 1px solid #CBD5E1
}

/* ── MISC ── */
.sep {
  height: 1px;
  background: var(--c200);
  margin: 14px 0
}

.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c500)
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums
}

.muted {
  color: var(--c400)
}

.text-ok {
  color: var(--ok)
}

.text-er {
  color: var(--er)
}

.text-wa {
  color: var(--wa)
}

.flex {
  display: flex;
  align-items: center;
  gap: 8px
}

.ml-auto {
  margin-left: auto
}

.progress {
  height: 5px;
  background: var(--c100);
  border-radius: 3px;
  overflow: hidden
}

.progress .bar {
  height: 100%;
  background: var(--brand);
  border-radius: 3px
}

/* ── SVG ICON placeholder ── */
svg.ic {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0
}

svg.ic {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  html, body {
    overflow-x: hidden;
  }

  .shell {
    display: block;
    min-height: 100vh;
  }

  .sb {
    position: fixed;
    left: -280px;
    z-index: 1200;
    transition: left .3s ease;
    width: 280px;
    height: 100vh;
    box-shadow: 10px 0 50px rgba(0, 0, 0, .3);
  }

  .sb.open {
    left: 0;
  }

  body.menu-open .shell > .sb-backdrop,
  .shell:has(.sb.open) > .sb-backdrop {
    display: block;
    opacity: 1;
    z-index: 1190;
  }

  .sb-brand {
    position: relative;
  }

  .sb-close {
    display: flex;
    position: absolute;
    right: 12px;
    top: 16px;
    z-index: 2;
  }

  .sb-toggle {
    display: none;
  }

  .menu-trigger {
    display: flex;
  }

  .main {
    width: 100%;
    margin: 0;
    max-width: 100%;
  }

  .card {
    max-width: 100%;
    min-width: 0;
  }

  .tb {
    padding: 0 16px;
    gap: 10px;
  }

  .tb .bc {
    display: none;
  }

  .tb .srch {
    flex: 1;
    max-width: none;
    margin-left: auto;
  }

  /* Force full visibility when open on mobile */
  .sb.open .sb-brand .name,
  .sb.open .sb-user .who {
    display: block !important;
  }

  .sb.open .sb-user {
    flex-direction: row !important;
    justify-content: flex-start !important;
    padding: 16px !important;
    gap: 12px !important;
  }

  .sb.open .sb-user .logout {
    margin-left: auto !important;
  }
}

@media (max-width: 768px) {
  .g2, .g3, .g4, .responsive-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .g2 > *, .g3 > *, .g4 > *, .responsive-grid > * {
    min-width: 0;
  }

  .ph {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .ph .acts {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .ph .acts .btn,
  .ph .acts a {
    flex: 1;
  }

  .ph .acts .btn {
    width: 100%;
    justify-content: center;
  }

  .pg {
    padding: 16px;
  }

  .tbl {
    min-width: 700px;
  }

  .tbl th, .tbl td {
    white-space: nowrap;
  }
}

.tb .srch {
  flex: 1;
  max-width: 380px;
  position: relative;
  display: flex;
  align-items: center;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  height: 38px;
  margin-right: 16px;
  transition: all 0.2s;
}

.tb .srch:focus-within {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.03);
}

.tb .srch .ic-srch {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #71717a;
  pointer-events: none;
}

.tb .srch input {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 12px 0 38px;
  font-size: 13.5px;
  color: #18181b;
}

.tb .srch-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(420px, 60vh);
  overflow: auto;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  z-index: 120;
}

.srch-empty {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--c500);
}

.srch-group + .srch-group {
  border-top: 1px solid var(--c100);
}

.srch-group-label {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c500);
}

.srch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.srch-item:hover,
.srch-item.is-active {
  background: var(--c50);
}

.srch-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.srch-item-main strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--c900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.srch-item-main small {
  font-size: 12px;
  color: var(--c500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.srch-meta {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--c100);
  color: var(--c600);
}

.srch-meta--activa,
.srch-meta--activo,
.srch-meta--disponible {
  background: #DCFCE7;
  color: #15803D;
}

.srch-meta--anulada,
.srch-meta--inactivo {
  background: #FEE2E2;
  color: #B91C1C;
}

.srch-meta--moroso,
.srch-meta--reservado {
  background: #FEF3C7;
  color: #B45309;
}

.srch-meta--vendido {
  background: #E2E8F0;
  color: #475569;
}

.tb .srch button {
  display: none;
}

@media (max-width: 640px) {
  .tb {
    gap: 8px;
  }

  .tb .srch input {
    display: none;
  }

  .tb .srch {
    flex: 0;
    width: 32px;
    height: 32px;
    margin-left: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c100);
    border-radius: var(--r);
    transition: var(--trans);
  }

  .tb .srch.active {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 50;
    padding: 0 16px;
    flex: 1;
    border-radius: 0;
  }

  .tb .srch.active .srch-results {
    top: calc(100% + 2px);
    left: 16px;
    right: 16px;
  }

  .tb .srch i,
  .tb .srch svg {
    position: static !important;
    width: 18px !important;
    height: 18px !important;
    opacity: 1;
    flex-shrink: 0;
  }

  .tb .srch.active input {
    display: block !important;
    flex: 1;
    border: 0;
    background: transparent;
    height: 100%;
    font-size: 15px;
  }

  .tb .srch button {
    display: none;
  }

  .tb .srch.active button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    padding: 4px;
    color: var(--c500);
    cursor: pointer;
  }

  .hide-mobile {
    display: none !important;
  }

  .tb .chip {
    padding: 0 8px;
    height: 32px;
    font-size: 10px;
    flex-shrink: 0;
  }
}
