/**
 * BloomTusks Technologies — Enterprise Design System v2
 * Blue / white / black enterprise theme for BTT Student Management
 */

/* ==========================================================================
   1. CSS Variables
   ========================================================================== */

:root {
    /* Brand — BloomTusks blue / white / black */
    --btt-primary: #0d47a1;
    --btt-primary-dark: #0a1628;
    --btt-primary-light: #1565c0;
    --btt-primary-50: #e3f2fd;
    --btt-accent: #2563eb;
    --btt-accent-hover: #1d4ed8;
    --btt-black: #1a1a2e;
    --btt-white: #ffffff;

    /* Neutrals */
    --btt-gray-900: #111827;
    --btt-gray-800: #1f2937;
    --btt-gray-700: #374151;
    --btt-gray-600: #4b5563;
    --btt-gray-500: #6b7280;
    --btt-gray-400: #9ca3af;
    --btt-gray-300: #d1d5db;
    --btt-gray-200: #e5e7eb;
    --btt-gray-100: #f3f4f6;
    --btt-gray-50: #f9fafb;
    --btt-bg: #f8fafc;
    --btt-surface: #ffffff;
    --btt-border: rgba(13, 71, 161, 0.08);
    --btt-border-strong: var(--btt-gray-300);

    /* Semantic colors */
    --btt-success: #059669;
    --btt-success-soft: rgba(5, 150, 105, 0.12);
    --btt-warning: #d97706;
    --btt-warning-soft: rgba(217, 119, 6, 0.12);
    --btt-danger: #dc2626;
    --btt-danger-soft: rgba(220, 38, 38, 0.12);
    --btt-info: #0284c7;
    --btt-info-soft: rgba(2, 132, 199, 0.12);
    --btt-secondary: #64748b;
    --btt-secondary-soft: rgba(100, 116, 139, 0.12);

    /* Layout tokens */
    --btt-sidebar-width: 280px;
    --btt-sidebar-collapsed-width: 80px;
    --btt-header-height: 64px;
    --btt-content-max-width: 1440px;
    --btt-footer-height: 48px;

    /* Radius */
    --btt-radius-xs: 4px;
    --btt-radius-sm: 6px;
    --btt-radius: 10px;
    --btt-radius-md: 12px;
    --btt-radius-lg: 16px;
    --btt-radius-xl: 20px;
    --btt-radius-pill: 999px;

    /* Shadows */
    --btt-shadow-xs: 0 1px 2px rgba(10, 22, 40, 0.04);
    --btt-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(13, 71, 161, 0.06);
    --btt-shadow-md: 0 4px 16px rgba(13, 71, 161, 0.08);
    --btt-shadow-lg: 0 10px 40px rgba(13, 71, 161, 0.12);
    --btt-shadow-xl: 0 20px 50px rgba(10, 22, 40, 0.15);
    --btt-shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.2);

    /* Transitions */
    --btt-transition-fast: 0.15s ease;
    --btt-transition: 0.2s ease;
    --btt-transition-slow: 0.3s ease;

    /* Typography & effects */
    --btt-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --btt-gradient: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #2563eb 100%);
    --btt-gradient-dark: linear-gradient(180deg, #0a1628 0%, #0d2137 100%);
    --btt-scrollbar: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   2. Base / Typography
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--btt-font);
    font-size: 0.9375rem;
    background: var(--btt-bg);
    color: var(--btt-gray-900);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--btt-primary-dark);
    font-weight: 700;
    line-height: 1.3;
}

a {
    color: var(--btt-accent);
    transition: color var(--btt-transition-fast);
}

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

code {
    font-size: 0.85em;
    padding: 0.15em 0.45em;
    background: var(--btt-gray-100);
    border-radius: var(--btt-radius-xs);
    color: var(--btt-primary);
    font-weight: 500;
}

.text-primary-btt { color: var(--btt-primary) !important; }
.text-muted { color: var(--btt-gray-500) !important; }

::selection {
    background: rgba(37, 99, 235, 0.2);
    color: var(--btt-primary-dark);
}

/* ==========================================================================
   3. Auth / Login
   ========================================================================== */

.auth-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #07111f;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: none;
}

.auth-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-brand-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem);
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(37, 99, 235, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 80%, rgba(13, 71, 161, 0.4) 0%, transparent 50%),
        linear-gradient(160deg, #0a1628 0%, #0d2137 45%, #0d47a1 100%);
    color: var(--btt-white);
    overflow: hidden;
}

.auth-brand-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    right: -120px;
    bottom: -140px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 440px;
    width: 100%;
}

.auth-brand-logo {
    width: 64px;
    height: 64px;
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.auth-brand-eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(147, 197, 253, 0.95);
}

.auth-brand-title {
    margin: 0 0 0.85rem;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--btt-white);
    letter-spacing: -0.02em;
}

.auth-brand-copy {
    margin: 0 0 1.75rem;
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
    max-width: 36ch;
}

.auth-brand-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.auth-brand-points li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.88);
    padding: 0.7rem 0.9rem;
    border-radius: var(--btt-radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand-points i {
    width: 1.25rem;
    text-align: center;
    color: #93c5fd;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background:
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.auth-form-card {
    width: 100%;
    max-width: 420px;
    background: var(--btt-white);
    border-radius: var(--btt-radius-lg);
    box-shadow: 0 20px 50px rgba(10, 22, 40, 0.1);
    border: 1px solid rgba(13, 71, 161, 0.08);
    padding: clamp(1.5rem, 3vw, 2.25rem);
}

.auth-form-intro {
    margin-bottom: 1.5rem;
}

.auth-form-logo {
    margin-bottom: 1rem;
}

.auth-form-title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--btt-primary-dark);
    letter-spacing: -0.02em;
}

.auth-form-subtitle {
    margin: 0;
    color: var(--btt-gray-500);
    font-size: 0.9375rem;
}

