/* ==========================================================================
   LMS EFC PNP — Canvas-Inspired Professional Design
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES
   -------------------------------------------------------------------------- */
:root {
    /* PNP Brand */
    --pnp-green-950: #071a0f;
    --pnp-green-900: #0a2e1a;
    --pnp-green-800: #0f3d24;
    --pnp-green-700: #115e33;
    --pnp-green-600: #1a7a42;
    --pnp-green-500: #22a85a;
    --pnp-green-100: #dcfce7;
    --pnp-green-50:  #f0fdf4;

    --pnp-gold-800: #78540a;
    --pnp-gold-700: #92680a;
    --pnp-gold-600: #b8860b;
    --pnp-gold:     #c9a227;
    --pnp-gold-400: #d4af37;
    --pnp-gold-300: #f0c940;
    --pnp-gold-100: #fef3c7;
    --pnp-gold-50:  #fffbeb;

    --pnp-red:     #dc2626;
    --pnp-red-100: #fee2e2;

    /* Neutrals */
    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic — Light theme */
    --nav-bg:         #0f3d24;
    --surface:        #ffffff;
    --surface-alt:    #f9fafb;
    --bg-page:        #f2f4f7;
    --border:         #e5e7eb;
    --border-dark:    #d1d5db;
    --text-primary:   #1f2937;
    --text-secondary: #4b5563;
    --text-muted:     #9ca3af;
    --text-light:     #f9fafb;

    /* Shadows */
    --shadow-xs:   0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm:   0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:   0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:   0 10px 24px rgba(0,0,0,0.1),  0 4px 8px rgba(0,0,0,0.05);
    --shadow-xl:   0 20px 40px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.05);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);

    /* Radius */
    --radius-sm:   0.25rem;
    --radius-md:   0.375rem;
    --radius-lg:   0.5rem;
    --radius-xl:   0.75rem;
    --radius-2xl:  1rem;
    --radius-full: 9999px;
}

/* --------------------------------------------------------------------------
   1b. DARK MODE VARIABLES
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
    --surface:        #1e2028;
    --surface-alt:    #252730;
    --bg-page:        #13141a;
    --border:         #2e3040;
    --border-dark:    #3a3d52;
    --text-primary:   #e4e6f0;
    --text-secondary: #9ca3b8;
    --text-muted:     #6b7585;
    --shadow-xs:   0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm:   0 1px 4px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md:   0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg:   0 10px 24px rgba(0,0,0,0.45), 0 4px 8px rgba(0,0,0,0.2);
    --shadow-xl:   0 20px 40px rgba(0,0,0,0.5), 0 8px 16px rgba(0,0,0,0.25);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.2);
}

/* Smooth transitions when switching theme */
body, .card, .card-header, .card-body, .card-footer,
input, select, textarea, .form-control,
.modal-content, .table, th, td,
.alert, .badge, .btn {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* Dark mode overrides for components that use hard-coded colors */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--surface-alt);
    color: var(--text-primary);
    border-color: var(--border-dark);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255,255,255,0.03);
}

[data-theme="dark"] .card { border-color: var(--border); }

[data-theme="dark"] hr { border-color: var(--border); }

/* Tabla: hover y cabecera en modo oscuro */
[data-theme="dark"] .table tbody tr:hover { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .table tbody tr { border-bottom-color: var(--border); }
[data-theme="dark"] .table thead th { background: var(--surface-alt); color: var(--text-muted); border-bottom-color: var(--border); }
[data-theme="dark"] .table tbody td { color: var(--text-primary); }

/* Curso interactivo hover en modo oscuro */
[data-theme="dark"] .course-item-interactive:hover { background: rgba(255,255,255,0.06) !important; border-color: var(--pnp-green-600) !important; }

/* Botones ghost/secondary en modo oscuro */
[data-theme="dark"] .btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
[data-theme="dark"] .btn-secondary { background: var(--surface-alt); color: var(--text-primary); border-color: var(--border-dark); }
[data-theme="dark"] .btn-secondary:hover { background: var(--border); }

/* Dark mode toggle button */
.btn-theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-full);
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.2s;
    flex-shrink: 0;
}
.btn-theme-toggle:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { min-height: 100vh; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-page);
    overflow-x: hidden;
}

