/* ================================================
   FuturePath - Modern Design System
   Clean, Professional Education Platform
   ================================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
    /* Primary Palette */
    --primary: #145c63;
    --primary-hover: #0f4a50;
    --primary-light: #1d7b83;
    --primary-50: #eaf7f6;
    --primary-100: #ccecea;
    --primary-200: #9fd8d5;
    --primary-600: #145c63;
    --primary-700: #0f4a50;
    --primary-800: #0b3d43;
    --primary-900: #062f34;

    /* Accent / Secondary */
    --accent: #d97706;
    --accent-light: #fbbf24;
    --accent-50: #fff7ed;
    --accent-100: #ffedd5;

    /* Semantic Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #059669;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #d97706;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #dc2626;
    --info: #4f46e5;
    --info-light: #e0e7ff;

    /* Neutral Palette */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* Backgrounds */
    --bg-primary: #f6f8fb;
    --bg-secondary: #eef3f6;
    --bg-card: #ffffff;
    --bg-sidebar: #fbfcfd;
    --bg-input: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-active: #eaf7f6;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    --text-link: #145c63;

    /* Borders */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: #145c63;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 12px 24px -18px rgba(15, 23, 42, 0.32);
    --shadow-xl: 0 24px 44px -30px rgba(15, 23, 42, 0.42);
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-card-hover: 0 14px 30px -24px rgba(15, 23, 42, 0.35);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 76px;
    --header-height: 64px;
    --max-content-width: 1280px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

body::selection {
    background: var(--primary-100);
    color: var(--primary-900);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

a {
    text-decoration: none;
    color: var(--text-link);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* --- Container --- */
.container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* ================================================
   PUBLIC LAYOUT (Unauthenticated)
   ================================================ */
.public-header {
    background: rgba(251, 252, 253, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width:100%;
    margin: 0;
    padding-left: 0;
    padding-right: var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--primary);
    letter-spacing: 0;
}

.logo-img {
    height: 38px;
    width: auto;
    display: block;
}

.nav-collapse {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    justify-content: flex-end;
}

.nav-collapse a {
    padding: var(--space-2) var(--space-4);
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.nav-collapse a:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.nav-collapse a.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    padding: var(--space-2) var(--space-5);
    box-shadow: 0 8px 18px -14px rgba(20, 92, 99, 0.8);
}

.nav-collapse a.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--text-inverse);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--bg-hover);
}

/* ================================================
   APP LAYOUT (Authenticated)
   ================================================ */
.app-layout {
    background: var(--bg-primary);
}

.app-container {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100%;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--slate-300) transparent;
    transition: width var(--transition-slow);
    box-shadow: 1px 0 0 var(--border-color);
}

.sidebar-header {
    padding: var(--space-5) var(--space-5);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--primary);
    letter-spacing: 0;
}

.sidebar-logo-img {
    height: 34px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-3) var(--space-3);
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8125rem;
    border-radius: var(--radius-md);
    margin-bottom: 2px;
    transition: all var(--transition-fast);
    position: relative;
    white-space: nowrap;
    text-decoration: none;
}

.nav-item:hover {
    background: #eef5f4;
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-3) var(--space-4);
}

/* Nav section labels */
.nav-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: var(--space-4) var(--space-4) var(--space-1);
    margin-top: var(--space-2);
}

/* Unread badge on nav item */
.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}

/* Tooltip for collapsed sidebar (1024px breakpoint) */
.nav-item {
    position: relative;
}
.nav-item::after {
    content: attr(title);
    position: absolute;
    left: calc(var(--sidebar-collapsed) - 4px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--slate-800);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--radius-md);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 200;
    box-shadow: var(--shadow-md);
}

.sidebar-footer {
    padding: var(--space-4) var(--space-3);
    border-top: 1px solid var(--border-color);
    background: #f4f7f8;
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-2);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    width: 100%;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-6) var(--space-8);
    min-height: 100vh;
    max-width: 100%;
    transition: margin-left var(--transition-slow);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(246,248,251,0) 220px),
        var(--bg-primary);
}

