
:root {
  --cez-primary: #293f4d;
  --cez-primary-2: #1f313c;
  --cez-accent: #57c5bd;
  --cez-accent-soft: #dff7f4;
  --cez-violet: #8c74ff;
  --cez-bg: #f4f8fb;
  --cez-surface: #ffffff;
  --cez-border: #dbe5ec;
  --cez-text: #23313b;
  --cez-muted: #6d7c88;
  --cez-success: #1aa372;
  --cez-danger: #df5c6d;
  --cez-warning: #f0b44a;
  --cez-shadow: 0 18px 40px rgba(41, 63, 77, 0.08);
  --cez-radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.cez-body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top right, rgba(87,197,189,0.14), transparent 20%),
    linear-gradient(180deg, #f8fbfd 0%, var(--cez-bg) 100%);
  color: var(--cez-text);
  min-height: 100vh;
}
body.cez-body .container,
body.cez-body .container-fluid { max-width: 1320px; }

.cez-navbar {
  background: linear-gradient(135deg, var(--cez-primary) 0%, #355263 100%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-top: .8rem;
  padding-bottom: .8rem;
}
.cez-navbar .navbar-brand { gap: .9rem; }
.cez-navbar .brand-copy { line-height: 1.05; }
.cez-navbar .brand-copy strong {
  display:block;
  color:#fff;
  font-size:1rem;
  font-weight:800;
  letter-spacing:.02em;
}
.cez-navbar .brand-copy small {
  color: rgba(255,255,255,.72);
  font-size:.72rem;
}
.cez-navbar .navbar-toggler {
  border: 1px solid rgba(255,255,255,.3);
  box-shadow: none !important;
}
.cez-navbar .nav-link {
  color: rgba(255,255,255,.82) !important;
  font-weight: 600;
  border-radius: 999px;
  padding: .6rem .9rem !important;
  transition: all .2s ease;
}
.cez-navbar .nav-link:hover,
.cez-navbar .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,.14);
}
.cez-navbar .cez-home-btn {
  border-color: rgba(255,255,255,.32);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
}
.cez-navbar .cez-home-btn:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
  border-color: rgba(255,255,255,.45);
}

.cez-page { padding-bottom: 2rem; }
.cez-page-header,
.cez-dashboard-hero {
  background: linear-gradient(140deg, rgba(41,63,77,.98), rgba(49,85,104,.96));
  border-radius: 24px;
  padding: 1.5rem 1.6rem;
  color: #fff;
  box-shadow: var(--cez-shadow);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.cez-page-header::after,
.cez-dashboard-hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(87,197,189,.35), transparent 65%);
  right: -70px;
  top: -70px;
}
.cez-kicker {
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.35rem .75rem;
  border-radius:999px;
  background: rgba(87,197,189,.18);
  color:#d8fffb;
  font-size:.78rem;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.cez-page-header h1,
.cez-dashboard-hero h1,
.cez-dashboard-hero h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.25rem);
  margin: .8rem 0 .45rem;
  font-weight: 800;
}
.cez-page-header p,
.cez-dashboard-hero p {
  margin: 0;
  color: rgba(255,255,255,.82);
  max-width: 780px;
}
.cez-header-actions {
  position: relative;
  z-index: 1;
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
  margin-top:1rem;
}

.cez-stat-grid { margin-top: 1.25rem; }
.cez-stat-card {
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.08);
  padding: 1rem 1.05rem;
  height: 100%;
  backdrop-filter: blur(4px);
}
.cez-stat-card small {
  display:block;
  color: rgba(255,255,255,.7);
  margin-bottom:.4rem;
}
.cez-stat-card strong {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
}

.card {
  border: 1px solid rgba(43, 66, 82, 0.08);
  border-radius: var(--cez-radius);
  box-shadow: var(--cez-shadow);
  overflow: hidden;
}
.card .card-header {
  border-bottom: 1px solid rgba(0,0,0,.05);
  font-weight: 700;
  padding: 1rem 1.1rem;
}
.card .card-body { padding: 1.2rem; }