img, video, iframe { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* --------------------------------------------------------------------------
   3. LAYOUT
   -------------------------------------------------------------------------- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-wrapper { padding: 2rem 0 4rem; }

/* --------------------------------------------------------------------------
   4. NAVIGATION (Canvas-style top bar)
   -------------------------------------------------------------------------- */
.navbar {
    background: var(--pnp-green-800);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    border-bottom: none;
}

/* Canvas-style accent line */
.navbar::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--pnp-gold-700) 0%,
        var(--pnp-gold-300) 35%,
        #fff8d6 50%,
        var(--pnp-gold-300) 65%,
        var(--pnp-gold-700) 100%);
    background-size: 300% 100%;
    animation: goldShimmer 6s ease-in-out infinite;
}
@keyframes goldShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-logo {
    width: 38px;
    height: 38px;
    background: var(--pnp-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--pnp-green-900);
    flex-shrink: 0;
}

.navbar-title strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.navbar-title span {
    display: block;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    list-style: none;
    flex: 1;
    justify-content: center;
}

.navbar-nav a {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    font-weight: 500;
    color: rgba(255,255,255,0.68);
    transition: all 0.15s;
    white-space: nowrap;
}

.navbar-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }

.navbar-nav a.active {
    background: rgba(201,162,39,0.18);
    color: var(--pnp-gold-300);
    font-weight: 600;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

.navbar-user-info { text-align: right; display: none; }

.navbar-user-name {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.navbar-user-role {
    display: block;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.navbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--pnp-gold);
    color: var(--pnp-green-900);
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s;
}
.navbar-avatar:hover {
    border-color: var(--pnp-gold-300);
    transform: scale(1.06);
}

.btn-logout {
    padding: 0.3rem 0.8rem;
    font-size: 0.76rem;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.75);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: inherit;
}
.btn-logout:hover {
    background: rgba(220,38,38,0.85);
    color: #fff;
    border-color: transparent;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    flex-direction: column;
    gap: 4px;
}
.navbar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(255,255,255,0.75);
    border-radius: 2px;
    transition: all 0.25s;
}

.navbar-menu-mobile {
    display: none;
    background: var(--pnp-green-900);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 0.5rem 1.5rem 0.875rem;
}
.navbar-menu-mobile.open { display: block; }
.navbar-menu-mobile a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.72);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
}
.navbar-menu-mobile a:last-child { border-bottom: none; }
.navbar-menu-mobile a:hover { color: #fff; }

/* --------------------------------------------------------------------------
   5. PAGE HEADER (Canvas-style breadcrumb + title)
   -------------------------------------------------------------------------- */
.page-header {
    padding: 1.75rem 0 1.5rem;
    margin-bottom: 2rem;
}

.page-header-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
    /* Disable animated gradient */
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    animation: none !important;
}

.page-title-accent {
    display: block;
    width: 36px;
    height: 3px;
    background: var(--pnp-green-700);
    border-radius: var(--radius-full);
    margin-top: 0.625rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--pnp-green-600);
    max-width: 560px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--pnp-green-700); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--gray-300); }

/* --------------------------------------------------------------------------
   6. CARDS
   -------------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    color: var(--text-primary);
    position: relative;
}

/* Remove the sweep animation */
.card::before { display: none; }

.card:hover { box-shadow: var(--shadow-md); }

.card h1,.card h2,.card h3,.card h4,.card h5,.card h6 { color: var(--text-primary); text-shadow: none; }
.card p { color: var(--text-secondary); text-shadow: none; }

.card-body { padding: 1.5rem; }

.card-header {
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--surface);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-footer {
    padding: 0.875rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
}

/* Course Card */
.course-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.course-card::after { display: none; }

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--pnp-green-700);
}

.course-card-image {
    height: 156px;
    background-size: cover;
    background-position: center;
    background-color: var(--pnp-green-800);
    position: relative;
}

.course-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,46,26,0.72) 0%, transparent 55%);
}

.course-card-body {
    padding: 1.125rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.course-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    flex: 1;
}

.course-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 0.5rem;
}

/* KPI Card */
.kpi-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    padding: 1.375rem;
    transition: all 0.2s;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Remove float animation on icons */
.kpi-icon { animation: none !important; }

.kpi-card-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.kpi-value {
    font-size: 2.375rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.03em;
}

.kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-bar { margin-top: 1rem; }

.kpi-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.77rem;
    margin-bottom: 0.3rem;
    color: var(--text-muted);
}
.kpi-bar-label span:last-child { font-weight: 600; color: var(--text-secondary); }

