:root {
    --accent: #2f6fed;
    --accent-dark: #1d4fbf;
    --accent-soft: #eaf1ff;
    --bg: #f4f6fb;
    --surface: #ffffff;
    --border: #e5e9f2;
    --text: #1f2937;
    --text-muted: #6b7280;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 6px 20px rgba(15, 23, 42, .05);
}

body {
    background: var(--bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
}

a { color: var(--accent); }

/* Authenticated shell */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
}

.app-sidebar-brand {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

.app-logo { height: 56px; width: auto; display: block; }

.app-sidebar-nav { padding: 16px 12px 4px; display: flex; flex-direction: column; gap: 4px; }

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-muted) !important;
    text-decoration: none;
    font-size: .92rem;
    font-weight: 600;
    transition: background .15s ease, color .15s ease;
}

.app-nav-link:hover { background: var(--accent-soft); color: var(--accent-dark) !important; }
.app-nav-link.active { background: var(--accent); color: #fff !important; }

.app-sidebar-cursos {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 12px 24px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.app-sidebar-section-title {
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin: 4px 0 10px;
}

.curso-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    margin: 0 -8px;
    border-radius: 8px;
    font-size: .84rem;
    color: var(--text) !important;
    text-decoration: none !important;
}

.curso-row:hover { background: var(--accent-soft); }

.curso-row .curso-count {
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg);
    border-radius: 999px;
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    font-size: .75rem;
}

.curso-row.has-solicitudes .curso-count { background: var(--accent-soft); color: var(--accent-dark); }

.app-sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.app-user { font-size: .85rem; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }

.app-main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; width: 100%; }

.app-topbar {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.app-topbar h1 { font-size: 1.3rem; margin: 0; font-weight: 800; }

.app-content { padding: 28px 32px; flex: 1; }

@media (max-width: 960px) {
    .app-shell { flex-direction: column; }
    .app-sidebar { position: static; width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 6px 16px; }
    .app-sidebar-brand { border-bottom: none; padding: 8px 12px 8px 0; }
    .app-sidebar-nav { flex-direction: row; flex-wrap: wrap; padding: 0; }
    .app-sidebar-cursos { display: none; }
    .app-sidebar-footer { border-top: none; display: flex; align-items: center; gap: 8px; padding: 8px 0; }
    .app-user { margin-bottom: 0; }
    .app-main { margin-left: 0; }
    .app-topbar, .app-content { padding-left: 16px; padding-right: 16px; }
}

/* Public shell */
.public-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.public-card-wrap { max-width: 480px; width: 100%; }
.public-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.public-logo { height: 120px; width: auto; display: block; }

.section-heading { font-size: 1.1rem; font-weight: 800; margin: 0 0 12px; }

/* Cards */
.uk-card { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.uk-card-title { font-weight: 800; }

/* Buttons */
.uk-button { border-radius: 10px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.uk-button-primary { background-color: var(--accent); }
.uk-button-primary:hover { background-color: var(--accent-dark); }
.uk-button-default { background: var(--surface); border-color: var(--border); color: var(--text); }
.uk-button-danger { background-color: #dc2626; }

/* Inputs */
.uk-input, .uk-select, .uk-textarea {
    border-radius: 10px;
    border-color: var(--border);
    background: var(--surface);
}
.uk-input:focus, .uk-select:focus, .uk-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.uk-form-label { font-weight: 600; font-size: .85rem; color: var(--text); margin-bottom: 4px; display: block; }

/* Metric cards */
.metric-card {
    border-radius: var(--radius);
    padding: 18px 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.metric-card .metric-value { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.metric-card .metric-label { color: var(--text-muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}
.status-badge-lg { padding: 7px 18px; font-size: .95rem; }
.status-recibida_peticion { background: #fef3c7; color: #92400e; }
.status-citado { background: #dbeafe; color: #1e40af; }
.status-espera { background: #f3f4f6; color: #374151; }
.status-presenta_solicitud { background: #d1fae5; color: #065f46; }
.status-no_presenta_solicitud { background: #fee2e2; color: #991b1b; }

/* Table */
.uk-table { background: var(--surface); }
.uk-table th { color: var(--text-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 700; }
.uk-table td, .uk-table th { border-bottom: 1px solid var(--border); }
.uk-table-hover tbody tr:hover { background: var(--accent-soft); }