.auth-field {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--btt-gray-300);
    border-radius: var(--btt-radius-sm);
    background: var(--btt-white);
    overflow: hidden;
    transition: border-color var(--btt-transition), box-shadow var(--btt-transition);
}

.auth-field:focus-within {
    border-color: var(--btt-accent);
    box-shadow: var(--btt-shadow-focus);
}

.auth-field-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    color: var(--btt-gray-400);
    background: var(--btt-gray-50);
    border-right: 1px solid var(--btt-gray-200);
    flex-shrink: 0;
}

.auth-input {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding-left: 0.85rem;
    min-height: 44px;
}

.auth-input:focus {
    box-shadow: none !important;
}

.auth-submit {
    min-height: 46px;
    font-size: 0.9375rem;
    gap: 0.5rem;
}

.auth-footer-note {
    margin: 1.5rem 0 0;
    text-align: center;
    color: var(--btt-gray-500);
    font-size: 0.75rem;
}

/* Legacy auth-card support (if reused elsewhere) */
.auth-card {
    position: relative;
    z-index: 1;
    background: var(--btt-white);
    border-radius: var(--btt-radius-lg);
    box-shadow: var(--btt-shadow-xl);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-header {
    background: var(--btt-primary-dark);
    color: var(--btt-white);
    padding: 2rem 2rem 1.75rem;
    text-align: center;
}

.auth-header h1 {
    font-size: 1.375rem;
    margin: 0.75rem 0 0;
    font-weight: 700;
    color: var(--btt-white);
    letter-spacing: -0.01em;
}

.auth-header p {
    margin: 0.35rem 0 0;
    opacity: 0.85;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
}

.auth-body {
    padding: 2rem;
}

.btt-logo {
    width: 56px;
    height: 56px;
    background: var(--btt-white);
    border-radius: var(--btt-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--btt-primary);
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    box-shadow: var(--btt-shadow-md);
    flex-shrink: 0;
}

@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        min-height: 100vh;
        min-height: 100dvh;
        background:
            radial-gradient(ellipse 90% 50% at 50% -10%, rgba(37, 99, 235, 0.18) 0%, transparent 55%),
            linear-gradient(180deg, #f8fafc 0%, #e8eef6 100%);
    }

    .auth-form-card {
        box-shadow: 0 16px 40px rgba(10, 22, 40, 0.08);
    }
}

@media (max-width: 575.98px) {
    .auth-form-panel {
        padding: 1.25rem;
    }

    .auth-form-card {
        padding: 1.35rem;
        border-radius: var(--btt-radius);
    }
}

/* ==========================================================================
   4. App Shell
   ========================================================================== */

.app-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--btt-bg);
}

.main-content {
    flex: 1;
    margin-left: var(--btt-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left var(--btt-transition-slow);
}

html.sidebar-collapsed .main-content {
    margin-left: var(--btt-sidebar-collapsed-width);
}

/* ==========================================================================
   5. Sidebar
   ========================================================================== */

.sidebar {
    width: var(--btt-sidebar-width);
    background: var(--btt-gradient-dark);
    color: var(--btt-white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow: visible;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width var(--btt-transition-slow), transform var(--btt-transition-slow);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

html.sidebar-collapsed .sidebar {
    width: var(--btt-sidebar-collapsed-width);
}

.sidebar-brand {
    position: relative;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: var(--btt-header-height);
    flex-shrink: 0;
}

.sidebar-brand .btt-logo {
    width: 42px;
    height: 42px;
    font-size: 1rem;
    border-radius: var(--btt-radius-sm);
    flex-shrink: 0;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1;
    gap: 0.12rem;
    padding-right: 0.15rem;
    transition: opacity var(--btt-transition), visibility var(--btt-transition);
}

.sidebar-brand-title {
    font-weight: 700;
    font-size: 0.8125rem;
    line-height: 1.3;
    white-space: normal;
    overflow: visible;
    color: var(--btt-white);
}

.sidebar-brand-sub {
    font-size: 0.65rem;
    opacity: 0.75;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.88);
    white-space: normal;
    overflow: visible;
}

html.sidebar-collapsed .sidebar-brand-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    visibility: hidden;
    flex: 0;
    pointer-events: none;
}

/* Edge toggle — blended into sidebar rail (same Y as logo) */
.sidebar-collapse-btn {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
    z-index: 1050;
    display: inline-flex;
    width: 20px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: none;
    background: #0a1628;
    color: rgba(255, 255, 255, 0.72);
    border-radius: 0 9px 9px 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    transition: background var(--btt-transition), color var(--btt-transition),
        border-color var(--btt-transition), box-shadow var(--btt-transition);
}

.sidebar-collapse-btn:hover,
.sidebar-collapse-btn:focus-visible {
    background: #0d47a1;
    border-color: rgba(37, 99, 235, 0.35);
    color: var(--btt-white);
    box-shadow: 2px 0 10px rgba(13, 71, 161, 0.3);
    outline: none;
}

.sidebar-collapse-chevron {
    font-size: 0.62rem;
    line-height: 1;
    transition: transform var(--btt-transition-slow);
}

html.sidebar-collapsed .sidebar-collapse-chevron {
    transform: rotate(180deg);
}

html.sidebar-collapsed .sidebar-brand {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 0.95rem 0.55rem;
    gap: 0;
    min-height: var(--btt-header-height);
}

html.sidebar-collapsed .sidebar-brand .btt-logo {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
    margin: 0;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

html.sidebar-collapsed .sidebar-collapse-btn {
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
    width: 18px;
    height: 34px;
    background: #0a1628;
    border-color: rgba(255, 255, 255, 0.08);
    border-left: none;
}

html.sidebar-no-transition .sidebar,
html.sidebar-no-transition .main-content {
    transition: none !important;
}

html.sidebar-no-transition .sidebar-collapse-chevron {
    transition: none !important;
}

.sidebar-nav {
    padding: 0.75rem 0;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--btt-scrollbar) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--btt-scrollbar);
    border-radius: var(--btt-radius-pill);
}

