/* conta_scuti/public/css/theme.css */

/* Importar tipografía moderna */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ==========================================
   TEMA CLARO (LIGHT MODE)
   ========================================== */
:root, [data-theme="light"] {
    /* 1. Colores de Marca (Azul Scuti) */
    --primary-color: #132E4F;
    --primary: #132E4F;
    --text-on-primary: #ffffff;

    /* 2. Fondos "Seamless" (Blanco Puro) */
    --bg-color: #ffffff;
    --page-bg: #ffffff;
    --bg-light-gray: #ffffff; /* Elimina el fondo gris estándar de las tarjetas de Frappe */
    --fg-color: #ffffff;
    --control-bg: #f8fafc; /* Gris ultra sutil exclusivo para los campos de entrada/inputs */

    /* 3. Suavizado de Bordes y Sombras */
    --border-color: #e2e8f0; /* Borde gris tenue y elegante */
    --border-radius-md: 8px; /* Curvatura moderna para componentes y botones */
    --border-radius: 8px;
    --shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.05); /* Sombra suave para separar áreas */

    /* 4. Tipografía en variables de Frappe */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================
   TEMA OSCURO (DARK MODE - SCUTI NAVY)
   ========================================== */
[data-theme="dark"] {
    --primary-color: #1A3E6B; /* Un tono levemente más claro del primario para resaltar en la oscuridad */
    --primary: #1A3E6B;
    --text-on-primary: #ffffff;
    
    /* Fondos Azul Medianoche en lugar de grises/negros estándar */
    --bg-color: #061220; 
    --page-bg: #061220;
    --bg-light-gray: #0A192B; /* Tarjetas y contenedores */
    --fg-color: #0A192B;
    
    /* Cajas de texto y bordes */
    --control-bg: #11253F; 
    --border-color: #1A3E6B;
    --text-color: #f1f5f9; /* Texto blanco suave para no cansar la vista */
    --text-muted: #94a3b8;

    /* Tipografía en variables de Frappe */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Aplicar la fuente Inter de forma estricta en todo el sistema */
html, body, *,
.frappe-control, 
.grid-row, 
.form-section, 
.page-title, 
.btn, 
.list-row,
.sidebar-item-label,
.item-anchor,
.page-container,
.navbar,
.standard-sidebar-item {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  letter-spacing: -0.011em !important;
}

h1, h2, h3, h4, h5, h6, .page-title {
  letter-spacing: -0.022em !important;
}

/* ==========================================
   BOTONES Y ACCIONES PRIMARIAS
   ========================================== */
.btn {
    border-radius: 8px !important;
    font-weight: 500 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}

/* Bordes más anchos y definidos para botones secundarios/acciones */
.btn-secondary,
.btn-default,
.btn-outline,
.btn-light,
.btn:not(.btn-primary) {
    border: 1.5px solid var(--border-color) !important;
}

.btn-secondary:hover,
.btn-default:hover,
.btn-outline:hover,
.btn-light:hover,
.btn:not(.btn-primary):hover {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    background-color: var(--control-bg) !important;
}

[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .btn-default:hover,
[data-theme="dark"] .btn-outline:hover,
[data-theme="dark"] .btn-light:hover,
[data-theme="dark"] .btn:not(.btn-primary):hover {
    border-color: #3b82f6 !important;
    color: #60a5fa !important;
    background-color: #11253f !important;
}

/* Efecto hover en botones primarios (Tono azul más oscuro con sombra de profundidad) */
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: #0a192a !important; 
    border-color: #0a192a !important;
    box-shadow: 0 4px 12px rgba(17, 42, 70, 0.2) !important;
}

[data-theme="dark"] .btn-primary:hover, 
[data-theme="dark"] .btn-primary:focus, 
[data-theme="dark"] .btn-primary:active {
    background-color: #122A4A !important; 
    border-color: #122A4A !important;
    box-shadow: 0 4px 12px rgba(26, 62, 107, 0.4) !important;
}

/* Checkboxes y Radios Modernos */
input[type="checkbox"]:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}
input[type="radio"]:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* ==========================================
   ESTRUCTURA DE PÁGINA Y CABECERA
   ========================================== */
