/* =====================================================================
   DISAH INVENTARIO - Hoja de estilos principal
   ===================================================================== */

:root {
  --dark: #2a2a2a;
  --cyan: #07b4de;
  --white: #ffffff;
  --navy: #16486e;
  --navy-light: #1d5a8a;
  --grey: #f4f6f9;
  --grey2: #e8ecf1;
  --grey3: #c5cdd6;
  --grey4: #8a96a3;
  --success: #2da06b;
  --warning: #d97706;
  --danger: #dc2626;

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'Lato', sans-serif;

  --shadow-sm: 0 1px 2px rgba(22, 72, 110, 0.05);
  --shadow-md: 0 2px 8px rgba(22, 72, 110, 0.08);
  --shadow-lg: 0 8px 24px rgba(22, 72, 110, 0.12);
  --shadow-xl: 0 16px 48px rgba(22, 72, 110, 0.18);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  font-family: var(--font-body);
  color: var(--dark);
  background: var(--grey);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--navy);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ============================================
   LAYOUT GENERAL
   ============================================ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--cyan) 50%, transparent);
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
}

.sidebar__scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.sidebar__scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar__scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar__scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

.sidebar__scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}

.sidebar__brand {
  padding: 20px 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar__logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.sidebar__brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
  line-height: 1;
}

.sidebar__brand-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cyan);
  font-weight: 500;
  margin-top: 4px;
}

.sidebar__section {
  padding: 20px 16px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.78);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 14px;
  font-weight: 400;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--white);
}

.nav-item.active {
  background: var(--navy-light);
  color: var(--white);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--cyan);
  border-radius: 0 2px 2px 0;
}

.nav-item__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-item__badge {
  margin-left: auto;
  background: var(--cyan);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar__user {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 1px;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar__user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar__user-info {
  flex: 1;
  min-width: 0;
}

.sidebar__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
  font-weight: 600;
}

.sidebar__user-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.sidebar__user-logout:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
}

/* ============================================
   MAIN AREA
   ============================================ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--grey);
}

.topbar {
  background: var(--white);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--grey2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.005em;
}

.topbar__title-sub {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--grey4);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: 0;
}

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

.topbar__search {
  position: relative;
  width: 280px;
}

.topbar__search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--grey2);
  border-radius: var(--radius-md);
  background: var(--grey);
  color: var(--dark);
  font-size: 13px;
  transition: var(--transition);
}

.topbar__search input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(7,180,222,0.12);
}

.topbar__search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--grey4);
}

.topbar__notif {
  background: var(--grey);
  border: 1px solid var(--grey2);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  position: relative;
  transition: var(--transition);
}

.topbar__notif:hover {
  background: var(--grey2);
}

.topbar__notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--cyan);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.content {
  padding: 24px 32px 48px;
  flex: 1;
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */
.page { display: none; animation: fadeIn 300ms ease-out; }
.page.active { display: block; }

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: var(--font-body);
  letter-spacing: 0.01em;
}

.btn--primary {
  background: var(--navy);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--accent {
  background: var(--cyan);
  color: var(--navy);
}

.btn--accent:hover {
  background: #05a3cb;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: var(--white);
  color: var(--navy);
  border-color: var(--grey2);
}

.btn--ghost:hover {
  background: var(--grey);
  border-color: var(--grey3);
}

.btn--danger {
  background: var(--white);
  color: var(--danger);
  border-color: #fecaca;
}

.btn--danger:hover {
  background: #fef2f2;
  border-color: var(--danger);
}

.btn--sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn--icon {
  padding: 8px;
  width: 34px;
  height: 34px;
  justify-content: center;
}

/* ============================================
   KPI CARDS (Dashboard)
   ============================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi {
  background: var(--white);
  border: 1px solid var(--grey2);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi:hover {
  border-color: var(--grey3);
  box-shadow: var(--shadow-md);
}

.kpi::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cyan);
  opacity: 0;
  transition: var(--transition);
}

.kpi:hover::after { opacity: 1; }

.kpi__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--grey4);
  font-weight: 600;
  margin-bottom: 8px;
}

.kpi__value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -0.01em;
}

.kpi__sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--grey4);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi__trend {
  font-weight: 700;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.kpi__trend--up { background: #dcfce7; color: var(--success); }
.kpi__trend--down { background: #fee2e2; color: var(--danger); }

/* ============================================
   CARDS GENERICAS
   ============================================ */
.card {
  background: var(--white);
  border: 1px solid var(--grey2);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card__header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--grey2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
}

.card__body { padding: 20px 24px; }

/* ============================================
   PANEL DE 2 COLUMNAS DASHBOARD
   ============================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

/* ============================================
   ALERTAS STOCK
   ============================================ */
.alert-list {
  display: flex;
  flex-direction: column;
}

.alert-item {
  padding: 14px 24px;
  border-bottom: 1px solid var(--grey2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-item:last-child { border-bottom: none; }

.alert-item__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: #fef3c7;
  color: var(--warning);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alert-item__info { flex: 1; min-width: 0; }

.alert-item__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-item__meta {
  font-size: 12px;
  color: var(--grey4);
}

.alert-item__stock {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--danger);
}

/* ============================================
   ACTIVIDAD RECIENTE
   ============================================ */
.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  padding: 14px 24px;
  border-bottom: 1px solid var(--grey2);
  display: flex;
  gap: 12px;
}

.activity-item:last-child { border-bottom: none; }

.activity-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-item__dot--entrada { background: var(--success); }
.activity-item__dot--venta { background: var(--cyan); }
.activity-item__dot--ajuste { background: var(--warning); }

.activity-item__content { flex: 1; min-width: 0; }

.activity-item__title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.activity-item__meta {
  font-size: 12px;
  color: var(--grey4);
}

/* ============================================
   TABLA DE PRODUCTOS
   ============================================ */
.toolbar {
  background: var(--white);
  border: 1px solid var(--grey2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar__search {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.toolbar__search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--grey2);
  border-radius: var(--radius-md);
  background: var(--grey);
  font-size: 13px;
  transition: var(--transition);
}

.toolbar__search input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(7,180,222,0.12);
}

.toolbar__search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--grey4);
}

