﻿/* Estilos Globales - Clínica Bessone Admin */
:root {
    --brand-primary: #004a99;
    --brand-secondary: #0076cc;
    --brand-light: #f0f7ff;
    --brand-accent: #2563eb;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-body: #f8fafc;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-box: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
aside {
    width: 260px;
    background-color: var(--brand-primary);
    color: var(--white);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-box {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.2);
}

.sidebar-title h1 {
    font-size: 1.1rem;
    font-weight: 700;
}

.sidebar-title p {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

.sidebar-nav {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s;
    font-weight: 500;
}

    .nav-link:hover {
        background: rgba(255,255,255,0.05);
        color: var(--white);
    }

    .nav-link.active {
        background: var(--white);
        color: var(--brand-primary);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
}

/* Main Content */
main {
    margin-left: 260px;
    padding: 40px;
    width: calc(100% - 260px);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* UI Components */
.card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    transition: 0.2s;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--brand-primary);
    color: var(--white);
}

    .btn-primary:hover {
        background-color: var(--brand-secondary);
    }

.btn-secondary {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

    .btn-secondary:hover {
        background-color: var(--bg-body);
    }

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-search {
    padding: 10px 16px 10px 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    outline: none;
    width: 240px;
    transition: 0.2s;
}

    .input-search:focus {
        border-color: var(--brand-accent);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.stat-info h4 {
    font-size: 2rem;
    font-weight: 800;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Tables */
.table-container {
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f8fafc;
    padding: 16px 24px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

td {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.tag {
    background: var(--brand-light);
    color: var(--brand-primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(0, 74, 153, 0.1);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none; /* Se activa con JS */
}

.modal {
    background: var(--white);
    width: 100%;
    max-width: 450px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.modal-body {
    padding: 32px;
}

.form-group {
    margin-bottom: 20px;
}

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 700;
        font-size: 0.9rem;
        color: #334155;
    }

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
}

    .form-control:focus {
        border-color: var(--brand-accent);
    }

/* Grid Layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Relations Layout */
.relations-container {
    display: flex;
    gap: 32px;
    height: 600px;
}

.prof-list {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.prof-item {
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
    cursor: pointer;
    text-align: left;
    transition: 0.2s;
}

    .prof-item.selected {
        background: var(--brand-primary);
        color: var(--white);
        border-color: var(--brand-primary);
    }

.spec-selector {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.spec-check-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: min-content; /* Mantiene las filas al tamaño del contenido */
    align-content: start; /* Alinea los elementos al inicio de la grilla */
    gap: 16px;
    overflow-y: auto;
    padding: 20px 4px;
    margin-bottom: 12px;
    flex-grow: 1;
}

    .spec-check-grid::-webkit-scrollbar {
        width: 4px;
    }

    .spec-check-grid::-webkit-scrollbar-track {
        background: transparent;
    }

    .spec-check-grid::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

.spec-check-btn {
    padding: 16px;
    min-height: 80px; /* Altura mínima consistente */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: 0.2s;
}

    .spec-check-btn.checked {
        background-color: var(--brand-light);
        border-color: var(--brand-secondary);
    }

.check-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spec-check-btn.checked .check-circle {
    background: var(--brand-accent);
    color: white;
    border: none;
}

/* Login Page Styles */
.login-body {
    background: radial-gradient(circle at top right, var(--brand-light), #f8fafc);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100vw;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0, 74, 153, 0.05), 0 8px 16px -6px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

    .login-logo .logo-box {
        background: var(--brand-primary);
        color: var(--white);
        width: 48px;
        height: 48px;
    }

    .login-logo h1 {
        font-size: 1.5rem;
        font-weight: 800;
        color: var(--brand-primary);
    }

    .login-logo p {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--text-muted);
        font-weight: 600;
    }

.input-icon-group {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

    .input-icon-group svg {
        position: absolute;
        left: 14px;
        color: var(--text-muted);
        pointer-events: none;
    }

    .input-icon-group input {
        width: 100%;
        padding: 12px 16px 12px 42px;
        border-radius: 10px;
        border: 1px solid var(--border-color);
        outline: none;
        transition: all 0.2s;
        font-size: 0.9rem;
        box-sizing: border-box;
    }

        .input-icon-group input:focus {
            border-color: var(--brand-accent);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

.password-toggle-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    height: 100%;
    top: 0;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 8px;
}
