﻿/*
 * custom.css - estilos del tema
 * Los colores se definen en: config/packages/theme.php
 * y se inyectan como variables CSS :root desde base.html.twig.
 */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.92rem;
    color: #374151;
    letter-spacing: -0.01em;
    background: #f8fafc;
}

/* == Overrides Bootstrap == */
.text-primary   { color: var(--color-primary) !important; }
.border-primary { border-color: var(--color-primary) !important; }
.bg-primary     { background: var(--color-primary) !important; }
.fw-500         { font-weight: 500; }
.fw-600         { font-weight: 600; }

/* == Page header == */
.page-header        { margin-bottom: 1.75rem; }
.page-header-title  { font-size: 1.05rem; font-weight: 700; color: #111827; letter-spacing: -0.02em; margin-bottom: 0.2rem; }
.page-header-sub    { font-size: 0.82rem; color: #9ca3af; margin: 0; }

/* == Section label == */
.section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: #f1f5f9; }

/* == Breadcrumb == */
.breadcrumb             { font-size: 0.78rem; background: transparent; padding: 0; margin-bottom: 0.5rem; }
.breadcrumb-item a      { color: var(--color-primary); text-decoration: none; }
.breadcrumb-item.active { color: #9ca3af; }

/* == Navbar == */
.navbar-dark.bg-primary { background: var(--color-secondary) !important; }
.navbar-brand           { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.nav-link               { transition: color 0.15s, background 0.15s; border-radius: 6px; padding: 0.4rem 0.8rem; }
.nav-link:hover         { background: rgba(255,255,255,0.08); }

/* == Sidebar activo == */
.nav-item.active > .nav-link,
.nav-link.active {
    background: rgba(var(--color-primary-rgb), 0.1) !important;
    color: var(--color-primary) !important;
    font-weight: 600;
}

/* == Cards == */
.card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    max-width: 100%;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.9rem 1.25rem;
    color: #374151;
}

/* Neutraliza card-header con bg hardcodeado */
.card-header.bg-primary,
.card-header.bg-white,
.card-header.bg-secondary,
.card-header.bg-warning,
.card-header.bg-info,
.card-header.bg-success {
    background: transparent !important;
    color: #374151 !important;
}
.card-header.bg-primary h5, .card-header.bg-primary h6,
.card-header.bg-white  h5, .card-header.bg-white  h6 {
    color: #111827 !important; font-size: 0.88rem;
}

.card-body   { padding: 1.25rem; }
.card-footer { background: transparent; border-top: 1px solid #f1f5f9; }

/* == Stat cards == */
.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.25rem 1.35rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.stat-card:hover          { box-shadow: 0 6px 20px rgba(0,0,0,0.08); transform: translateY(-2px); color: inherit; }
.stat-card-icon           { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-card-icon.accent    { background: rgba(var(--color-primary-rgb), 0.12); color: var(--color-primary); }
.stat-card-icon.success   { background: rgba(16,185,129,0.12);  color: #10b981; }
.stat-card-icon.warning   { background: rgba(245,158,11,0.12);  color: #f59e0b; }
.stat-card-icon.neutral   { background: #f1f5f9; color: #6b7280; }
.stat-card-value          { font-size: 1.65rem; font-weight: 700; color: #111827; line-height: 1; letter-spacing: -0.03em; }
.stat-card-label          { font-size: 0.78rem; color: #6b7280; margin-top: 0.15rem; font-weight: 500; }
.stat-card-hint           { font-size: 0.72rem; color: #9ca3af; margin-top: 0.1rem; }

/* == Admin menu cards == */
.admin-card {
    display: flex; align-items: center; gap: 1rem;
    background: white; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 1.1rem 1.25rem; text-decoration: none; color: #374151;
    transition: all 0.18s ease; height: 100%;
}
.admin-card:hover          { border-color: var(--color-primary); background: rgba(var(--color-primary-rgb),0.03); color: #111827; box-shadow: 0 4px 16px rgba(var(--color-primary-rgb),0.12); transform: translateY(-2px); }
.admin-card-icon           { width: 42px; height: 42px; border-radius: 10px; background: rgba(var(--color-primary-rgb),0.1); color: var(--color-primary); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; transition: background 0.18s; }
.admin-card:hover .admin-card-icon { background: var(--color-primary); color: white; }
.admin-card-label          { font-weight: 600; font-size: 0.88rem; color: #111827; line-height: 1.2; }
.admin-card-desc           { font-size: 0.76rem; color: #9ca3af; margin-top: 0.2rem; }
.admin-card-arrow          { margin-left: auto; color: #d1d5db; font-size: 0.9rem; transition: color 0.18s, transform 0.18s; }
.admin-card:hover .admin-card-arrow { color: var(--color-primary); transform: translateX(3px); }

/* == Empty state == */
.empty-state      { text-align: center; padding: 3.5rem 2rem; color: #9ca3af; }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.4; }
.empty-state p    { font-size: 0.88rem; margin: 0.25rem 0; }

/* ===================================================================
   FORMULARIOS - diseno moderno estilo filled
   =================================================================== */

/* == Label == */
.form-label {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6b7280;
    margin-bottom: 0.4rem;
}

/* == Input / Textarea / Select == */
.form-control,
.form-select {
    background-color: #f3f4f6;
    border: 1.5px solid transparent;
    border-radius: 10px;
    padding: 0.62rem 0.95rem;
    font-size: 0.875rem;
    color: #111827;
    font-weight: 400;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
}

.form-control::placeholder { color: #9ca3af; font-weight: 400; }

.form-control:hover:not(:disabled):not([readonly]),
.form-select:hover:not(:disabled) {
    background-color: #eeeff1;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.1);
    outline: none;
    color: #111827;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background-color: #f9fafb;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 1;
}

/* == Textarea == */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

/* == Select - flecha custom == */
.form-select {
    --bs-form-select-bg-img: none;
    --bs-form-select-bg-icon: none;
    --app-select-arrow: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-image: var(--app-select-arrow) !important;
    background-repeat: no-repeat !important;
    background-position: right 0.85rem center !important;
    background-size: 14px 10px !important;
    padding-right: 2.5rem;
}
.form-select:hover:not(:disabled),
.form-select:focus {
    --app-select-arrow: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2300bcd4' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-image: var(--app-select-arrow) !important;
    background-repeat: no-repeat !important;
    background-position: right 0.85rem center !important;
    background-size: 14px 10px !important;
}

.form-select option {
    background-image: none !important;
}

/* == Input group == */
.input-group .form-control,
.input-group .form-select { border-radius: 0; }

.input-group > :first-child { border-radius: 10px 0 0 10px; }
.input-group > :last-child  { border-radius: 0 10px 10px 0; }

.input-group-text {
    background: #e9eaec;
    border: 1.5px solid transparent;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.62rem 0.9rem;
    transition: background 0.15s;
}

.input-group:focus-within .input-group-text {
    background: rgba(var(--color-primary-rgb), 0.1);
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.input-group:focus-within .form-control,
.input-group:focus-within .form-select { border-color: var(--color-primary); }

/* == Form text (ayuda) == */
.form-text {
    font-size: 0.76rem;
    color: #9ca3af;
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* == Checkbox / Radio == */
.form-check { padding-left: 1.7rem; min-height: 1.4rem; }

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    margin-left: -1.7rem;
    background-color: #f3f4f6;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
}
.form-check-input[type="radio"] { border-radius: 50%; }

.form-check-input:hover:not(:disabled) { border-color: var(--color-primary); }

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
    background-size: 70%;
    background-position: center;
    background-repeat: no-repeat;
}
.form-check-input[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
    background-size: auto;
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.12);
    border-color: var(--color-primary);
    outline: none;
}
.form-check-input:disabled { background: #e5e7eb; border-color: #d1d5db; cursor: not-allowed; }

.form-check-label { font-size: 0.875rem; color: #374151; cursor: pointer; }

/* == Switch == */
.form-switch { padding-left: 2.6rem; }
.form-switch .form-check-input {
    width: 2.2rem; height: 1.2rem;
    border-radius: 1rem; margin-left: -2.6rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23d1d5db'/%3e%3c/svg%3e");
    background-position: left center; background-size: auto;
}
.form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-position: right center;
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* == Validacion == */
.form-control.is-valid,  .form-select.is-valid  { border-color: #10b981; }
.form-control.is-invalid, .form-select.is-invalid { border-color: #ef4444; }
.invalid-feedback { font-size: 0.76rem; color: #ef4444; margin-top: 0.3rem; }
.valid-feedback   { font-size: 0.76rem; color: #10b981;  margin-top: 0.3rem; }

/* == Modal == */
.modal-content  { border-radius: 16px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.modal-header   { border-bottom: 1px solid #f1f5f9; padding: 1.1rem 1.5rem; }
.modal-header .modal-title { font-size: 0.95rem; font-weight: 700; }
.modal-body     { padding: 1.35rem 1.5rem; }
.modal-footer   { border-top: 1px solid #f1f5f9; padding: 0.9rem 1.5rem; }
.btn-close      { opacity: 0.4; transition: opacity 0.15s; }
.btn-close:hover { opacity: 0.8; }

/* == Botones == */
.btn {
    font-weight: 600;
    border-radius: 9px;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
    padding: 0.52rem 1.1rem;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.btn-sm  { border-radius: 7px; font-size: 0.775rem; padding: 0.35rem 0.75rem; }
.btn-lg  { border-radius: 11px; font-size: 0.95rem; padding: 0.7rem 1.4rem; }

.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.3);
}
.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--color-primary-rgb), 0.4);
    color: white;
}
.btn-primary:active { transform: translateY(0); }

.btn-outline-primary { color: var(--color-primary); border-color: var(--color-primary); background: transparent; }
.btn-outline-primary:hover { background: var(--color-primary); border-color: var(--color-primary); color: white; transform: translateY(-1px); }

.btn-outline-secondary { color: #6b7280; border-color: #e5e7eb; }
.btn-outline-secondary:hover { background: #f3f4f6; border-color: #d1d5db; color: #374151; }

.btn-outline-danger  { color: #ef4444; border-color: #fca5a5; }
.btn-outline-danger:hover { background: #ef4444; border-color: #ef4444; color: white; }

.btn-outline-warning { color: #d97706; border-color: #fcd34d; }
.btn-outline-warning:hover { background: #f59e0b; border-color: #f59e0b; color: white; }

.btn-outline-success { color: #059669; border-color: #6ee7b7; }
.btn-outline-success:hover { background: #10b981; border-color: #10b981; color: white; }

.btn-danger  { background: #ef4444; border-color: #ef4444; color: white; box-shadow: 0 2px 8px rgba(239,68,68,0.25); }
.btn-danger:hover  { background: #dc2626; border-color: #dc2626; transform: translateY(-1px); color: white; }

.btn-success { background: #10b981; border-color: #10b981; color: white; box-shadow: 0 2px 8px rgba(16,185,129,0.25); }
.btn-success:hover { background: #059669; border-color: #059669; transform: translateY(-1px); color: white; }

/* == Alertas == */
.alert { border: none; border-radius: 10px; border-left: 4px solid; font-size: 0.875rem; padding: 0.85rem 1.1rem; }
.alert-success { background: rgba(16,185,129,0.08); border-left-color: #10b981; color: #065f46; }
.alert-danger  { background: rgba(239,68,68,0.08);  border-left-color: #ef4444; color: #7f1d1d; }
.alert-warning { background: rgba(245,158,11,0.08); border-left-color: #f59e0b; color: #78350f; }
.alert-info    { background: rgba(var(--color-primary-rgb),0.08); border-left-color: var(--color-primary); color: #111827; }

/* == Badges == */
.badge { font-weight: 600; padding: 0.35em 0.65em; border-radius: 6px; font-size: 0.74rem; letter-spacing: 0.02em; }

/* == Tablas == */
.table { font-size: 0.86rem; overflow: hidden; }

.table thead th {
    background: #f8fafc;
    color: #6b7280;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.8rem 1rem;
}
.table tbody td           { padding: 0.75rem 1rem; border-color: #f1f5f9; vertical-align: middle; }
.table tbody tr           { transition: background 0.1s ease; }
.table tbody tr:hover     { background: rgba(var(--color-primary-rgb), 0.03); }
.table-secondary td       { background: #f9fafb; color: #9ca3af; }

.table-responsive {
    max-width: 100%;
}

.scheduled-report-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.scheduled-report-actions form {
    display: inline-flex !important;
    margin: 0;
}

.scheduled-report-actions .btn {
    width: 2.1rem;
    height: 2.1rem;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 991.98px) {
    .scheduled-report-actions {
        justify-content: flex-start;
    }
}

/* == Dropdowns == */
.dropdown-menu { border: 1px solid #e5e7eb; box-shadow: 0 8px 24px rgba(0,0,0,0.09); border-radius: 12px; font-size: 0.875rem; padding: 0.35rem; }
.dropdown-item { border-radius: 8px; transition: all 0.12s ease; padding: 0.48rem 0.8rem; }
.dropdown-item:hover { background: rgba(var(--color-primary-rgb),0.07); color: var(--color-primary); }

/* == Footer == */
footer {
    background: var(--color-secondary);
    color: rgba(255,255,255,0.4);
    border-top: 2px solid var(--color-primary);
    padding: 0.75rem 1.75rem;
    text-align: center;
    font-size: 0.74rem;
}

/* == Paginacion == */
.pagination .page-link { border: 1px solid #e5e7eb; color: var(--color-primary); border-radius: 8px; margin: 0 2px; font-size: 0.82rem; padding: 0.4rem 0.75rem; }
.pagination .page-link:hover { background: rgba(var(--color-primary-rgb),0.08); border-color: var(--color-primary); }
.pagination .active .page-link { background: var(--color-primary); border-color: var(--color-primary); color: white; }

/* == Scrollbar == */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* == Animaciones == */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.card, .stat-card, .admin-card { animation: fadeUp 0.25s ease both; }

/* == Responsive == */
@media (max-width: 768px) {
    .stat-card     { padding: 1rem; }
    .card          { margin-bottom: 0.75rem; }
    .page-header   { margin-bottom: 1.25rem; }
    .card-body     { padding: 1rem; }
}
