/* =========================================================
 * Authaz minimal theme 5.0
 *  - Fondo limpio sin degradado
 *  - Login Authaz restaurado
 *  - Backend con inputs ovalados
 *  - Navbar superior tipo píldoras
 *  - Toolbar del calendario con fondo blanco
 * ======================================================= */

/* ====== BASE GENERAL BACKEND (fondo) ====== */

/* Mantengo el html neutro */
html {
    height: 100%;
    background: #f9fafb;
}

/* Fondo general limpio, sin degradados “metalizados” */
body {
    margin: 0;
    min-height: 100vh;
    background: #f9fafb; /* blanco moderno muy suave */
}

/* Contenedor principal del backend */
.container.backend-page {
    padding-top: 20px;
    padding-bottom: 20px;
    background: transparent !important;
}

/* Evitar bloques con fondos raros */
.backend-page .row {
    margin-bottom: 10px;
    background: transparent;
}

/* =========================================================
 * HEADER SUPERIOR (navbar: Calendario / Clientes / Servicios)
 * ======================================================= */

/* Navbar principal del backend */
body > nav.navbar,
#backend-header.navbar {
    box-shadow: 0 10px 34px rgba(15, 23, 42, 0.25);
    border-bottom: none;
}

/* Marca: logo + texto alineados */
body > nav.navbar .navbar-brand,
#backend-header.navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Enlaces del menú como "píldoras" */
body > nav.navbar .navbar-nav .nav-link,
#backend-header.navbar .navbar-nav .nav-link {
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    margin: 0 0.1rem;
    font-weight: 500;
    opacity: 0.9;
    transition:
        background 0.18s ease,
        opacity 0.18s ease,
        transform 0.12s ease;
}

/* Hover / focus */
body > nav.navbar .navbar-nav .nav-link:hover,
body > nav.navbar .navbar-nav .nav-link:focus,
#backend-header.navbar .navbar-nav .nav-link:hover,
#backend-header.navbar .navbar-nav .nav-link:focus {
    background: rgba(255, 255, 255, 0.20);
    opacity: 1;
    transform: translateY(-1px);
}

/* Activo (sección actual) */
body > nav.navbar .navbar-nav .nav-link.active,
body > nav.navbar .navbar-nav .active > .nav-link,
#backend-header.navbar .navbar-nav .nav-link.active,
#backend-header.navbar .navbar-nav .active > .nav-link {
    background: rgba(255, 255, 255, 0.28);
    opacity: 1;
}

/* IMPORTANTE: cuando haces click (estado :active) NO se rellena entero
   del color de la barra, se queda como la píldora activa de arriba */
body > nav.navbar .navbar-nav .nav-link:active,
#backend-header.navbar .navbar-nav .nav-link:active {
    background: rgba(255, 255, 255, 0.28) !important;
    color: #ffffff !important;
}

/* Dropdown del usuario más suave */
body > nav.navbar .dropdown-menu,
#backend-header .dropdown-menu {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.16);
}

/* Navbar en móvil */
@media (max-width: 768px) {
    body > nav.navbar,
    #backend-header.navbar {
        padding-inline: 0.75rem;
    }
}

/* =========================================================
 * CALENDARIO: TOOLBAR (fila de filtro + botones)
 *  -> Solo tocamos estilos visuales, NO el layout bootstrap.
 * ======================================================= */

/* Barra negra original -> ahora blanca, pero sin cambiar estructura */
#calendar-page #calendar-toolbar,
#calendar-page .bg-dark {
    background-color: #ffffff !important;
    color: #111827 !important;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

/* Select "Todo / proveedor" más suave */
#calendar-page .bg-dark select,
#calendar-page .bg-dark #select-filter-item {
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    padding: 4px 12px;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.04);
    background-color: #ffffff;
    max-width: 220px;
}

/* Botones dentro de la toolbar (sin tocar la posición) */
#calendar-page .bg-dark .btn {
    border-radius: 999px !important;
    padding: 6px 16px;
    font-size: 13px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background-color: #ffffff;
    color: #111827;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    opacity: 0.96;
    transition:
        transform 0.08s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease;
}

