/**
 * KiTAcc - Design System
 * Royal Purple Light-Mode Theme
 * Adapted from CoreFLAME Template
 */

/* ========================================
   CSS VARIABLES / DESIGN TOKENS
   ======================================== */
:root {
    /* Primary Colors - Royal Purple */
    --primary: #6C2BD9;
    --primary-light: #8B5CF6;
    --primary-dark: #5B21B6;
    --primary-rgb: 108, 43, 217;

    /* Secondary Colors - Soft Purple */
    --secondary: #A855F7;
    --secondary-light: #C084FC;
    --secondary-dark: #9333EA;
    --secondary-rgb: 168, 85, 247;

    /* Neutral Colors */
    --white: #FFFFFF;
    --gray-50: #F8F7FC;
    --gray-100: #F1F0F7;
    --gray-200: #E5E4EB;
    --gray-300: #D1D0DB;
    --gray-400: #9CA0AF;
    --gray-500: #6B6F80;
    --gray-600: #4B4F63;
    --gray-700: #374051;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Semantic Colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #3B82F6;
    --info-light: #DBEAFE;

    /* Sidebar - Royal Purple Gradient */
    --sidebar-bg: linear-gradient(180deg, #5B21B6 0%, #7C3AED 50%, #6C2BD9 100%);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(255, 255, 255, 0.18);
    --sidebar-text: rgba(255, 255, 255, 0.7);
    --sidebar-text-active: #FFFFFF;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --sidebar-border: rgba(255, 255, 255, 0.12);

    /* Header */
    --header-height: 64px;
    --header-bg: #FFFFFF;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(108, 43, 217, 0.04);
    --shadow: 0 1px 3px 0 rgba(108, 43, 217, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(108, 43, 217, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(108, 43, 217, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 20px 25px -5px rgba(108, 43, 217, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

    /* Bottom Nav */
    --bottom-nav-height: 64px;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-family);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--gray-700);
    background-color: var(--gray-50);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

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

.text-secondary {
    color: var(--secondary);
}

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

.text-warning {
    color: var(--warning);
}

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

.text-muted {
    color: var(--gray-500);
}

.bg-primary {
    background-color: var(--primary);
}

.bg-secondary {
    background-color: var(--secondary);
}

.bg-success {
    background-color: var(--success);
}

.bg-warning {
    background-color: var(--warning);
}

.bg-danger {
    background-color: var(--danger);
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.d-inline-flex {
    display: inline-flex !important;
}

.d-grid {
    display: grid !important;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

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

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.align-center {
    align-items: center;
}

.align-start {
    align-items: flex-start;
}

.align-end {
    align-items: flex-end;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-5 {
    gap: 1.25rem;
}

.gap-6 {
    gap: 1.5rem;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-5 {
    margin-top: 1.25rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-5 {
    margin-bottom: 1.25rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-5 {
    padding: 1.25rem;
}

.p-6 {
    padding: 1.5rem;
}

.rounded {
    border-radius: var(--radius);
}

.rounded-md {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-xl {
    border-radius: var(--radius-xl);
}

.rounded-full {
    border-radius: var(--radius-full);
}

.shadow {
    box-shadow: var(--shadow);
}

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

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.overflow-x-auto {
    overflow-x: auto;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   LAYOUT
   ======================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

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

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

.page-content {
    flex: 1;
    padding: 1.5rem;
    padding-top: 100px;
    position: relative;
    z-index: 1;
}

/* Page Header (greeting bar on dashboard etc.) */
.page-header {
    padding: 0.5rem 0;
    min-height: 48px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Grid System */
.grid {
    display: grid;
}

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

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

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ========================================
   SIDEBAR - Royal Purple Gradient
   ======================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: none;
    z-index: 1000;
    transition: width var(--transition-slow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(91, 33, 182, 0.15);
}

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

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: var(--header-height);
    min-height: var(--header-height);
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--white);
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--white);
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
    transition: opacity var(--transition-slow);
    color: var(--white);
    letter-spacing: 0.02em;
}

.sidebar-collapsed .sidebar-logo-text {
    opacity: 0;
    width: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-collapsed .nav-section-title {
    opacity: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0.125rem 0.5rem;
    color: var(--sidebar-text);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--white);
}

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

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

.nav-item {
    position: relative;
}

.nav-item i {
    width: 20px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-item-text {
    transition: opacity var(--transition-slow);
}

.sidebar-collapsed .nav-item-text {
    opacity: 0;
    width: 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* ========================================
   HEADER
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 900;
    transition: left var(--transition-slow);
}

.sidebar-collapsed .header {
    left: var(--sidebar-collapsed-width);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-50);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    background: var(--gray-50);
    transition: all var(--transition-fast);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: all var(--transition-fast);
    position: relative;
}

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

.header-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Avatar Initial */
.avatar-initial {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.avatar-initial.lg {
    width: 80px;
    height: 80px;
    font-size: 1.75rem;
}

.avatar-initial.xl {
    width: 100px;
    height: 100px;
    font-size: 2.25rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-user:hover {
    background: var(--gray-100);
}

.header-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.header-user-info {
    display: flex;
    flex-direction: column;
}

.header-user-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.875rem;
}

.header-user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 200px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1000;
}

.user-dropdown:hover .user-dropdown-menu,
.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    transition: all var(--transition-fast);
}

.user-dropdown-menu a:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.user-dropdown-menu a i {
    width: 16px;
    text-align: center;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.25rem 0;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

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

/* Stat Cards */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--primary-rgb), 0.1);
}

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

.stat-icon.primary {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.stat-icon.secondary {
    background: rgba(var(--secondary-rgb), 0.1);
    color: var(--secondary);
}

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

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

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

.stat-content {
    flex: 1;
    min-width: 0;
}

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

.stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.stat-change.up {
    color: var(--success);
}

.stat-change.down {
    color: var(--danger);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: var(--white);
    border-color: var(--secondary);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--secondary-dark), var(--secondary));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--secondary-rgb), 0.4);
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

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

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-outline:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

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

.btn-outline-primary:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border: none;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--primary);
}

.btn-icon {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    appearance: none;
}

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

.form-control.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

select.form-control {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

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

.form-help {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
}

.form-error {
    display: block;
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.375rem;
}

/* Input Group */
.input-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
}

.input-group-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    z-index: 1;
    pointer-events: none;
}

.input-group-icon-right {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    z-index: 1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.form-control.has-icon-left {
    padding-left: 2.5rem;
}

.form-control.has-icon-right {
    padding-right: 2.5rem;
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    appearance: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.form-check-input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-check-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
}

/* Toggle Switch (checkbox-based) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
    margin: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--white);
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--success);
}

.toggle-switch input:checked+.toggle-slider::after {
    transform: translateX(18px);
}

/* ========================================
   TABLE
   ======================================== */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

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

.table-actions {
    display: flex;
    gap: 0.25rem;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.badge-secondary {
    background: rgba(var(--secondary-rgb), 0.1);
    color: var(--secondary);
}

.badge-success {
    background: var(--success-light);
    color: #065F46;
}

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

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

.badge-info {
    background: var(--info-light);
    color: #1E40AF;
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.alert-success {
    background: var(--success-light);
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-danger {
    background: var(--danger-light);
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: var(--info-light);
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.alert-content {
    flex: 1;
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.95);
    transition: all var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-lg {
    max-width: 700px;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    gap: 0.25rem;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--gray-700);
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

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

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--info);
    min-width: 300px;
    max-width: 450px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
}

.toast-close:hover {
    color: var(--gray-600);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   SPINNER
   ======================================== */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 0.6s linear infinite;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* ========================================
   CHART CONTAINER
   ======================================== */
.chart-container {
    position: relative;
    height: 300px;
}

/* ========================================
   LOGIN PAGE
   ======================================== */
.login-page {
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, #C084FC 100%);
    padding: 1rem;
    overflow: hidden;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.login-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-400);
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-100);
}

.login-footer p {
    margin-bottom: 0.25rem;
}

/* ========================================
   PAGE FOOTER
   ======================================== */
.page-footer {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-100);
}

.page-footer p {
    margin-bottom: 0.25rem;
}

/* ========================================
   BOTTOM NAVIGATION (Mobile)
   ======================================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav-items {
    display: flex;
    height: 100%;
    align-items: stretch;
    list-style: none;
    padding: 0;
    margin: 0;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.625rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.bottom-nav-item i {
    font-size: 1.125rem;
    transition: all var(--transition-fast);
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 0 0 3px 3px;
}

.bottom-nav-item:hover {
    color: var(--primary);
}

/* ========================================
   MOBILE RESPONSIVE CARDS (for tables)
   ======================================== */
.mobile-card {
    display: none;
}

.mobile-card-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.mobile-card-label {
    color: var(--gray-500);
    font-weight: 500;
}

.mobile-card-value {
    color: var(--gray-800);
    font-weight: 500;
}

.mobile-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

/* ========================================
   AVATAR & UPLOAD ZONE
   ======================================== */
.avatar-upload {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.625rem;
}

.avatar-info p {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--gray-50);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.upload-zone i {
    font-size: 2.5rem;
    color: var(--gray-400);
    margin-bottom: 0.75rem;
}

.upload-zone p {
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.upload-zone .text-muted {
    font-size: 0.75rem;
}

.upload-preview {
    margin-top: 1rem;
    text-align: center;
}

.upload-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius);
    margin: 0 auto;
}

/* Upload Action Sheet (Mobile Camera/Gallery picker) */
.upload-action-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.upload-action-overlay.active {
    opacity: 1;
    visibility: visible;
}

.upload-action-sheet {
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 500px;
    padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.upload-action-overlay.active .upload-action-sheet {
    transform: translateY(0);
}

.upload-action-title {
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.upload-action-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 0.625rem;
    font-size: 1rem;
    color: var(--gray-800);
    font-weight: 500;
}

.upload-action-btn:hover,
.upload-action-btn:active {
    background: rgba(var(--primary-rgb), 0.06);
    border-color: var(--primary);
}

.upload-action-btn i {
    font-size: 1.375rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.upload-action-btn .fa-camera {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
}

.upload-action-btn .fa-images {
    background: linear-gradient(135deg, var(--success), #34D399);
    color: var(--white);
}

.upload-action-btn span {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.upload-action-btn .action-label {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--gray-800);
}

.upload-action-btn .action-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 400;
    margin-top: 0.125rem;
}

.upload-action-cancel {
    display: block;
    width: 100%;
    padding: 0.875rem;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.375rem;
    transition: all var(--transition-fast);
}

.upload-action-cancel:hover,
.upload-action-cancel:active {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* ========================================
   MOBILE OVERLAY
   ======================================== */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablet */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.mobile-open~.mobile-overlay {
        display: block;
    }

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

    .header {
        left: 0 !important;
    }

    .header-search {
        display: none;
    }

    .header-user-info {
        display: none;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .page-content {
        padding: 1rem;
        padding-top: 80px;
        padding-bottom: calc(var(--bottom-nav-height) + 1rem);
    }

    .bottom-nav {
        display: block;
    }

    .page-footer {
        padding-bottom: calc(var(--bottom-nav-height) + 1rem);
    }

    /* Hide desktop table, show cards */
    .table-responsive-cards .table-container {
        display: none;
    }

    .table-responsive-cards .mobile-card {
        display: block;
    }

    /* Stack grids */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr !important;
    }

    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    /* Modal full-screen on mobile */
    .modal-overlay {
        padding: 0.5rem;
    }

    .modal {
        max-width: 100%;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
        border-radius: var(--radius-lg);
        margin: 0;
    }

    .modal-header {
        padding: 1rem;
        flex-shrink: 0;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
    }

    /* Card adjustments */
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.875rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Header adjustments */
    .d-flex.justify-between.align-center.mb-6 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

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

    /* Login page on mobile */
    .login-card {
        padding: 1.5rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .sm\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    .toast {
        min-width: auto;
        max-width: calc(100vw - 2rem);
    }
}

/* Desktop sidebar hidden bottom nav */
@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
    }
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state i {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* ========================================
   CLAIM DETAILS & RECEIPT LINK
   ======================================== */
.claim-details .mobile-card-row {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--gray-100);
    align-items: center;
}

.claim-details .mobile-card-row:last-child {
    border-bottom: none;
}

.receipt-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.receipt-link:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary-dark);
}

.receipt-link i {
    font-size: 1rem;
}

.receipt-preview {
    max-width: 300px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.receipt-preview img {
    width: 100%;
    height: auto;
}

/* ========================================
   TAB NAVIGATION
   ======================================== */
.tabs {
    display: inline-flex;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    padding: 4px;
    gap: 4px;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border: none;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: transparent;
    position: relative;
}

.tab:hover {
    color: var(--gray-700);
    background: rgba(255, 255, 255, 0.5);
}

.tab.active {
    color: var(--white);
    background: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   ACCOUNTING MODE INDICATOR
   ======================================== */
.mode-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

.mode-indicator i {
    font-size: 0.625rem;
}

/* ========================================
   LOADING SKELETONS (P2)
   ======================================== */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius);
    min-height: 1rem;
}

.skeleton-card {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
    min-height: 120px;
    padding: 1.25rem;
}

.skeleton-text {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
    height: 0.875rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 40%;
}

.skeleton-text.medium {
    width: 65%;
}

.skeleton-text.long {
    width: 90%;
}

.skeleton-circle {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.skeleton-row:last-child {
    border-bottom: none;
}

/* Chart skeleton — shown until JS chart renders */
.chart-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem;
    z-index: 1;
    background: var(--white);
    border-radius: var(--radius-md);
}

.chart-skeleton .skeleton-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    height: 80%;
    border-bottom: none;
    padding: 0;
}
}