.hidden {
    display: none !important;
}
:root{
  --wine: #730719;
  --wine-soft: rgba(115,7,25,0.9);
  --bg-body: #f3f4f6;
  --card-radius: 18px;
  --shadow-soft: 0 10px 30px rgba(15,23,42,0.12);
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg-body);
}
a{text-decoration:none;}
.layout{
  display:flex;
  min-height:100vh;
}
.sidebar{
  width:250px;
  background:linear-gradient(180deg,var(--wine-soft),#4b0212);
  color:#fff;
  padding:20px 18px;
  display:flex;
  flex-direction:column;
}
.sidebar-header{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:24px;
}
.sidebar-logo{
  width:44px;
  height:44px;
  border-radius:16px;
  background:rgba(255,255,255,0.12);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
}
.sidebar-title{
  font-weight:600;
}
.sidebar-subtitle{
  font-size:12px;
  opacity:0.9;
}
.nav-link-sirel{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border-radius:10px;
  color:rgba(255,255,255,0.95);
  font-size:14px;
  margin-bottom:4px;
}
.nav-link-sirel:hover,
.nav-link-sirel.active{
  background:rgba(255,255,255,0.12);
}
.nav-link-sirel span.icon{
  width:22px;
  text-align:center;
  font-size:16px;
}
.sidebar-footer{
  margin-top:auto;
  font-size:11px;
  opacity:0.9;
}
.main{
  flex:1;
  padding:18px 22px;
}
.topbar{
  background:linear-gradient(90deg,var(--wine-soft),rgba(115,7,25,0.08));
  color:#fff;
  padding:12px 18px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  box-shadow:var(--shadow-soft);
}
.topbar-title{
  font-size:18px;
  font-weight:600;
}
.topbar-sub{
  font-size:12px;
  opacity:0.9;
}
.topbar-right{
  font-size:12px;
  text-align:right;
}
.grid{
  display:grid;
  gap:16px;
}
@media(min-width:900px){
  .grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr));}
  .grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr));}
  .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr));}
}
.card{
  background:#fff;
  border-radius:var(--card-radius);
  box-shadow:var(--shadow-soft);
  padding:16px 18px;
}
.card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}
.chip{
  font-size:11px;
  padding:2px 8px;
  border-radius:999px;
  background:rgba(15,23,42,0.06);
}
.stat-title{
  font-size:13px;
  color:#6b7280;
}
.stat-value{
  font-size:26px;
  font-weight:600;
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:none;
  padding:8px 16px;
  font-size:14px;
  cursor:pointer;
  transition:transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn-primary{
  background:var(--wine-soft);
  color:#fff;
  box-shadow:0 8px 20px rgba(115,7,25,0.35);
}
.btn-primary:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 28px rgba(115,7,25,0.4);
}
.btn-outline{
  background:#fff;
  border:1px solid rgba(148,163,184,0.6);
  color:#374151;
}
.btn-sm{padding:5px 12px;font-size:13px;}
.table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.table th,.table td{
  padding:8px 10px;
  border-bottom:1px solid #e5e7eb;
}
.badge{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  font-size:11px;
}
.badge-revision{background:#eff6ff;color:#1d4ed8;}
.badge-autorizado{background:#ecfdf3;color:#16a34a;}
.badge-noaut{background:#fef2f2;color:#b91c1c;}
.badge-atendido{background:#f5f3ff;color:#7c3aed;}
.form-group{margin-bottom:10px;font-size:13px;}
.form-label{display:block;margin-bottom:4px;color:#4b5563;}
.form-control,select,textarea{
  width:100%;
  border-radius:10px;
  border:1px solid #d1d5db;
  padding:8px 10px;
  font-size:13px;
}
textarea{resize:vertical;min-height:70px;}
.small-muted{font-size:11px;color:#6b7280;}
.login-wrapper{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background:radial-gradient(circle at top left,rgba(115,7,25,0.22),transparent 55%),
             radial-gradient(circle at bottom right,rgba(15,23,42,0.15),transparent 60%),
             #f3f4f6;
}
.login-card{
  background:#fff;
  border-radius:22px;
  box-shadow:var(--shadow-soft);
  padding:26px 26px 22px;
  width:100%;
  max-width:380px;
}
.login-header{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:16px;
}
.login-logo{
  width:42px;height:42px;border-radius:16px;
  background:linear-gradient(135deg,var(--wine-soft),#111827);
  display:flex;align-items:center;justify-content:center;
  color:#fff;font-size:22px;
}
.login-title{font-weight:600;}
.login-sub{font-size:12px;color:#6b7280;}
.alert{padding:8px 10px;border-radius:10px;margin-bottom:10px;font-size:12px;}
.alert-danger{background:#fef2f2;color:#b91c1c;}
footer.login-foot{margin-top:12px;font-size:11px;color:#9ca3af;}

/* === MODAL BITÁCORA === */
.modal-sirel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
}

.modal-sirel.hidden {
    display: none;
}

.modal-sirel-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #0007;
    backdrop-filter: blur(2px);
}

.modal-sirel-box {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    max-width: 900px;
    background: white;
    border-radius: 14px;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 25px #0004;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

.modal-sirel-header {
    background: rgba(87, 0, 17, 0.85);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-sirel-title {
    font-size: 18px;
    font-weight: bold;
}

.modal-sirel-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.modal-sirel-body {
    max-height: 65vh;
    overflow-y: auto;
    padding: 15px;
    font-size: 14px;
}

/* Animación */
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}