/* --- Top Bar --- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-color);
}

.top-bar-left {
    flex: 1;
}

.top-bar-left .breadcrumb {
    margin-bottom: 0;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

/* --- Breadcrumb --- */
.breadcrumb {
    margin-bottom: var(--space-4);
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    gap: var(--space-2);
    font-size: 0.8125rem;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    color: var(--text-muted);
    margin-left: var(--space-2);
}

.breadcrumb a {
    color: var(--text-tertiary);
    font-weight: 500;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb li:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

/* ================================================
   CARDS
   ================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    border-color: #d6e2e3;
    box-shadow: var(--shadow-card-hover);
}

.card-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.card-body {
    padding: var(--space-5);
}

.card-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-color);
    background: var(--slate-50);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.4;
    letter-spacing: 0;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 8px 18px -14px rgba(20, 92, 99, 0.85);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--text-inverse);
    box-shadow: 0 14px 24px -18px rgba(20, 92, 99, 0.9);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--slate-50);
    color: var(--text-primary);
    border-color: #cbd8dc;
}

.btn-success {
    background: var(--success);
    color: var(--text-inverse);
}

.btn-success:hover {
    background: var(--success-dark);
    color: var(--text-inverse);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}

.btn-danger:hover {
    background: var(--danger-dark);
    color: var(--text-inverse);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-xl {
    padding: 16px 36px;
    font-size: 1.0625rem;
    border-radius: var(--radius-lg);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Visually hidden (accessible hide) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.visually-hidden:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 8px 12px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--primary, #2563eb);
    color: #fff;
    z-index: 10000;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
}

/* Spacing utilities */
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.text-xs { font-size: 0.625rem; }

.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-success { color: var(--success); }
.text-muted { color: var(--text-muted); }

.hidden { display: none; }

/* ================================================
   FORMS
   ================================================ */
.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.875rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:hover:not(:focus) {
    border-color: var(--slate-300);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.form-check label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
}

/* Form validation states */
.form-control.is-valid {
    border-color: var(--success);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2310b981' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}
.form-control.is-invalid {
    border-color: var(--danger);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23ef4444' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 6l8 8m0-8l-8 8'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}
.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
    line-height: 1.4;
}
.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    line-height: 1.4;
}
.form-error::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='%23ef4444' d='M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z'/%3e%3c/svg%3e");
    background-size: contain;
    flex-shrink: 0;
}

/* ================================================
   SKELETON LOADING
   ================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
    pointer-events: none;
    user-select: none;
    color: transparent !important;
}
.skeleton * {
    visibility: hidden;
}
.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: var(--radius-sm);
}
.skeleton-text:last-child {
    width: 80%;
}
.skeleton-card {
    height: 120px;
    border-radius: var(--radius-lg);
}
.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}
.skeleton-button {
    height: 38px;
    width: 100px;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ================================================
   BUTTON LOADING STATE
   ================================================ */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.75s linear infinite;
    color: var(--text-inverse);
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ================================================
   FOCUS-VISIBLE IMPROVEMENTS
   ================================================ */
.btn:focus-visible,
a:focus-visible,
.nav-item:focus-visible,
.form-control:focus-visible {
    outline: 3px solid var(--primary-200);
    outline-offset: 2px;
}
.btn:focus:not(:focus-visible),
a:focus:not(:focus-visible),
.nav-item:focus:not(:focus-visible),
.form-control:focus:not(:focus-visible) {
    outline: none;
}

/* ================================================
   BADGES
   ================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: capitalize;
    letter-spacing: 0.01em;
}

.badge-pending {
    background: var(--warning-light);
    color: #92400e;
}

.badge-approved, .badge-complete, .badge-success {
    background: var(--success-light);
    color: #065f46;
}

.badge-rejected, .badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-info {
    background: var(--info-light);
    color: #155e75;
}

.badge-under_review, .badge-under%20review {
    background: var(--primary-100);
    color: var(--primary-800);
}

/* ================================================
   ALERTS / MESSAGES
   ================================================ */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-error, .alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: var(--info-light);
    color: #155e75;
    border-color: #a5f3fc;
}

/* ================================================
   STATS CARDS
   ================================================ */
.stats-grid {
    display: grid;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all var(--transition-base);
}

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

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-3);
    font-size: 1.25rem;
}

