/* =========================================================
   TallerPilot — Hoja de estilos principal
   Paleta: azul corporativo + acento naranja industrial
   ========================================================= */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f97316;
  --accent-dark: #ea580c;
  --sidebar-bg: #0f2440;
  --sidebar-bg-2: #0a1c33;
  --sidebar-text: #a7b4cc;
  --sidebar-active: #f97316;
  --bg: #eef1f6;
  --card: #ffffff;
  --text: #334155;
  --muted: #8592a6;
  --border: #e5e9f0;
  --success: #16a34a;
  --info: #0ea5e9;
  --warning: #f59e0b;
  --danger: #ef4444;
  --secondary: #94a3b8;
  --shadow: 0 2px 12px rgba(30, 41, 66, .07);
  --shadow-lg: 0 8px 30px rgba(30, 41, 66, .14);
  --radius: 12px;
  --sidebar-w: 240px;
}

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

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

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

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

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .25s ease;
}

.sidebar-profile {
  background: var(--accent);
  padding: 22px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  border: 2px solid rgba(255,255,255,.5);
}
.sidebar-profile .info { line-height: 1.25; }
.sidebar-profile .name { font-weight: 600; font-size: 14px; }
.sidebar-profile .role { font-size: 11.5px; opacity: .85; }

.sidebar-brand {
  padding: 16px 20px;
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  letter-spacing: .3px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-brand svg { color: var(--accent); }

.menu { list-style: none; padding: 10px 0; overflow-y: auto; flex: 1; }
.menu-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,.35); padding: 14px 22px 6px;
}
.menu li a {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 22px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  border-left: 3px solid transparent;
  transition: all .15s ease;
}
.menu li a svg { width: 18px; height: 18px; }
.menu li a:hover { background: rgba(255,255,255,.05); color: #fff; }
.menu li a.active {
  background: rgba(37,99,235,.18);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}
.sidebar-version {
  padding: 10px 22px 14px;
  color: rgba(255,255,255,.4);
  font-size: 10px;
  letter-spacing: .5px;
}

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

.topbar {
  height: 62px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}
.topbar .left { display: flex; align-items: center; gap: 14px; }
.topbar h1 { font-size: 17px; font-weight: 600; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); }

.search {
  display: flex; align-items: center;
  background: var(--bg);
  border-radius: 20px;
  padding: 7px 14px; gap: 8px;
  width: 260px; max-width: 40vw;
}
.search input { border: none; background: none; outline: none; width: 100%; font-size: 13px; color: var(--text); }
.topbar .right { display: flex; align-items: center; gap: 18px; }
.icon-badge { position: relative; color: var(--muted); cursor: pointer; }
.icon-badge .dot {
  position: absolute; top: -6px; right: -8px;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 1px 6px;
}

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

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; cursor: pointer;
  padding: 9px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  transition: all .15s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-light { background: var(--bg); color: var(--text); }
.btn-light:hover { background: #e2e5ee; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  background: var(--primary);
  color: #fff;
  padding: 12px 18px;
  font-weight: 600; font-size: 13.5px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-head.plain { background: var(--card); color: var(--text); border-bottom: 1px solid var(--border); }
.card-body { padding: 18px; }

/* ---------- Métricas (stat cards) ---------- */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 18px; margin-bottom: 22px;
}
.stat {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
}
.stat .stat-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.stat .stat-icon svg { width: 24px; height: 24px; }
.stat .value { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat .label { font-size: 12px; color: var(--muted); }
.bg-primary { background: var(--primary); }
.bg-info { background: var(--info); }
.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }

/* ---------- Grids del dashboard ---------- */
.dash-row { display: grid; gap: 18px; margin-bottom: 18px; }
.dash-row.main-row { grid-template-columns: 2.4fr 1fr; }
.dash-row.bottom-row { grid-template-columns: 1fr 1.2fr 1fr; }

/* ---------- Grid de gráficos estadísticos ---------- */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.chart-card { display: flex; flex-direction: column; }
.chart-card .card-head .ch-ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.chart-card .card-body { position: relative; height: 300px; }
.chart-card .card-body canvas { width: 100% !important; }

