/* ══════════════════════════════════════════════════════
   PEIPER ADMIN THEME
   Paleta: naranja #F29829 · crema #F6EDC5 · café #3D3431
   ══════════════════════════════════════════════════════ */

/* ── Fuentes ──────────────────────────────────────────── */
@font-face {
  font-family: 'RetroPica';
  src: url('/fonts/RetroPica-Regular.ttf') format('truetype'),
       url('/fonts/RetroPica-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── Variables ────────────────────────────────────────── */
:root {
  --p-cream:     #F6EDC5;
  --p-cream-bg:  #F2E3B3;
  --p-orange:    #F29829;
  --p-brown:     #3D3431;
  --p-brown-rgb: 61, 52, 49;
}

/* ── Fondo general ────────────────────────────────────── */
html, body {
  background-color: var(--p-cream-bg) !important;
}

/* ── Sidebar ──────────────────────────────────────────── */
.fi-sidebar {
  background-color: var(--p-cream) !important;
  border-right: 2px solid var(--p-brown) !important;
}

.fi-sidebar-header {
  background-color: var(--p-cream) !important;
  border-bottom: 2px solid var(--p-brown) !important;
}

/* ── Brand / Logo ─────────────────────────────────────── */
.fi-logo {
  font-family: 'RetroPica', serif !important;
  font-size: 1.45rem !important;
  color: var(--p-orange) !important;
  -webkit-text-stroke: 0.5px var(--p-brown) !important;
  letter-spacing: 0.03em !important;
}

/* ── Ítems de navegación ──────────────────────────────── */
.fi-sidebar-item-label {
  font-family: 'RetroPica', serif !important;
  font-size: 0.9rem !important;
}

.fi-sidebar-item-btn {
  border-radius: 10px !important;
  transition: background-color 150ms ease, color 150ms ease !important;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-btn,
.fi-sidebar-item.fi-active .fi-sidebar-item-btn *,
.fi-sidebar-item.fi-active .fi-sidebar-item-label {
  background-color: transparent !important;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-btn {
  background-color: var(--p-orange) !important;
  color: #2A1710 !important;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-btn *,
.fi-sidebar-item.fi-active .fi-sidebar-item-label {
  color: #2A1710 !important;
}

.fi-sidebar-item-btn:hover {
  background-color: rgba(var(--p-brown-rgb), 0.08) !important;
}

/* ── Topbar ───────────────────────────────────────────── */
.fi-topbar-ctn {
  border-bottom: 2px solid var(--p-brown) !important;
}

.fi-topbar {
  background-color: var(--p-cream) !important;
}

/* ── Heading de página ────────────────────────────────── */
.fi-header-heading {
  font-family: 'RetroPica', serif !important;
  color: var(--p-orange) !important;
  -webkit-text-stroke: 0.4px var(--p-brown) !important;
}

/* ── Secciones de formulario ──────────────────────────── */
.fi-section {
  border: 2px solid var(--p-brown) !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  background-color: #fff !important;
}

.fi-section-header {
  background-color: var(--p-cream) !important;
  border-bottom: 2px solid var(--p-brown) !important;
}

.fi-section-header-heading {
  font-family: 'RetroPica', serif !important;
  color: var(--p-orange) !important;
  -webkit-text-stroke: 0.3px var(--p-brown) !important;
}

/* ── Encabezados de tabla ─────────────────────────────── */
.fi-ta-header-cell {
  font-family: 'RetroPica', serif !important;
  font-size: 0.8rem !important;
  color: var(--p-brown) !important;
  background-color: var(--p-cream) !important;
}

.fi-ta-header-heading {
  font-family: 'RetroPica', serif !important;
}

/* ── Tabla — borde y radio ────────────────────────────── */
.fi-ta-ctn {
  border: 2px solid var(--p-brown) !important;
  border-radius: 14px !important;
  overflow: hidden !important;
}

/* ══════════════════════════════════════════════════════
   LOGIN — Split layout: panel izquierdo + formulario derecho
   ══════════════════════════════════════════════════════ */

/* ── Panel izquierdo (brand) ──────────────────────────── */
#peiper-login-panel {
  display: none;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 420px;
  background-color: #2A1710;
  flex-direction: column;
  justify-content: space-between;
  padding: 3.5rem 3rem 2.5rem;
  overflow: hidden;
  z-index: 100;
}

body:has(.fi-simple-page) #peiper-login-panel {
  display: flex;
}

/* Círculos decorativos */
.plbp-circle {
  position: absolute;
  border-radius: 50%;
  background-color: var(--p-orange);
  pointer-events: none;
}
.plbp-c1 { width: 420px; height: 420px; top: -140px; right: -130px; opacity: 0.07; }
.plbp-c2 { width: 240px; height: 240px; bottom: 20px;  left: -90px;  opacity: 0.05; }
.plbp-c3 { width: 100px; height: 100px; bottom: 210px; right: 30px;  opacity: 0.12; }

/* Branding */
.plbp-brand-name {
  font-family: 'RetroPica', serif;
  font-size: 3.8rem;
  color: var(--p-orange);
  -webkit-text-stroke: 1px rgba(122,74,42,0.6);
  line-height: 1;
  letter-spacing: 0.02em;
}

.plbp-brand-chip {
  display: inline-block;
  margin-top: 0.5rem;
  background-color: rgba(242,152,41,0.12);
  border: 1px solid rgba(242,152,41,0.30);
  color: var(--p-orange);
  font-family: 'RetroPica', serif;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.25rem 0.85rem;
  border-radius: 20px;
}

.plbp-tagline {
  color: rgba(246,237,197,0.60);
  font-size: 0.92rem;
  line-height: 1.65;
  margin-top: 1.75rem;
}

.plbp-sep {
  width: 36px;
  height: 3px;
  background-color: var(--p-orange);
  border-radius: 2px;
  margin: 1.75rem 0;
  opacity: 0.50;
}

.plbp-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.plbp-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: rgba(246,237,197,0.68);
  font-size: 0.88rem;
}

.plbp-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--p-orange);
  opacity: 0.65;
}