.stat-card .stat-icon.primary {
    background: var(--primary-50);
    color: var(--primary);
}

.stat-card .stat-icon.success {
    background: var(--success-light);
    color: var(--success-dark);
}

.stat-card .stat-icon.info {
    background: var(--info-light);
    color: var(--info);
}

.stat-card .stat-icon.warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: 0;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: var(--space-1);
    font-weight: 500;
}

/* ================================================
   PROGRESS BAR
   ================================================ */
.progress {
    height: 6px;
    background: var(--slate-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-full);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar.success {
    background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
}

/* ================================================
   TABLE
   ================================================ */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--slate-50);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.table tbody tr:hover {
    background: var(--slate-50);
}

/* ================================================
   PAGINATION
   ================================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    justify-content: center;
    margin-top: var(--space-8);
}

.pagination a,
.pagination span {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination a {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.pagination a:hover {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

.pagination .current {
    background: var(--primary);
    color: var(--text-inverse);
    border: 1px solid var(--primary);
}

/* ================================================
   HERO SECTION
   ================================================ */
.hero-section {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4f8 50%, #f0f0ff 100%);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-section h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    letter-spacing: 0;
    line-height: 1.15;
    position: relative;
}

.hero-section p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto var(--space-8);
    line-height: 1.7;
    position: relative;
}

.hero-buttons {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

/* ================================================
   FEATURES
   ================================================ */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    padding: var(--space-12) 0;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-8) var(--space-6);
    text-align: center;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--primary-50);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    font-size: 1.5rem;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    line-height: 1.6;
}

/* ================================================
   EMPTY STATE
   ================================================ */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.empty-state h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

/* ================================================
   GRID UTILITIES
   ================================================ */
.grid {
    display: grid;
    gap: var(--space-5);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Flex utilities */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-gap-8 { gap: var(--space-2); }
.flex-gap-16 { gap: var(--space-4); }

/* ================================================
   MOBILE NAVIGATION
   ================================================ */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: var(--space-2) var(--space-3);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.mobile-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-2);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    letter-spacing: 0.02em;
}

.mobile-nav a.active {
    color: var(--primary);
}

.mobile-nav a:hover {
    color: var(--primary);
    background: var(--primary-50);
}

.mobile-nav form {
    flex: 1;
    display: flex;
    margin: 0;
}

.mobile-nav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-2);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    letter-spacing: 0.02em;
    cursor: pointer;
}

.mobile-nav button:hover {
    color: var(--primary);
    background: var(--primary-50);
}

.mobile-nav i {
    font-size: 1.25rem;
}

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */
.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    animation: toastSlideIn 0.3s ease;
}

.toast-hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-content {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--text-primary);
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.75rem;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

