:root {
  --citius-green: #315d0c;
  --citius-green-2: #4e7d1b;
  --citius-green-soft: #f3f8ef;
  --citius-border: #d9e7ca;
  --citius-gold: #c59c1c;
  --citius-bg: #f7faf5;
  --citius-text: #25351d;
  --citius-muted: #65725e;
}

html, body { min-height: 100%; }
body { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--citius-text); background: var(--citius-bg); }
.login-page { background: radial-gradient(circle at top left, #fff 0, #f6fbf2 45%, #eef7e7 100%); }
.citius-login-card { border: 1px solid var(--citius-border) !important; }
.citius-logo { display: block; object-fit: contain; }
.brand-mark { display: none; align-items: center; justify-content: center; min-width: 110px; min-height: 52px; border: 1px solid var(--citius-border); border-radius: 14px; color: var(--citius-gold); font-weight: 700; letter-spacing: .04em; background: #fff; }
.login-logo-wrap { display: inline-flex; align-items: center; justify-content: center; width: min(100%, 320px); min-height: 96px; }
.login-logo-wrap img { width: 100%; max-width: 300px; max-height: 92px; object-fit: contain; }
.brand-panel { display: inline-flex; align-items: center; justify-content: center; width: 228px; height: 82px; border: 1px solid var(--citius-border); border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(49,93,12,.08); padding: .45rem .75rem; }
.brand-panel img { width: 100%; max-width: 208px; max-height: 68px; object-fit: contain; }
.brand-title { display: flex; flex-direction: column; gap: .05rem; font-size: 1.08rem; font-weight: 900; color: var(--citius-green); line-height: 1.05; }
.brand-title small { color: #66745d; font-size: .76rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.app-header { background: rgba(255,255,255,.94); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 100; }
.user-box { color: #34412b; }
.app-layout { min-height: calc(100vh - 83px); }
.app-sidebar { min-height: calc(100vh - 83px); background: rgba(248,252,246,.96); }
.app-main { min-height: calc(100vh - 83px); overflow: auto; }
.content-card { min-height: calc(100vh - 122px); margin: 0 12px; border: 1px solid var(--citius-border); border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(49,93,12,.04); }

.sidebar-nav .section-title { font-size: .92rem; font-weight: 800; color: var(--citius-green); padding: .85rem 1rem; margin: .35rem 0; border-bottom: 1px solid var(--citius-border); cursor: pointer; border-radius: 12px; user-select: none; }
.sidebar-nav .section-title:hover { background: #edf6e8; }
.sidebar-nav ul.menu { list-style: none; margin: 0 0 .55rem; padding: 0; display: block; }
.sidebar-nav ul.menu:not(.show) { display: none; }
.sidebar-nav li a { display: block; padding: .62rem .75rem; margin: .1rem .25rem; color: #3b4d32; text-decoration: none; border-radius: 12px; border-left: 4px solid transparent; cursor: pointer; transition: background-color .15s ease, transform .15s ease, border-color .15s ease; }
.sidebar-nav li a:hover, .sidebar-nav li.active a { background: #eff7ea; border-left-color: var(--citius-green-2); color: var(--citius-green); transform: translateX(2px); }

.btn-primary { --bs-btn-bg: #1f7a3d; --bs-btn-border-color: #1f7a3d; --bs-btn-hover-bg: #186633; --bs-btn-hover-border-color: #186633; }
.btn-outline-primary { --bs-btn-color: #1f7a3d; --bs-btn-border-color: #1f7a3d; --bs-btn-hover-bg: #1f7a3d; --bs-btn-hover-border-color: #1f7a3d; }

.page-title { color: var(--citius-green); font-weight: 900; font-size: 1.2rem; padding-bottom: .75rem; margin-bottom: 1rem; border-bottom: 1px solid var(--citius-border); }
.page-subtitle { color: var(--citius-muted); margin-top: -.55rem; margin-bottom: 1rem; font-size: .9rem; }
.loading-box { width: min(100%, 320px); text-align: center; padding: 18px; margin: 40px auto; background: white; border: 1px solid var(--citius-border); border-radius: 14px; box-shadow: 0 8px 24px rgba(49,93,12,.08); color: var(--citius-green); font-weight: 800; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat-card { border: 1px solid var(--citius-border); border-radius: 14px; background: #fbfdf9; padding: .9rem 1rem; min-height: 88px; }
.stat-card .label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #64745b; font-weight: 800; }
.stat-card .value { display: block; font-size: 1.5rem; font-weight: 900; color: var(--citius-green); line-height: 1.15; margin-top: .2rem; }
.stat-card .hint { display: block; color: var(--citius-muted); font-size: .76rem; margin-top: .2rem; }
.info-banner { border: 1px solid #d7e7ca; background: #f7fbf4; color: #3b4e31; border-radius: 14px; padding: .9rem 1rem; margin-bottom: 1rem; }
.info-banner.warning { border-color: #f0dd99; background: #fffdf4; color: #604500; }

.table-wrap { border: 1px solid var(--citius-border); border-radius: 14px; overflow: auto; background: #fff; }
.table-citius { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; margin: 0; }
.table-citius thead th { position: sticky; top: 0; z-index: 2; background: #f3f8ef; color: #163907; font-weight: 800; border-bottom: 1px solid var(--citius-border); padding: .75rem .65rem; vertical-align: middle; white-space: nowrap; }
.table-citius tbody td { padding: .7rem .65rem; border-bottom: 1px solid #edf2e8; vertical-align: middle; }
.table-citius tbody tr:last-child td { border-bottom: 0; }
.table-citius tbody tr:hover td { background: #fbfdf9; }
.table-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.table-actions .btn { white-space: nowrap; }

.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.toolbar .form-control { max-width: 360px; }
.empty-state { border: 1px dashed #cadbbc; background: #fbfdf9; border-radius: 14px; padding: 1.4rem; text-align: center; color: var(--citius-muted); }

.regimen-badge, .status-pill { display: inline-flex; align-items: center; justify-content: center; padding: .22rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 900; white-space: nowrap; }
.regimen-badge.master { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; }
.regimen-badge.experto { background: #f3f8ef; color: var(--citius-green); border: 1px solid var(--citius-border); }
.status-pill.ok { background: #dcfce7; color: #166534; }
.status-pill.warn { background: #fef3c7; color: #92400e; }
.status-pill.ko { background: #fee2e2; color: #991b1b; }
.status-pill.muted { background: #f3f4f6; color: #4b5563; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; }
.detail-item { border-bottom: 1px solid #eef3ea; padding-bottom: .55rem; }
.detail-item .label { display: block; color: #6b7764; font-size: .72rem; text-transform: uppercase; font-weight: 800; letter-spacing: .05em; margin-bottom: .15rem; }
.detail-item .value { display: block; color: var(--citius-text); font-weight: 650; word-break: break-word; }
.detail-section { border: 1px solid var(--citius-border); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; }
.detail-section h3 { color: var(--citius-green); font-size: .95rem; font-weight: 900; margin: 0 0 .8rem; }

/* Perfil */
.perfil-page .profile-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); gap: 1rem; align-items: stretch; }
.profile-card { border: 1px solid var(--citius-border); border-radius: 16px; background: #fff; padding: 1rem 1.1rem; box-shadow: 0 8px 22px rgba(49,93,12,.035); }
.profile-card-main { background: linear-gradient(135deg, #fbfdf9 0%, #fff 100%); }
.profile-card-title { color: var(--citius-green); font-weight: 900; font-size: .98rem; margin-bottom: .9rem; padding-bottom: .55rem; border-bottom: 1px solid var(--citius-border); }
.profile-readonly-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.profile-readonly-grid .label { display: block; color: #66725d; font-size: .72rem; text-transform: uppercase; font-weight: 800; letter-spacing: .05em; margin-bottom: .2rem; }
.profile-readonly-grid strong { display: block; color: var(--citius-text); font-size: .98rem; }
.perfil-page .form-label, .dialog-form .form-label { font-weight: 800; color: #34472a; font-size: .86rem; }
.perfil-page .form-control, .dialog-form .form-control, .dialog-form .form-select { border-color: #cddfbe; border-radius: 10px; min-height: 40px; }
.perfil-page .form-control:focus, .dialog-form .form-control:focus, .dialog-form .form-select:focus { border-color: var(--citius-green-2); box-shadow: 0 0 0 .18rem rgba(78,125,27,.14); }
.password-rules { border: 1px solid #e7d58d; background: #fffdf3; color: #604500; border-radius: 12px; padding: .7rem .85rem; font-size: .86rem; }
.password-meter { width: 100%; height: 9px; background: #eef2e9; border-radius: 999px; overflow: hidden; }
.password-meter-bar { width: 0; height: 100%; background: #c2410c; transition: width .2s ease, background .2s ease; }
.password-meter-bar[data-score="3"] { background: #ca8a04; }
.password-meter-bar[data-score="4"], .password-meter-bar[data-score="5"] { background: #15803d; }
.password-meter-label { color: #607056; font-size: .78rem; font-weight: 800; margin-top: .35rem; }

/* Diálogos */
.ui-dialog { border: 0 !important; border-radius: 16px !important; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,.22) !important; z-index: 2000 !important; }
.ui-widget-overlay { background: rgba(19,31,15,.45) !important; opacity: 1 !important; z-index: 1990 !important; }
.ui-dialog .ui-dialog-titlebar { background: var(--citius-green); color: #fff; border: 0; padding: .8rem 1rem; }
.ui-dialog .ui-dialog-title { font-weight: 800; }
.ui-dialog .ui-dialog-titlebar-close { cursor: pointer; border-radius: 999px; border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.16); right: .8rem; top: 50%; transform: translateY(-50%); }
.ui-dialog .ui-dialog-titlebar-close .ui-icon { display: none; }
.ui-dialog .ui-dialog-titlebar-close:after { content: '×'; color: #fff; font-size: 20px; line-height: 16px; position: absolute; left: 6px; top: 0; }
.ui-dialog .ui-dialog-content { padding: 1rem !important; }
.ui-dialog .ui-dialog-buttonpane button { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid #cbd5c0; border-radius: 10px; background: #fff; padding: .45rem .8rem; color: #25351d; }
.ui-dialog .ui-dialog-buttonpane button:hover { background: #f3f8ef; }

@media (max-width: 1199.98px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .brand-panel { width: 170px; height: 62px; }
  .brand-panel img { max-width: 150px; max-height: 52px; }
  .brand-title { font-size: 1rem; }
  .content-card { margin: 0; min-height: calc(100vh - 112px); border-radius: 14px; }
  .perfil-page .profile-grid, .detail-grid { grid-template-columns: 1fr; }
  .profile-readonly-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
  .user-box { display: none; }
  .summary-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; }
  .toolbar .form-control { max-width: none; width: 100%; }
  .table-citius { font-size: .84rem; }
}
