:root{
  --bg:#0f172a;
  --panel:#111827;
  --card:#0b1220;
  --text:#e5e7eb;
  --muted:#94a3b8;
  --line:rgba(148,163,184,.18);
  --accent:#f97316; /* naranja */
  --accent2:#fb923c;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 30% 0%, rgba(249,115,22,.12), transparent 60%),
              radial-gradient(1000px 600px at 70% 20%, rgba(56,189,248,.10), transparent 55%),
              var(--bg);
  color:var(--text);
}

.layout{
  display:grid;
  grid-template-columns: 280px 1fr;
  min-height:100vh;
}

.sidebar{
  background: linear-gradient(180deg, rgba(17,24,39,.92), rgba(17,24,39,.78));
  border-right: 1px solid var(--line);
  padding:16px;
  position:sticky;
  top:0;
  height:100vh;
  overflow-y:auto;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 10px 14px;
  border-bottom:1px solid var(--line);
  margin-bottom:12px;
}

.logo{
  width:40px;height:40px;border-radius:12px;
  display:grid;place-items:center;
  background: rgba(249,115,22,.18);
  border:1px solid rgba(249,115,22,.35);
  color: #fff;
  font-weight:800;
  letter-spacing:.5px;
}

.brand-logo{
  width: 160px;     /* ajustable */
  height: auto;
  display: block;
  flex: 0 0 auto;
}

.brand-name{font-weight:800}
.brand-tag{font-size:12px;color:var(--muted)}

.app-icon{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* background: rgba(249,115,22,.18); */
  /* border: 1px solid rgba(249,115,22,.35); */
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
  flex: 0 0 auto;
}

.app-icon img{
  width: 40px;
  height: auto;
  display: block;
}

.nav{display:flex;flex-direction:column;gap:4px;margin-top:10px}
.nav-section{
  margin:12px 10px 6px;
  font-size:11px;
  letter-spacing:.10em;
  text-transform:uppercase;
  color: rgba(148,163,184,.85);
}
.nav-item{
  text-decoration:none;
  color: var(--text);
  padding:10px 10px;
  border-radius:12px;
  border:1px solid transparent;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.nav-item:hover{
  border-color: rgba(249,115,22,.35);
  background: rgba(249,115,22,.08);
}
.nav-item.active{
  background: rgba(249,115,22,.14);
  border-color: rgba(249,115,22,.45);
}
.nav-item.disabled{
  opacity:.45;
  cursor:not-allowed;
  pointer-events:none;
}

.sidebar-footer{
  position:absolute;
  bottom:14px;
  left:16px;
  right:16px;
  color:var(--muted);
  border-top:1px solid var(--line);
  padding-top:10px;
}

.main{
  padding:22px 26px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  margin-bottom:16px;
}
h1{margin:0 0 6px;font-size:22px}
h2{margin:0 0 10px;font-size:18px}
.muted{color:var(--muted);margin:0}

.card{
  background: linear-gradient(180deg, rgba(11,18,32,.92), rgba(11,18,32,.78));
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.28);
}

.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.spacer{flex:1}

.btn{
  border:1px solid var(--line);
  background: rgba(148,163,184,.08);
  color: var(--text);
  padding:10px 12px;
  border-radius:12px;
  text-decoration:none;
  cursor:pointer;
}
.btn:hover{border-color: rgba(249,115,22,.35); background: rgba(249,115,22,.08);}
.btn.primary{
  border-color: rgba(249,115,22,.55);
  background: rgba(249,115,22,.18);
}
.btn.primary:hover{
  border-color: rgba(249,115,22,.75);
  background: rgba(249,115,22,.25);
}
.input{
  width:280px;
  max-width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(2,6,23,.35);
  color: var(--text);
}
.table{
  width:100%;
  border-collapse: collapse;
  margin-top:12px;
  font-size:14px;
}
.table th,.table td{
  border-bottom:1px solid var(--line);
  padding:10px 8px;
  text-align:left;
}
.table th{color: rgba(226,232,240,.9); font-weight:700}
.pill{
  font-size:12px;
  color: rgba(226,232,240,.9);
  padding:5px 10px;
  border-radius:999px;
  border:1px solid rgba(249,115,22,.35);
  background: rgba(249,115,22,.10);
}
.list{margin:10px 0 0 18px}

/* =========================
   Botones (ajuste contraste)
   ========================= */

/* Caso general por si el color se está heredando muy claro */
.btn2 {
  color: #111;                 /* fuerza texto negro */
  font-weight: 700;
}

/* Botón primario (Imprimir) */
.btn2{
  border:1px solid var(--line);
  background: rgba(148,163,184,.08);
  color: var(--text);
  padding:10px 12px;
  border-radius:12px;
  text-decoration:none;
  cursor:pointer;
}

.btn2.primary {
  color: #111 !important;      /* texto negro */
  background: rgba(255,140,0,0.28);
  border: 2px solid rgba(255,140,0,0.95);
}

.btn2.primary:hover {
  background: rgba(255,140,0,0.40);
  border-color: rgba(255,140,0,0.98);
}

/* Botón secundario (Volver) */
.btn2.secondary {
  color: #111 !important;      /* texto negro */
  background: rgba(120,130,150,0.18);
  border: 2px solid rgba(120,130,150,0.70);
}

.btn2.secondary:hover {
  background: rgba(120,130,150,0.26);
  border-color: rgba(120,130,150,0.90);
}

/* Si en tu HTML usaste <a class="btn ..."> */
a.btn2 { color: #111 !important; }

/* Mismo tamaño de texto en botones Imprimir y Volver*/
.btn2 {
  font-size: 13px;
  font-weight: 600;
}

/* =========================
   Tema claro (opcional)
   Activación: <html data-theme="light">
   ========================= */
html[data-theme="light"]{
  --bg:#f5f7fb;
  --panel:#ffffff;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --line:rgba(15,23,42,.12);
  --accent:#f97316;
  --accent2:#fb923c;
}

/* Ajustes extra para inputs y tablas en light (mantiene look limpio) */
html[data-theme="light"] body{
  background: radial-gradient(1200px 700px at 30% 0%, rgba(249,115,22,.10), transparent 60%),
              radial-gradient(1000px 600px at 70% 20%, rgba(56,189,248,.08), transparent 55%),
              var(--bg);
}

html[data-theme="light"] .sidebar{
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.88));
}

html[data-theme="light"] .card{
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.88));
}

html[data-theme="light"] .input{
  background: rgba(15,23,42,.04);
}

html[data-theme="light"] .btn{
  background: rgba(15,23,42,.03);
}


/* === Ajuste para imprimir === */

@page {
  size: letter;
  margin: 18mm;
}

@media print{
  .no-print{ display:none !important; }

  body { background:#fff; }

  /* la carta se adapta al área imprimible */
  .carta-wrap{
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* Evita que Chrome “encoga” fuentes/elementos raro */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