.nav-section {
    padding: 0.65rem 1.25rem 0.35rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.45;
    font-weight: 600;
    white-space: normal;
    overflow: visible;
    line-height: 1.35;
}

html.sidebar-collapsed .nav-section {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    margin: 0.1rem 0.65rem;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--btt-transition);
    border-radius: var(--btt-radius-sm);
    border-left: none;
    position: relative;
}

.nav-link-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.nav-link-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity var(--btt-transition), visibility var(--btt-transition);
}

html.sidebar-collapsed .nav-link {
    justify-content: center;
    align-items: center;
    padding: 0.7rem 0.35rem;
    margin: 0.15rem 0.55rem;
    gap: 0;
}

html.sidebar-collapsed .nav-link-icon {
    width: 22px;
    height: 22px;
    margin: 0;
}

html.sidebar-collapsed .nav-link-label {
    opacity: 0;
    visibility: hidden;
    width: 0;
    height: 0;
    overflow: hidden;
    position: absolute;
    pointer-events: none;
}

.nav-link:hover {
    color: var(--btt-white);
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: var(--btt-white);
    background: rgba(37, 99, 235, 0.25);
    box-shadow: inset 3px 0 0 var(--btt-accent);
}

html.sidebar-collapsed .nav-link.active {
    box-shadow: none;
    background: rgba(37, 99, 235, 0.35);
}

.nav-link.active .nav-link-icon {
    color: #93c5fd;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.7rem;
    opacity: 0.45;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
}

html.sidebar-collapsed .sidebar-footer {
    opacity: 0;
    visibility: hidden;
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
    overflow: hidden;
}

/* Mobile drawer */
.sidebar-toggle {
    display: none;
    background: var(--btt-gray-100);
    border: 1px solid var(--btt-gray-200);
    border-radius: var(--btt-radius-sm);
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    color: var(--btt-primary-dark);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--btt-transition), border-color var(--btt-transition);
}

.sidebar-toggle:hover {
    background: var(--btt-gray-200);
    border-color: var(--btt-gray-300);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 40, 0.55);
    z-index: 1035;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity var(--btt-transition-slow);
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   6. Top Header
   ========================================================================== */

.top-header {
    background: var(--btt-white);
    min-height: var(--btt-header-height);
    border-bottom: 1px solid var(--btt-border-strong);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--btt-shadow-xs);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--btt-radius-sm);
    border: 1px solid var(--btt-gray-200);
    background: var(--btt-white);
    color: var(--btt-gray-700);
    text-decoration: none;
    font-size: 1.05rem;
    transition: all var(--btt-transition);
    position: relative;
}

.header-icon-btn:hover {
    background: var(--btt-gray-100);
    color: var(--btt-primary);
    border-color: var(--btt-gray-300);
}

.header-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    border: 1px solid var(--btt-gray-200);
    border-radius: var(--btt-radius-pill);
    background: var(--btt-white);
    color: var(--btt-gray-800);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--btt-transition);
}

.header-user-btn:hover,
.header-user-btn:focus {
    background: var(--btt-gray-50);
    border-color: var(--btt-gray-300);
    color: var(--btt-primary-dark);
}

.header-user-btn::after {
    margin-left: 0.25rem;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--btt-gradient);
    color: var(--btt-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--btt-primary-dark);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.page-subtitle {
    color: var(--btt-gray-500);
    font-size: 0.8125rem;
    margin: 0.15rem 0 0;
}

/* ==========================================================================
   7. Breadcrumb
   ========================================================================== */

.btt-breadcrumb {
    margin-bottom: 0.15rem;
}

.btt-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.75rem;
}

.btt-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--btt-gray-400);
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    vertical-align: middle;
}

.btt-breadcrumb .breadcrumb-item a {
    color: var(--btt-gray-500);
    text-decoration: none;
}

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

.btt-breadcrumb .breadcrumb-item.active {
    color: var(--btt-gray-700);
    font-weight: 500;
}

.btt-breadcrumb .breadcrumb-item:first-child a {
    color: var(--btt-primary);
}

/* ==========================================================================
   8. Page Content, Toolbar, Footer
   ========================================================================== */

.page-content {
    padding: 1.5rem;
    flex: 1;
    max-width: var(--btt-content-max-width);
    width: 100%;
    margin: 0 auto;
}

.page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.page-toolbar-title {
    font-size: 0.875rem;
    color: var(--btt-gray-500);
    margin: 0;
}

.page-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.app-footer {
    margin-top: auto;
    border-top: 1px solid var(--btt-gray-200);
    background: var(--btt-white);
    padding: 0.75rem 1.5rem;
}

.app-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    max-width: var(--btt-content-max-width);
    margin: 0 auto;
    font-size: 0.75rem;
    color: var(--btt-gray-500);
}

.app-footer-meta {
    opacity: 0.85;
}

/* ==========================================================================
   9. Stat Cards
   ========================================================================== */

.stat-card {
    background: var(--btt-white);
    border-radius: var(--btt-radius);
    padding: 1.25rem;
    box-shadow: var(--btt-shadow);
    border: 1px solid var(--btt-border);
    transition: transform var(--btt-transition), box-shadow var(--btt-transition);
    height: 100%;
}

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

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

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--btt-primary-dark);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--btt-gray-500);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.stat-desc {
    color: var(--btt-gray-400);
    font-size: 0.75rem;
    margin-top: 0.35rem;
}

.bg-primary-soft { background: rgba(13, 71, 161, 0.1); color: var(--btt-primary); }
.bg-success-soft { background: var(--btt-success-soft); color: var(--btt-success); }
.bg-warning-soft { background: var(--btt-warning-soft); color: var(--btt-warning); }
.bg-danger-soft  { background: var(--btt-danger-soft); color: var(--btt-danger); }
.bg-info-soft    { background: var(--btt-info-soft); color: var(--btt-info); }
.bg-secondary-soft { background: var(--btt-secondary-soft); color: var(--btt-secondary); }

