:root{
  --bg:#f4f7fb;
  --bg-soft:#eef3fb;
  --surface:#ffffff;
  --surface-2:#f8fbff;
  --text:#16314f;
  --muted:#5d738d;
  --line:rgba(15, 52, 96, .12);
  --line-strong:rgba(15, 52, 96, .22);

  --primary:#1b5fa7;
  --primary-2:#2a7bd3;
  --primary-3:#0f3f77;
  --secondary:#d4a63c;
  --secondary-2:#f0c96a;
  --success:#1f8f5f;
  --danger:#c84b4b;

  --shadow-sm:0 8px 22px rgba(14, 42, 77, .08);
  --shadow-md:0 16px 36px rgba(14, 42, 77, .12);
  --shadow-lg:0 24px 60px rgba(14, 42, 77, .16);

  --radius-sm:14px;
  --radius-md:18px;
  --radius-lg:24px;
}

*{font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  color:var(--text);
  background:
    radial-gradient(circle at top left, rgba(42,123,211,.15), transparent 28%),
    radial-gradient(circle at top right, rgba(212,166,60,.18), transparent 24%),
    linear-gradient(180deg, #edf4fb 0%, #f7fbff 36%, #f2f7fc 100%);
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.16), transparent 70%);
  z-index:0;
}

.topbar{
  position:sticky;
  top:0;
  z-index:30;
  padding:14px 18px;
  gap:16px;
  align-items:center;
  background:
    linear-gradient(135deg, rgba(12,46,87,.96), rgba(27,95,167,.95) 60%, rgba(42,123,211,.95));
  border-bottom:1px solid rgba(255,255,255,.12);
  box-shadow:0 14px 36px rgba(8, 29, 54, .18);
}

.topbar::before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height:4px;
  background:linear-gradient(90deg, var(--secondary), var(--secondary-2), #fff1b8);
}

.brand, .tabs, .userBox, .container{
  position:relative;
  z-index:1;
}

.logoBox{
  width:78px;
  height:78px;
  border-radius:22px;
  background:linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
  border:1px solid rgba(255,255,255,.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 10px 24px rgba(0,0,0,.18);
}

.logoBox img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:8px;
}

.title{
  color:#fff;
  font-size:1.2rem;
  font-weight:800;
  letter-spacing:.2px;
  text-shadow:0 2px 12px rgba(0,0,0,.16);
}

.subtitle{
  color:rgba(255,255,255,.78);
  font-size:.82rem;
}

.tabs{
  gap:10px;
}

.tab{
  color:#fff;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  border-radius:999px;
  padding:10px 15px;
  font-weight:600;
  transition:transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.tab:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.14);
  border-color:rgba(255,255,255,.26);
}

.tab.active{
  color:#112f4d;
  background:linear-gradient(180deg, #fff6d5, #efc666);
  border-color:rgba(255,255,255,.55);
  box-shadow:0 10px 24px rgba(0,0,0,.14);
}

.userBox{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:8px;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.08);
  color:#fff;
}

.userName{font-weight:700}
.userRole{color:rgba(255,255,255,.82); font-size:.9rem}

.container{
  max-width:1180px;
  padding:24px 18px 36px;
}

.card{
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,251,255,.96));
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  padding:18px;
  box-shadow:var(--shadow-md);
  backdrop-filter:blur(8px);
}

.card:hover{
  box-shadow:var(--shadow-lg);
}

h2{
  margin:0 0 14px 0;
  color:var(--primary-3);
  font-size:1.15rem;
  font-weight:800;
  padding-bottom:10px;
  border-bottom:1px solid rgba(27,95,167,.12);
}

.form label{
  color:var(--primary-3);
  font-weight:600;
  font-size:.92rem;
}

input, select, textarea{
  margin-top:7px;
  border-radius:16px;
  border:1px solid rgba(27,95,167,.18);
  background:#fff;
  color:var(--text);
  padding:12px 14px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.03);
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

input::placeholder, textarea::placeholder{
  color:#8ca0b4;
}

input:focus, select:focus, textarea:focus{
  border-color:rgba(42,123,211,.72);
  box-shadow:0 0 0 4px rgba(42,123,211,.12);
}

.actions{
  gap:12px;
  margin-top:12px;
}