.kpi-bar-track {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.kpi-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--pnp-green-700), var(--pnp-green-500));
    transition: width 0.6s ease;
}

/* Action Tile */
.action-tile {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    border-left: 4px solid transparent;
    box-shadow: var(--shadow-card);
    padding: 1.25rem 1.375rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: all 0.2s;
    color: var(--text-primary);
}

.action-tile:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-left-color: var(--pnp-green-700);
}

.action-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.action-tile-body { flex: 1; }
.action-tile-title { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.2rem; }
.action-tile-desc  { font-size: 0.8rem; color: var(--text-muted); }
.action-tile-arrow { color: var(--text-muted); font-size: 1.1rem; transition: transform 0.2s; }
.action-tile:hover .action-tile-arrow { transform: translateX(4px); color: var(--pnp-green-700); }

/* --------------------------------------------------------------------------
   7. TABLES
   -------------------------------------------------------------------------- */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    background: var(--surface);
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 0.875rem;
}

.table thead th {
    padding: 0.75rem 1.125rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table tbody tr { border-bottom: 1px solid var(--gray-100); transition: background 0.1s; }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--gray-50); }
.table tbody td { padding: 0.875rem 1.125rem; color: var(--text-primary); vertical-align: middle; }

.td-name strong { display: block; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.td-name small  { font-size: 0.8rem; color: var(--text-muted); }
.td-actions { display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end; white-space: nowrap; }

/* --------------------------------------------------------------------------
   8. FORMS
   -------------------------------------------------------------------------- */
.form-group { margin-bottom: 1.125rem; }

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-dark);
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--pnp-green-600);
    box-shadow: 0 0 0 3px rgba(26,122,66,0.14);
}

.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 88px; }

.input-wrapper { position: relative; }
.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
}
.form-control.with-icon { padding-left: 2.4rem; }
.form-hint { margin-top: 0.3rem; font-size: 0.77rem; color: var(--text-muted); }

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
    padding-right: 2.25rem;
}

/* --------------------------------------------------------------------------
   9. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.55rem 1.125rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: 1.5px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.25;
    position: relative;
    overflow: hidden;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-primary {
    background: var(--pnp-green-700);
    color: #fff;
    border-color: var(--pnp-green-700);
}
.btn-primary:hover {
    background: var(--pnp-green-800);
    border-color: var(--pnp-green-800);
    box-shadow: 0 2px 8px rgba(15,61,36,0.3);
}

.btn-gold {
    background: var(--pnp-gold);
    color: var(--pnp-green-900);
    border-color: var(--pnp-gold);
    font-weight: 600;
}
.btn-gold:hover { background: var(--pnp-gold-400); border-color: var(--pnp-gold-400); }

.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border-dark);
}
.btn-secondary:hover { background: var(--gray-50); color: var(--text-primary); }

.btn-outline {
    background: transparent;
    border-color: var(--pnp-green-700);
    color: var(--pnp-green-700);
}
.btn-outline:hover { background: var(--pnp-green-700); color: #fff; }

.btn-danger {
    background: var(--pnp-red);
    color: #fff;
    border-color: var(--pnp-red);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-outline-danger {
    background: transparent;
    border-color: #fca5a5;
    color: var(--pnp-red);
}
.btn-outline-danger:hover { background: var(--pnp-red); color: #fff; border-color: var(--pnp-red); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--text-primary); }

.btn-sm  { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.75rem 1.75rem; font-size: 0.9375rem; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--radius-md); font-size: 0.875rem; flex-shrink: 0; }

/* Ripple */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    pointer-events: none;
    transform: scale(0);
    animation: rippleAnim 0.45s ease-out forwards;
}
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

/* --------------------------------------------------------------------------
   10. BADGES
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.19rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.badge-green  { background: var(--pnp-green-100); color: var(--pnp-green-800); }
.badge-gold   { background: var(--pnp-gold-100);  color: var(--pnp-gold-800); }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-red    { background: var(--pnp-red-100); color: #991b1b; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }

.code-badge {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--pnp-green-50);
    color: var(--pnp-green-800);
    border: 1px solid var(--pnp-green-100);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.08em;
}

/* --------------------------------------------------------------------------
   11. ALERTS
   -------------------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    margin-bottom: 1.125rem;
    border: 1px solid transparent;
}
.alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.1rem; }
.alert-success { background: var(--pnp-green-50); color: var(--pnp-green-800); border-color: var(--pnp-green-100); }
.alert-error   { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.alert-warning { background: var(--pnp-gold-50); color: var(--pnp-gold-800); border-color: var(--pnp-gold-100); }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #dbeafe; }

/* --------------------------------------------------------------------------
   12. MODALS
   -------------------------------------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.18);
    animation: modalIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-lg { max-width: 720px; }

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 0.5rem; }
.modal-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.modal-close:hover { background: var(--gray-200); color: var(--text-primary); }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
}

/* --------------------------------------------------------------------------
   13. AUTH PAGES (kept dark — login/register)
   -------------------------------------------------------------------------- */