/* ==========================================================================
   10. Card Panels
   ========================================================================== */

.card-panel {
    background: var(--btt-white);
    border-radius: var(--btt-radius);
    box-shadow: var(--btt-shadow);
    border: 1px solid var(--btt-border);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--btt-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: linear-gradient(180deg, var(--btt-white) 0%, var(--btt-gray-50) 100%);
}

.card-panel-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
    color: var(--btt-primary-dark);
}

.card-panel-body {
    padding: 1.25rem;
}

/* ==========================================================================
   11. Buttons
   ========================================================================== */

.btn-btt-primary,
.btn-btt-outline,
.btn-btt-success,
.btn-btt-danger,
.btn-btt-warning,
.btn-btt-info,
.btn-btt-secondary,
.btn-btt-sky,
.btn-btt-dark,
.btn-btt-reset,
.btn-btt-on-dark,
.btn-btt-on-dark-warning,
.btn-btt-on-dark-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--btt-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.4;
    transition: all var(--btt-transition);
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
}

.btn-btt-primary {
    background: var(--btt-gradient);
    border-color: transparent;
    color: var(--btt-white);
}

.btn-btt-primary:hover,
.btn-btt-primary:focus {
    color: var(--btt-white);
    box-shadow: 0 4px 14px rgba(13, 71, 161, 0.35);
    transform: translateY(-1px);
}

.btn-btt-primary:focus {
    box-shadow: var(--btt-shadow-focus), 0 4px 14px rgba(13, 71, 161, 0.35);
}

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

.btn-btt-outline:hover,
.btn-btt-outline:focus {
    background: rgba(13, 71, 161, 0.06);
    color: var(--btt-primary-dark);
    border-color: var(--btt-primary-dark);
}

.btn-btt-success {
    background: var(--btt-success);
    color: var(--btt-white);
}

.btn-btt-success:hover,
.btn-btt-success:focus {
    background: #047857;
    color: var(--btt-white);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.btn-btt-danger {
    background: var(--btt-danger);
    color: var(--btt-white);
}

.btn-btt-danger:hover,
.btn-btt-danger:focus {
    background: #b91c1c;
    color: var(--btt-white);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.btn-btt-warning {
    background: var(--btt-warning);
    color: var(--btt-white);
}

.btn-btt-warning:hover,
.btn-btt-warning:focus {
    background: #b45309;
    color: var(--btt-white);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

.btn-btt-info {
    background: var(--btt-info);
    color: var(--btt-white);
}

.btn-btt-info:hover,
.btn-btt-info:focus {
    background: #0369a1;
    color: var(--btt-white);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.btn-btt-secondary {
    background: var(--btt-secondary);
    color: var(--btt-white);
}

.btn-btt-secondary:hover,
.btn-btt-secondary:focus {
    background: #475569;
    color: var(--btt-white);
}

.btn-btt-sky {
    background: #0284c7;
    color: var(--btt-white);
}

.btn-btt-sky:hover,
.btn-btt-sky:focus {
    background: #0369a1;
    color: var(--btt-white);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.btn-btt-dark {
    background: #1e293b;
    color: var(--btt-white);
}

.btn-btt-dark:hover,
.btn-btt-dark:focus {
    background: #0f172a;
    color: var(--btt-white);
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.35);
}

.btn-btt-reset {
    background: var(--btt-white);
    color: #ea580c;
    border-color: rgba(234, 88, 12, 0.35);
}

.btn-btt-reset:hover,
.btn-btt-reset:focus {
    background: rgba(234, 88, 12, 0.1);
    color: #c2410c;
    border-color: #ea580c;
}

.btn-btt-on-dark {
    background: rgba(255, 255, 255, 0.95);
    color: var(--btt-primary-dark);
    border-color: transparent;
}

.btn-btt-on-dark:hover,
.btn-btt-on-dark:focus {
    background: var(--btt-white);
    color: var(--btt-primary);
}

.btn-btt-on-dark-warning {
    background: rgba(255, 255, 255, 0.18);
    color: var(--btt-white);
    border-color: rgba(255, 255, 255, 0.45);
}

.btn-btt-on-dark-warning:hover,
.btn-btt-on-dark-warning:focus {
    background: var(--btt-warning);
    border-color: var(--btt-warning);
    color: var(--btt-white);
}

.btn-btt-on-dark-danger {
    background: transparent;
    color: var(--btt-white);
    border-color: rgba(255, 255, 255, 0.45);
}

.btn-btt-on-dark-danger:hover,
.btn-btt-on-dark-danger:focus {
    background: var(--btt-danger);
    border-color: var(--btt-danger);
    color: var(--btt-white);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--btt-radius-sm);
}

.btn-sm.btn-btt-primary,
.btn-sm.btn-btt-outline,
.btn-sm.btn-btt-success,
.btn-sm.btn-btt-danger,
.btn-sm.btn-btt-warning,
.btn-sm.btn-btt-info,
.btn-sm.btn-btt-secondary,
.btn-sm.btn-btt-sky,
.btn-sm.btn-btt-dark,
.btn-sm.btn-btt-reset,
.btn-sm.btn-btt-on-dark,
.btn-sm.btn-btt-on-dark-warning,
.btn-sm.btn-btt-on-dark-danger {
    padding: 0.3rem 0.75rem;
    font-size: 0.8125rem;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.table-actions form {
    display: inline-flex;
    margin: 0;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--btt-gray-100);
}

/* ==========================================================================
   12. Tables
   ========================================================================== */

.table-btt {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table-btt thead th {
    background: var(--btt-gray-100);
    border: none;
    border-bottom: 2px solid var(--btt-gray-200);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--btt-gray-700);
    font-weight: 700;
    padding: 0.85rem 1rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-btt tbody td {
    padding: 0.85rem 1rem;
    border-color: var(--btt-gray-100);
    font-size: 0.875rem;
    vertical-align: middle;
}

.table-btt tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.8);
}

.table-btt tbody tr:hover {
    background: rgba(13, 71, 161, 0.04);
}

.table-btt tbody tr:last-child td {
    border-bottom: none;
}

.table-btt code {
    font-size: 0.8rem;
    background: var(--btt-primary-50);
    color: var(--btt-primary);
    padding: 0.2em 0.5em;
    border-radius: var(--btt-radius-xs);
}

.table-responsive {
    border-radius: 0 0 var(--btt-radius) var(--btt-radius);
}

/* ==========================================================================
   13. Pagination
   ========================================================================== */

.btt-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 0.75rem 0;
}

.btt-pagination-info {
    font-size: 0.8125rem;
    color: var(--btt-gray-500);
}

.btt-page-size {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btt-page-size label {
    font-size: 0.8125rem;
    color: var(--btt-gray-500);
    margin: 0;
    white-space: nowrap;
}

.btt-page-size .form-select {
    min-width: 72px;
    width: auto;
}

.btt-pagination .pagination {
    gap: 0.25rem;
}

.btt-pagination .page-link {
    border-radius: var(--btt-radius-sm);
    border: 1px solid var(--btt-gray-200);
    color: var(--btt-gray-700);
    font-size: 0.8125rem;
    padding: 0.4rem 0.7rem;
    transition: all var(--btt-transition);
}

.btt-pagination .page-link:hover {
    background: var(--btt-gray-100);
    border-color: var(--btt-gray-300);
    color: var(--btt-primary);
}

.btt-pagination .page-item.active .page-link {
    background: var(--btt-primary);
    border-color: var(--btt-primary);
    color: var(--btt-white);
    font-weight: 600;
}

.btt-pagination .page-item.disabled .page-link {
    opacity: 0.45;
}

/* ==========================================================================
   14. Badges
   ========================================================================== */

.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 0.3em 0.7em;
    border-radius: var(--btt-radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.3;
    white-space: nowrap;
}

/* Success / positive */
.badge-active,
.badge-verified,
.badge-paid,
.badge-completed,
.badge-converted,
.badge-success {
    background: var(--btt-success-soft);
    color: var(--btt-success);
}

/* Warning / attention */
.badge-pending,
.badge-follow_up,
.badge-new,
.badge-interested,
.badge-partial,
.badge-upcoming,
.badge-warning {
    background: var(--btt-warning-soft);
    color: var(--btt-warning);
}

/* Neutral / inactive */
.badge-inactive,
.badge-closed,
.badge-archived,
.badge-private,
.badge-not_interested,
.badge-cancelled,
.badge-revoked,
.badge-secondary {
    background: var(--btt-secondary-soft);
    color: var(--btt-secondary);
}

/* Info / public */
.badge-public,
.badge-info {
    background: rgba(37, 99, 235, 0.12);
    color: var(--btt-accent);
}

/* Danger / negative */
.badge-overdue,
.badge-dropped,
.badge-suspended,
.badge-terminated,
.badge-danger {
    background: var(--btt-danger-soft);
    color: var(--btt-danger);
}

/* Employment */
.badge-on_leave {
    background: rgba(168, 85, 247, 0.12);
    color: #7c3aed;
}

/* ==========================================================================
   15. Forms
   ========================================================================== */

.form-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--btt-gray-700);
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border-radius: var(--btt-radius-sm);
    border: 1px solid var(--btt-gray-300);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color var(--btt-transition), box-shadow var(--btt-transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--btt-accent);
    box-shadow: var(--btt-shadow-focus);
}