.page-head {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

.navbar {
    background-color: var(--bg-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
}

/* Fondo Blanco Puro en el Contenedor Principal de Formularios y Listas */
.page-container, 
.layout-main-section, 
.form-layout, 
.list-container {
  background-color: var(--bg-color) !important;
  border-radius: 12px !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01) !important;
}

/* Estilos de Tarjetas, Modales y Popups Modernos (Estilo Stripe/SaaS) */
.card,
.modal-content,
.dropdown-menu {
    border-radius: 14px !important;
    box-shadow: 0 4px 25px -4px rgba(0, 0, 0, 0.04), 0 1px 4px -1px rgba(0, 0, 0, 0.01), 0 0 1px 0 rgba(0, 0, 0, 0.08) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu {
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4) !important;
}

/* Estilización Avanzada de Inputs */
.form-control,
.frappe-control input,
.frappe-control select,
.frappe-control textarea {
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    padding: 6px 12px !important; /* Reducido para evitar recortes */
    height: 36px !important; /* Altura fija para evitar recortes en inputs estándar */
    line-height: 1.5 !important;
    background-color: var(--control-bg) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Evitar altura fija en textareas */
.frappe-control textarea {
    height: auto !important;
    min-height: 80px !important;
}

/* Mantener inputs compactos en las grillas (Child Tables) */
.grid-row .form-control,
.grid-row input,
.grid-row select {
    height: 30px !important;
    padding: 4px 8px !important;
    font-size: 12.5px !important;
}

.form-control:focus,
.frappe-control input:focus,
.frappe-control select:focus,
.frappe-control textarea:focus {
    border-color: var(--primary-color) !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(19, 46, 79, 0.08) !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .frappe-control input:focus,
[data-theme="dark"] .frappe-control select:focus,
[data-theme="dark"] .frappe-control textarea:focus {
    background-color: #0c1a2d !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* ==========================================
   MENÚ LATERAL IZQUIERDO (SIDEBAR) SEAMLESS (Frappe v16)
   ========================================== */
/* Forzar columnas laterales y contenedores de sidebar a fondo correspondiente y división sutil */
.body-sidebar,
.body-sidebar-container,
.layout-side-cards, 
.page-sidebar, 
.desk-sidebar {
    background-color: var(--bg-color) !important;
    border-right: 1px solid var(--border-color) !important;
}

/* Limpiar separadores de sección en la barra lateral */
.sidebar-section,
.divider {
    border-bottom: none !important;
    border-color: transparent !important;
    background-color: var(--bg-color) !important;
}

/* Estado Activo: Elemento del menú donde está posicionado el usuario con indicador sutil de barra lateral */
.standard-sidebar-item {
    margin: 2px 8px !important;
    border-radius: 6px !important;
    border-left: 0px solid transparent !important;
    padding: 8px 12px !important;
    transition: all 0.2s ease !important;
}

.standard-sidebar-item.active-sidebar {
    background-color: rgba(19, 46, 79, 0.06) !important; 
    color: var(--primary-color) !important;
    font-weight: 600 !important;
    border-left: 3px solid var(--primary-color) !important;
}

[data-theme="dark"] .standard-sidebar-item.active-sidebar {
    background-color: rgba(59, 130, 246, 0.12) !important;
    color: #60a5fa !important;
    border-left: 3px solid #3b82f6 !important;
}

.standard-sidebar-item.active-sidebar a,
.standard-sidebar-item.active-sidebar .sidebar-item-label,
.standard-sidebar-item.active-sidebar .sidebar-item-icon svg {
    color: var(--primary-color) !important;
    stroke: var(--primary-color) !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .standard-sidebar-item.active-sidebar a,
[data-theme="dark"] .standard-sidebar-item.active-sidebar .sidebar-item-label,
[data-theme="dark"] .standard-sidebar-item.active-sidebar .sidebar-item-icon svg {
    color: #60a5fa !important;
    stroke: #3b82f6 !important;
}

/* Efecto Hover Seamless: Fondo gris-celeste tenue con texto e íconos en Azul Scuti */
.standard-sidebar-item:hover {
    background-color: var(--control-bg) !important; 
    color: var(--primary-color) !important;
    text-decoration: none !important;
}

[data-theme="dark"] .standard-sidebar-item:hover {
    background-color: #11253f !important;
    color: #f1f5f9 !important;
}

.standard-sidebar-item:hover a,
.standard-sidebar-item:hover .sidebar-item-label,
.standard-sidebar-item:hover .sidebar-item-icon svg {
    color: var(--primary-color) !important;
    stroke: var(--primary-color) !important;
}

[data-theme="dark"] .standard-sidebar-item:hover a,
[data-theme="dark"] .standard-sidebar-item:hover .sidebar-item-label,
[data-theme="dark"] .standard-sidebar-item:hover .sidebar-item-icon svg {
    color: #ffffff !important;
    stroke: #60a5fa !important;
}

/* Forzar que las líneas del ícono SVG también tomen el color de la marca en el hover */
.sidebar-item-container:hover .sidebar-item-link svg,
.sidebar-item-container:hover .sidebar-item-link,
.sidebar-link:hover,
.sidebar-link:hover svg {
    color: var(--primary-color) !important;
    stroke: var(--primary-color) !important;
}

[data-theme="dark"] .sidebar-item-container:hover .sidebar-item-link svg,
[data-theme="dark"] .sidebar-item-container:hover .sidebar-item-link,
[data-theme="dark"] .sidebar-link:hover,
[data-theme="dark"] .sidebar-link:hover svg {
    color: #60a5fa !important;
    stroke: #60a5fa !important;
}

/* ==========================================
   DISEÑO Y CONTRASTE DE GRILLAS / TABLAS HIJAS
   ========================================== */
/* ==========================================
   DISEÑO Y CONTRASTE DE GRILLAS / TABLAS HIJAS (Estilo Premium)
   ========================================== */
.frappe-control[data-fieldtype="Table"] .grid-row,
.grid-row {
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    transition: background-color 0.15s ease;
}

.frappe-control[data-fieldtype="Table"] .grid-row:hover,
.grid-row:hover {
    background-color: rgba(19, 46, 79, 0.02) !important;
}

.frappe-control[data-fieldtype="Table"] .grid-heading-row,
.grid-heading-row {
    background-color: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
    font-weight: 600 !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    font-size: 11px !important;
    letter-spacing: 0.05em !important;
}

/* Forzar contraste en las Grillas/Asientos Contables en Modo Oscuro */
[data-theme="dark"] .frappe-control[data-fieldtype="Table"] .grid-row,
[data-theme="dark"] .grid-row {
    background-color: #0A192B !important;
    border-bottom: 1px solid #1A3E6B !important;
}
[data-theme="dark"] .frappe-control[data-fieldtype="Table"] .grid-row:hover,
[data-theme="dark"] .grid-row:hover {
    background-color: rgba(26, 62, 107, 0.08) !important;
}

[data-theme="dark"] .frappe-control[data-fieldtype="Table"] .grid-heading-row,
[data-theme="dark"] .grid-heading-row {
    background-color: #11253F !important;
    border-bottom: 2px solid #1A3E6B !important;
    color: #cbd5e1 !important;
}

/* ==========================================
   LOGIN SEAMLESS PREMIUM DESIGN
   ========================================== */
body:has(.for-login),
body:has(.login-content),
body.for-login,
.for-login,
.page-card-container {
    background-color: #ffffff !important;
}

/* Efecto de fondo sutil en el body del login */
body:has(.for-login) {
    background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f8fafc 100%) !important;
}

/* Centrar y estilizar la tarjeta de login */
.for-login .page-card,
.login-content.page-card {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 50px 40px !important;
    max-width: 420px !important;
    margin: 60px auto !important;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05) !important;
    position: relative !important;
}

/* Ajustes del encabezado (logo y título) */
.page-card-head {
    margin-bottom: 35px !important;
    text-align: center !important;
}

.page-card-head img.app-logo {
    max-height: 70px !important;
    width: auto !important;
    margin-bottom: 15px !important;
}

.page-card-head h4 {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.025em !important;
}

/* Estilización de Inputs del Login */
.for-login input[type="text"],
.for-login input[type="email"],
.for-login input[type="password"] {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 14px 16px 14px 44px !important; /* Espacio para el ícono */
    height: auto !important;
    font-size: 14px !important;
    color: #1e293b !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.for-login input[type="text"]:focus,
.for-login input[type="email"]:focus,
.for-login input[type="password"]:focus {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important; /* Enfoque azul brillante */
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
}

/* Posición de los íconos dentro de los inputs */
.for-login .email-field,
.for-login .password-field {
    position: relative !important;
}

.for-login .field-icon {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #94a3b8 !important;
    z-index: 10 !important;
    pointer-events: none !important;
    transition: color 0.2s ease !important;
}

.for-login input:focus + .field-icon {
    color: #3b82f6 !important;
}

/* Ocultar/Mostrar contraseña */
.for-login .toggle-password {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #2563eb !important;
    cursor: pointer !important;
    z-index: 10 !important;
}

/* Botón principal de login (Azul Real Brillante con Degradado) */
.btn-login,
.for-login .btn-login,
.for-login button[type="submit"] {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important; /* Azul más claro y brillante */
    border: none !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 14px 28px !important;
    border-radius: 10px !important;
    height: auto !important;
    width: 100% !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2) !important;
    cursor: pointer !important;
    text-transform: none !important;
}

.btn-login:hover,
.btn-login:focus,
.btn-login:active,
.for-login .btn-login:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    transform: translateY(-1.5px) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3) !important;
}

/* Enlaces secundarios (olvidé mi contraseña, etc.) */
.forgot-password-message,
.sign-up-message {
    font-size: 13px !important;
    margin-top: 15px !important;
    color: #64748b !important;
}

.forgot-password-message a,
.sign-up-message a {
    color: #2563eb !important;
    font-weight: 600 !important;
    transition: color 0.2s ease !important;
}

.forgot-password-message a:hover,
.sign-up-message a:hover {
    color: #1d4ed8 !important;
    text-decoration: none !important;
}

/* ==========================================
   TEMA OSCURO: LOGIN SEAMLESS
   ========================================== */
[data-theme="dark"] body:has(.for-login),
[data-theme="dark"] body:has(.login-content) {
    background: radial-gradient(circle at 50% 50%, #0c1c30 0%, #061220 100%) !important;
}

[data-theme="dark"] .for-login .page-card {
    background-color: #0c1a2d !important;
    border: 1px solid #1a3e6b !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .page-card-head h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .for-login input[type="text"],
[data-theme="dark"] .for-login input[type="email"],
[data-theme="dark"] .for-login input[type="password"] {
    background-color: #11253f !important;
    border: 1px solid #1a3e6b !important;
    color: #ffffff !important;
}

[data-theme="dark"] .for-login input[type="text"]:focus,
[data-theme="dark"] .for-login input[type="email"]:focus,
[data-theme="dark"] .for-login input[type="password"]:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25) !important;
}

[data-theme="dark"] .btn-login,
[data-theme="dark"] .for-login .btn-login,
[data-theme="dark"] .for-login button[type="submit"] {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25) !important;
}