#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

.auth-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.28;
    animation: orbFloat 14s ease-in-out infinite alternate;
}
.orb-1 { width: 520px; height: 520px; background: radial-gradient(circle, rgba(17,94,51,0.9) 0%, rgba(17,94,51,0.2) 70%); top: -160px; left: -160px; animation-duration: 18s; }
.orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(201,162,39,0.8) 0%, rgba(201,162,39,0.1) 70%); bottom: -120px; right: -80px; animation-duration: 14s; animation-delay: -4s; }
.orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(34,139,75,0.7) 0%, rgba(34,139,75,0.1) 70%); top: 40%; left: 60%; animation-duration: 20s; animation-delay: -8s; }
.orb-4 { width: 240px; height: 240px; background: radial-gradient(circle, rgba(255,220,80,0.5) 0%, rgba(255,220,80,0.05) 70%); top: 60%; left: 10%; animation-duration: 16s; animation-delay: -12s; }

@keyframes orbFloat {
    0%   { transform: translate(0,0) scale(1); }
    33%  { transform: translate(40px,-60px) scale(1.08); }
    66%  { transform: translate(-30px,30px) scale(0.95); }
    100% { transform: translate(20px,-20px) scale(1.04); }
}

.auth-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
    background: linear-gradient(160deg, #000000 0%, #050f08 20%, #071a0f 45%, #0a2e1a 70%, #071a0f 100%);
    background-attachment: fixed;
}

.auth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 30% 20%, rgba(17,94,51,0.35) 0%, transparent 65%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(201,162,39,0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.auth-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.11);
    border-top: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 460px;
    padding: 2.75rem 2.25rem;
    box-shadow: 0 30px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.07);
    position: relative;
    z-index: 1;
    animation: authCardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-logo { display: flex; justify-content: center; margin-bottom: 1.625rem; }
.auth-logo-shield {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--pnp-gold-300) 0%, var(--pnp-gold) 50%, var(--pnp-gold-700) 100%);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    box-shadow: 0 8px 28px rgba(201,162,39,0.35), 0 0 0 6px rgba(201,162,39,0.08);
    font-weight: 900;
    color: var(--pnp-green-900);
}

.auth-header { text-align: center; margin-bottom: 1.75rem; }
.auth-institution { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--pnp-gold-400); margin-bottom: 0.4rem; }
.auth-title { font-size: 1.5rem; font-weight: 800; color: #fff; letter-spacing: -0.02em; margin-bottom: 0.35rem; line-height: 1.25; }
.auth-subtitle { font-size: 0.875rem; color: rgba(255,255,255,0.5); }

.auth-form .form-label { color: rgba(255,255,255,0.8); font-size: 0.82rem; }
.auth-form .form-control {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.13);
    color: #fff;
    padding: 0.75rem 1rem 0.75rem 2.6rem;
}
.auth-form .form-control::placeholder { color: rgba(255,255,255,0.3); }
.auth-form .form-control:focus { border-color: var(--pnp-gold); box-shadow: 0 0 0 3px rgba(201,162,39,0.12); background: rgba(255,255,255,0.1); }
.auth-form .input-icon { color: rgba(255,255,255,0.38); }
.auth-form .input-wrapper:focus-within .input-icon { color: var(--pnp-gold-400); }
.auth-form select.form-control option { background: var(--pnp-green-800); }
.auth-form .btn-primary {
    background: linear-gradient(135deg, var(--pnp-gold-300) 0%, var(--pnp-gold) 60%, var(--pnp-gold-700) 100%);
    color: var(--pnp-green-900);
    font-weight: 700;
    font-size: 0.9375rem;
    padding: 0.875rem;
    box-shadow: 0 4px 16px rgba(201,162,39,0.25);
    border-radius: var(--radius-full);
    width: 100%;
    margin-top: 0.375rem;
    border-color: transparent;
}
.auth-form .btn-primary:hover {
    background: linear-gradient(135deg, var(--pnp-gold-300) 0%, var(--pnp-gold) 100%);
    box-shadow: 0 6px 20px rgba(201,162,39,0.35);
    transform: translateY(-1px);
}

