:root {
    --sidebar-width: 264px;
    --sidebar-bg: #111827;
    --sidebar-bg-soft: #1f2937;
    --sidebar-text: #9ca3af;
    --sidebar-active: #ffffff;
    --body-bg: #f5f7fa;
    --border: #dde3ea;
    --text: #111827;
    --muted: #6b7280;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--body-bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-wrapper {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    overflow-y: auto;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255,255,255,.05);
}

.sidebar-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 82px;
    padding: 20px 22px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-brand strong,
.sidebar-brand small {
    display: block;
}

.sidebar-brand strong {
    font-size: 15px;
}

.sidebar-brand small {
    margin-top: 2px;
    color: #6b7280;
    font-size: 11px;
}

.brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 8px;
    background: var(--sidebar-bg-soft);
}

.sidebar-nav {
    padding: 14px 12px 30px;
}

.sidebar-title {
    margin: 24px 12px 8px;
    color: #667085;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sidebar-link {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 3px;
    border-radius: 7px;
    color: var(--sidebar-text);
    font-size: 14px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
    transform: translateX(2px);
}

.sidebar-link.active {
    color: var(--sidebar-active);
    background: rgba(255,255,255,.1);
}

.sidebar-link i {
    width: 19px;
    text-align: center;
}

.main-content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: 38px;
}

.page-header {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 34px;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 750;
    letter-spacing: -.03em;
}

.eyebrow {
    color: #7c8798;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
}

.status-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: flex-end;
}

.status-label {
    color: var(--muted);
    font-size: 11px;
}

.system-note {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 11px 0;
    color: #4b5563;
    border-block: 1px solid var(--border);
    font-size: 13px;
}

.metric {
    height: 100%;
    padding: 18px 0 22px;
    border-top: 1px solid var(--border);
}

.metric-label,
.metric-meta {
    display: block;
}

.metric-label {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.metric-value {
    display: block;
    margin-bottom: 6px;
    font-size: clamp(25px, 2.8vw, 34px);
    font-weight: 760;
    letter-spacing: -.04em;
}

.metric-meta {
    color: #98a2b3;
    font-size: 11px;
}

.workspace {
    padding: 28px 0 0;
    border-top: 1px solid var(--border);
}

.workspace-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.workspace h2 {
    margin: 0;
    font-size: 22px;
}

.phase-badge {
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #4b5563;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: 24px;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.check-grid > div {
    padding: 16px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,.45);
    font-size: 13px;
}

.check-grid i {
    margin-right: 7px;
}

.error-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 30px;
}

.error-code {
    display: block;
    margin-bottom: 15px;
    font-size: 76px;
    font-weight: 800;
    letter-spacing: -.07em;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
    }

    .main-content {
        margin-left: 0;
        padding: 24px;
    }

    .sidebar-nav {
        display: none;
    }

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