.select {
  padding: 9px 30px 9px 12px;
  border: 1px solid var(--grey2);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23677584' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: var(--transition);
}

.select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(7,180,222,0.12);
}

.table-card {
  background: var(--white);
  border: 1px solid var(--grey2);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

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

.table th {
  background: var(--grey);
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey4);
  border-bottom: 1px solid var(--grey2);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--grey2);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }

.table tr:hover td { background: var(--grey); }

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

.table__product-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--grey);
  border: 1px solid var(--grey2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey4);
}

.table__product-name {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 2px;
}

.table__product-sku {
  font-size: 11px;
  color: var(--grey4);
  font-family: monospace;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--success { background: #dcfce7; color: var(--success); }
.badge--warning { background: #fef3c7; color: var(--warning); }
.badge--danger { background: #fee2e2; color: var(--danger); }
.badge--info { background: #dbeafe; color: var(--navy); }
.badge--cyan { background: rgba(7,180,222,0.12); color: var(--navy); }

.table__actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey4);
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--grey);
  color: var(--navy);
}

.icon-btn--danger:hover {
  background: #fef2f2;
  color: var(--danger);
}

.table-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--grey2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--grey);
  font-size: 12px;
  color: var(--grey4);
}

.pagination {
  display: flex;
  gap: 4px;
}

.pagination button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--grey2);
  background: var(--white);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
  transition: var(--transition);
}

.pagination button:hover:not(.active) {
  background: var(--grey);
  border-color: var(--grey3);
}

.pagination button.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* ============================================
   FORMULARIO CRUD
   ============================================ */
.form-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.form-image {
  background: var(--grey);
  border: 2px dashed var(--grey3);
  border-radius: var(--radius-lg);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--grey4);
  text-align: center;
  padding: 20px;
}

.form-image:hover {
  border-color: var(--cyan);
  background: rgba(7,180,222,0.04);
  color: var(--navy);
}

.form-image__hint {
  font-size: 12px;
  line-height: 1.4;
}

.form-image__optional {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey4);
  font-weight: 600;
  margin-top: 8px;
}

.form-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field--full { grid-column: 1 / -1; }

.field__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.field__required {
  color: var(--cyan);
  font-size: 14px;
  line-height: 1;
}

.field__optional {
  font-size: 10px;
  color: var(--grey4);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  margin-left: auto;
}

.field input,
.field textarea,
.field select {
  padding: 9px 12px;
  border: 1px solid var(--grey2);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--white);
  color: var(--dark);
  transition: var(--transition);
  font-family: var(--font-body);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(7,180,222,0.12);
}

.field__hint {
  font-size: 11px;
  color: var(--grey4);
}

.field-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.field-row .field { flex: 1; }

.input-prefix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--grey2);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  transition: var(--transition);
}

.input-prefix:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(7,180,222,0.12);
}

.input-prefix__addon {
  background: var(--grey);
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--grey4);
  border-right: 1px solid var(--grey2);
  display: flex;
  align-items: center;
}

.input-prefix input {
  border: none !important;
  flex: 1;
  box-shadow: none !important;
}