.form-control::placeholder {
    color: var(--btt-gray-400);
}

.form-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--btt-primary);
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--btt-gray-100);
}

.form-section-title:first-child {
    margin-top: 0;
}

.filter-bar {
    background: var(--btt-white);
    border-radius: var(--btt-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--btt-shadow);
    border: 1px solid var(--btt-border);
}

.input-group-text {
    background: var(--btt-gray-50);
    border-color: var(--btt-gray-300);
    color: var(--btt-gray-500);
    border-radius: var(--btt-radius-sm);
}

.input-group .form-control {
    border-radius: var(--btt-radius-sm);
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* ==========================================================================
   16. Alerts
   ========================================================================== */

.alert-btt {
    border: none;
    border-radius: var(--btt-radius);
    padding: 0.85rem 1.15rem;
    font-size: 0.875rem;
    border-left: 4px solid transparent;
    box-shadow: var(--btt-shadow-xs);
}

.alert-btt.alert-success {
    background: var(--btt-success-soft);
    color: #065f46;
    border-left-color: var(--btt-success);
}

.alert-btt.alert-danger {
    background: var(--btt-danger-soft);
    color: #991b1b;
    border-left-color: var(--btt-danger);
}

.alert-btt.alert-warning {
    background: var(--btt-warning-soft);
    color: #92400e;
    border-left-color: var(--btt-warning);
}

.alert-btt.alert-info {
    background: var(--btt-info-soft);
    color: #075985;
    border-left-color: var(--btt-info);
}

/* ==========================================================================
   17. Modals
   ========================================================================== */

.modal-content {
    border: none;
    border-radius: var(--btt-radius-lg);
    box-shadow: var(--btt-shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(180deg, var(--btt-white) 0%, var(--btt-gray-50) 100%);
    border-bottom: 1px solid var(--btt-gray-100);
    padding: 1.15rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    color: var(--btt-primary-dark);
    font-size: 1.05rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--btt-gray-100);
    padding: 1rem 1.5rem;
    background: var(--btt-gray-50);
    gap: 0.5rem;
}

.modal-backdrop.show {
    opacity: 0.45;
}

/* ==========================================================================
   18. Tabs
   ========================================================================== */

.nav-tabs-btt,
.nav-tabs {
    border-bottom: 2px solid var(--btt-gray-200);
    gap: 0.25rem;
}

.nav-tabs-btt .nav-link,
.nav-tabs .nav-link {
    border: none;
    border-radius: var(--btt-radius-sm) var(--btt-radius-sm) 0 0;
    color: var(--btt-gray-600);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.65rem 1.15rem;
    margin-bottom: -2px;
    transition: all var(--btt-transition);
    background: transparent;
}

.nav-tabs-btt .nav-link:hover,
.nav-tabs .nav-link:hover {
    color: var(--btt-primary);
    background: rgba(13, 71, 161, 0.04);
    border-color: transparent;
}

.nav-tabs-btt .nav-link.active,
.nav-tabs .nav-link.active {
    color: var(--btt-primary);
    background: var(--btt-white);
    border-bottom: 2px solid var(--btt-primary);
    box-shadow: var(--btt-shadow-xs);
}

/* ==========================================================================
   19. Profile, Timeline, Empty State, Charts, Dashboard
   ========================================================================== */

.profile-header {
    background: var(--btt-gradient);
    color: var(--btt-white);
    border-radius: var(--btt-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--btt-shadow-md);
}

.profile-header h2 {
    color: var(--btt-white);
    font-size: 1.5rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.timeline-item {
    border-left: 2px solid var(--btt-gray-300);
    padding-left: 1.25rem;
    padding-bottom: 1.25rem;
    margin-left: 0.35rem;
    position: relative;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--btt-accent);
    border: 2px solid var(--btt-white);
    border-radius: 50%;
    position: absolute;
    left: -6px;
    top: 4px;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--btt-gray-500);
}