/* ================================================
   SCROLLBAR
   ================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
        min-width: var(--sidebar-collapsed);
        max-width: var(--sidebar-collapsed);
    }

    .sidebar-logo span,
    .nav-item span,
    .nav-badge,
    .logout-btn span,
    .nav-section-label,
    .nav-divider + .nav-item span {
        display: none;
    }

    .sidebar-logo {
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
        padding: var(--space-3);
    }

    /* Show tooltip on hover when sidebar is collapsed */
    .nav-item:hover::after {
        opacity: 1;
    }

    .nav-item.active::before {
        display: none;
    }

    .logout-btn {
        justify-content: center;
    }

    .sidebar-user-info,
    .sidebar-user {
        display: none;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
        padding: var(--space-5);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: var(--space-3) var(--space-4);
        padding-bottom: 90px; /* clear mobile nav + breathing room */
    }

    .mobile-nav {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .nav-collapse {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-card);
        padding: var(--space-4);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        box-shadow: var(--shadow-lg);
        z-index: 1001;
    }

    .nav-collapse.show {
        display: flex;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section {
        padding: var(--space-10) 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Top bar — keep icon, hide label text */
    .top-bar {
        padding-bottom: var(--space-3);
        margin-bottom: var(--space-4);
    }
    .top-bar-right .btn-label {
        display: none;
    }
    .top-bar-right .btn {
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: var(--radius-md);
    }

    /* Breadcrumb — prevent overflow */
    .breadcrumb ol {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex-wrap: nowrap;
        max-width: calc(100vw - 80px);
    }

    /* Mobile-friendly touch targets */
    .btn, .nav-item, .mobile-nav a {
        min-height: 44px;
    }
    .btn-sm {
        min-height: 36px;
    }

    /* Stat labels allow wrapping on mobile */
    .stat-label {
        white-space: normal !important;
        font-size: 0.625rem;
    }

    /* Alert text */
    .alert {
        font-size: 0.8125rem;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: var(--space-3);
        padding-bottom: 90px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr; /* keep 2-col at 480 for stat cards */
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    /* Very small screens: stack stat cards */
    .stat-number {
        font-size: 1.25rem;
    }

    /* Pagination — smaller on mobile */
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

/* Remove 300ms tap delay on mobile */
a, button, input, select, textarea {
    touch-action: manipulation;
}

/* Prevent iOS font size inflation */
@media (max-width: 768px) {
    body { -webkit-text-size-adjust: 100%; }
    .form-control, .form-select, textarea.form-control {
        font-size: 16px; /* prevent iOS auto-zoom on focus */
    }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .skeleton { animation: none !important; background: var(--slate-200); }
    .toast { animation: none !important; }
    .toast-hiding { animation: none !important; opacity: 0; }
}
/* ================================================
   Footer Styles
   ================================================ */

/* ── App Footer (authenticated / logged-in layout) ── */
.app-footer {
    margin-top: var(--space-10);
    background: var(--slate-900);
    color: rgba(255,255,255,0.75);
}

.app-footer-inner {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: var(--space-8);
    padding: var(--space-8) var(--space-8) var(--space-6);
    max-width: 1200px;
}

/* Brand column */
.app-footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.footer-logo-img {
    height: 34px;
    width: auto;
    display: block;
}

.app-footer-logo .footer-logo-img {
    filter: brightness(0) invert(1);
}
.app-footer-tagline {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
    max-width: 260px;
    margin: 0;
}

/* Footer columns */
.app-footer-heading {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
    margin-bottom: var(--space-4);
}

.app-footer-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    font-size: 0.8125rem;
}
.app-footer-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    color: rgba(255,255,255,0.65);
    line-height: 1.5;
}
.app-footer-list li i {
    color: var(--primary-light);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 0.75rem;
}
.app-footer-list a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.app-footer-list a:hover { color: white; }
.app-footer-list a i {
    color: var(--primary-light);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

/* Social icons */
.app-footer-socials {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-top: var(--space-4);
}
.social-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid rgba(255,255,255,0.1);
}
.social-icon:hover { background: var(--primary); color: white; border-color: var(--primary); }
.social-icon.whatsapp:hover { background: #25D366; border-color: #25D366; }
.social-icon.facebook:hover { background: #1877F2; border-color: #1877F2; }
.social-icon.linkedin:hover { background: #0A66C2; border-color: #0A66C2; }
.social-icon.youtube:hover  { background: #FF0000; border-color: #FF0000; }

/* Bottom bar */
.app-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-8);
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.3);
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* ── Public Footer (landing / unauthenticated pages) ── */
.public-footer {
    background: #0f172a;
    color: rgba(255,255,255,0.75);
    padding-top: var(--space-10);
}

.public-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-8);
}

.public-footer-top {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: var(--space-8);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Brand column */
.public-footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.public-footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.public-footer-logo .footer-logo-img {
    height: 38px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}
.public-footer-brand > p {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
    max-width: 260px;
    margin: 0;
}
.public-footer-socials {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-top: var(--space-1);
}
.public-footer-socials a {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid rgba(255,255,255,0.1);
}
.public-footer-socials a:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* Info columns */
.public-footer-col {
    display: flex;
    flex-direction: column;
}
.public-footer-col h4 {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
    margin-bottom: var(--space-4);
}
.public-footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    font-size: 0.8125rem;
}
.public-footer-col ul li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
}
.public-footer-col ul li i {
    color: var(--primary-light);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 0.75rem;
}
.public-footer-col ul a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.public-footer-col ul a:hover { color: white; }
.public-footer-col ul a i {
    color: var(--primary-light);
    width: 14px;
    text-align: center;
}

