/* ============================================================
   NOVA CORE GT — CSS UNIVERSAL
   APEX 24.2 · Vita Theme (configurado via Theme Roller)
   
   NOTA: Los colores base (accent, header, nav, botones)
   ya están configurados en el Theme Roller.
   Este archivo solo cubre lo que APEX no maneja desde ahí.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── VARIABLES ── */
:root {
  --nc-ink:      #1a1a18;
  --nc-accent:   #c8a96e;
  --nc-accent-d: #9b7d46;
  --nc-muted:    #6b6b66;
  --nc-light:    #aeada8;
  --nc-off:      #f0ede8;
  --nc-border:   rgba(26,26,24,0.10);
  --font-body:   'DM Sans', system-ui, sans-serif;
}

/* ============================================================
   TIPOGRAFÍA GLOBAL
   ============================================================ */
body, .t-Body, .t-PageBody {
  font-family: var(--font-body) !important;
}

.t-Region-title,
.t-Form-label, label.t-Form-label,
.t-BreadcrumbRegion-title,
.t-Alert,
.t-Button,
.a-Menu-item a {
  font-family: var(--font-body) !important;
}

/* ============================================================
   BOTONES
   ============================================================ */

/* ── GUARDAR / ACTUALIZAR ── */
button.btn-guardar {
  background-color: #1a1a18 !important;
  border: 1.5px solid #1a1a18 !important;
  color: #ffffff !important;
}

button.btn-guardar:hover {
  background-color: #c8a96e !important;
  border-color: #c8a96e !important;
}

/* ── CREAR / NUEVO ── */
button.btn-crear {
  background-color: rgba(200,169,110,0.12) !important;
  border: 1.5px solid #c8a96e !important;
  color: #9b7d46 !important;
}

button.btn-crear:hover {
  background-color: #c8a96e !important;
  border-color: #c8a96e !important;
  color: #ffffff !important;
}

/* ── CANCELAR / VOLVER ── */
button.btn-cancelar {
  background-color: #ffffff !important;
  border: 1.5px solid rgba(26,26,24,0.15) !important;
  color: #6b6b66 !important;
}

button.btn-cancelar:hover {
  background-color: #f0ede8 !important;
  border-color: #1a1a18 !important;
  color: #1a1a18 !important;
}

/* ── ELIMINAR ── */
button.btn-eliminar {
  background-color: #fcebeb !important;
  border: 1.5px solid rgba(163,45,45,0.30) !important;
  color: #a32d2d !important;
}

button.btn-eliminar:hover {
  background-color: #f5d0d0 !important;
  border-color: #a32d2d !important;
}

/* ── ESTILO GENERAL PARA TODOS LOS BOTONES ── */
a.t-Button:not(.apex-item-select),
button.t-Button:not(.apex-item-select) {
  font-family: 'DM Sans', system-ui, sans-serif !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  padding: 0.55rem 1.25rem !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
}

a.t-Button:not(.apex-item-select):hover,
button.t-Button:not(.apex-item-select):hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(26,26,24,0.10) !important;
}

/* ============================================================
   FORMULARIOS — Lo que el Theme Roller no cubre
   ============================================================ */

/* Labels */
.t-Form-label, label.t-Form-label {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.10em !important;
  text-transform: uppercase !important;
  color: var(--nc-muted) !important;
}

/* Asterisco de campo requerido */
.t-Form-required { color: var(--nc-accent) !important; }

/* Focus en inputs */
.apex-item-text:focus,
.apex-item-select:focus,
.apex-item-textarea:focus,
input:focus, select:focus, textarea:focus {
  border-color: var(--nc-accent) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(200,169,110,0.12) !important;
}

/* Placeholder */
input::placeholder, textarea::placeholder {
  color: var(--nc-light) !important;
  font-weight: 300 !important;
}

/* Readonly / disabled */
input[readonly], input[disabled], select[disabled] {
  opacity: 0.7 !important;
}

/* ============================================================
   REGIONES — Ajustes de detalle
   ============================================================ */

.t-Region {
  border-radius: 10px !important;
  box-shadow: 0 1px 4px rgba(26,26,24,0.06) !important;
}

.t-Region-header {
  border-radius: 10px 10px 0 0 !important;
  padding: 0.85rem 1.25rem !important;
}