.empty-state i {
    color: var(--btt-gray-400);
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.dashboard-welcome {
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.06) 0%, rgba(37, 99, 235, 0.04) 100%);
    border: 1px solid var(--btt-border);
    border-radius: var(--btt-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-welcome h4 {
    color: var(--btt-primary-dark);
    margin-bottom: 0.35rem;
}

.dashboard-welcome p {
    color: var(--btt-gray-600);
    margin-bottom: 0;
    font-size: 0.9rem;
}

.alert-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--btt-gray-100);
}

.alert-list-item:last-child {
    border-bottom: none;
}

.alert-list-item-label {
    font-size: 0.875rem;
    color: var(--btt-gray-700);
}

/* ==========================================================================
   20. Public Certificate Pages
   ========================================================================== */

.public-cert-page {
    min-height: 100vh;
    background: var(--btt-bg);
    padding: 2rem 1rem;
}

.public-cert-card {
    max-width: 720px;
    margin: 0 auto;
    background: var(--btt-white);
    border-radius: var(--btt-radius-lg);
    box-shadow: var(--btt-shadow-lg);
    overflow: hidden;
    border: 1px solid var(--btt-border);
}

.public-cert-header {
    background: var(--btt-gradient);
    color: var(--btt-white);
    padding: 2rem;
    text-align: center;
}

.public-cert-header h2 {
    color: var(--btt-white);
    font-size: 1.375rem;
}

.public-cert-header a.text-white:hover {
    color: var(--btt-white) !important;
    opacity: 0.85;
}

.public-cert-body {
    padding: 2rem;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--btt-success-soft);
    color: var(--btt-success);
    padding: 0.5rem 1rem;
    border-radius: var(--btt-radius-pill);
    font-weight: 600;
    font-size: 0.875rem;
}

.public-cert-body .table th {
    background: var(--btt-gray-50);
    font-weight: 600;
    color: var(--btt-gray-700);
    font-size: 0.875rem;
}

/* ==========================================================================
   21. Print Media
   ========================================================================== */

@media print {
    .no-print,
    .sidebar,
    .sidebar-overlay,
    .sidebar-toggle,
    .top-header,
    .app-footer,
    .btt-pagination,
    .btt-breadcrumb,
    .filter-bar,
    .btn,
    .nav-tabs {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .page-content {
        padding: 0;
        max-width: none;
    }

    .card-panel {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .table-btt thead th {
        position: static;
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .public-cert-page {
        padding: 0;
        background: #fff;
    }

    .public-cert-card {
        box-shadow: none;
        border: none;
    }

    a[href]::after {
        content: none !important;
    }
}

/* ==========================================================================
   22. Mobile Table Cards
   ========================================================================== */

@media (max-width: 767.98px) {
    .table-btt-mobile thead {
        display: none;
    }

    .table-btt-mobile tbody tr {
        display: block;
        background: var(--btt-white);
        border: 1px solid var(--btt-gray-200);
        border-radius: var(--btt-radius);
        margin-bottom: 0.75rem;
        padding: 0.5rem 0;
        box-shadow: var(--btt-shadow-xs);
    }

    .table-btt-mobile tbody tr:hover {
        background: var(--btt-white);
    }

    .table-btt-mobile tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.55rem 1rem;
        border: none;
        border-bottom: 1px solid var(--btt-gray-100);
        text-align: right;
    }

    .table-btt-mobile tbody td:last-child {
        border-bottom: none;
    }

    .table-btt-mobile tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--btt-gray-500);
        text-align: left;
        flex-shrink: 0;
        max-width: 45%;
    }

    .table-btt-mobile tbody td.text-end {
        justify-content: space-between;
    }

    .table-btt-mobile tbody tr td[colspan] {
        display: block;
        text-align: center;
    }

    .table-btt-mobile tbody tr td[colspan]::before {
        display: none;
    }
}

/* ==========================================================================
   23. Responsive Breakpoints
   ========================================================================== */