.donut-wrap { position: relative; display: flex; justify-content: center; align-items: center; height: 100%; }
.donut-center {
  position: absolute; text-align: center;
}
.donut-center .num { font-size: 26px; font-weight: 700; }
.donut-center .txt { font-size: 11px; color: var(--muted); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 11px 14px;
  color: var(--muted); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 2px solid var(--border);
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
table.data tbody tr:hover { background: #fafbfd; }
table.data tbody tr:last-child td { border-bottom: none; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-secondary { background: #eceef4; color: var(--secondary); }
.badge-info { background: #e3f0fa; color: var(--info); }
.badge-primary { background: #dbeafe; color: var(--primary); }
.badge-success { background: #e2f3ea; color: var(--success); }
.badge-warning { background: #fdf0dc; color: #c88519; }
.badge-danger { background: #fbe3e7; color: var(--danger); }

.prio-urgente { color: var(--danger); font-weight: 700; }
.prio-alta { color: var(--warning); font-weight: 600; }

/* ---------- Progreso ---------- */
.progress { background: var(--bg); border-radius: 20px; height: 8px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 20px; }

/* ---------- Página / cabecera ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-head h2 { font-size: 20px; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.input, select.input {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; background: var(--card); color: var(--text);
  outline: none;
}
.input:focus { border-color: var(--primary); }

/* ---------- Formularios ---------- */
.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fld { display: flex; flex-direction: column; }
.fld label { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.fld .input, .fld select.input, .fld textarea.input {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 13.5px; background: var(--card); color: var(--text);
  outline: none; font-family: inherit;
}
.fld .input:focus, .fld select.input:focus, .fld textarea.input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.fld .hint, .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.fld ul.errorlist, ul.errorlist { list-style: none; color: var(--danger); font-size: 12px; margin-top: 5px; }
@media (max-width: 768px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Paginación ---------- */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--text); background: var(--card);
  cursor: pointer; transition: all .15s ease;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn.disabled { opacity: .4; pointer-events: none; }
.page-btn svg { width: 16px; height: 16px; }
.page-info { margin-left: 10px; font-size: 12px; color: var(--muted); }

/* ---------- Línea de tiempo de seguimiento ---------- */
.timeline { list-style: none; position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 16px 12px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid var(--card); box-shadow: 0 0 0 2px var(--primary); }
.timeline li:last-child { padding-bottom: 0; }
.timeline .tl-fecha { font-size: 11px; color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty svg { width: 40px; height: 40px; margin-bottom: 10px; opacity: .5; }

.messages { margin-bottom: 16px; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.alert.success { background: #e2f3ea; color: #2f7d54; }
.alert.info { background: #e3f0fa; color: #2b6f9c; }
.alert.warning { background: #fdf0dc; color: #9c6c19; }
.alert.danger { background: #fbe3e7; color: #b23a4c; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f2440 0%, #2563eb 90%, #f97316 175%);
  padding: 20px;
}
.login-card {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 400px; overflow: hidden;
}
.login-head { background: var(--primary); color: #fff; padding: 34px 30px; text-align: center; }
.login-head .logo {
  width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 50%;
  background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.5);
}
.login-head h1 { font-size: 19px; font-weight: 700; }
.login-head p { font-size: 12.5px; opacity: .9; margin-top: 4px; }
.login-body { padding: 30px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.form-control {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 14px; font-size: 14px; outline: none; transition: border .15s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }
.login-error { background: #fbe3e7; color: #b23a4c; padding: 10px 14px; border-radius: 8px; font-size: 12.5px; margin-bottom: 16px; }
.login-hint { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-row.main-row, .dash-row.bottom-row { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .stats-grid { grid-template-columns: 1fr; }
  .search { width: 150px; }
}

/* ---------- Experiencia móvil completa ---------- */
.sidebar-backdrop,
.sidebar-close { display: none; }

@media (max-width: 768px) {
  html { overflow-x: hidden; }
  body { min-width: 0; overflow-x: hidden; }
  body.menu-open { overflow: hidden; touch-action: none; }

  .layout,
  .main { width: 100%; min-width: 0; }

  .sidebar {
    width: min(86vw, 320px);
    max-width: 100%;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 18px 0 44px rgba(8, 20, 38, .28);
  }
  .sidebar-profile { padding-top: max(18px, env(safe-area-inset-top)); }
  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    flex: 0 0 auto;
  }
  .sidebar-close svg { width: 20px; height: 20px; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    visibility: hidden;
    opacity: 0;
    border: 0;
    background: rgba(7, 17, 32, .58);
    backdrop-filter: blur(3px);
    transition: opacity .2s ease, visibility .2s ease;
  }
  body.menu-open .sidebar-backdrop { visibility: visible; opacity: 1; }

  .topbar {
    min-height: 62px;
    height: auto;
    padding: max(9px, env(safe-area-inset-top)) 14px 9px;
    gap: 8px;
  }
  .topbar .left { min-width: 0; flex: 1; gap: 8px; }
  .topbar .left h1 {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 15px;
  }
  .menu-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 10px;
  }
  .topbar .right { min-width: 0; max-width: 55%; gap: 6px; }
  .topbar .search,
  .topbar .icon-badge { display: none; }
  .topbar-company {
    min-width: 44px;
    max-width: 170px;
    height: 40px;
    padding: 8px 10px;
  }
  .topbar-company span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .content { width: 100%; min-width: 0; padding: 16px 14px max(24px, env(safe-area-inset-bottom)); }
  .page-head { align-items: stretch; margin-bottom: 16px; }
  .page-head > div:first-child { min-width: 0; }
  .page-head h2 { font-size: 19px; }
  .page-head > .btn,
  .page-head > .toolbar { width: 100%; }

  .toolbar { width: 100%; align-items: stretch; }
  .toolbar > .input,
  .toolbar > select.input { flex: 1 1 180px; width: 100%; min-width: 0; }
  .toolbar > .btn { flex: 1 1 auto; justify-content: center; }

  .btn { min-height: 44px; justify-content: center; }
  .btn-sm { min-height: 40px; padding: 8px 12px; }
  .input,
  select.input,
  .fld .input,
  .fld select.input,
  .fld textarea.input { min-height: 44px; font-size: 16px; }
  .fld textarea.input { min-height: 92px; resize: vertical; }

  .card { max-width: 100%; }
  .card-head { min-height: 46px; padding: 12px 14px; }
  .card-body { padding: 14px; }
  .chart-card .card-body { height: 250px; min-height: 220px; }
  .dash-row[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  .table-wrap { width: 100%; overflow: visible; }
  table.data,
  table.data tbody,
  table.data tr,
  table.data td { display: block; width: 100%; }
  table.data thead { display: none; }
  table.data { font-size: 13px; }
  table.data tbody { display: grid; gap: 12px; }
  table.data tbody tr {
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(30, 41, 66, .05);
  }
  table.data tbody tr:hover { background: var(--card); }
  table.data td {
    min-height: 42px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: minmax(90px, 38%) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    text-align: right !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  table.data td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .35px;
    text-align: left;
    text-transform: uppercase;
  }
  table.data td:last-child { border-bottom: 0; }
  table.data td.mobile-full-cell {
    display: block;
    padding: 18px 12px;
    text-align: center !important;
  }
  table.data td.mobile-full-cell::before { display: none; }
  table.data td .btn,
  table.data td form { justify-self: end; }
  table.data td form { display: inline-flex !important; }
  table.data td form + .btn { margin-left: 4px; }

  .pagination { justify-content: center; }
  .page-info { width: 100%; margin: 6px 0 0; text-align: center; }
}

@media (max-width: 480px) {
  .topbar .right { max-width: 48%; }
  .topbar-company { max-width: 118px; }
  .topbar .right > .btn:not(.topbar-company) { min-width: 44px; padding-inline: 10px; }
  .content { padding-inline: 12px; }
  .stats-grid { gap: 12px; }
  .stat { padding: 15px; }
  .stat .value { font-size: 21px; }
  .form-grid-2,
  .form-grid-3 { gap: 12px; }
  .toolbar { flex-direction: column; }
  .toolbar > * { width: 100%; }
}

/* ---------- Portal y evidencia de órdenes ---------- */
.portal-share-row { display:flex; align-items:center; gap:10px; }
.portal-share-row .input { flex:1; min-width:0; }
.check-label { display:flex; align-items:center; gap:9px; color:var(--text); font-size:12.5px; font-weight:600; cursor:pointer; }
.check-input { width:18px; height:18px; accent-color:var(--primary); }
.order-photo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:14px; }
.order-photo-card { display:flex; min-width:0; flex-direction:column; gap:9px; padding:10px; border:1px solid var(--border); border-radius:11px; background:var(--bg); }
.order-photo-card a { display:block; overflow:hidden; aspect-ratio:4/3; border-radius:8px; background:#dbe3ef; }
.order-photo-card img { width:100%; height:100%; display:block; object-fit:cover; }
.order-photo-card div { display:flex; min-width:0; flex-direction:column; }
.order-photo-card strong { font-size:12px; }
.order-photo-card div span { overflow:hidden; color:var(--muted); font-size:11px; white-space:nowrap; text-overflow:ellipsis; }
.order-photo-card form .btn { width:100%; }
.checklist-summary { display:flex; flex-wrap:wrap; gap:8px; }
.check-status { padding:7px 11px; border-radius:999px; font-size:11.5px; font-weight:700; }
.check-status.ok { color:#146c43; background:#e3f6ec; }
.check-status.fail { color:#a52a3a; background:#fde8eb; }
.btn-success { color:#fff; background:#16a34a; border-color:#16a34a; }
.btn-success:hover { color:#fff; background:#15803d; }

@media (max-width: 768px) {
  .portal-share-row { align-items:stretch; flex-direction:column; }
  .portal-share-row .btn { width:100%; }
  .order-photo-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 420px) {
  .order-photo-grid { grid-template-columns:1fr; }
}

/* Aviso de prueba / licencia */
.aviso-suscripcion { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; font-weight: 500; }
.aviso-prueba { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; }
.aviso-por_vencer { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.aviso-vencida { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.aviso-suscripcion-btn { padding: 6px 12px; border-radius: 8px; text-decoration: none; }
.aviso-suscripcion-btn { color: #fff !important; background: #4f46e5; }
.aviso-vencida .aviso-suscripcion-btn { background: #dc2626; }

/* ═══════════════════════════════════════════════════════════════════
   2026-10 · El panel con la misma identidad que la app
   Morado de marca #4f46e5, letra Inter, encabezado morado, menú lateral
   claro con la sección activa en morado suave, superficies planas y
   textos con contraste suficiente (gris #64748b como mínimo).
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --sidebar-bg: #ffffff;
  --sidebar-bg-2: #ffffff;
  --sidebar-text: #475569;
  --sidebar-active: #4f46e5;
  --bg: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #047857;
  --info: #0369a1;
  --warning: #b45309;
  --danger: #dc2626;
  --secondary: #64748b;
  --shadow: none;
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.14);
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}

/* Menú lateral claro */
.sidebar { background: #ffffff; border-right: 1px solid var(--border); }
.sidebar-profile { background: #ffffff; color: var(--text); border-bottom: 1px solid var(--border); }
.avatar { background: var(--primary); color: #ffffff; border: 0; }
.sidebar-profile .role { font-size: 12px; color: var(--muted); opacity: 1; }
.sidebar-brand { color: var(--text); border-bottom: 1px solid var(--border); }
.sidebar-brand svg { color: var(--primary); }
.menu-title { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--muted); }
.menu li a {
  margin: 2px 10px;
  padding: 10px 12px;
  border-left: 0;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-size: 14px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.menu li a:hover { background: #f1f5f9; color: var(--text); }
.menu li a.active { background: var(--primary-light); color: var(--primary); }
.sidebar-version { font-size: 12px; color: var(--muted); }
.sidebar-close { color: var(--text); }

/* Encabezado morado, como en la app */
.topbar { background: var(--primary); color: #ffffff; box-shadow: none; }
.topbar h1 { color: #ffffff; }
.menu-toggle { color: #ffffff; }
.topbar .btn-light { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.topbar .btn-light:hover { background: rgba(255, 255, 255, 0.24); }
.search { background: rgba(255, 255, 255, 0.14); }
.search svg { color: rgba(255, 255, 255, 0.9) !important; }
.search input { color: #ffffff; font-size: 14px; }
.search input::placeholder { color: rgba(255, 255, 255, 0.9); }
.topbar :focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
/* La campana y el sobre no tenían ninguna función. */
.icon-badge { display: none; }

/* Superficies planas: borde en lugar de sombra, títulos de tarjeta en texto */
.card,
.stat { box-shadow: none; border: 1px solid var(--border); }
.card-head { background: var(--card); color: var(--text); border-bottom: 1px solid var(--border); font-size: 15px; }
.stat .stat-icon { display: none; }
.stat .label { font-size: 13px; color: var(--muted); }
table.data { font-size: 14px; }
table.data th { font-size: 12px; text-transform: none; letter-spacing: 0; }
.badge { font-size: 12px; font-weight: 500; }

/* Respuesta al presionar */
.btn { transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease; }
.btn:active { transform: scale(0.97); }