.btn{
  border:none;
  border-radius:16px;
  padding:11px 15px;
  font-weight:700;
  letter-spacing:.15px;
  background:linear-gradient(180deg, #ffffff, #eef5fb);
  color:var(--primary-3);
  border:1px solid rgba(27,95,167,.14);
  box-shadow:var(--shadow-sm);
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 24px rgba(16,52,92,.14);
  filter:saturate(1.04);
}

.btn.primary{
  color:#fff;
  background:linear-gradient(135deg, var(--primary), var(--primary-2));
  border:1px solid rgba(24,90,160,.22);
}

.btn.danger{
  color:#fff;
  background:linear-gradient(135deg, #b94242, #d45d5d);
}

.btn.mini{
  padding:8px 12px;
  border-radius:12px;
}

.tableWrap{
  border-radius:20px;
  overflow:auto;
  border:1px solid rgba(27,95,167,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.table{
  background:#fff;
  min-width:640px;
}

.table th, .table td{
  padding:12px 12px;
  border-bottom:1px solid rgba(15,52,96,.08);
  font-size:.9rem;
}

.table th{
  position:sticky;
  top:0;
  z-index:1;
  color:#fff;
  font-weight:700;
  background:linear-gradient(135deg, var(--primary-3), var(--primary));
}

.table tbody tr:nth-child(even){
  background:#f7fbff;
}

.table tbody tr:hover{
  background:#eef6ff;
}

.status{
  color:var(--text);
  border:1px solid rgba(27,95,167,.12);
  background:linear-gradient(180deg, #ffffff, #f5faff);
  border-left:5px solid var(--secondary);
  border-radius:18px;
  box-shadow:var(--shadow-sm);
}

.hint{
  color:var(--muted);
  font-size:.84rem;
}

code{
  background:#eef5fb;
  color:var(--primary-3);
  padding:2px 6px;
  border-radius:8px;
}

.loginWrap{
  min-height:calc(100vh - 180px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px 0;
}

.loginCard{
  width:min(520px, 100%);
  position:relative;
  overflow:hidden;
  border-radius:28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.97), rgba(248,252,255,.95));
}

.loginCard::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:110px;
  background:
    linear-gradient(135deg, rgba(15,63,119,.95), rgba(42,123,211,.88)),
    linear-gradient(90deg, rgba(255,255,255,.06), transparent);
}

.loginCard h2, .loginCard .hint, .loginCard form{
  position:relative;
  z-index:1;
}

.loginCard h2{
  color:#fff;
  border-bottom:none;
  margin:-18px -18px 18px;
  padding:28px 22px 6px;
}

.loginCard .hint:first-of-type{
  color:#dbe8f8;
  margin-top:-10px;
  margin-bottom:18px;
}

.loginCard .hint:last-of-type{
  margin-top:14px !important;
  padding:12px 14px;
  border-radius:16px;
  background:#f3f8fe;
  border:1px dashed rgba(27,95,167,.22);
  color:var(--primary-3);
}

.reciboArea{
  margin-top:16px;
}

.recibo{
  border-radius:22px;
  border:1px solid rgba(15,52,96,.12);
  box-shadow:0 16px 34px rgba(14,42,77,.12);
  background:
    linear-gradient(180deg, #ffffff, #fbfdff);
  position:relative;
  overflow:hidden;
}

.recibo::before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height:10px;
  background:linear-gradient(90deg, var(--primary), var(--secondary), var(--primary-2));
}

.reciboHeader{
  border-bottom:1px dashed rgba(15,52,96,.18);
  padding-bottom:12px;
  margin-bottom:14px;
}

.reciboTitle{
  color:var(--primary-3);
  font-size:1.35rem;
}

.reciboSub, .reciboNum, .muted, .footer{
  color:#54697f;
}

.numBox{
  background:#f7fbff;
  border:1px solid rgba(27,95,167,.18);
  border-radius:12px;
  color:var(--primary-3);
}

.sign .line{
  background:linear-gradient(90deg, var(--primary-3), rgba(15,63,119,.22));
}

.kpi, .badge, .pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#eef6ff;
  color:var(--primary-3);
  border:1px solid rgba(27,95,167,.12);
  font-weight:700;
}

.view .card:first-child h2::before{
  content:"✦ ";
  color:var(--secondary);
}

@media (max-width: 920px){
  .topbar{
    padding:14px;
  }
  .brand{
    min-width:100%;
  }
  .tabs{
    margin-left:0;
    width:100%;
  }
  .userBox{
    width:100%;
    justify-content:space-between;
    margin-left:0;
  }
  .container{
    padding:18px 14px 28px;
  }
  .card{
    border-radius:22px;
    padding:16px;
  }
  .logoBox{
    width:68px;
    height:68px;
  }
}

@media print{
  body{
    background:#fff !important;
  }
  body::before{
    display:none !important;
  }
  .topbar, .actions, .hint, .status{
    display:none !important;
  }
  .card{
    box-shadow:none !important;
    border:none !important;
    background:#fff !important;
  }
  .recibo{
    box-shadow:none !important;
    border:1px solid #d7dde6 !important;
  }
}