.t-Region-title {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

/* Línea acento izquierda en header de región */
.t-Region-header::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--nc-accent);
  border-radius: 2px;
  margin-right: 10px;
  vertical-align: middle;
}

/* Sin acento en el login */
.t-Login-region .t-Region-header::before { display: none !important; }

/* ============================================================
   TABLAS — Tipografía y detalles
   ============================================================ */

.t-Report thead th,
.a-IRR-table thead th {
  font-family: var(--font-body) !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.10em !important;
  text-transform: uppercase !important;
}

.t-Report tbody td,
.a-IRR-table tbody td {
  font-family: var(--font-body) !important;
  font-size: 0.87rem !important;
}

/* Primera columna destacada */
.t-Report tbody td:first-child {
  color: var(--nc-ink) !important;
  font-weight: 500 !important;
}

/* Hover en fila */
.t-Report tbody tr:hover td,
.a-IRR-table tbody tr:hover td {
  background: rgba(200,169,110,0.05) !important;
}

/* Bordes redondeados en contenedor de tabla */
.t-Report-wrap {
  border-radius: 10px !important;
  overflow: hidden !important;
}

/* ============================================================
   ALERTAS — Estilo personalizado
   ============================================================ */

.t-Alert {
  font-family: var(--font-body) !important;
  font-size: 0.87rem !important;
  border-radius: 0 8px 8px 0 !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
}

.t-Alert--success {
  background: #eaf3de !important;
  border-left: 3px solid #3b6d11 !important;
  color: #3b6d11 !important;
}

.t-Alert--warning {
  background: #faeeda !important;
  border-left: 3px solid #854f0b !important;
  color: #854f0b !important;
}

.t-Alert--danger {
  background: #fcebeb !important;
  border-left: 3px solid #a32d2d !important;
  color: #a32d2d !important;
}

.t-Alert--info {
  background: rgba(200,169,110,0.08) !important;
  border-left: 3px solid var(--nc-accent) !important;
  color: var(--nc-accent-d) !important;
}

/* ============================================================
   MODALES / DIALOGS
   ============================================================ */

.ui-dialog, .t-Dialog-page {
  border-radius: 12px !important;
  overflow: hidden !important;
  border: none !important;
  box-shadow: 0 16px 64px rgba(26,26,24,0.16) !important;
}

.ui-dialog-titlebar, .t-Dialog-header {
  font-family: var(--font-body) !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  border-bottom: none !important;
}

.ui-dialog-titlebar-close:hover {
  background: rgba(255,255,255,0.1) !important;
  border-radius: 4px !important;
}

.ui-dialog-buttonpane {
  border-top: 1px solid var(--nc-border) !important;
}

/* ============================================================
   SCROLLBAR PERSONALIZADO
   ============================================================ */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--nc-off); }
::-webkit-scrollbar-thumb { background: rgba(26,26,24,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--nc-light); }

/* ============================================================
   SIDEBAR — Detalles que el Theme Roller no toca
   ============================================================ */

/* Item activo con borde izquierdo dorado */
#t_TreeNav .is-current > .a-TreeView-row,
#t_TreeNav .a-TreeView-row.is-selected {
  border-left: 3px solid var(--nc-accent) !important;
  border-radius: 0 6px 6px 0 !important;
}

/* Etiquetas de sección del menú */
#t_TreeNav .t-TreeNav-sectionLabel {
  font-family: var(--font-body) !important;
  font-size: 0.6rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase !important;
  opacity: 0.35 !important;
  padding: 18px 16px 4px !important;
}

/* Scrollbar sidebar */
#t_TreeNav::-webkit-scrollbar { width: 3px; }
#t_TreeNav::-webkit-scrollbar-track { background: transparent; }
#t_TreeNav::-webkit-scrollbar-thumb {
  background: rgba(200,169,110,0.2);
  border-radius: 4px;
}

/* ============================================================
   FOOTER
   ============================================================ */

.t-Footer, #t_Footer {
  font-family: var(--font-body) !important;
  font-size: 0.72rem !important;
}

/* ============================================================
   LOGIN
   ============================================================ */

