@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root{
  --navy:#0B2436;
  --navy-deep:#071A27;
  --teal:#1C5C5A;
  --brass:#C9974B;
  --ivory:#F5F1E8;
  --charcoal:#1A1F23;
  --rust:#B5533C;
}

*,*::before,*::after{box-sizing:border-box;}
body{
  margin:0; font-family:'Inter',sans-serif; background:var(--ivory); color:var(--charcoal);
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;}
h1,h2,h3{font-family:'Fraunces',serif; font-weight:600; margin:0;}
.mono{font-family:'IBM Plex Mono',monospace;}

/* ---------- Login / Setup ---------- */
.auth-wrap{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(120% 90% at 15% -10%, #123249 0%, var(--navy) 45%, var(--navy-deep) 100%);
  padding:20px;
}
.auth-card{
  background:var(--ivory); border-radius:6px; padding:40px 36px; width:100%; max-width:380px;
  box-shadow:0 30px 60px -20px rgba(0,0,0,0.5);
}
.auth-card h1{font-size:22px; margin-bottom:6px; color:var(--navy);}
.auth-card p.sub{font-size:13.5px; color:rgba(26,31,35,0.6); margin-bottom:24px;}

/* ---------- Formularios genéricos ---------- */
label{display:block; font-family:'IBM Plex Mono',monospace; font-size:11px; text-transform:uppercase; letter-spacing:0.03em; color:rgba(11,36,54,0.6); margin-bottom:6px;}
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea{
  width:100%; background:#fff; border:1px solid rgba(11,36,54,0.18); border-radius:3px;
  padding:10px 12px; font-size:14px; color:var(--charcoal); font-family:'Inter',sans-serif; margin-bottom:16px;
}
textarea{resize:vertical; min-height:70px;}

.btn{
  cursor:pointer; border:none; font-family:'Inter',sans-serif; font-weight:600; font-size:13.5px;
  border-radius:3px; padding:10px 18px; display:inline-flex; align-items:center; gap:7px;
  text-decoration:none; transition:opacity .15s ease;
}
.btn:hover{opacity:0.85;}
.btn-brass{background:var(--brass); color:var(--navy-deep);}
.btn-navy{background:var(--navy); color:var(--ivory);}
.btn-ghost{background:rgba(11,36,54,0.08); color:var(--navy);}
.btn-danger{background:rgba(181,83,60,0.12); color:var(--rust);}
.btn-block{width:100%; justify-content:center;}

.error-msg{color:var(--rust); font-size:13.5px; margin:-6px 0 14px;}
.ok-msg{color:var(--teal); font-size:13.5px; margin:-6px 0 14px;}

/* ---------- Layout de la app ---------- */
.app-header{background:var(--navy); color:var(--ivory); padding:20px 28px;}
.app-header .top-row{display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px;}
.brand{display:flex; align-items:center; gap:12px;}
.brand h1{font-size:19px; color:var(--ivory);}
.brand .sub{font-size:12px; color:rgba(245,241,232,0.6);}
.header-actions{display:flex; gap:10px; flex-wrap:wrap;}

.stats-row{display:flex; gap:12px; flex-wrap:wrap; margin-top:20px;}
.stat-card{background:var(--navy-deep); border:1px solid rgba(245,241,232,0.1); border-radius:4px; padding:16px 18px; flex:1 1 150px; min-width:140px;}
.stat-card .label{font-family:'IBM Plex Mono',monospace; font-size:10.5px; text-transform:uppercase; letter-spacing:0.04em; color:rgba(245,241,232,0.55); margin-bottom:6px;}
.stat-card .value{font-family:'Fraunces',serif; font-size:24px; font-weight:600; color:var(--ivory);}

.main-content{padding:24px 28px 40px;}

.tabs{display:flex; gap:4px; border-bottom:1px solid rgba(11,36,54,0.12); margin-bottom:18px; flex-wrap:wrap;}
.tab{padding:10px 16px; font-size:13.5px; font-weight:600; color:rgba(11,36,54,0.55); text-decoration:none; border-radius:3px 3px 0 0;}
.tab.active{color:var(--navy); box-shadow:inset 0 -2px 0 var(--brass);}

.filters-row{display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px;}
.filters-row select, .filters-row input{margin-bottom:0; max-width:240px;}

table.data{width:100%; border-collapse:collapse; background:#fff; border-radius:4px; overflow:hidden;}
table.data thead{background:rgba(11,36,54,0.03);}
table.data th{text-align:left; font-family:'IBM Plex Mono',monospace; font-size:11px; text-transform:uppercase; letter-spacing:0.03em; color:rgba(11,36,54,0.55); padding:10px 12px; border-bottom:1px solid rgba(11,36,54,0.12); white-space:nowrap;}
table.data td{padding:12px; border-bottom:1px solid rgba(11,36,54,0.08); font-size:13.5px; vertical-align:middle;}
table.data tr:hover td{background:rgba(11,36,54,0.02);}
table.data tr.total-row td{font-weight:700; background:rgba(11,36,54,0.03);}
.table-wrap{overflow-x:auto; border:1px solid rgba(11,36,54,0.1); border-radius:4px;}

.badge{display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; padding:4px 10px; border-radius:999px; white-space:nowrap;}

.empty-state{padding:40px; text-align:center; color:rgba(11,36,54,0.5); font-size:14px;}

.modal-bg{position:fixed; inset:0; background:rgba(7,26,39,0.6); display:flex; align-items:center; justify-content:center; padding:16px; z-index:50;}
.modal-card{background:var(--ivory); border-radius:6px; padding:26px; width:100%; max-width:560px; max-height:90vh; overflow-y:auto;}
.modal-card h2{font-size:19px; color:var(--navy); margin-bottom:18px;}
.form-grid{display:grid; grid-template-columns:1fr 1fr; gap:0 14px;}
.form-grid .full{grid-column:span 2;}

.actions-row{display:flex; gap:8px;}
.actions-row form{display:inline;}

@media (max-width:700px){
  .form-grid{grid-template-columns:1fr;}
  .form-grid .full{grid-column:span 1;}
}
