/* ============================================================
   Estética & Salud — Panel de Especialistas
   assets/css/style.css
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* --- Variables de diseño --- */
:root {
    --primary:       #00AEEF;
    --primary-dark:  #0090cc;
    --primary-light: #e6f7fd;
    --sidebar-bg:    #0f172a;
    --sidebar-w:     260px;
    --text:          #1e293b;
    --text-muted:    #64748b;
    --text-light:    #94a3b8;
    --bg:            #f1f5f9;
    --card:          #ffffff;
    --border:        #e2e8f0;
    --success:       #10b981;
    --success-light: #d1fae5;
    --warning:       #f59e0b;
    --warning-light: #fef3c7;
    --danger:        #ef4444;
    --danger-light:  #fee2e2;
    --info:          #3b82f6;
    --info-light:    #dbeafe;
    --radius:        10px;
    --radius-lg:     14px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow:        0 4px 16px rgba(0,0,0,.07);
    --shadow-lg:     0 10px 32px rgba(0,0,0,.10);
    --transition:    .2s ease;
    --font:          'DM Sans', system-ui, sans-serif;
    --font-mono:     'DM Mono', monospace;
    --topbar-h:      64px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ============================================================
   LAYOUT GENERAL DEL PANEL
   ============================================================ */
.panel-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.logo-icon {
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 6px 9px;
    border-radius: 8px;
}
.logo-text {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .3px;
}

.sidebar-close {
    color: var(--text-light);
    padding: 4px;
    border-radius: 6px;
    display: none;
    transition: color var(--transition);
}
.sidebar-close:hover { color: #fff; }

/* Perfil en sidebar */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.profile-info { display: flex; flex-direction: column; overflow: hidden; }
.profile-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-role {
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
}

/* Avatar */
.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .5px;
}
.avatar-sm { width: 34px; height: 34px; font-size: 12px; }

/* Navegación */
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav ul { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }

.nav-separator {
    padding: 14px 10px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,.25);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,.6);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}
.nav-link:hover {
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.9);
}
.nav-link.active {
    background: var(--primary);
    color: #fff;
}
.nav-link svg { flex-shrink: 0; opacity: .85; }
.nav-link.active svg { opacity: 1; }

/* Footer del sidebar */
.sidebar-footer {
    padding: 16px 10px;
    border-top: 1px solid rgba(255,255,255,.06);
}
.logout-link { color: rgba(255,255,255,.5) !important; }
.logout-link:hover { background: rgba(239,68,68,.15) !important; color: #fca5a5 !important; }

/* Overlay mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 190;
    backdrop-filter: blur(2px);
}

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 100;
    gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.hamburger {
    color: var(--text-muted);
    padding: 6px;
    border-radius: 8px;
    transition: color var(--transition), background var(--transition);
    display: none;
}
.hamburger:hover { color: var(--text); background: var(--bg); }

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.topbar-icon-btn {
    color: var(--text-muted);
    padding: 8px;
    border-radius: 8px;
    transition: color var(--transition), background var(--transition);
    position: relative;
}
.topbar-icon-btn:hover { color: var(--text); background: var(--bg); }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 40px;
    border: 1px solid var(--border);
    background: var(--bg);
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }

/* ============================================================
   PÁGINA CONTENT
   ============================================================ */
.page-content {
    padding: 28px;
    flex: 1;
}

/* ============================================================
   TARJETAS MÉTRICAS
   ============================================================ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    transition: box-shadow var(--transition), transform var(--transition);
}
.metric-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.metric-info { display: flex; flex-direction: column; gap: 4px; }
.metric-label {
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.metric-sub {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}
.metric-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.metric-icon.blue    { background: var(--info-light);    color: var(--info); }
.metric-icon.green   { background: var(--success-light); color: var(--success); }
.metric-icon.amber   { background: var(--warning-light); color: var(--warning); }
.metric-icon.primary { background: var(--primary-light); color: var(--primary); }

/* ============================================================
   SECCIÓN / CARD PANEL
   ============================================================ */
.panel-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.panel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.panel-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.panel-card-body { padding: 24px; }

/* ============================================================
   TABLA
   ============================================================ */
.es-table-wrapper { overflow-x: auto; }
.es-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.es-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.es-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
.es-table tbody tr:last-child td { border-bottom: none; }
.es-table tbody tr:hover { background: var(--bg); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-muted);
}
.empty-state-icon {
    margin: 0 auto 16px;
    width: 56px; height: 56px;
    background: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

/* Badges de estado */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-pending  { background: var(--warning-light); color: #92400e; }
.badge-confirmed{ background: var(--success-light); color: #065f46; }
.badge-cancelled{ background: var(--danger-light);  color: #991b1b; }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(0,174,239,.35); }
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 7px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    background: var(--card);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    font-family: var(--font);
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,174,239,.12);
}
.form-control.error { border-color: var(--danger); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* ============================================================
   ALERTAS
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-error   { background: var(--danger-light);  color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #6ee7b7; }
.alert-info    { background: var(--info-light);    color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ============================================================
   PÁGINA DE LOGIN
   ============================================================ */
body.login-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.login-header {
    background: var(--sidebar-bg);
    padding: 32px;
    text-align: center;
}
.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.login-subtitle {
    color: rgba(255,255,255,.5);
    font-size: 13px;
}
.login-body { padding: 32px; }
.login-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.login-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-muted);
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; }
.forgot-link { font-size: 13px; font-weight: 600; }

.btn-login {
    width: 100%;
    padding: 13px;
    font-size: 15px;
    justify-content: center;
}

.login-footer {
    text-align: center;
    padding: 16px 32px 28px;
    font-size: 12.5px;
    color: var(--text-light);
}

/* ============================================================
   SECCIÓN "PRÓXIMAMENTE" (placeholders)
   ============================================================ */
.coming-soon {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1.5px dashed var(--border);
    padding: 48px;
    text-align: center;
    color: var(--text-muted);
}
.coming-soon h3 { font-size: 16px; margin-bottom: 8px; color: var(--text); }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 1024px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .sidebar-close { display: flex; }

    .main-content { margin-left: 0; }

    .hamburger { display: flex; }

    .page-content { padding: 20px 16px; }

    .topbar { padding: 0 16px; }

    .user-name { display: none; }

    .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .panel-card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 480px) {
    .metrics-grid { grid-template-columns: 1fr; }
    .metric-card { padding: 18px; }
    .metric-value { font-size: 24px; }
}