.auth-link { color: var(--pnp-gold-400); font-weight: 600; transition: color 0.15s; }
.auth-link:hover { color: var(--pnp-gold-300); text-decoration: underline; }
.auth-footer-text { text-align: center; margin-top: 1.375rem; font-size: 0.875rem; color: rgba(255,255,255,0.4); }
.auth-back-link { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: rgba(255,255,255,0.4); transition: color 0.15s; margin-top: 1.125rem; }
.auth-back-link:hover { color: rgba(255,255,255,0.75); }
.auth-divider { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 1.375rem 0; }
.auth-alert { padding: 0.75rem 0.875rem; border-radius: var(--radius-md); font-size: 0.875rem; margin-bottom: 1.125rem; border: 1px solid transparent; display: flex; align-items: flex-start; gap: 0.5rem; word-break: break-word; }
.auth-alert-error   { background: rgba(220,38,38,0.15); color: #fca5a5; border-color: rgba(220,38,38,0.28); }
.auth-alert-success { background: rgba(16,185,129,0.12); color: #a7f3d0; border-color: rgba(16,185,129,0.25); }

/* --------------------------------------------------------------------------
   14. SECTION HEADERS
   -------------------------------------------------------------------------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.125rem;
    flex-wrap: wrap;
}

.section-title {
    font-size: 1.075rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-title-dark { color: var(--text-primary); }

/* --------------------------------------------------------------------------
   15. GRIDS
   -------------------------------------------------------------------------- */
.grid-courses   { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }
.grid-kpi       { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.125rem; }
.grid-2         { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3         { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.125rem; }

/* --------------------------------------------------------------------------
   16. EMPTY STATE
   -------------------------------------------------------------------------- */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3.5rem 2rem;
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-dark);
}
.empty-state-icon  { font-size: 2.75rem; margin-bottom: 0.875rem; opacity: 0.35; }
.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.375rem; }
.empty-state-desc  { font-size: 0.875rem; color: var(--text-muted); max-width: 360px; margin: 0 auto 1.375rem; line-height: 1.6; }

/* --------------------------------------------------------------------------
   17. PROGRESS
   -------------------------------------------------------------------------- */
.progress {
    width: 100%;
    height: 7px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--pnp-green-700), var(--pnp-green-500));
    transition: width 0.6s ease;
}

/* --------------------------------------------------------------------------
   18. COURSE PAGE LAYOUT
   -------------------------------------------------------------------------- */
.grid-course-layout {
    display: grid;
    grid-template-columns: 1fr 295px;
    gap: 1.5rem;
    align-items: start;
}

.module-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    margin-bottom: 0.5rem;
    transition: all 0.15s;
}
.module-item:hover {
    border-color: var(--pnp-green-700);
    background: var(--pnp-green-50);
    transform: translateX(2px);
}
.module-item-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   19. UTILITIES
   -------------------------------------------------------------------------- */
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-muted    { color: var(--text-muted) !important; }
.text-green    { color: var(--pnp-green-700); }
.text-gold     { color: var(--pnp-gold); }
.text-danger   { color: var(--pnp-red); }
.text-white    { color: #fff; }
.text-sm       { font-size: 0.875rem; }
.text-xs       { font-size: 0.75rem; }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }

.d-flex      { display: flex; }
.align-center { align-items: center; }
.gap-2       { gap: 1rem; }
.flex-1      { flex: 1; }
.flex-wrap   { flex-wrap: wrap; }