.t-PageBody--login, body.t-PageBody--login {
  background-color: #f7f6f2 !important;
  background-image:
    linear-gradient(135deg, rgba(200,169,110,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 50%, rgba(200,169,110,0.06) 0%, transparent 50%) !important;
}

.t-PageBody--login::before {
  content: '';
  position: fixed;
  left: -60px; top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 320px; height: 320px;
  border: 2px solid rgba(200,169,110,0.35);
  pointer-events: none; z-index: 0;
}

.t-PageBody--login::after {
  content: '';
  position: fixed;
  left: -30px; top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 220px; height: 220px;
  border: 1.5px solid rgba(200,169,110,0.22);
  pointer-events: none; z-index: 0;
}

.t-Body-login, .t-Login-container {
  position: relative;
  z-index: 1;
}

.t-Login-region.t-Form--stretchInputs,
.t-Login-region {
  background: #ffffff !important;
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 48px rgba(26,26,24,0.10), 0 2px 8px rgba(26,26,24,0.06) !important;
  padding: 2.5rem 2.75rem 2rem !important;
  max-width: 420px !important;
  width: 100% !important;
}

.t-Login-logo { text-align: center !important; margin-bottom: 0.5rem !important; }
.t-Login-logo a, .t-Login-logo img { display: inline-block !important; }

.t-Login-region .t-Region-header,
.t-Login-region .t-Region-title,
.t-Login-region h1,
.t-Login-region h2 {
  font-family: var(--font-body) !important;
  font-weight: 300 !important;
  font-size: 1rem !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  color: var(--nc-ink) !important;
  text-align: center !important;
  margin-bottom: 0.25rem !important;
}

.t-Login-region .t-Region-header::after,
.t-Login-region h1::after,
.t-Login-region h2::after {
  content: '';
  display: block;
  width: 48px; height: 1.5px;
  background: var(--nc-accent);
  margin: 0.6rem auto 1.5rem;
  opacity: 0.8;
}

.t-Login-region .t-Form-label,
.t-Login-region label {
  font-family: var(--font-body) !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: var(--nc-muted) !important;
  margin-bottom: 0.4rem !important;
}

.t-Login-region input[type="text"],
.t-Login-region input[type="password"],
.t-Login-region input[type="email"] {
  font-family: var(--font-body) !important;
  font-size: 0.9rem !important;
  color: var(--nc-ink) !important;
  background: #ffffff !important;
  border: 1px solid rgba(26,26,24,0.15) !important;
  border-radius: 8px !important;
  padding: 0.75rem 2.5rem !important;
  height: auto !important;
  width: 100% !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease !important;
}

.t-Login-region input:focus {
  border-color: var(--nc-accent) !important;
  box-shadow: 0 0 0 3px rgba(200,169,110,0.12) !important;
}

.t-Login-region input::placeholder {
  color: var(--nc-light) !important;
  font-weight: 300 !important;
}

.t-Login-region .t-Button--hot,
.t-Login-region button[type="submit"],
#LOGIN {
  font-family: var(--font-body) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: #ffffff !important;
  background: var(--nc-ink) !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 0.85rem 1rem !important;
  width: 100% !important;
  transition: background 0.2s ease !important;
  margin-top: 0.5rem !important;
}

.t-Login-region .t-Button--hot:hover,
#LOGIN:hover { background: var(--nc-accent) !important; }

.t-Login-footer {
  text-align: center !important;
  margin-top: 1.25rem !important;
  padding-top: 1rem !important;
  position: relative;
}

.t-Login-footer::before {
  content: '◆';
  display: block;
  color: var(--nc-accent);
  font-size: 8px;
  text-align: center;
  margin-bottom: 0.6rem;
  opacity: 0.7;
}

.t-Login-footer::after {
  content: '';
  display: block;
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: var(--nc-border);
}

.t-Login-footer a {
  color: var(--nc-accent) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  font-size: 0.78rem !important;
}

.t-Login-footer a:hover { color: var(--nc-accent-d) !important; }

/* ============================================================
   ERROR LOGIN PERSONALIZADO
   ============================================================ */

body.t-PageBody--login .apex-page-error { display: none !important; }

#custom-login-error {
  background: #fcebeb;
  color: #a32d2d;
  border: 1px solid rgba(163,45,45,0.15);
  border-left: 3px solid #a32d2d;
  border-right: 3px solid #a32d2d;
  padding: 11px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  animation: ncgFadeInDown 0.25s ease;
}

@keyframes ncgFadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.custom-login-error {
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 1;
}

.custom-login-error.fade-out {
  opacity: 0;
  transform: translateY(-5px);
}