#calendar-page .bg-dark .btn i,
#calendar-page .bg-dark .btn .fa {
    font-size: 14px;
    margin-right: 2px;
}

/* Hover bonito */
#calendar-page .bg-dark .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
    opacity: 1;
    background-color: #f3f4ff;
    border-color: rgba(15, 23, 42, 0.18);
}

/* Botones "neutros" tipo Habilitar sincronización, etc. */
#calendar-page .bg-dark .btn-light,
#calendar-page .bg-dark .btn-default,
#calendar-page .bg-dark .btn-secondary {
    background-color: #f3f4f6;
    border-color: transparent;
    box-shadow: none;
}

/* Vista activa Día / Semana / Mes más marcada, pero legible */
#calendar-page .bg-dark .btn-group .btn.active,
#calendar-page .bg-dark .btn-group .btn.fc-state-active {
    background-color: #111827;
    color: #ffffff;
    border-color: #111827;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.25);
}


/* =========================================================
 * INPUTS / SELECTS BACKEND
 * ======================================================= */

.backend-page .form-control {
    border-radius: 999px;
    box-shadow: none !important;
    padding: 10px 22px !important;
}

.backend-page textarea.form-control {
    border-radius: 14px;
    min-height: 90px;
    resize: vertical;
    padding: 10px 16px !important;
}

.backend-page .form-select {
    border-radius: 999px !important;
    box-shadow: none !important;
    padding: 10px 22px !important;
    background-position: right 18px center;
}

/* ====== LABELS BACKEND ====== */

.backend-page .form-horizontal .control-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding-top: 6px;
    padding-left: 6px;
}

/* =========================================================
 * LISTAS LATERALES (clientes, proveedores, servicios…)
 * ======================================================= */

.backend-page .list-group-item {
    border: none;
    border-radius: 999px !important;
    margin-bottom: 6px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.05);
    background: #ffffff;
}

/* =========================================================
 * TABLAS (incl. esquema horario)
 * ======================================================= */

.backend-page .table {
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.backend-page .table thead th {
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 16px;
}

.backend-page .table tbody td {
    border-top: 1px solid #F1F5F9;
    padding: 9px 16px;
    vertical-align: middle;
    font-size: 13px;
}

.backend-page .table tbody tr:nth-child(odd) {
    background-color: #F9FAFF;
}

.backend-page .table tbody tr:hover {
    background-color: #EEF2FF;
}

.backend-page .table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* =========================================================
 * LISTA DE CITAS (columna derecha en clientes/proveedores)
 * ======================================================= */

.backend-page .appointments-list {
    max-height: 70vh;
    overflow-y: auto;
}

/* =========================================================
 * TARJETAS / PANELES GENERALES
 * ======================================================= */

.panel,
.card {
    border-radius: 18px;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
    background: #ffffff;
}

/* =========================================================
 * CALENDARIO (cuadro grande)
 * ======================================================= */

#calendar-page,
#calendar-page .calendar-wrapper,
#calendar {
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

#calendar-page {
    margin-top: 0.25rem;
    margin-bottom: 18px;
}

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

footer.footer {
    border-top: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* =========================================================
 * MENSAJES (logout, etc.)
 * ======================================================= */

#message-frame.frame-container {
    border-radius: 20px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
    background: #ffffff;
}

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

/* Fondo suave detrás del frame de login */
body #login-frame {
    background: radial-gradient(
        circle at top,
        rgba(0, 0, 0, 0.03),
        transparent 60%
    );
}

/* Tarjeta principal de login */
#login-frame.frame-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 32px 28px;
    border-radius: 24px;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
    background: #ffffff;
}

/* ====== RESPONSIVO LOGIN ====== */
@media (max-width: 991.98px) {
    #login-frame.frame-container {
        margin: 30px 12px;
        padding: 24px 20px;
    }
}

/* =========================================================
 * CALENDARIO – pequeño ajuste en móvil
 * Solo añadimos espacio por arriba, sin cambiar el orden
 * ni la estructura de los botones.
 * ======================================================= */

@media (max-width: 768px) {
    #calendar-page .fc-toolbar.fc-header-toolbar {
        padding-top: 10px; /* franja de blanco por encima de los botones */
    }
}