.plbp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(246,237,197,0.25);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

/* ── Lado derecho: Filament simple page ───────────────── */

body:has(.fi-simple-page) {
  overflow-x: hidden !important;
}

/* 1. Borrar fondos/bordes/sombras de Filament en todos los wrappers */
body:has(.fi-simple-page) .fi-simple-layout,
body:has(.fi-simple-page) .fi-simple-main,
body:has(.fi-simple-page) .fi-simple-main-ctn,
body:has(.fi-simple-page) .fi-simple-page-content,
body:has(.fi-simple-page) .fi-width-lg {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* 2. Panel derecho: empuja el contenido fuera del panel de marca */
body:has(.fi-simple-page) .fi-simple-page {
  margin-left: 420px !important;
  background-color: var(--p-cream-bg) !important;
  min-height: 100vh !important;
}

/* 3. fi-simple-layout: ocupa el panel derecho y centra el formulario */
body:has(.fi-simple-page) .fi-simple-layout {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 100vh !important;
  padding: 4rem 3rem !important;
  box-sizing: border-box !important;
}

/* 4. Ancho del bloque de formulario */
body:has(.fi-simple-page) .fi-simple-main,
body:has(.fi-simple-page) .fi-simple-main-ctn,
body:has(.fi-simple-page) .fi-simple-page-content {
  max-width: calc(100% - 2rem) !important;
  box-sizing: border-box !important;
}

/* Header: logo grande + subtítulo */
body:has(.fi-simple-page) .fi-simple-header {
  text-align: left !important;
  margin-bottom: 2.5rem !important;
  padding-bottom: 1.5rem !important;
  border-bottom: 1.5px solid rgba(var(--p-brown-rgb), 0.15) !important;
}

body:has(.fi-simple-page) .fi-logo {
  font-size: 2rem !important;
  display: block !important;
  margin-bottom: 0.35rem !important;
}

body:has(.fi-simple-page) .fi-simple-header-heading {
  font-family: 'Nunito', sans-serif !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  color: var(--p-brown) !important;
  opacity: 0.5 !important;
  -webkit-text-stroke: 0 !important;
}

/* Labels */
body:has(.fi-simple-page) .fi-fo-field-label {
  color: var(--p-brown) !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
}

/* Espacio entre campos */
body:has(.fi-simple-page) .fi-fo-field {
  margin-bottom: 1.25rem !important;
}

/* Inputs con fondo blanco cálido, borde sutil */
body:has(.fi-simple-page) .fi-input-wrp {
  width: 100% !important;
  min-height: 48px !important;
  border-radius: 10px !important;
  border-color: rgba(var(--p-brown-rgb), 0.25) !important;
  background-color: rgba(255,250,240,0.9) !important;
  box-sizing: border-box !important;
}

body:has(.fi-simple-page) .fi-input-wrp:focus-within {
  border-color: var(--p-orange) !important;
  box-shadow: 0 0 0 3px rgba(242,152,41,0.15) !important;
}

body:has(.fi-simple-page) .fi-input {
  background-color: transparent !important;
  color: var(--p-brown) !important;
  font-size: 0.95rem !important;
  padding: 0.65rem 1rem !important;
  width: 100% !important;
}

/* Checkbox */
body:has(.fi-simple-page) .fi-checkbox-input {
  accent-color: var(--p-orange) !important;
}

/* Botón */
body:has(.fi-simple-page) .fi-ac-btn-action {
  width: 100% !important;
  margin-top: 0.75rem !important;
  background-color: var(--p-orange) !important;
  border: 2px solid rgba(var(--p-brown-rgb), 0.40) !important;
  border-radius: 12px !important;
  font-family: 'RetroPica', serif !important;
  font-size: 1rem !important;
  letter-spacing: 0.04em !important;
  color: #2A1710 !important;
  box-shadow: 0 4px 0 rgba(var(--p-brown-rgb), 0.20) !important;
  transition: transform 80ms ease, box-shadow 80ms ease !important;
  padding: 0.8rem 1rem !important;
}

body:has(.fi-simple-page) .fi-ac-btn-action:active {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 rgba(var(--p-brown-rgb), 0.20) !important;
}

/* Responsive */
@media (max-width: 1024px) {
  #peiper-login-panel { display: none !important; }
  body:has(.fi-simple-page) .fi-simple-page {
    margin-left: 0 !important;
  }
}

/* ── Badges ───────────────────────────────────────────── */
.fi-badge {
  font-family: 'RetroPica', serif !important;
  font-size: 0.75rem !important;
}

/* ══════════════════════════════════════════════════════
   MODO OSCURO
   Filament añade .dark al <html> al activar dark mode
   ══════════════════════════════════════════════════════ */

/* ── Variables oscuras ────────────────────────────────── */
html.dark {
  --p-cream:     #251A16;
  --p-cream-bg:  #1A110E;
  --p-brown:     #C4A882;
  --p-brown-rgb: 196, 168, 130;
}

/* ── Fondo general (dark) ─────────────────────────────── */
html.dark body {
  background-color: var(--p-cream-bg) !important;
}

/* ── Sidebar (dark) ───────────────────────────────────── */
html.dark .fi-sidebar {
  background-color: #1E1511 !important;
  border-right-color: var(--p-brown) !important;
}

html.dark .fi-sidebar-header {
  background-color: #1E1511 !important;
  border-bottom-color: var(--p-brown) !important;
}

/* Ítem activo en dark mode → mismo café oscuro sobre naranja */
html.dark .fi-sidebar-item.fi-active .fi-sidebar-item-btn,
html.dark .fi-sidebar-item.fi-active .fi-sidebar-item-btn *,
html.dark .fi-sidebar-item.fi-active .fi-sidebar-item-label {
  color: #2A1710 !important;
}

/* ── Topbar (dark) ────────────────────────────────────── */
html.dark .fi-topbar {
  background-color: #1E1511 !important;
}

html.dark .fi-topbar-ctn {
  border-bottom-color: var(--p-brown) !important;
}

/* ── Secciones de formulario (dark) ──────────────────── */
html.dark .fi-section {
  background-color: #2A1E1B !important;
  border-color: var(--p-brown) !important;
}

html.dark .fi-section-header {
  background-color: #231714 !important;
  border-bottom-color: var(--p-brown) !important;
}

/* ── Tabla (dark) ─────────────────────────────────────── */
html.dark .fi-ta-ctn {
  border-color: var(--p-brown) !important;
}

html.dark .fi-ta-header-cell {
  background-color: #231714 !important;
  color: var(--p-orange) !important;
}

/* ── Login (dark) ─────────────────────────────────────── */
html.dark body:has(.fi-simple-page) .fi-simple-page {
  background-color: #1A110E !important;
}

html.dark body:has(.fi-simple-page) .fi-simple-page-content {
  background-color: #2A1E1B !important;
  border-color: rgba(var(--p-brown-rgb), 0.22) !important;
  box-shadow: 0 4px 32px rgba(0,0,0,0.25) !important;
}

html.dark body:has(.fi-simple-page) .fi-input-wrp {
  background-color: #1E1410 !important;
  border-color: rgba(var(--p-brown-rgb), 0.35) !important;
}

html.dark body:has(.fi-simple-page) .fi-input {
  color: var(--p-cream) !important;
}