.public-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) 0;
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.3);
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* ── Footer Responsive ── */
@media (max-width: 1024px) {
    .public-footer-top {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }
    .app-footer-inner {
        grid-template-columns: 1fr 1fr;
    }
    .app-footer-col.app-footer-brand-col {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    /* App footer hidden on mobile (mobile nav replaces it) */
    .app-footer { display: none; }

    .public-footer-top {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-5);
    }
    .public-footer-brand {
        grid-column: 1 / -1;
    }
    .public-footer-inner { padding: 0 var(--space-4); }
    .public-footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .public-footer-top {
        grid-template-columns: 1fr;
    }
    .public-footer-brand { grid-column: auto; }
}

/* Print stylesheet */
@media print {
    .public-header,
    .sidebar,
    .app-footer,
    .public-footer,
    .mobile-nav,
    .top-bar,
    .toast-container,
    .cookie-consent,
    .chat-widget,
    .btn,
    .menu-toggle,
    .lang-switcher,
    .nav-collapse a.btn-primary {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
    .card,
    .content-card,
    .contact-form-card,
    .contact-sidebar-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.75rem;
        color: #666;
    }
    a[href^="javascript"]::after,
    a[href^="#"]::after {
        content: "";
    }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/**
 * FuturePath Language Switcher - Clean Dropdown Design
 * Fixes: bullet points, z-index, panel styling, hover states
 */

/* ── Language Dropdown Container ── */
.lang-dropdown-menu {
    position: relative;
    display: inline-block;
    z-index: 9999;
}

/* ── Trigger Button ── */
.lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s ease;
    line-height: 1;
    white-space: nowrap;
    outline: none;
}

.lang-trigger:hover {
    border-color: #2563eb;
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.lang-trigger:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* ── Flag in Trigger ── */
.lang-flag {
    font-size: 16px;
    line-height: 1;
}

/* ── Language Code ── */
.lang-code {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: inherit;
}

/* ── Arrow Icon ── */
.lang-arrow {
    width: 10px;
    height: 10px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
    flex-shrink: 0;
    margin-left: 2px;
}

.lang-dropdown-menu.open .lang-arrow {
    transform: rotate(180deg);
    opacity: 0.8;
}

/* ── Dropdown Panel ── */
.lang-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    list-style: none;
    margin: 0;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transform-origin: top right;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    pointer-events: none;
}

/* Show dropdown when open - FIXED z-index and visibility */
.lang-dropdown-menu.open .lang-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Remove default list styling - NO BULLETS */
.lang-options li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lang-options li::before,
.lang-options li::after {
    display: none;
    content: none;
}

/* ── Individual Option ── */
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #1e293b;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.lang-option:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.lang-option:active {
    background: #e2e8f0;
    transform: scale(0.98);
}

.lang-option.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.lang-option.active .lang-option-code {
    color: #2563eb;
    font-weight: 600;
}