/* Large desktops — 1400px+ */
@media (min-width: 1400px) {
    :root {
        --btt-content-max-width: 1600px;
    }

    .page-content {
        padding: 1.75rem 2rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .chart-container {
        height: 320px;
    }
}

/* Ultra-wide — 1920px+ */
@media (min-width: 1920px) {
    :root {
        --btt-content-max-width: 1800px;
        --btt-sidebar-width: 300px;
    }

    html.sidebar-collapsed .main-content {
        margin-left: var(--btt-sidebar-collapsed-width);
    }

    .page-title {
        font-size: 1.5rem;
    }

    .stat-card {
        padding: 1.5rem;
    }
}

/* Tablet / mobile sidebar — 991px */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--btt-sidebar-width) !important;
        box-shadow: var(--btt-shadow-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    html.sidebar-collapsed .sidebar {
        width: var(--btt-sidebar-width) !important;
    }

    html.sidebar-collapsed .sidebar-brand-text,
    html.sidebar-collapsed .nav-link-label,
    html.sidebar-collapsed .nav-section {
        position: static;
        opacity: 1;
        visibility: visible;
        width: auto;
        height: auto;
        padding: inherit;
        margin: 0;
        clip: auto;
        overflow: visible;
        pointer-events: auto;
        flex: 1;
    }

    html.sidebar-collapsed .nav-link-label {
        flex: initial;
        width: auto;
        height: auto;
        position: static;
    }

    html.sidebar-collapsed .nav-link {
        justify-content: flex-start;
        padding: 0.65rem 1.25rem;
        margin: 0.1rem 0.65rem;
        gap: 0.75rem;
    }

    html.sidebar-collapsed .nav-link.active {
        box-shadow: inset 3px 0 0 var(--btt-accent);
    }

    html.sidebar-collapsed .sidebar-footer {
        opacity: 0.45;
        visibility: visible;
        height: auto;
        padding: 1rem 1.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .main-content,
    html.sidebar-collapsed .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .sidebar-collapse-btn {
        display: none !important;
    }

    .top-header {
        padding: 0.65rem 1rem;
    }

    .page-content {
        padding: 1rem;
    }

    .header-user-btn span:not(.header-avatar) {
        display: none;
    }

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

/* Small mobile — 575px */
@media (max-width: 575.98px) {
    .stat-card .stat-value {
        font-size: 1.35rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.125rem;
    }

    .auth-body,
    .auth-header {
        padding: 1.5rem;
    }

    .public-cert-body,
    .public-cert-header {
        padding: 1.5rem;
    }

    .profile-header {
        padding: 1.5rem;
    }

    .btt-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .btt-pagination .d-flex {
        justify-content: center;
    }

    .filter-bar .row > [class*='col-'] {
        margin-bottom: 0.25rem;
    }

    .btn-btt-primary,
    .btn-btt-outline {
        padding: 0.45rem 1rem;
        font-size: 0.8125rem;
    }
}

/* ==========================================================================
   24. Dashboard Page (scoped — admin dashboard only)
   ========================================================================== */

.dashboard-page {
    --dash-gap: 1.25rem;
    --dash-gap-lg: 1.5rem;
    --dash-radius: var(--btt-radius);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}

.dashboard-page * {
    box-sizing: border-box;
}

.dashboard-section {
    margin-bottom: var(--dash-gap-lg);
}

.dashboard-section--last {
    margin-bottom: 0;
}

.dashboard-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.dashboard-section-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--btt-primary-dark);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-section-title i {
    color: var(--btt-accent);
    font-size: 0.9rem;
}

/* Welcome */
.dashboard-page .dashboard-welcome {
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.08) 0%, rgba(37, 99, 235, 0.04) 55%, #fff 100%);
    border: 1px solid var(--btt-border);
    border-radius: var(--dash-radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: var(--dash-gap-lg);
    box-shadow: var(--btt-shadow-xs);
}

.dashboard-welcome-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--btt-accent);
}

.dashboard-welcome-title {
    margin: 0;
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    font-weight: 700;
    color: var(--btt-primary-dark);
    line-height: 1.3;
    max-width: 100%;
}

.dashboard-welcome-sub {
    margin: 0.35rem 0 0;
    color: var(--btt-gray-600);
    font-size: 0.9rem;
    line-height: 1.5;
}

.dashboard-date-card {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: var(--btt-white);
    border: 1px solid var(--btt-gray-200);
    border-radius: var(--btt-radius-sm);
    box-shadow: var(--btt-shadow-xs);
    white-space: nowrap;
}

.dashboard-date-card > i {
    width: 36px;
    height: 36px;
    border-radius: var(--btt-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 71, 161, 0.1);
    color: var(--btt-primary);
    flex-shrink: 0;
}

.dashboard-date-day {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--btt-primary-dark);
    line-height: 1.2;
}

.dashboard-date-full {
    font-size: 0.75rem;
    color: var(--btt-gray-500);
    margin-top: 0.1rem;
}

/* KPI grid — adaptive, no fixed widths, no overlap */
.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: stretch;
}

.dashboard-kpi {
    background: var(--btt-white);
    border: 1px solid var(--btt-border);
    border-radius: var(--dash-radius);
    box-shadow: var(--btt-shadow);
    padding: 1.1rem 1.15rem;
    min-width: 0;
    min-height: 118px;
    height: 100%;
    transition: transform var(--btt-transition), box-shadow var(--btt-transition);
    overflow: hidden;
}

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

.dashboard-kpi-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    height: 100%;
}

.dashboard-kpi-label {
    color: var(--btt-gray-500);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    margin-bottom: 0.35rem;
    line-height: 1.3;
    word-break: break-word;
}

.dashboard-kpi-value {
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    font-weight: 700;
    color: var(--btt-primary-dark);
    line-height: 1.25;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-variant-numeric: tabular-nums;
}

.dashboard-kpi--compact .dashboard-kpi-value {
    font-size: clamp(0.95rem, 1.6vw, 1.25rem);
}

.dashboard-kpi-desc {
    color: var(--btt-gray-400);
    font-size: 0.72rem;
    margin-top: 0.35rem;
    line-height: 1.35;
}