.w-100 { width: 100%; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* --------------------------------------------------------------------------
   20. BACKWARD COMPATIBILITY (clases legacy en PHP)
   -------------------------------------------------------------------------- */
.card-glass { background: var(--surface); border-radius: var(--radius-xl); border: 1px solid var(--border); box-shadow: var(--shadow-card); overflow: hidden; color: var(--text-primary); }
.card-glass-body { padding: 1.125rem; flex: 1; display: flex; flex-direction: column; }
.card-glass h3 { color: var(--text-primary) !important; font-weight: 600; }
.card-glass p  { color: var(--text-muted) !important; }
.card-glass .btn-outline { background: var(--pnp-green-700) !important; color: #fff !important; border-color: var(--pnp-green-700) !important; }
.navbar-glass { background: var(--pnp-green-800); border-bottom: 3px solid var(--pnp-gold); padding: 0; position: sticky; top: 0; z-index: 200; box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.navbar-standard { background: var(--pnp-green-800); border-bottom: 3px solid var(--pnp-gold); padding: 0; position: sticky; top: 0; z-index: 200; box-shadow: 0 2px 8px rgba(0,0,0,0.18); color: #fff !important; }
.navbar-standard::after { display: none; }
.hero-section { padding: 1.75rem 0 1.25rem; margin-bottom: 1.75rem; }
.hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: inline-block;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    animation: none !important;
}
.hero-title::after { content: ''; display: block; width: 36px; height: 3px; background: var(--pnp-green-700); margin-top: 0.5rem; border-radius: var(--radius-full); }
.hero-subtitle { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.5rem; padding-left: 0.75rem; border-left: 3px solid var(--pnp-green-600); }
.flex-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.375rem; flex-wrap: wrap; gap: 1rem; }
.grid-responsive { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.user-name { font-weight: 600; color: var(--text-primary); }
.course-item-interactive { cursor: pointer; transition: all 0.2s ease !important; }
.course-item-interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--pnp-green-700) !important; background: var(--pnp-green-50) !important; }

/* --------------------------------------------------------------------------
   21. ORBS — hidden on main pages (kept for auth pages)
   -------------------------------------------------------------------------- */
#page-orbs { display: none; }

/* Keep auth-bg body dark */
body:has(.auth-bg) { background: #071a0f; }

/* --------------------------------------------------------------------------
   22. ANIMATIONS & TRANSITIONS
   -------------------------------------------------------------------------- */
@keyframes pageFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.page-wrapper, .container, .auth-bg, .quiz-container { position: relative; z-index: 1; }
.page-wrapper { animation: pageFadeUp 0.3s ease both; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.4s ease, transform 0.4s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal:nth-child(1) { transition-delay: 0.03s; }
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.13s; }
.reveal:nth-child(4) { transition-delay: 0.18s; }
.reveal:nth-child(5) { transition-delay: 0.23s; }
.reveal:nth-child(6) { transition-delay: 0.28s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .reveal { opacity: 1; transform: none; }
    .page-wrapper { animation: none; }
}

/* --------------------------------------------------------------------------
   23. RESPONSIVE
   -------------------------------------------------------------------------- */
/* ---- Breakpoints ---- */
@media (min-width: 1024px) { .navbar-user-info { display: block; } }
@media (max-width: 1023px) { .navbar-nav { display: none; } .navbar-toggle { display: flex; } }
@media (max-width: 900px)  { .grid-course-layout { grid-template-columns: 1fr; } }

/* ---- Tablet / phablet ---- */
@media (max-width: 768px) {
    body { background-attachment: scroll; }

    /* Container */
    .container { padding: 0 1rem; }
    .page-wrapper { padding: 1rem 0 3rem; }

    /* Page headers */
    .page-title { font-size: 1.5rem; }
    .page-subtitle { font-size: 0.82rem; }
    .page-header { padding: 1.25rem 0 1rem; margin-bottom: 1.25rem; }
    .page-header-inner { flex-direction: column; align-items: flex-start; gap: 0.875rem; }
    .page-header-inner > .btn,
    .page-header-inner > button { width: 100%; justify-content: center; }

    /* Navbar */
    .navbar-inner { height: auto; min-height: 56px; padding: 0.45rem 0; }
    .navbar-title span { display: none; }
    .navbar-avatar { width: 30px; height: 30px; font-size: 0.68rem; }
    .btn-logout { font-size: 0.74rem; padding: 0.3rem 0.65rem; }
    .navbar-user { gap: 0.4rem; }
    .navbar-menu-mobile a { padding: 0.8rem 1.25rem; font-size: 0.9rem; min-height: 44px; }
    .navbar-toggle { padding: 0.375rem; min-width: 44px; min-height: 44px; }

    /* Grids */
    .grid-courses { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
    .grid-kpi { grid-template-columns: repeat(2, 1fr); gap: 0.875rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .section-header { flex-direction: column; align-items: flex-start; }

    /* Cards */
    .card-body { padding: 1.125rem; }
    .card-header { padding: 0.875rem 1.125rem; }
    .kpi-card { padding: 1rem; }
    .kpi-value { font-size: 2rem; }
    .kpi-icon { width: 40px; height: 40px; font-size: 1.05rem; }
    .course-card-body { padding: 1rem; }

    /* Tables */
    .table-wrapper { border-radius: var(--radius-lg); }
    .table { min-width: 480px; }
    .table thead th { font-size: 0.65rem; padding: 0.6rem 0.875rem; }
    .table tbody td { font-size: 0.875rem; padding: 0.75rem 0.875rem; }
    .td-actions { gap: 0.25rem; }

    /* Buttons — touch targets */
    .btn { min-height: 44px; font-size: 0.875rem; }
    .btn-sm { min-height: 38px; font-size: 0.8rem; }
    .btn-icon { width: 38px; height: 38px; min-height: unset; }

    /* Forms — prevent iOS zoom (must be 16px) */
    .form-control,
    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="search"], input[type="tel"],
    input[type="url"], input[type="date"], input[type="datetime-local"],
    textarea, select { font-size: 1rem !important; }

    /* Filter form stacking */
    .filter-form { flex-direction: column !important; }
    .filter-form > div { min-width: 100% !important; }

    /* Modals */
    .modal { max-width: 96vw; border-radius: var(--radius-xl); max-height: 94vh; }
    .modal-overlay { padding: 0.5rem; align-items: flex-end; }
    .modal { border-bottom-left-radius: 0; border-bottom-right-radius: 0; max-height: 88vh; }

    /* Hero / section titles */
    .hero-title { font-size: 1.5rem; }
    .hero-section { padding: 1.25rem 0 0.875rem; margin-bottom: 1rem; }
    .flex-header { flex-direction: column; align-items: flex-start; }

    /* Auth */
    .auth-card { padding: 2rem 1.375rem; max-width: 100%; }
    .auth-title { font-size: 1.375rem; }

    /* Misc */
    .empty-state { padding: 2.5rem 1.25rem; }
    .action-tile { padding: 1rem; }
    .action-tile-icon { width: 42px; height: 42px; font-size: 1.2rem; }
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    .container { padding: 0 0.875rem; }
    .page-wrapper { padding: 0.875rem 0 2.5rem; }
    .page-title { font-size: 1.375rem; }
    .page-header { padding: 1rem 0 0.875rem; margin-bottom: 1rem; }

    /* Navbar */
    .navbar-title strong { font-size: 0.78rem; }
    .btn-logout-text { display: none; }

    /* Grids */
    .grid-courses { grid-template-columns: 1fr; }
    .grid-kpi { grid-template-columns: 1fr 1fr; }

    /* Cards */
    .card-body { padding: 1rem; }
    .kpi-value { font-size: 1.875rem; }
    .kpi-card { padding: 0.875rem; }

    /* Buttons */
    .btn { font-size: 0.84rem; padding: 0.55rem 1rem; min-height: 44px; }
    .btn-sm { padding: 0.4rem 0.75rem; font-size: 0.78rem; min-height: 38px; }
    .btn-lg { padding: 0.75rem 1.25rem; font-size: 0.9rem; }

    /* Modals */
    .modal-header, .modal-body, .modal-footer { padding-left: 1rem; padding-right: 1rem; }
    .modal-title { font-size: 0.9375rem; }

    /* Tables */
    .table { min-width: 420px; }
    .table thead th { font-size: 0.6rem; padding: 0.5rem 0.75rem; }
    .table tbody td { font-size: 0.84rem; padding: 0.65rem 0.75rem; }

    /* Hero */
    .hero-title { font-size: 1.25rem; }

    /* Section */
    .section-title { font-size: 1rem; }

    /* Forms */
    .form-group { margin-bottom: 1rem; }

    /* Action tiles */
    .action-tile-desc { display: none; }
}

/* ---- Small phones (360px) ---- */
@media (max-width: 380px) {
    .container { padding: 0 0.75rem; }
    .navbar-brand img,
    .navbar-brand .navbar-logo { width: 30px; height: 30px; }
    .page-title { font-size: 1.25rem; }
    .kpi-value { font-size: 1.625rem; }
    .grid-kpi { grid-template-columns: 1fr; }
    .btn { min-height: 44px; }
    .course-card-image { height: 130px; }
}