/* ── Flag in Option ── */
.lang-option-flag {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

/* ── Language Name ── */
.lang-option-name {
    flex: 1;
    font-weight: 500;
}

/* ── Language Code Badge ── */
.lang-option-code {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 28px;
    text-align: center;
}

.lang-option:hover .lang-option-code,
.lang-option.active .lang-option-code {
    background: #dbeafe;
    color: #2563eb;
}

/* ── Checkmark for active item ── */
.lang-option.active::after {
    content: "";
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
    margin-left: 4px;
}

/* ── Divider ── */
.lang-options li + li {
    margin-top: 2px;
}

/* ── Header label (optional) ── */
.lang-options::before {
    content: "Select Language";
    display: block;
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}

/* ── Mobile Adaptations ── */
@media (max-width: 768px) {
    .lang-trigger {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .lang-flag {
        font-size: 14px;
    }
    
    .lang-options {
        min-width: 180px;
        right: -10px;
        top: calc(100% + 6px);
    }
    
    .lang-option {
        padding: 9px 10px;
        font-size: 13px;
    }
    
    .lang-option-flag {
        font-size: 16px;
    }
}

/* ── Public Header Integration ── */
.public-header .lang-dropdown-menu {
    margin-right: 12px;
}

/* ── App Header (Authenticated) Integration ── */
.top-bar .lang-dropdown-menu {
    margin-right: 8px;
}

/* ── Nav collapse mobile menu integration (≤1024px) ── */
@media (max-width: 1024px) {
    .nav-collapse .lang-dropdown-menu {
        margin: 8px 0;
        width: 100%;
    }

    .nav-collapse .lang-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 10px 14px;
    }

    .nav-collapse .lang-options {
        position: static;
        width: 100%;
        box-shadow: none;
        border: 1px solid #e2e8f0;
        margin-top: 4px;
        opacity: 0;
        visibility: hidden;
        display: none;
        transform: none;
        transition: opacity 0.2s ease;
    }

    .nav-collapse .lang-dropdown-menu.open .lang-options {
        display: block;
        opacity: 1;
        visibility: visible;
    }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
    .lang-options,
    .lang-arrow,
    .lang-option {
        transition: none !important;
    }
}

/* ── Focus visible for keyboard users ── */
.lang-option:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    border-radius: 8px;
}

.lang-trigger:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
/* ============================================
   CRITICAL FIXES FOR LANGUAGE SWITCHER
   Ensure dropdown floats above all content
   ============================================ */

/* Force dropdown to be above all other elements */
.lang-dropdown-menu,
.lang-dropdown-menu.open,
.lang-dropdown-menu.open .lang-options {
    z-index: 2147483647 !important; /* Maximum z-index */
}

/* Ensure public-header doesn't clip the dropdown */
.public-header,
.header-content,
.app-container,
.main-content,
.sidebar {
    overflow: visible !important;
}

/* Fix for any parent with overflow:hidden */
.lang-dropdown-menu {
    position: relative;
    transform: none;
}

.lang-options {
    position: absolute;
    will-change: transform, opacity;
}

/* Ensure dropdown is never clipped by parent */
.lang-dropdown-menu {
    isolation: isolate;
}
/* ============================================
   SIDEBAR SCROLLABILITY FIX
   Makes sidebar scrollable with visible scrollbar
   ============================================ */

/* Fix sidebar to be properly scrollable */
.sidebar {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--slate-400, #94a3b8) var(--slate-100, #f1f5f9) !important;
    padding-bottom: 20px !important;
}

/* Webkit scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px !important;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--slate-100, #f1f5f9) !important;
    border-radius: 3px !important;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--slate-400, #94a3b8) !important;
    border-radius: 3px !important;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--slate-500, #64748b) !important;
}

/* Ensure sidebar nav takes available space but doesn't push footer off-screen */
.sidebar-nav {
    flex: 1 1 auto !important;
    overflow-y: visible !important;
    min-height: 0 !important;
}

/* Sidebar footer should always be visible at bottom when scrolled */
.sidebar-footer {
    position: sticky !important;
    bottom: 0 !important;
    background: #f4f7f8 !important;
    z-index: 10 !important;
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

/* Add padding to bottom of sidebar content */
.sidebar-nav::after {
    content: '' !important;
    display: block !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

/* Mobile sidebar scrollability */
@media (max-width: 1024px) {
    .sidebar {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: env(safe-area-inset-bottom, 20px) !important;
    }
    
    .sidebar-footer {
        position: sticky !important;
        bottom: 0 !important;
        padding-bottom: max(var(--space-4), env(safe-area-inset-bottom, 20px)) !important;
    }
}

/* Ensure the app container doesn't clip the sidebar */
.app-container {
    overflow: visible !important;
}

/* Fix for mobile nav if it uses similar structure */
.mobile-nav-panel,
.mobile-menu {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
}

/* Ensure nav items don't get squished */
.nav-item {
    flex-shrink: 0 !important;
}

.nav-section-label {
    flex-shrink: 0 !important;
}

/* Improve touch targets on mobile */
@media (pointer: coarse) {
    .sidebar::-webkit-scrollbar {
        width: 8px !important;
    }
    
    .nav-item {
        min-height: 44px !important;
    }
}