.form-section {
  background: var(--white);
  border: 1px solid var(--grey2);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.form-section__header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--grey2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section__num {
  width: 24px;
  height: 24px;
  background: var(--navy);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
}

.form-section__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.form-section__body { padding: 20px; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 0;
  position: sticky;
  bottom: 0;
  background: var(--grey);
  border-top: 1px solid var(--grey2);
  margin: 16px -32px -48px;
  padding: 16px 32px;
}

/* ============================================
   LOGIN
   ============================================ */
.login-page {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top left, rgba(7,180,222,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(7,180,222,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  padding: 40px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-xl);
}

.login-card__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.login-card__logo svg {
  width: 64px;
  height: 64px;
}

.login-card__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--navy);
  letter-spacing: 0.02em;
  margin-top: 12px;
}

.login-card__sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cyan);
  font-weight: 600;
  margin-top: 4px;
}

.login-card__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 4px;
}

.login-card__desc {
  font-size: 13px;
  color: var(--grey4);
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form__forgot {
  text-align: right;
  font-size: 12px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
}

.login-form__forgot:hover { color: var(--cyan); }

.login-form button[type="submit"] {
  margin-top: 8px;
  padding: 12px;
  font-size: 14px;
  justify-content: center;
  width: 100%;
}

.login-card__footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--grey2);
  text-align: center;
  font-size: 11px;
  color: var(--grey4);
  letter-spacing: 0.05em;
}

/* ============================================
   MODAL
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 72, 110, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fadeIn 200ms ease-out;
}

.modal-backdrop.active { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalSlide 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
}

.modal__body { padding: 20px 24px; }
.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--grey2);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--grey);
}

.modal__close {
  background: none;
  border: none;
  color: var(--grey4);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.modal__close:hover {
  background: var(--grey);
  color: var(--dark);
}

/* ============================================
   PROMPT INICIAL
   ============================================ */
.demo-banner {
  position: fixed;
  top: 16px;
  right: 16px;
  background: var(--navy);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  z-index: 200;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--cyan);
}

.demo-banner button {
  background: var(--cyan);
  color: var(--navy);
  border: none;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   PAGE HEADER (en páginas internas)
   ============================================ */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header__title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.005em;
  line-height: 1;
}

.page-header__crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--grey4);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 8px;
}

.page-header__crumbs a {
  color: var(--grey4);
  text-decoration: none;
}

.page-header__crumbs a:hover { color: var(--navy); }

.page-header__actions {
  display: flex;
  gap: 8px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--grey2);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--navy);
}

@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .topbar__search { width: 200px; }
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 240px;
    z-index: 50;
    transition: left 300ms ease;
  }
  .sidebar.open { left: 0; box-shadow: var(--shadow-xl); }
  .menu-toggle { display: flex; }
  .topbar { padding: 12px 16px; }
  .topbar__title { font-size: 18px; }
  .topbar__title-sub { display: none; }
  .topbar__search { display: none; }
  .content { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr; gap: 12px; }
  .kpi { padding: 16px 18px; }
  .kpi__value { font-size: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-fields { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header__actions { width: 100%; }
  .page-header__actions .btn { flex: 1; justify-content: center; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .form-actions {
    flex-direction: column-reverse;
    margin-left: -16px;
    margin-right: -16px;
    padding: 12px 16px;
  }
  .form-actions .btn { width: 100%; justify-content: center; }
  .login-card { padding: 28px 22px; }
  .table th, .table td { padding: 10px 12px; }
  .demo-banner { left: 16px; right: 16px; top: 8px; flex-wrap: wrap; }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(22, 72, 110, 0.5);
  z-index: 40;
}

.sidebar-overlay.active { display: block; }

/* ============================================
   FORM RADIO PILLS
   ============================================ */
.radio-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.radio-pills input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-pills label {
  padding: 8px 14px;
  border: 1px solid var(--grey2);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--grey4);
  background: var(--white);
  transition: var(--transition);
}

.radio-pills input[type="radio"]:checked + label {
  border-color: var(--cyan);
  background: rgba(7,180,222,0.08);
  color: var(--navy);
}

.radio-pills label:hover {
  border-color: var(--grey3);
  color: var(--navy);
}

/* ============================================
   UTILS
   ============================================ */
.text-right { text-align: right; }
.font-mono { font-family: 'SF Mono', Monaco, monospace; font-size: 12px; }
.text-muted { color: var(--grey4); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }

/* Decorative element inspired by logo */
.deco-lines {
  display: inline-block;
  width: 24px;
  height: 14px;
  background-image: repeating-linear-gradient(
    0deg,
    var(--cyan) 0,
    var(--cyan) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.4;
}