/* ============================== */
/* FORZAR LAYOUT CORRECTO         */
/* ============================== */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #0c0c0c !important;
    color: #f1f5f9;
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
}

.panel-body {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    background: #0c0c0c !important;
}

/* ============================== */
/* HEADER SUPERIOR HORIZONTAL     */
/* ============================== */
.top-header {
    order: 1 !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    background: #141414 !important;
    border-bottom: 1px solid #2a2a2a !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 20px !important;
    gap: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.top-left {
    flex: 0 0 auto;
}

.brand {
    font-size: 17px !important;
    color: #d4af37 !important;
    letter-spacing: 2px;
    margin: 0 !important;
    white-space: nowrap;
}

.brand span {
    color: #777;
    font-weight: 400;
}

.top-nav {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    flex: 1 !important;
    justify-content: center !important;
    align-items: center !important;
}

.nav-btn {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: #aaa !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    white-space: nowrap;
}

.nav-btn:hover {
    color: #d4af37 !important;
    border-color: #333 !important;
}

.nav-btn.active {
    background: linear-gradient(135deg, #d4af37, #b8860b) !important;
    color: #111 !important;
    font-weight: 600 !important;
    border-color: transparent !important;
}

.top-right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 0 0 auto;
}

.user-name {
    color: #ccc;
    font-size: 13px;
}

.btn-logout {
    background: transparent !important;
    border: 1px solid #d4af37 !important;
    color: #d4af37 !important;
    padding: 7px 14px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    cursor: pointer !important;
}

.btn-logout:hover {
    background: #d4af37 !important;
    color: #111 !important;
}

/* ============================== */
/* CONTENIDO DEBAJO DEL HEADER    */
/* ============================== */
.app-layout {
    order: 2 !important;
    display: grid !important;
    grid-template-columns: 270px 1fr !important;
    flex: 1 !important;
    min-height: calc(100vh - 58px) !important;
    width: 100% !important;
}

/* SIDEBAR IZQUIERDO */
.sidebar {
    background: #111 !important;
    border-right: 1px solid #222 !important;
    padding: 18px 14px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    overflow-y: auto;
}

.side-card {
    background: #1a1a1a !important;
    border: 1px solid #2e2e2e !important;
    border-radius: 12px !important;
    padding: 16px !important;
}

.side-card h3 {
    color: #d4af37 !important;
    font-size: 13px !important;
    margin: 0 0 10px 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-card {
    text-align: center !important;
}

.logo-barberia {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #b8860b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #111;
    overflow: hidden;
    margin: 0 auto 10px;
}

.logo-barberia img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card h2 {
    font-size: 15px !important;
    margin: 0 0 5px 0 !important;
}

.codigo {
    color: #d4af37 !important;
    font-size: 13px !important;
    font-weight: 600;
    margin-bottom: 4px;
}

.texto-sec {
    color: #888 !important;
    font-size: 12px !important;
}

/* ÁREA PRINCIPAL */
.main-area {
    padding: 20px !important;
    overflow-y: auto;
}

.content-card {
    background: #1a1a1a !important;
    border: 1px solid #2e2e2e !important;
    border-radius: 14px !important;
    padding: 20px !important;
}

.content-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 18px !important;
    flex-wrap: wrap;
    gap: 10px;
}

.content-header h2 {
    color: #d4af37 !important;
    font-size: 17px !important;
    margin: 0 !important;
}

/* BOTONES */
.btn-dorado {
    background: linear-gradient(135deg, #d4af37, #b8860b) !important;
    color: #111 !important;
    border: none !important;
    padding: 9px 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.btn-sec {
    background: transparent !important;
    border: 1px solid #555 !important;
    color: #ccc !important;
    padding: 9px 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    cursor: pointer !important;
}

/* FILTROS */
.filtros-citas {
    display: flex !important;
    gap: 6px !important;
    flex-wrap: wrap;
}

.filtro {
    background: #222 !important;
    border: 1px solid #333 !important;
    color: #999 !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    cursor: pointer !important;
}

.filtro.active {
    background: rgba(212, 175, 55, 0.15) !important;
    border-color: #d4af37 !important;
    color: #d4af37 !important;
}

/* CITAS */
.lista-citas {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.card-cita {
    background: #222 !important;
    border: 1px solid #333 !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px;
    flex-wrap: wrap;
}

.card-cita .info h4 {
    font-size: 14px !important;
    margin: 0 0 5px 0 !important;
}

.card-cita .info p {
    color: #999 !important;
    font-size: 12px !important;
    margin: 0 0 2px 0 !important;
}

.estado {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.estado.pendiente { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.estado.confirmada { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.estado.cancelada { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.estado.completada { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.estado.no_asistio { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.acciones-cita {
    display: flex;
    gap: 6px;
}

.btn-accion {
    padding: 6px 11px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-confirmar { background: #22c55e; color: #111; }
.btn-cancelar { background: transparent; border: 1px solid #ef4444; color: #ef4444; }

/* GRID */
.grid-items {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 10px !important;
}

.item-card {
    background: #222 !important;
    border: 1px solid #333 !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
}

.item-card h4 {
    font-size: 14px !important;
    margin: 0 0 4px 0 !important;
}

.item-card p {
    color: #999 !important;
    font-size: 12px !important;
    margin: 0 !important;
}

/* FORMS */
.form-box {
    background: #222 !important;
    border: 1px solid #333 !important;
    border-radius: 10px !important;
    padding: 14px !important;
    margin-bottom: 14px !important;
}

.form-row {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap;
    margin-bottom: 10px !important;
}

.form-row input {
    flex: 1;
    min-width: 120px;
    padding: 9px 11px !important;
    border: 1px solid #444 !important;
    border-radius: 8px !important;
    background: #111 !important;
    color: #f1f5f9 !important;
    font-size: 13px !important;
    outline: none;
}

.form-acciones {
    display: flex;
    gap: 8px;
}

/* HORARIOS */
.lista-horarios {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.horario-row {
    display: grid;
    grid-template-columns: 130px 1fr 1fr;
    gap: 12px;
    align-items: center;
    background: #222;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 12px 14px;
}

.horario-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.horario-row input[type="time"] {
    padding: 7px 10px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #111;
    color: #f1f5f9;
    font-size: 13px;
    outline: none;
}

.horario-row input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #d4af37;
}

/* FOTOS */
.preview-foto {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #222;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 8px;
}

.preview-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.galeria-fotos {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.galeria-fotos img {
    width: 90px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #333;
}

/* MENSAJES */
.mensaje {
    margin-top: 8px;
    font-size: 13px;
}

.mensaje.error { color: #f87171; }
.mensaje.exito { color: #4ade80; }

/* RESPONSIVE */
@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 1fr !important;
    }

    .top-header {
        flex-wrap: wrap !important;
        height: auto !important;
        max-height: none !important;
        padding: 10px 14px !important;
    }

    .top-nav {
        order: 3;
        width: 100%;
        justify-content: center !important;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .top-header {
        flex-wrap: wrap !important;
        height: auto !important;
        max-height: none !important;
        padding: 10px 12px !important;
        gap: 8px !important;
    }
    .top-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start !important;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 4px;
    }
    .nav-btn {
        flex-shrink: 0;
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
    .app-layout {
        grid-template-columns: 1fr !important;
    }
    .sidebar {
        border-right: none !important;
        border-bottom: 1px solid #222 !important;
    }
    .card-cita {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .acciones-cita {
        width: 100%;
        flex-wrap: wrap;
    }
}