[data-theme="dark"] .btn-login:hover,
[data-theme="dark"] .for-login .btn-login:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35) !important;
}

[data-theme="dark"] .forgot-password-message a,
[data-theme="dark"] .sign-up-message a {
    color: #3b82f6 !important;
}

[data-theme="dark"] .forgot-password-message a:hover,
[data-theme="dark"] .sign-up-message a:hover {
    color: #60a5fa !important;
}

/* ==========================================
   WIDGETS Y ACCESOS RÁPIDOS (SHORTCUTS)
   ========================================== */
.shortcut-widget-box,
.widget-shortcut,
.shortcut-item,
.shortcut-widget {
    border: 1.5px solid var(--border-color) !important; /* Más grosor en las líneas (1.5px) */
    border-radius: 10px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Hover moderno con deslizamiento hacia arriba y sombra */
.shortcut-widget-box:hover,
.widget-shortcut:hover,
.shortcut-widget:hover {
    border-color: var(--primary-color) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(19, 46, 79, 0.06) !important;
    text-decoration: none !important;
}

[data-theme="dark"] .shortcut-widget-box:hover,
[data-theme="dark"] .widget-shortcut:hover,
[data-theme="dark"] .shortcut-widget:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.12) !important;
}

/* ==========================================
   SELECTOR DE EMPRESAS (BARRA DE NAVEGACIÓN)
   ========================================== */
.company-selector-dropdown .company-selector-btn {
    background-color: var(--primary-color, #132E4F) !important;
    color: #ffffff !important;
    border: 1.5px solid var(--primary-color, #132E4F) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.company-selector-dropdown .company-selector-btn svg {
    stroke: #ffffff !important;
}

.company-selector-dropdown .company-selector-btn:hover {
    background-color: #0b1a2e !important;
    border-color: #0b1a2e !important;
    box-shadow: 0 4px 10px rgba(19, 46, 79, 0.2) !important;
}

/* Modo Oscuro */
[data-theme="dark"] .company-selector-dropdown .company-selector-btn {
    background-color: var(--control-bg, #11253F) !important;
    color: var(--text-color, #f1f5f9) !important;
    border: 1.5px solid var(--border-color, #1A3E6B) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .company-selector-dropdown .company-selector-btn svg {
    stroke: var(--text-color, #f1f5f9) !important;
}

[data-theme="dark"] .company-selector-dropdown .company-selector-btn:hover {
    border-color: #3b82f6 !important;
    color: #60a5fa !important;
    background-color: #162f50 !important;
}