@media (max-width: 575.98px) {
    .page-header {
        flex-direction: column;
    }

    .status-group {
        align-items: flex-start;
    }

    .check-grid {
        grid-template-columns: 1fr;
    }
}
.disabled-link{opacity:.5;pointer-events:none}.topbar{display:flex;justify-content:flex-end;gap:18px;align-items:center;min-height:66px;padding:10px 32px;border-bottom:1px solid #dde3ea;background:#fff}.topbar>div{display:grid;text-align:right;line-height:1.15}.topbar-label{color:#98a2b3;font-size:10px;text-transform:uppercase;letter-spacing:.08em}.topbar strong{font-size:13px}.topbar small{color:#6b7280;font-size:11px}.page-body{padding:34px 38px 42px}.auth-shell{display:grid;grid-template-columns:minmax(420px,560px) 1fr;min-height:100vh}.auth-panel{display:flex;flex-direction:column;justify-content:center;padding:clamp(32px,7vw,90px);background:#fff}.auth-brand{display:flex;gap:14px;align-items:center;margin-bottom:26px}.auth-brand h1{margin:0;font-size:34px;letter-spacing:-.04em}.brand-mark.large{width:44px;height:44px}.auth-aside{display:flex;align-items:flex-end;min-height:100vh;padding:60px;color:#fff;background:linear-gradient(180deg,rgba(17,24,39,.25),rgba(17,24,39,.96)),radial-gradient(circle at top right,#334155 0,#111827 60%)}.auth-aside h2{max-width:540px;font-size:clamp(40px,7vw,78px);line-height:.95;letter-spacing:-.06em}.auth-aside p{max-width:620px;color:#cbd5e1}.permission-list>div{display:grid;grid-template-columns:18px 1fr auto;gap:8px;padding:10px 0;border-bottom:1px solid #dde3ea;font-size:13px}.permission-list small{color:#6b7280}@media(max-width:991.98px){.auth-shell{grid-template-columns:1fr}.auth-aside{display:none}.page-body{padding:24px}.topbar{padding-inline:20px}}

.exchange-hero{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:#dde3ea;border:1px solid #dde3ea}
.exchange-hero>div{padding:22px;background:#fff}
.exchange-hero span{display:block;color:#6b7280;font-size:11px;margin-bottom:8px}
.exchange-hero strong{display:block;font-size:30px;letter-spacing:-.04em}
@media(max-width:767.98px){.exchange-hero{grid-template-columns:1fr}}

.product-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:var(--border);border:1px solid var(--border)}
.product-facts>div{padding:18px;background:#fff}
.product-facts span{display:block;color:var(--muted);font-size:11px;margin-bottom:7px}
.product-facts strong{display:block;font-size:16px}
@media(max-width:767.98px){.product-facts{grid-template-columns:1fr 1fr}}
@media(max-width:575.98px){.product-facts{grid-template-columns:1fr}}


/* ===== FASE 11 · THEME TOKENS ===== */
:root{
  --brand-primary:#111827;
  --brand-primary-2:#1f2937;
  --brand-accent:#d4a72c;
  --surface:#ffffff;
  --surface-soft:#f6f7f9;
  --text:#111827;
  --muted:#6b7280;
  --border:#e5e7eb;
  --success:#15803d;
  --warning:#b45309;
  --danger:#b91c1c;
  --radius:14px;
  --shadow:0 12px 30px rgba(17,24,39,.08);
}

.kpi-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:22px;
  box-shadow:var(--shadow);
}
.kpi-card span{display:block;color:var(--muted);font-size:12px;margin-bottom:10px}
.kpi-card strong{display:block;font-size:28px;line-height:1.1}
.kpi-card small{display:block;color:var(--muted);margin-top:8px}
.dashboard-rate{background:var(--brand-primary);color:#fff;padding:12px 18px;border-radius:var(--radius)}
.dashboard-rate span{display:block;font-size:11px;opacity:.7}.dashboard-rate strong{font-size:20px}
.metric-big{font-size:32px;font-weight:700}
.chart-bars{display:flex;align-items:flex-end;gap:12px;min-height:250px;overflow-x:auto;padding-top:25px}
.chart-col{min-width:58px;text-align:center}.chart-col span{font-size:11px;color:var(--muted)}
.chart-bar{width:30px;margin:4px auto 8px;background:linear-gradient(180deg,var(--brand-accent),var(--brand-primary));border-radius:8px 8px 3px 3px}
.chart-value{font-size:9px;white-space:nowrap;color:var(--muted)}
.activity-row{display:flex;justify-content:space-between;gap:15px;padding:12px 0;border-bottom:1px solid var(--border)}
.activity-row:last-child{border-bottom:0}.activity-row small{display:block;color:var(--muted)}
.report-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px}
.report-card{display:flex;flex-direction:column;gap:8px;padding:18px;border:1px solid var(--border);border-radius:var(--radius);text-decoration:none;color:var(--text);background:var(--surface)}
.report-card:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.report-card i{font-size:22px;color:var(--brand-accent)}
.report-card small{color:var(--muted)}

/* ===== AUDITORÍA FINAL · MOBILE / RESPONSIVE ===== */
.mobile-menu-toggle,.sidebar-overlay{display:none}
@media (max-width: 991.98px){
  body{overflow-x:hidden}
  body.sidebar-open{overflow:hidden}
  .sidebar{position:fixed;inset:0 auto 0 0;width:min(86vw,320px);min-height:100vh;z-index:1050;transform:translateX(-102%);transition:transform .22s ease;box-shadow:0 0 40px rgba(0,0,0,.22)}
  body.sidebar-open .sidebar{transform:translateX(0)}
  .sidebar-nav{display:block}
  .sidebar-overlay{display:block;position:fixed;inset:0;z-index:1040;border:0;background:rgba(15,23,42,.45);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s ease,visibility .2s ease}
  body.sidebar-open .sidebar-overlay{opacity:1;visibility:visible;pointer-events:auto}
  .main-content{margin-left:0;padding:0;min-width:0}
  .topbar{justify-content:space-between;padding:10px 16px;position:sticky;top:0;z-index:1020}
  .mobile-menu-toggle{display:inline-grid;place-items:center;width:42px;height:42px;border:1px solid var(--border);border-radius:10px;background:#fff;color:var(--text)}
  .page-body{padding:22px 16px 34px}
  .page-header{gap:16px;margin-bottom:24px;flex-wrap:wrap}
  .page-header>div:first-child{min-width:0;flex:1 1 100%}
  .page-header>.d-flex,.page-header>a,.page-header>form{max-width:100%}
  .workspace{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .workspace .table{min-width:680px;margin-bottom:0}
  .chart-bars{max-width:100%}
  .report-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 575.98px){
  .page-body{padding:18px 12px 28px}
  .page-header{flex-direction:column;align-items:stretch}
  .page-header h1{font-size:28px}
  .page-header>a,.page-header>form,.page-header>.d-flex{width:100%}
  .page-header>.d-flex{flex-direction:column}
  .page-header .btn{width:100%}
  .topbar>div{margin-left:auto}
  .topbar{gap:10px;padding-inline:12px}
  .topbar-label{display:none}
  .workspace{padding-top:20px}
  .kpi-card{padding:18px}
  .kpi-card strong,.metric-big{font-size:24px}
  .dashboard-rate{width:100%;display:flex;align-items:center;justify-content:space-between}
  .report-grid{grid-template-columns:1fr}
  .auth-panel{padding:28px 20px}
  .auth-brand h1{font-size:28px}
  .form-control,.form-select,.btn{min-height:44px}
  .activity-row{align-items:flex-start;flex-direction:column;gap:5px}
}