.dashboard-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--btt-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.dashboard-page .tone-primary { background: rgba(13, 71, 161, 0.1); color: var(--btt-primary); }
.dashboard-page .tone-success { background: var(--btt-success-soft); color: var(--btt-success); }
.dashboard-page .tone-warning { background: var(--btt-warning-soft); color: var(--btt-warning); }
.dashboard-page .tone-danger { background: var(--btt-danger-soft); color: var(--btt-danger); }
.dashboard-page .tone-info { background: var(--btt-info-soft); color: var(--btt-info); }
.dashboard-page .tone-secondary { background: var(--btt-secondary-soft); color: var(--btt-secondary); }
.dashboard-page .tone-purple { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.dashboard-page .tone-cyan { background: rgba(8, 145, 178, 0.12); color: #0891b2; }
.dashboard-page .tone-orange { background: rgba(234, 88, 12, 0.12); color: #ea580c; }
.dashboard-page .tone-indigo { background: rgba(79, 70, 229, 0.12); color: #4f46e5; }
.dashboard-page .tone-sky { background: rgba(2, 132, 199, 0.12); color: #0284c7; }

.dashboard-page .tone-text-danger { color: var(--btt-danger); }
.dashboard-page .tone-text-warning { color: var(--btt-warning); }
.dashboard-page .tone-text-info { color: var(--btt-info); }
.dashboard-page .tone-text-primary { color: var(--btt-primary); }
.dashboard-page .tone-text-secondary { color: var(--btt-secondary); }

/* Quick actions */
.dashboard-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.dashboard-quick-btn {
    flex: 1 1 auto;
    min-width: min(100%, 160px);
    justify-content: center;
}

.dashboard-quick-btn .btn-label,
.dashboard-page .btn .btn-label {
    margin-left: 0;
}

.dashboard-page .btn-sm.btn-btt-outline {
    gap: 0.35rem;
}

/* Split: charts + alerts */
.dashboard-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--dash-gap);
    align-items: stretch;
}

.dashboard-split-main,
.dashboard-split-side {
    min-width: 0;
}

.dashboard-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.dashboard-panel > .card-panel-body {
    flex: 1;
    min-width: 0;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.dashboard-chart-block {
    min-width: 0;
}

.dashboard-page .dashboard-chart {
    height: 240px;
    max-width: 100%;
    overflow: hidden;
}

.dashboard-alerts {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dashboard-alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--btt-gray-100);
    min-width: 0;
}

.dashboard-alert-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dashboard-alert-item:first-child {
    padding-top: 0;
}

.dashboard-alert-label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.875rem;
    color: var(--btt-gray-700);
    min-width: 0;
    line-height: 1.35;
}

.dashboard-alert-label i {
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

.dashboard-alert-item .badge-status {
    flex-shrink: 0;
}

/* Dual panels (tables / activity) */
.dashboard-dual {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--dash-gap);
    align-items: stretch;
}

.dashboard-table-wrap {
    max-width: 100%;
}

.dashboard-page .table-btt td,
.dashboard-page .table-btt th {
    vertical-align: middle;
}

.dashboard-activity-feed {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    max-height: 360px;
    overflow-y: auto;
}

.dashboard-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.8rem 1.15rem;
    border-bottom: 1px solid var(--btt-gray-100);
    min-width: 0;
}

.dashboard-activity-item:last-child {
    border-bottom: none;
}

.dashboard-activity-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--btt-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(13, 71, 161, 0.1);
    color: var(--btt-primary);
    font-size: 0.8rem;
}

.dashboard-activity-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--btt-gray-800);
    line-height: 1.35;
}

.dashboard-activity-meta {
    font-size: 0.72rem;
    color: var(--btt-gray-500);
    margin-top: 0.15rem;
}

/* Breakpoints — tablet+ */
@media (min-width: 576px) {
    .dashboard-kpi-grid {
        gap: 1rem;
    }

    .dashboard-charts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-page .dashboard-chart {
        height: 260px;
    }
}

@media (min-width: 992px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dashboard-split {
        grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    }

    .dashboard-dual {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-page .dashboard-chart {
        height: 280px;
    }
}

@media (min-width: 1200px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1400px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.1rem;
    }

    .dashboard-page .dashboard-welcome {
        padding: 1.5rem 1.75rem;
    }

    .dashboard-page .dashboard-chart {
        height: 300px;
    }
}

@media (min-width: 1920px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

/* Mobile refinements */
@media (max-width: 575.98px) {
    .dashboard-page .dashboard-welcome {
        padding: 1rem 1.1rem;
    }

    .dashboard-date-card {
        width: 100%;
    }

    .dashboard-kpi {
        min-height: 108px;
        padding: 0.95rem;
    }

    .dashboard-kpi-icon {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }

    .dashboard-quick-btn {
        min-width: 100%;
        width: 100%;
    }

    .dashboard-page .dashboard-chart {
        height: 220px;
    }

    .dashboard-page .card-panel-header {
        gap: 0.65rem;
    }

    .dashboard-page .card-panel-header .btn {
        width: auto;
    }
}

@media (max-width: 359.98px) {
    .dashboard-kpi-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ==========================================================================
   25. Reports Module
   ========================================================================== */

.reports-page,
.reports-hub {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.reports-card {
    transition: transform var(--btt-transition), box-shadow var(--btt-transition);
}

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

.reports-filter-bar {
    margin-bottom: 1rem;
}

.reports-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.reports-table-wrap {
    max-width: 100%;
}

.reports-summary-row td {
    background: rgba(13, 71, 161, 0.06);
    border-top: 2px solid var(--btt-gray-200);
}

.reports-page .btt-page-size {
    display: none;
}

.btn-export-excel,
.btn-btt-success.btn-export-excel {
    background: #059669;
    border-color: transparent;
    color: #fff;
}

.btn-export-excel:hover,
.btn-export-excel:focus {
    background: #047857;
    color: #fff;
}

@media (max-width: 575.98px) {
    .reports-page .page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .reports-page .page-toolbar .btn {
        width: 100%;
        justify-content: center;
    }
}