.card-header.bg-dark,
.table-dark,
.border-caja.bg-dark {
  background: linear-gradient(135deg, var(--cez-primary), #304c5d) !important;
  color:#fff !important;
}
.card-header.bg-secondary {
  background: linear-gradient(135deg, #6a78b8, #8994cb) !important;
  color:#fff !important;
}
.card-header.bg-success,
.bg-success {
  background: linear-gradient(135deg, #1fa977, #27c08a) !important;
  color:#fff !important;
}
.bg-primary,
.btn-primary,
.badge.bg-primary {
  background: linear-gradient(135deg, var(--cez-primary), #355263) !important;
  border-color: var(--cez-primary) !important;
  color:#fff !important;
}
.bg-danger {
  background: linear-gradient(135deg, #db596a, #ef7a88) !important;
  color:#fff !important;
}
.bg-warning { color:#503c11 !important; }
.badge.bg-secondary {
  background: #e9eef3 !important;
  color: var(--cez-primary) !important;
  border: 1px solid rgba(41,63,77,.08);
}
.badge.bg-success,
.badge.bg-warning,
.badge.bg-danger {
  border-radius: 999px;
  font-weight: 700;
  padding: .48rem .72rem;
}

.btn {
  border-radius: 12px;
  font-weight: 700;
  padding: .62rem .95rem;
  box-shadow: none !important;
}
.btn-sm { border-radius: 10px; padding: .48rem .78rem; }
.btn-outline-secondary,
.btn-outline-dark,
.btn-outline-light,
.btn-outline-primary,
.btn-outline-danger,
.btn-outline-success {
  border-width: 1px;
}
.btn-outline-primary { color: var(--cez-primary); border-color: rgba(41,63,77,.22); }
.btn-outline-primary:hover { background: var(--cez-primary); color:#fff; border-color: var(--cez-primary); }
.btn-outline-success:hover,
.btn-success:hover,
.btn-primary:hover,
.btn-dark:hover,
.btn-secondary:hover { transform: translateY(-1px); }
.btn-dark,
.btn-secondary {
  background: linear-gradient(135deg, #516473, #6d7f8c) !important;
  border-color: transparent !important;
  color:#fff !important;
}
.btn-success {
  background: linear-gradient(135deg, #1aa372, #24bf85) !important;
  border-color: transparent !important;
}
.btn-outline-secondary {
  color: var(--cez-primary);
  border-color: rgba(41,63,77,.16);
}
.btn-outline-secondary:hover { background: #eef3f7; color: var(--cez-primary); border-color: rgba(41,63,77,.2); }

.form-control,
.form-select {
  border-radius: 12px;
  border: 1px solid var(--cez-border);
  min-height: 44px;
  color: var(--cez-text);
  background-color: #fff;
}
.form-control-sm,
.form-select-sm { min-height: 38px; }
.form-control:focus,
.form-select:focus {
  border-color: rgba(87,197,189,.75);
  box-shadow: 0 0 0 .2rem rgba(87,197,189,.18);
}
label.form-label {
  color: var(--cez-primary);
  font-weight: 700;
}

h2, h3, h4, h5 { color: var(--cez-primary); font-weight: 800; }
.text-primary { color: var(--cez-primary) !important; }
.text-muted { color: var(--cez-muted) !important; }
.section-muted { color: var(--cez-muted); }

.alert {
  border: 0;
  border-radius: 16px;
  box-shadow: var(--cez-shadow);
}
.alert-success { background: #e7fbf5; color: #11694b; }
.alert-danger { background: #fff0f2; color: #8d2231; }
.alert-warning { background: #fff7e8; color: #7b5a14; }

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}
.table thead th {
  color: var(--cez-primary);
  font-size: .86rem;
  border-bottom-width: 1px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.table td, .table th {
  padding-top: .85rem;
  padding-bottom: .85rem;
  border-color: #edf2f7;
}
.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: rgba(41,63,77,.025);
}
.table-responsive { border-radius: 14px; }

.modal-content {
  border: none;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
}
.modal-header { border-bottom-color: rgba(0,0,0,.05); }
.modal-footer { border-top-color: rgba(0,0,0,.05); }

.cez-dashboard-card {
  height:100%;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
}
.cez-dashboard-card .icon-bubble {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(87,197,189,.18), rgba(140,116,255,.15));
}
.cez-dashboard-card p { color: var(--cez-muted); }
.cez-dashboard-card .card-footer {
  background: transparent;
  border-top: 1px solid #eef3f7;
  padding: 1rem 1.2rem 1.2rem;
}
.cez-chip {
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.45rem .8rem;
  border-radius:999px;
  font-weight:700;
  background:#eef5f8;
  color:var(--cez-primary);
  font-size:.86rem;
}

.receipt-screen {
  background: linear-gradient(180deg, #eef4f8, #f7fbfd);
}
.factura-box {
  border-radius: 24px !important;
  border: 1px solid rgba(41,63,77,.08) !important;
  box-shadow: 0 20px 60px rgba(41,63,77,.12) !important;
}
.factura-actionbar {
  border-radius: 18px !important;
}

.cez-login-card {
  width: 100%;
  max-width: 430px;
  border-radius: 24px;
}
.cez-login-hero {
  width: min(460px, 92vw);
  margin: 0 auto 1rem;
}

@media (max-width: 991.98px) {
  .cez-navbar .navbar-collapse {
    background: rgba(16, 26, 33, .22);
    border-radius: 18px;
    padding: .9rem;
    margin-top: .9rem;
  }
  .cez-navbar .cez-home-btn { margin-top: .6rem; display:inline-flex; }
}

@media (max-width: 767.98px) {
  .cez-page-header,
  .cez-dashboard-hero { padding: 1.2rem; border-radius: 20px; }
  .card .card-body { padding: 1rem; }
}

@media print {
  body.cez-body { background:#fff !important; }
}


/* ===== PASO 6: LAYOUT CON BARRA LATERAL ===== */
:root {
  --cez-sidebar-width: 270px;
}

.cez-app-shell {
  min-height: 100vh;
}

.cez-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--cez-sidebar-width);
  background: linear-gradient(180deg, #293f4d 0%, #223541 72%, #1d2e38 100%);
  color: #fff;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1rem;
  box-shadow: 14px 0 36px rgba(30, 50, 62, .11);
}

.cez-sidebar-brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .45rem .35rem 1rem;
  margin-bottom: .6rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.cez-sidebar-brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.cez-sidebar-brand .brand-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  display:block;
  line-height:1.1;
}
.cez-sidebar-brand .brand-subtitle {
  color: rgba(255,255,255,.62);
  font-size: .7rem;
  display:block;
  margin-top:.22rem;
}

.cez-sidebar-label {
  padding: .75rem .75rem .45rem;
  color: rgba(255,255,255,.42);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.cez-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.cez-sidebar-link {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .78rem .85rem;
  color: rgba(255,255,255,.76);
  border-radius: 13px;
  text-decoration: none;
  font-weight: 650;
  transition: .18s ease;
  position: relative;
}
.cez-sidebar-link .nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,.07);
  font-size: .98rem;
}
.cez-sidebar-link:hover {
  color:#fff;
  background: rgba(255,255,255,.08);
  transform: translateX(2px);
}
.cez-sidebar-link.active {
  color:#fff;
  background: linear-gradient(135deg, rgba(87,197,189,.28), rgba(87,197,189,.12));
  box-shadow: inset 0 0 0 1px rgba(123,232,222,.16);
}
.cez-sidebar-link.active::before {
  content:"";
  position:absolute;
  left:-1rem;
  width:4px;
  height:28px;
  border-radius:0 4px 4px 0;
  background:#71d8cf;
}
.cez-sidebar-link.active .nav-icon {
  background: rgba(113,216,207,.22);
}

.cez-sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.09);
}
.cez-sidebar-footer .status-pill {
  display:flex;
  align-items:center;
  gap:.55rem;
  padding:.72rem .8rem;
  background:rgba(255,255,255,.06);
  border-radius:12px;
  color:rgba(255,255,255,.68);
  font-size:.76rem;
}
.cez-sidebar-footer .status-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  background:#5ee0a7;
  box-shadow:0 0 0 4px rgba(94,224,167,.09);
}

.cez-main {
  margin-left: var(--cez-sidebar-width);
  min-height: 100vh;
  padding: 1.35rem 1.65rem 2.25rem;
}
.cez-main .container,
.cez-main .container-fluid {
  max-width: 1450px;
}

.cez-mobile-topbar {
  display:none;
  position:sticky;
  top:0;
  z-index:1030;
  background:linear-gradient(135deg,#293f4d,#355263);
  color:#fff;
  padding:.75rem 1rem;
  box-shadow:0 10px 22px rgba(41,63,77,.12);
}
.cez-mobile-topbar .mobile-brand {
  display:flex;
  align-items:center;
  gap:.55rem;
  font-weight:800;
}
.cez-mobile-topbar img { height:38px; }
.cez-menu-button {
  border:1px solid rgba(255,255,255,.26);
  background:rgba(255,255,255,.08);
  color:#fff;
  border-radius:10px;
  padding:.42rem .65rem;
}

.cez-section-titlebar {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:1.15rem;
}
.cez-section-titlebar h2 {
  margin:0;
  font-size:1.65rem;
}
.cez-section-titlebar p {
  margin:.25rem 0 0;
  color:var(--cez-muted);
  font-size:.92rem;
}

@media (max-width: 991.98px) {
  .cez-sidebar {
    transform: translateX(-102%);
    transition: transform .22s ease;
    width: min(290px, 86vw);
  }
  body.cez-sidebar-open .cez-sidebar { transform: translateX(0); }
  body.cez-sidebar-open::after {
    content:"";
    position:fixed;
    inset:0;
    background:rgba(15,26,34,.42);
    z-index:1035;
  }
  body.cez-sidebar-open .cez-sidebar { z-index:1045; }
  .cez-main { margin-left:0; padding:1rem; }
  .cez-mobile-topbar { display:flex; align-items:center; justify-content:space-between; }
}


/* ===== PASO 7: DASHBOARD OPERATIVO ===== */
.dashboard-hero-compact { padding: 1.35rem 1.5rem; }
.dashboard-metrics-grid {
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap:1rem;
}
.dashboard-metric {
  position:relative;
  display:flex;
  gap:.85rem;
  align-items:flex-start;
  padding:1.05rem;
  border-radius:18px;
  background:#fff;
  border:1px solid rgba(41,63,77,.08);
  box-shadow:0 12px 30px rgba(41,63,77,.07);
  color:var(--cez-text);
  transition:.18s ease;
  min-height:132px;
}
.dashboard-metric:hover { transform:translateY(-2px); box-shadow:0 16px 34px rgba(41,63,77,.11); color:var(--cez-text); }
.dashboard-metric::after { content:""; position:absolute; inset:auto 14px 0 14px; height:3px; border-radius:3px 3px 0 0; background:var(--metric-color,#8aa0ad); }
.metric-icon { width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; border-radius:13px; background:var(--metric-soft,#eef3f6); font-size:1.15rem; }
.metric-body { min-width:0; }
.metric-body span { display:block; font-size:.74rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color:var(--cez-muted); }
.metric-body strong { display:block; color:var(--cez-primary); font-size:1.35rem; line-height:1.15; margin:.35rem 0 .3rem; word-break:break-word; }
.metric-body small { color:var(--cez-muted); font-size:.76rem; line-height:1.3; display:block; }
.metric-neutral { --metric-color:#5f7d8e; --metric-soft:#edf4f7; }
.metric-warning { --metric-color:#e0a239; --metric-soft:#fff6e6; }
.metric-danger { --metric-color:#df5c6d; --metric-soft:#fff0f3; }
.metric-success { --metric-color:#1aa372; --metric-soft:#e9f9f3; }
.metric-violet { --metric-color:#8c74ff; --metric-soft:#f1efff; }
.metric-accent { --metric-color:#57c5bd; --metric-soft:#e9faf8; }
.dashboard-panel { border-radius:20px; }
.dashboard-panel-header { background:#fff !important; color:var(--cez-primary) !important; border-bottom:1px solid #edf2f5 !important; padding:1rem 1.2rem !important; }
.panel-kicker { display:block; color:#66a9a4; font-size:.68rem; text-transform:uppercase; letter-spacing:.08em; font-weight:800; margin-bottom:.2rem; }
.dashboard-table thead th { padding:.75rem 1rem; font-size:.71rem; background:#f8fafb; }
.dashboard-table td { padding:.78rem 1rem; font-size:.86rem; }
.dashboard-table .row-overdue > * { background:#fff8f8 !important; }
.dashboard-activity-list { display:flex; flex-direction:column; }
.activity-item { display:grid; grid-template-columns:48px minmax(0,1fr) auto; gap:.85rem; align-items:center; padding:.9rem 1rem; border-bottom:1px solid #edf2f5; }
.activity-item:last-child { border-bottom:0; }
.activity-date { width:44px; height:44px; border-radius:12px; display:flex; flex-direction:column; align-items:center; justify-content:center; background:#edf7f6; color:var(--cez-primary); line-height:1; }
.activity-date strong { font-size:1rem; }
.activity-date span { font-size:.65rem; margin-top:.2rem; color:var(--cez-muted); }
.activity-main { min-width:0; display:flex; flex-direction:column; }
.activity-main strong { font-size:.88rem; color:var(--cez-primary); }
.activity-main span { font-size:.76rem; color:var(--cez-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.activity-amount { font-size:.82rem; font-weight:800; color:var(--cez-success); }
.dashboard-balance-card { background:linear-gradient(135deg,#293f4d,#355263); color:#fff; border:0; }
.dashboard-balance-card .panel-kicker { color:#9be1db; }
.dashboard-balance-card h3, .dashboard-balance-card p { color:#fff; }
.dashboard-balance-card p { opacity:.72; }
.dashboard-balance-card.balance-negative { background:linear-gradient(135deg,#7e3d48,#a65360); }
.balance-number { font-size:clamp(1.8rem,3vw,2.5rem); font-weight:800; margin:.2rem 0 .7rem; }
.quick-actions-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.8rem; }
.quick-action { display:flex; align-items:center; gap:.75rem; text-decoration:none; color:var(--cez-text); background:#f8fbfc; border:1px solid #e8eff3; padding:.9rem; border-radius:15px; transition:.18s ease; }
.quick-action:hover { background:#eef8f7; border-color:#d5ece9; transform:translateY(-1px); color:var(--cez-text); }
.quick-action > span { width:38px; height:38px; display:grid; place-items:center; border-radius:11px; background:#fff; box-shadow:0 5px 14px rgba(41,63,77,.06); }
.quick-action div { min-width:0; display:flex; flex-direction:column; }
.quick-action strong { font-size:.83rem; color:var(--cez-primary); }
.quick-action small { font-size:.7rem; color:var(--cez-muted); }
@media (max-width: 1399px) { .dashboard-metrics-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width: 767.98px) { .dashboard-metrics-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .quick-actions-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 480px) { .dashboard-metrics-grid, .quick-actions-grid { grid-template-columns:1fr; } .activity-item { grid-template-columns:44px minmax(0,1fr); } .activity-amount { grid-column:2; } }


/* ===== Usuarios, login y permisos ===== */
.cez-user-box{display:flex;gap:.7rem;align-items:center;padding:.85rem;border-radius:16px;background:rgba(255,255,255,.07);margin-bottom:.55rem}.cez-user-avatar{width:36px;height:36px;border-radius:12px;background:linear-gradient(135deg,var(--cez-accent),var(--cez-violet));display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800}.cez-user-info{min-width:0}.cez-user-info strong,.cez-user-info span{display:block}.cez-user-info strong{font-size:.83rem;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cez-user-info span{font-size:.68rem;color:rgba(255,255,255,.62)}.cez-logout-link{display:block;text-align:center;color:rgba(255,255,255,.72);text-decoration:none;font-size:.78rem;padding:.45rem;border-radius:10px}.cez-logout-link:hover{background:rgba(255,255,255,.08);color:#fff}.cez-auth-page{display:flex;align-items:center;justify-content:center;padding:2rem;min-height:100vh;background:radial-gradient(circle at 15% 15%,rgba(87,197,189,.18),transparent 30%),linear-gradient(135deg,#213440,#355263)}.cez-auth-shell{width:min(470px,100%)}.cez-auth-brand{display:flex;align-items:center;justify-content:center;gap:.8rem;color:#fff;margin-bottom:1.25rem}.cez-auth-brand img{width:68px;height:auto}.cez-auth-brand strong,.cez-auth-brand span{display:block}.cez-auth-brand strong{font-size:1.25rem}.cez-auth-brand span{font-size:.8rem;color:rgba(255,255,255,.68)}.cez-auth-card{border:1px solid rgba(255,255,255,.15);box-shadow:0 30px 80px rgba(0,0,0,.22)}.cez-auth-card h1{font-size:1.75rem;margin:.6rem 0 .35rem}.cez-auth-kicker,.panel-kicker{font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--cez-accent)}.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.permission-group{border:1px solid var(--cez-border);border-radius:16px;padding:1rem;background:#fbfdfe}.permission-group h6{font-size:.82rem;margin-bottom:.7rem;color:var(--cez-primary)}.permission-item{display:flex;align-items:flex-start;gap:.55rem;padding:.38rem 0;font-size:.8rem;cursor:pointer}.permission-item input{margin-top:.18rem;accent-color:var(--cez-accent)}@media(max-width:767.98px){.permission-grid{grid-template-columns:1fr}}


/* ===== CEZ AUTH v9.2 - layout robusto ===== */
html, body { min-height: 100%; }
body.cez-auth-page {
  margin: 0 !important;
  min-height: 100vh !important;
  display: grid !important;
  place-items: center !important;
  padding: 28px !important;
  background:
    radial-gradient(circle at 18% 12%, rgba(87,197,189,.22), transparent 30%),
    radial-gradient(circle at 88% 88%, rgba(140,116,255,.16), transparent 28%),
    linear-gradient(145deg, #20333e 0%, #2f4a5b 100%) !important;
  overflow-x: hidden;
}
body.cez-auth-page .cez-auth-shell {
  width: min(920px, 100%) !important;
  display: grid !important;
  grid-template-columns: minmax(280px, .85fr) minmax(360px, 1.15fr) !important;
  background: #fff !important;
  border-radius: 28px !important;
  overflow: hidden !important;
  box-shadow: 0 32px 90px rgba(5,20,29,.28) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
}
body.cez-auth-page .cez-auth-brand {
  min-height: 520px !important;
  margin: 0 !important;
  padding: 46px 38px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 18px !important;
  color: #fff !important;
  background:
    radial-gradient(circle at 30% 18%, rgba(87,197,189,.30), transparent 30%),
    linear-gradient(155deg, #293f4d 0%, #355a68 100%) !important;
}
body.cez-auth-page .cez-auth-brand img {
  display: block !important;
  width: 108px !important;
  max-width: 108px !important;
  height: auto !important;
  max-height: 108px !important;
  object-fit: contain !important;
  margin: 0 !important;
}
body.cez-auth-page .cez-auth-brand strong {
  display: block !important;
  font-size: 1.75rem !important;
  line-height: 1.05 !important;
  color: #fff !important;
  margin-bottom: 7px !important;
}
body.cez-auth-page .cez-auth-brand span {
  display: block !important;
  font-size: .92rem !important;
  color: rgba(255,255,255,.72) !important;
}
body.cez-auth-page .cez-auth-card {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  background: #fff !important;
}
body.cez-auth-page .cez-auth-card .card-body {
  width: 100% !important;
  padding: 52px 54px !important;
}
body.cez-auth-page .cez-auth-card h1 {
  color: #293f4d !important;
  font-size: 2rem !important;
  line-height: 1.12 !important;
  margin: .55rem 0 .45rem !important;
}
body.cez-auth-page .cez-auth-card .form-control {
  min-height: 48px !important;
  font-size: .95rem !important;
}
body.cez-auth-page .cez-auth-card .btn {
  min-height: 48px !important;
}
.cez-auth-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #edf2f5;
  font-size: .78rem;
  color: #82909a;
}
@media (max-width: 760px) {
  body.cez-auth-page { padding: 14px !important; }
  body.cez-auth-page .cez-auth-shell {
    grid-template-columns: 1fr !important;
    max-width: 500px !important;
  }
  body.cez-auth-page .cez-auth-brand {
    min-height: auto !important;
    padding: 24px 26px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
  body.cez-auth-page .cez-auth-brand img {
    width: 72px !important;
    max-width: 72px !important;
    max-height: 72px !important;
  }
  body.cez-auth-page .cez-auth-brand strong { font-size: 1.25rem !important; }
  body.cez-auth-page .cez-auth-card .card-body { padding: 32px 26px !important; }
}


/* Auditoría */
.audit-stat .card-body { display:flex; flex-direction:column; gap:.35rem; position:relative; }
.audit-stat-icon { font-size:1.45rem; margin-bottom:.25rem; }
.audit-stat small { color:var(--cez-muted); font-weight:700; }
.audit-stat strong { font-size:2rem; color:var(--cez-primary); line-height:1; }
.audit-stat-warning { background:linear-gradient(135deg,#fff,#fff8ea); }
.audit-table thead th { background:#f7fafc; white-space:nowrap; }
.audit-user { display:flex; align-items:center; gap:.7rem; min-width:170px; }
.audit-user > span:last-child { display:flex; flex-direction:column; }
.audit-user small { color:var(--cez-muted); font-size:.72rem; }
.audit-avatar { width:34px; height:34px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; background:var(--cez-accent-soft); color:var(--cez-primary); font-weight:800; flex:0 0 auto; }
.audit-action { display:inline-flex; padding:.36rem .62rem; border-radius:999px; background:#eef3f7; color:var(--cez-primary); font-size:.75rem; font-weight:800; white-space:nowrap; }
.audit-action-success { background:#e7fbf5; color:#117252; }
.audit-action-warning { background:#fff5df; color:#8a6211; }
.audit-action-danger { background:#fff0f2; color:#a42a3c; }


/* Cuenta corriente por alumno */
.cez-account-hero {
  background: linear-gradient(135deg, #293f4d 0%, #355b68 100%);
  border-radius: 24px;
  padding: 1.5rem 1.6rem;
  color: #fff;
  box-shadow: var(--cez-shadow);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}
.cez-account-hero::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -70px;
  top: -90px;
  border-radius: 50%;
  background: rgba(87,197,189,.14);
}
.cez-account-hero > * { position: relative; z-index: 1; }
.cez-account-hero h1 { color: #fff; margin: .45rem 0 .75rem; font-size: clamp(1.7rem, 2.7vw, 2.35rem); }
.cez-account-meta { display: flex; flex-wrap: wrap; gap: .55rem 1rem; color: rgba(255,255,255,.82); font-size: .92rem; }
.cez-account-stat { height: 100%; border-top: 4px solid #6d8390; }
.cez-account-stat.success { border-top-color: #1aa372; }
.cez-account-stat.warning { border-top-color: #f0b44a; }
.cez-account-stat.danger { border-top-color: #df5c6d; }
.cez-account-stat .card-body { display:flex; flex-direction:column; gap:.35rem; }
.cez-account-stat span { color: var(--cez-muted); font-size: .83rem; font-weight: 700; text-transform: uppercase; letter-spacing:.035em; }
.cez-account-stat strong { color: var(--cez-primary); font-size: clamp(1.25rem, 2vw, 1.7rem); }
.cez-account-stat small { color: var(--cez-muted); }
.cez-row-overdue > * { background: rgba(223,92,109,.055) !important; }
.cez-timeline { position: relative; }
.cez-timeline-item { position: relative; display:flex; gap:.9rem; padding: 0 0 1.15rem; }
.cez-timeline-item:not(:last-child)::before { content:""; position:absolute; left:7px; top:16px; bottom:-1px; width:2px; background:#e4edf2; }
.timeline-dot { width:16px; height:16px; border-radius:50%; background:var(--cez-accent); border:4px solid #def6f3; flex:0 0 auto; margin-top:.18rem; z-index:1; }
.timeline-content { flex:1; min-width:0; }
.cez-account-accordion .accordion-item { border: 1px solid #e9f0f4; border-radius: 14px !important; overflow:hidden; margin-bottom:.75rem; }
.cez-account-accordion .accordion-button { background:#fff; color:var(--cez-primary); box-shadow:none; padding:1rem 1.1rem; }
.cez-account-accordion .accordion-button:not(.collapsed) { background:#f3f8fa; color:var(--cez-primary); }
.cez-account-accordion .accordion-button::after { margin-left:1rem; }
@media (max-width: 767.98px) {
  .cez-account-hero { flex-direction: column; border-radius:20px; }
  .cez-account-hero .btn { width:100%; }
}


/* Paso 13: fichas de alumnos */
.cez-student-hero {
  background: linear-gradient(135deg, var(--cez-primary), #355d70);
  color: #fff;
  border-radius: 24px;
  padding: 1.5rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--cez-shadow);
}
.cez-student-hero h1 { color:#fff; margin:.45rem 0; font-size:clamp(1.65rem,2.4vw,2.35rem); }
.cez-detail-list { margin:0; display:grid; gap:.9rem; }
.cez-detail-list > div { display:flex; justify-content:space-between; gap:1rem; padding-bottom:.75rem; border-bottom:1px solid #edf2f7; }
.cez-detail-list > div:last-child { border-bottom:0; padding-bottom:0; }
.cez-detail-list dt { color:var(--cez-muted); font-weight:600; }
.cez-detail-list dd { margin:0; font-weight:800; color:var(--cez-primary); text-align:right; }
.cez-info-block { background:#f7fafc; border:1px solid #e8eff4; border-radius:14px; padding:.85rem 1rem; height:100%; }
.cez-info-block span { display:block; color:var(--cez-muted); font-size:.78rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; margin-bottom:.25rem; }
.cez-info-block strong { color:var(--cez-primary); word-break:break-word; }
@media (max-width: 767.98px) { .cez-student-hero { flex-direction:column; align-items:flex-start; } }

/* Morosidad y cobranzas */
.cez-collections-table tbody tr:hover { background: rgba(87,197,189,.06); }
.cez-collections-table td { vertical-align: middle; }


/* Paso 18 · Panel financiero */
.finance-kpi { position: relative; overflow: hidden; }
.finance-kpi::after { content:""; position:absolute; width:90px; height:90px; border-radius:50%; right:-30px; top:-30px; background:rgba(87,197,189,.08); }
.finance-kpi-success { border-left: 4px solid #1aa372; }
.finance-kpi-danger { border-left: 4px solid #df5c6d; }
.chart-wrap { position: relative; height: 320px; }
.chart-wrap-small { height: 300px; }
@media (max-width: 767.98px) { .chart-wrap, .chart-wrap-small { height: 280px; } }


/* =========================================================
   DASHBOARD FINAL CEZ
   ========================================================= */
.dashboard-final { padding-bottom: 36px; }

.dashboard-final-hero {
    margin-bottom: 22px;
    padding: 25px 27px;
}
.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.dashboard-final-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.final-kpi {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 19px;
    border-radius: 19px;
    background: #fff;
    border: 1px solid rgba(41,63,77,.08);
    box-shadow: 0 12px 32px rgba(41,63,77,.07);
    color: var(--cez-text);
    text-decoration: none;
    min-width: 0;
    transition: transform .18s ease, box-shadow .18s ease;
}
a.final-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 17px 36px rgba(41,63,77,.11);
    color: var(--cez-text);
}
.final-kpi-icon {
    width: 49px;
    height: 49px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex: 0 0 auto;
}
.final-kpi div { min-width: 0; }
.final-kpi small {
    display: block;
    color: var(--cez-muted);
    font-weight: 700;
    margin-bottom: 3px;
}
.final-kpi strong {
    display: block;
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    line-height: 1.08;
    color: var(--cez-primary);
}
.final-kpi span:not(.final-kpi-icon) {
    display: block;
    color: var(--cez-muted);
    font-size: .78rem;
    margin-top: 5px;
}
.kpi-students .final-kpi-icon { background: #edf3f7; }
.kpi-overdue .final-kpi-icon { background: #fff0f2; }
.kpi-income .final-kpi-icon { background: #e7fbf5; }
.kpi-result .final-kpi-icon { background: #edf9f4; }
.kpi-result-negative .final-kpi-icon { background: #fff0f2; }
.kpi-overdue strong, .kpi-result-negative strong { color: #c64457; }
.kpi-income strong, .kpi-result strong { color: #18845e; }

.final-dashboard-card {
    border-radius: 20px;
    overflow: hidden;
}
.final-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: #fff !important;
    color: var(--cez-text) !important;
    border-bottom: 1px solid #edf2f6 !important;
}
.final-card-header h3 { color: var(--cez-primary); }

.finance-summary-list {
    display: grid;
    gap: 10px;
}
.finance-summary-row,
.finance-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 11px 13px;
    border-radius: 12px;
    background: #f8fafc;
}
.finance-summary-row span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cez-muted);
}
.finance-summary-total {
    margin-top: 4px;
    background: #eaf8f3;
    color: #176c50;
    font-size: 1.05rem;
}
.finance-summary-total.negative {
    background: #fff0f2;
    color: #a93446;
}
.finance-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}
.dot-income { background: #1fa977; }
.dot-expense { background: #df5c6d; }
.dot-payroll { background: #8c74ff; }
.final-progress {
    height: 9px;
    background: #e9eff3;
    border-radius: 999px;
}
.final-progress .progress-bar {
    background: linear-gradient(90deg, #57c5bd, #1fa977);
    border-radius: 999px;
}

.final-dashboard-table thead th {
    padding-left: 16px;
    padding-right: 16px;
    white-space: nowrap;
}
.final-dashboard-table td {
    padding-left: 16px;
    padding-right: 16px;
}
.final-dashboard-table td small {
    display: block;
    color: var(--cez-muted);
    margin-top: 2px;
}
.priority-pill,
.audit-code {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .35rem .6rem;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}
.priority-high { background: #fff0f2; color: #b33245; }
.priority-medium { background: #fff7e6; color: #8a6115; }
.priority-low { background: #edf7f5; color: #237463; }

.final-audit-list { display: grid; }
.final-audit-item {
    display: grid;
    grid-template-columns: 58px minmax(0,1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 12px 17px;
    border-bottom: 1px solid #edf2f6;
}
.final-audit-item:last-child { border-bottom: 0; }
.audit-time {
    text-align: center;
    border-right: 1px solid #edf2f6;
    padding-right: 10px;
}
.audit-time strong {
    display: block;
    color: var(--cez-primary);
}
.audit-time span {
    display: block;
    font-size: .7rem;
    color: var(--cez-muted);
}
.audit-copy { min-width: 0; }
.audit-copy strong {
    display: block;
    color: var(--cez-primary);
    font-size: .86rem;
}
.audit-copy span {
    display: block;
    color: var(--cez-muted);
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.audit-code {
    background: #eef3f7;
    color: #526775;
    font-size: .63rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.final-quick-grid {
    display: grid;
    gap: 10px;
}
.final-quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border: 1px solid #e6edf2;
    border-radius: 14px;
    text-decoration: none;
    color: var(--cez-text);
    transition: background .18s ease, transform .18s ease;
}
.final-quick-action:hover {
    color: var(--cez-text);
    background: #f5f9fb;
    transform: translateX(2px);
}
.final-quick-action > span {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #eaf5f5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.final-quick-action strong {
    display: block;
    color: var(--cez-primary);
    font-size: .85rem;
}
.final-quick-action small {
    display: block;
    color: var(--cez-muted);
    margin-top: 1px;
}

@media (max-width: 1199.98px) {
    .dashboard-final-metrics {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}
@media (max-width: 575.98px) {
    .dashboard-final-metrics {
        grid-template-columns: 1fr;
    }
    .final-audit-item {
        grid-template-columns: 50px minmax(0,1fr);
    }
    .audit-code { display: none; }
    .dashboard-final-hero { padding: 20px; }
}
