/* ==========================================
   CHURCH-OPS AFRICA PREMIUM DESIGN SYSTEM
   ========================================== */

:root {
    /* Color Palette - HSL Values for flexibility */
    --font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: var(--font-family);
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 0.95rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-page: 1.8rem;
    
    /* Theme Tokens (Light Mode Defaults) */
    --bg-primary: hsl(245, 45%, 98%);
    --bg-secondary: hsl(0, 0%, 100%);
    --bg-tertiary: hsl(245, 30%, 94%);
    --border-color: hsl(245, 20%, 90%);
    
    --text-primary: hsl(245, 60%, 16%);
    --text-secondary: hsl(245, 25%, 45%);
    --text-muted: hsl(245, 15%, 65%);
    
    --primary: hsl(255, 65%, 60%);
    --primary-hover: hsl(255, 65%, 52%);
    --primary-light: hsl(255, 65%, 95%);
    --primary-glow: hsla(255, 65%, 60%, 0.15);
    
    --secondary: hsl(175, 75%, 42%);
    --secondary-hover: hsl(175, 75%, 35%);
    --secondary-light: hsl(175, 75%, 94%);
    
    --success: hsl(142, 70%, 42%);
    --success-light: hsl(142, 70%, 94%);
    --warning: hsl(38, 92%, 50%);
    --warning-light: hsl(38, 92%, 94%);
    --danger: hsl(350, 80%, 58%);
    --danger-light: hsl(350, 80%, 95%);
    
    /* System Values */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(45, 35, 66, 0.08);
    --shadow-lg: 0 16px 40px rgba(45, 35, 66, 0.12);
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    --sidebar-width: 260px;
    --mobile-nav-height: 64px;

    /* Admin experience primitives */
    --bg-card: var(--bg-secondary);
    --surface-page: var(--bg-primary);
    --surface-card: var(--bg-secondary);
    --surface-muted: var(--bg-tertiary);
    --surface-raised: color-mix(in srgb, var(--bg-secondary) 94%, white);
    --surface-overlay: color-mix(in srgb, var(--bg-secondary) 88%, transparent);
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --radius-xs: 8px;
    --radius-xl: 24px;
    --shadow-card: 0 10px 30px -18px rgba(15, 23, 42, 0.16), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-hover: 0 22px 46px -24px rgba(15, 23, 42, 0.26), 0 8px 18px -16px var(--primary-glow);
    --shadow-modal: 0 30px 80px -28px rgba(15, 23, 42, 0.48);
    --shadow-dropdown: 0 18px 48px -24px rgba(15, 23, 42, 0.38);
    --control-height: 44px;
    --content-readable: 760px;
    --admin-page-gap: 24px;
}

/* Dark Mode Theme Tokens override */
[data-theme="dark"] {
    --bg-primary: hsl(245, 45%, 8%);
    --bg-secondary: hsl(245, 40%, 12%);
    --bg-tertiary: hsl(245, 35%, 15%);
    --border-color: hsl(245, 30%, 20%);
    
    --text-primary: hsl(245, 30%, 95%);
    --text-secondary: hsl(245, 20%, 75%);
    --text-muted: hsl(245, 15%, 50%);
    
    --primary-light: hsl(255, 40%, 20%);
    --secondary-light: hsl(175, 40%, 18%);
    --success-light: hsl(142, 40%, 18%);
    --warning-light: hsl(38, 40%, 18%);
    --danger-light: hsl(350, 40%, 20%);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
    --surface-raised: color-mix(in srgb, var(--bg-secondary) 94%, white 3%);
    --surface-overlay: color-mix(in srgb, var(--bg-secondary) 88%, transparent);
    --shadow-card: 0 16px 36px -20px rgba(0, 0, 0, 0.72), 0 1px 1px rgba(255, 255, 255, 0.03);
    --shadow-hover: 0 24px 54px -24px rgba(0, 0, 0, 0.82), 0 8px 22px -18px var(--primary-glow);
    --shadow-modal: 0 34px 90px -24px rgba(0, 0, 0, 0.9);
    --shadow-dropdown: 0 22px 54px -24px rgba(0, 0, 0, 0.88);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

button,
input,
select,
textarea {
    font: inherit;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    color: var(--text-primary);
}

p {
    line-height: 1.6;
}

small {
    line-height: 1.4;
}

strong {
    font-weight: 700;
}

code,
kbd,
pre {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

body,
button,
input,
select,
textarea,
span,
small,
label,
.badge,
.btn,
.table th,
.form-label,
.nav-item a,
.sidebar-section-label,
.bottom-nav-item,
.page-title,
.page-subtitle,
.card-title,
.card-subtitle {
    letter-spacing: 0 !important;
}

body * {
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* ==========================================
   CHURCH ADMIN EXPERIENCE COMPONENTS
   ========================================== */

.co-page {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: var(--admin-page-gap);
}

.co-page > * {
    min-width: 0;
}

.co-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-5);
    width: 100%;
}

.co-page-header__copy {
    min-width: 0;
}

.co-page-kicker {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border-color));
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--primary) 9%, var(--surface-card));
    color: var(--primary);
    font-size: var(--font-size-xs);
    font-weight: 800;
}

.co-page-kicker i,
.co-page-kicker svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.2;
}

.co-page-title {
    margin: var(--space-3) 0 0;
    font-size: clamp(1.65rem, 2.5vw, 2.25rem);
    line-height: 1.08;
    font-weight: 850;
    text-wrap: balance;
}

.co-page-description {
    max-width: var(--content-readable);
    margin-top: var(--space-2);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

.co-page-description p {
    margin: 0;
}

.co-page-actions,
.co-card__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.co-page-actions .btn,
.co-card__actions .btn {
    min-height: var(--control-height);
}

.co-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: var(--space-4);
    width: 100%;
}

.co-kpi-card {
    --co-kpi-accent: var(--primary);
    position: relative;
    display: grid;
    align-content: start;
    min-width: 0;
    min-height: 154px;
    gap: var(--space-2);
    padding: 20px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--co-kpi-accent) 14%, var(--border-color));
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--co-kpi-accent) 10%, transparent), transparent 42%),
        var(--surface-card);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.co-kpi-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--co-kpi-accent), color-mix(in srgb, var(--co-kpi-accent) 38%, var(--secondary)));
}

.co-kpi-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--co-kpi-accent) 30%, var(--border-color));
    box-shadow: var(--shadow-hover);
}

.co-kpi-card--secondary { --co-kpi-accent: var(--secondary); }
.co-kpi-card--success { --co-kpi-accent: var(--success); }
.co-kpi-card--warning { --co-kpi-accent: var(--warning); }
.co-kpi-card--danger { --co-kpi-accent: var(--danger); }
.co-kpi-card--info { --co-kpi-accent: hsl(215, 80%, 55%); }

.co-kpi-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.co-kpi-card__icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--co-kpi-accent) 11%, var(--surface-card));
    color: var(--co-kpi-accent);
}

.co-kpi-card__icon i,
.co-kpi-card__icon svg {
    width: 20px;
    height: 20px;
}

.co-kpi-card__aside {
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 750;
}

.co-kpi-card__label {
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 750;
}

.co-kpi-card__value {
    color: var(--text-primary);
    font-size: clamp(1.55rem, 2.5vw, 2rem);
    line-height: 1;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.co-kpi-card__description {
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    line-height: 1.45;
}

.co-card {
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-card);
}

.co-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 20px 22px;
    border-bottom: 1px solid var(--border-color);
}

.co-card__title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 800;
}

.co-card__description {
    max-width: var(--content-readable);
    margin: var(--space-1) 0 0;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.co-card__body {
    padding: 22px;
}

.co-empty-state {
    display: grid;
    justify-items: center;
    gap: var(--space-2);
    padding: clamp(24px, 5vw, 44px) 20px;
    border: 1px dashed color-mix(in srgb, var(--primary) 18%, var(--border-color));
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--primary) 3%, var(--surface-muted));
    text-align: center;
}

.co-empty-state__icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--primary) 10%, var(--surface-card));
    color: var(--primary);
}

.co-empty-state__icon i,
.co-empty-state__icon svg {
    width: 22px;
    height: 22px;
}

.co-empty-state__title {
    font-size: var(--font-size-md);
}

.co-empty-state__description {
    max-width: 480px;
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.co-empty-state__actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.co-action-bar,
.co-filter-bar,
.co-table-shell__toolbar,
.co-table-shell__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.co-action-bar {
    min-height: 64px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-card);
}

.co-action-bar__label {
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 800;
}

.co-action-bar__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.co-filter-bar {
    padding: var(--space-3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
}

.co-filter-bar :is(input, select, button, .btn) {
    min-height: var(--control-height);
}

.co-status-badge {
    --co-status-color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid color-mix(in srgb, var(--co-status-color) 22%, var(--border-color));
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--co-status-color) 9%, var(--surface-card));
    color: var(--co-status-color);
    font-size: var(--font-size-xs);
    font-weight: 800;
}

.co-status-badge i,
.co-status-badge svg {
    width: 13px;
    height: 13px;
}

.co-status-badge--brand { --co-status-color: var(--primary); }
.co-status-badge--success { --co-status-color: var(--success); }
.co-status-badge--warning { --co-status-color: color-mix(in srgb, var(--warning) 80%, var(--text-primary)); }
.co-status-badge--danger { --co-status-color: var(--danger); }
.co-status-badge--info { --co-status-color: hsl(215, 72%, 48%); }

.co-form-section {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.co-form-section__heading {
    display: grid;
    width: 100%;
    gap: var(--space-1);
    margin: 0 0 var(--space-4);
    padding: 0 0 var(--space-3);
    border-bottom: 1px solid var(--border-color);
}

.co-form-section__title {
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    font-weight: 800;
}

.co-form-section__description {
    max-width: var(--content-readable);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.co-form-section__body {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-4);
}

.co-table-shell {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-card);
}

.co-table-shell__toolbar,
.co-table-shell__footer {
    padding: var(--space-3) var(--space-4);
}

.co-table-shell__toolbar {
    border-bottom: 1px solid var(--border-color);
}

.co-table-shell__footer {
    border-top: 1px solid var(--border-color);
}

.co-table-shell__viewport {
    width: 100%;
    overflow-x: auto;
}

.co-table-shell table {
    width: 100%;
}

.co-timeline {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.co-timeline > li {
    position: relative;
    min-width: 0;
    padding: 0 0 var(--space-5) 32px;
}

.co-timeline > li::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 7px;
    width: 11px;
    height: 11px;
    border: 3px solid var(--surface-card);
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 30%, var(--border-color));
}

.co-timeline > li::after {
    content: '';
    position: absolute;
    top: 18px;
    bottom: 0;
    left: 12px;
    width: 1px;
    background: var(--border-color);
}

.co-timeline > li:last-child {
    padding-bottom: 0;
}

.co-timeline > li:last-child::after {
    display: none;
}

.co-chart-shell {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-card);
}

.co-chart-shell__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.co-chart-shell__title,
.co-modal__title,
.co-drawer__title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 800;
}

.co-chart-shell__description,
.co-modal__description,
.co-drawer__description {
    max-width: var(--content-readable);
    margin: var(--space-1) 0 0;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.co-chart-shell__body {
    position: relative;
    min-width: 0;
}

.co-chart-shell__fallback {
    margin-top: var(--space-4);
}

.co-modal__content {
    box-shadow: var(--shadow-modal);
}

.co-modal__body {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.co-modal__content--small { max-width: 440px; }
.co-modal__content--medium { max-width: 680px; }
.co-modal__content--large { max-width: 960px; }
.co-modal__content--fullscreen {
    width: calc(100vw - 32px);
    max-width: none;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: none;
}

.co-modal__header,
.co-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
}

.co-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 1200;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(440px, 100vw);
    border-left: 1px solid var(--border-color);
    background: var(--surface-card);
    box-shadow: var(--shadow-modal);
}

.co-drawer[hidden] {
    display: none;
}

.co-drawer__header,
.co-drawer__body,
.co-drawer__footer {
    padding: 20px;
}

.co-drawer__body {
    overflow-y: auto;
}

.co-drawer__footer {
    border-top: 1px solid var(--border-color);
}

.co-admin-shell :is(button, a, input, select, textarea):focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--focus-ring);
}

@media (max-width: 768px) {
    :root {
        --admin-page-gap: 18px;
    }

    .co-page-header {
        display: grid;
        gap: var(--space-4);
    }

    .co-page-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .co-page-actions .btn {
        flex: 1 1 150px;
        justify-content: center;
    }

    .co-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-3);
    }

    .co-kpi-card {
        min-height: 145px;
        padding: 16px;
    }

    .co-kpi-card:hover {
        transform: none;
    }

    .co-card__header {
        display: grid;
        padding: 18px;
    }

    .co-card__actions {
        justify-content: flex-start;
    }

    .co-card__body {
        padding: 18px;
    }

    .co-action-bar,
    .co-filter-bar,
    .co-table-shell__toolbar,
    .co-table-shell__footer,
    .co-chart-shell__header {
        align-items: stretch;
    }

    .co-action-bar__actions,
    .co-chart-shell__actions {
        width: 100%;
    }

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

    .co-modal__content--fullscreen {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }
}

@media (max-width: 380px) {
    .co-kpi-grid {
        grid-template-columns: 1fr;
    }
}

span,
small,
label,
.badge,
.form-label,
.table th,
.sidebar-section-label {
    text-transform: none !important;
}
a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--primary-hover);
}

/* ==========================================
   LAYOUT STRUCTURES
   ========================================== */

/* Main Responsive Application Shell */
.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Desktop Sidebar Dashboard */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0 8px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.brand-name {
    font-weight: 800;
    font-size: 1.15rem;
    background: linear-gradient(to right, var(--text-primary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Sidebar Menu Navigation */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    line-height: 1.25;
    transition: all var(--transition-fast);
}

.nav-item a svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: stroke var(--transition-fast);
}

.nav-item.active a, .nav-item a:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Main Dashboard Panel */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    max-width: calc(100% - var(--sidebar-width));
    transition: margin-left var(--transition-normal), max-width var(--transition-normal);
}

/* Mobile Top Bar (Hidden on Desktop) */
.mobile-top-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 90;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    height: 60px;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

/* Mobile bottom navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 700;
    line-height: 1.15;
    transition: color var(--transition-fast);
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

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

/* ==========================================
   BUTTONS AND INTERACTIVE COMPONENTS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: var(--font-size-md);
    line-height: 1.2;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

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

.btn-success {
    background-color: var(--success);
    color: white;
}
.btn-success:hover {
    background-color: hsl(142, 70%, 35%);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}
.btn-danger:hover {
    background-color: hsl(350, 80%, 50%);
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}

.btn:active {
    transform: translateY(0);
}

/* ==========================================
   CARDS AND VISUAL SHEETS (Glassmorphic touches)
   ========================================== */

.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}

.page-title {
    font-size: var(--font-size-page);
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
    margin: 0;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-md);
    line-height: 1.55;
    margin-top: 6px;
    max-width: 70ch;
}

.eyebrow,
.section-kicker {
    color: var(--primary);
    font-size: var(--font-size-xs);
    font-weight: 800;
    text-transform: none;
}

.metric-label,
.muted-label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1.35;
}

.tabular-number {
    font-variant-numeric: tabular-nums;
}

/* ==========================================
   METRIC STATUS BADGES
   ========================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
}

.badge-primary { background-color: var(--primary-light); color: var(--primary); }
.badge-secondary { background-color: var(--secondary-light); color: var(--secondary); }
.badge-success { background-color: var(--success-light); color: var(--success); }
.badge-warning { background-color: var(--warning-light); color: var(--warning); }
.badge-danger { background-color: var(--danger-light); color: var(--danger); }

/* ==========================================
   DATA TABLES AND AMOUNT ALIGNMENTS
   ========================================== */

.table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
}

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

.table th, .table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: var(--font-size-sm);
    text-transform: none;
}

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

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: var(--bg-primary);
}

/* Right-align numeric financial data */
.amount-column {
    text-align: right;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ==========================================
   FORMS AND INPUTS
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    line-height: 1.35;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    line-height: 1.35;
    transition: all var(--transition-fast);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

/* ==========================================
   MODAL WINDOW BEHAVIOR (Standard Forms popups)
   ========================================== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 10, 25, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    padding: clamp(10px, 2.5vh, 28px);
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
    display: flex !important;
}

body.modal-open {
    overflow: hidden !important;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: min(100%, calc(100vw - clamp(20px, 5vw, 56px)));
    max-width: min(600px, calc(100vw - clamp(20px, 5vw, 56px)));
    max-height: calc(100vh - clamp(20px, 5vh, 56px)) !important;
    max-height: calc(100dvh - clamp(20px, 5vh, 56px)) !important;
    padding: clamp(18px, 3vw, 32px);
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-content > form,
.co-modal__content > form {
    min-height: 0;
}

.modal-content > form {
    display: block;
    flex: 0 0 auto;
    overflow: visible;
    padding-bottom: clamp(14px, 3vh, 32px);
}

.modal-content > form > :last-child {
    position: sticky;
    bottom: calc(-1 * clamp(18px, 3vw, 32px));
    z-index: 2;
    flex-shrink: 0;
    background: linear-gradient(180deg, transparent 0%, var(--bg-secondary) 22%, var(--bg-secondary) 100%);
    padding-top: 16px;
    padding-bottom: clamp(18px, 3vw, 32px);
    margin-bottom: calc(-1 * clamp(18px, 3vw, 32px));
}

.modal-content--fixed-actions {
    height: calc(100vh - clamp(20px, 5vh, 56px));
    height: calc(100dvh - clamp(20px, 5vh, 56px));
    overflow: hidden !important;
}

.modal-content--fixed-actions > .modal-header {
    flex: 0 0 auto;
}

.modal-form-shell {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding-bottom: 0 !important;
}

.modal-form-shell > .modal-scroll-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
}

.modal-form-shell > .modal-action-bar {
    position: static !important;
    bottom: auto !important;
    z-index: 4;
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 12px;
    margin: 18px calc(-1 * clamp(18px, 3vw, 32px)) calc(-1 * clamp(18px, 3vw, 32px));
    padding: 16px clamp(18px, 3vw, 32px) clamp(18px, 3vw, 32px);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.modal-backdrop.open .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 24px;
    position: sticky;
    top: calc(-1 * clamp(18px, 3vw, 32px));
    z-index: 3;
    background: var(--bg-secondary);
    padding-top: clamp(18px, 3vw, 32px);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   PAGE DASHBOARD SPECIFIC PARTS
   ========================================== */

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    stroke-width: 2;
}

.stat-number {
    font-size: var(--font-size-page);
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

/* Bilingual Language Toggles */
.language-selector {
    display: flex;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.lang-btn {
    border: none;
    background: none;
    padding: 4px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
}

.lang-btn.active {
    background-color: var(--bg-secondary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ==========================================
   RESPONSIVE DESIGN (Adaptive styling)
   ========================================== */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }
}

@media (max-width: 768px) {
    :root {
        --mobile-nav-height: 76px;
        --font-size-page: 1.42rem;
    }

    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 24px 16px calc(var(--mobile-nav-height) + 16px);
    }
    
    .mobile-top-bar {
        display: flex;
    }
    
    .mobile-bottom-nav {
        display: flex;
        height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
        align-items: flex-start;
        justify-content: space-between;
        gap: 4px;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        box-shadow: 0 -16px 42px rgba(15, 10, 25, 0.14);
    }

    .bottom-nav-item {
        flex: 1 1 0;
        min-width: 0;
        height: 56px;
        justify-content: center;
        border-radius: 16px;
        gap: 3px;
        font-size: 0.68rem;
        color: var(--text-muted);
    }

    .bottom-nav-item svg {
        width: 21px;
        height: 21px;
    }

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

    .btn {
        min-height: 44px;
        padding: 11px 16px;
        border-radius: 12px;
        font-size: 0.9rem;
        white-space: normal;
        text-align: center;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    .page-header-premium {
        padding: 18px !important;
        margin-bottom: 18px;
        border-radius: 18px;
        align-items: stretch;
        gap: 14px;
    }

    .page-header-premium > * {
        min-width: 0;
    }

    .page-header-premium > .btn,
    .page-header-premium > div:last-child .btn {
        width: 100%;
    }

    .page-title {
        font-size: 1.42rem;
        line-height: 1.18;
        overflow-wrap: anywhere;
    }

    .page-subtitle {
        font-size: 0.88rem;
        line-height: 1.45;
    }

    .card,
    .card-premium {
        border-radius: 18px;
        padding: 18px !important;
    }

    .card:hover,
    .card-premium:hover,
    .table-premium tbody tr:hover {
        transform: none;
    }

    .card-header {
        align-items: flex-start;
        gap: 12px;
        flex-wrap: wrap;
        margin-bottom: 16px;
    }

    .dashboard-stats-grid,
    .stat-bar,
    .fin-stat-grid,
    .info-grid,
    .summary-grid,
    .reports-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        margin-bottom: 18px !important;
    }

    .stat-pill,
    .fin-stat,
    .summary-chip,
    .info-card {
        border-radius: 16px !important;
        padding: 16px !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-control {
        min-height: 46px;
        border-radius: 12px;
        padding: 12px 14px;
    }

    textarea.form-control {
        min-height: 96px;
    }

    .filter-row {
        align-items: stretch;
        padding: 14px !important;
        border-radius: 18px !important;
    }

    .search-box,
    .filter-select {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        min-height: 46px;
        width: 100%;
    }

    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        margin: 0 -2px 18px;
        padding: 0 2px 8px;
    }

    .nav-tab {
        flex: 0 0 auto;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    .table-container {
        border-radius: 16px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: var(--shadow-sm);
    }

    .table {
        min-width: 680px;
    }

    .table th,
    .table td {
        padding: 12px 14px;
        white-space: nowrap;
        vertical-align: middle;
    }
    
    /* Make Modals look like slide-up bottom sheets on mobile */
    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
        overflow-y: hidden !important;
        overscroll-behavior: contain;
    }

    .modal-content {
        max-width: 100%;
        max-height: calc(100vh - 10px) !important;
        max-height: calc(100dvh - 10px) !important;
        overflow-y: auto !important;
        padding: 22px 18px calc(22px + env(safe-area-inset-bottom)) !important;
        margin-top: auto;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        transition: transform var(--transition-slow);
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .modal-content > form {
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
    }

    .modal-content > form > :last-child {
        bottom: calc(-1 * (22px + env(safe-area-inset-bottom)));
        background: linear-gradient(180deg, transparent 0%, var(--bg-secondary) 26%, var(--bg-secondary) 100%);
        padding-bottom: calc(22px + env(safe-area-inset-bottom));
        margin-bottom: calc(-1 * (22px + env(safe-area-inset-bottom)));
    }

    .modal-content--fixed-actions {
        height: calc(100vh - 10px);
        height: calc(100dvh - 10px);
    }

    .modal-form-shell > .modal-scroll-body {
        padding-right: 0;
    }

    .modal-form-shell > .modal-action-bar {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 10px;
        margin: 16px -18px calc(-1 * (22px + env(safe-area-inset-bottom)));
        padding: 14px 18px calc(22px + env(safe-area-inset-bottom));
    }

    .modal-form-shell > .modal-action-bar .btn {
        width: 100%;
    }

    .modal-header {
        position: sticky;
        top: -22px;
        z-index: 1;
        background: var(--bg-secondary);
        margin: -22px -18px 18px;
        padding: 18px;
        border-bottom: 1px solid var(--border-color);
    }

    .modal-header h3 {
        font-size: 1.18rem !important;
        line-height: 1.2;
    }

    .close-btn {
        min-width: 40px;
        min-height: 40px;
        border-radius: 12px;
        background: var(--bg-primary);
    }

    .modal-content [style*="justify-content: flex-end"] {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 10px !important;
    }

    .modal-content [style*="justify-content: flex-end"] .btn {
        width: 100%;
    }
    
    .modal-backdrop.open .modal-content {
        transform: translateY(0);
    }

    .empty-state-premium {
        padding: 30px 18px;
        margin: 22px auto;
        border-radius: 18px;
    }

    .fab {
        right: 18px;
        bottom: calc(var(--mobile-nav-height) + 18px + env(safe-area-inset-bottom)) !important;
        width: 56px;
        height: 56px;
    }

    /* Mobile admin hardening: prevent page-local styles from forcing horizontal scroll. */
    #churchAdminPageContent,
    .tower-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    #churchAdminPageContent :where(*),
    .tower-content :where(*) {
        min-width: 0;
    }

    #churchAdminPageContent :where(.card, .card-premium, .modal-content, [class*="card"], [class*="panel"], [class*="sheet"], [class*="section"], [class*="item"], [class*="row"]),
    .tower-content :where(.card, .card-premium, .modal-content, [class*="card"], [class*="panel"], [class*="sheet"], [class*="section"], [class*="item"], [class*="row"]) {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    #churchAdminPageContent :where(.page-header-premium, .card-header, .modal-header, .filter-row, .filter-actions, .header-actions, .page-actions, .card-actions, .bulk-actions, .toolbar, .action-row, [class*="actions"], [class*="toolbar"], [style*="display:flex"], [style*="display: flex"]),
    .tower-content :where(.tower-header, .section-heading, .card-header, .modal-header, .filter-row, .filter-actions, .header-actions, .page-actions, .card-actions, .bulk-actions, .toolbar, .action-row, [class*="actions"], [class*="toolbar"], [style*="display:flex"], [style*="display: flex"]) {
        flex-wrap: wrap !important;
        align-items: stretch;
        max-width: 100%;
    }

    #churchAdminPageContent :where([class$="-grid"], [class*="-grid "], [class*="_grid"], [style*="grid-template-columns"]),
    .tower-content :where([class$="-grid"], [class*="-grid "], [class*="_grid"], [style*="grid-template-columns"]) {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)) !important;
    }

    #churchAdminPageContent :where(.table-container, .table-responsive, .responsive-table, [class*="table-wrap"], [class*="table-container"]),
    .tower-content :where(.table-container, .table-responsive, .responsive-table, [class*="table-wrap"], [class*="table-container"]) {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #churchAdminPageContent :where(table),
    .tower-content :where(table) {
        width: max-content;
        min-width: 100%;
    }

    #churchAdminPageContent :where(.btn, button, input[type="button"], input[type="submit"], input[type="reset"]),
    .tower-content :where(.btn, button, input[type="button"], input[type="submit"], input[type="reset"]) {
        max-width: 100%;
        min-width: 0;
        white-space: normal;
    }

    #churchAdminPageContent :where(input, select, textarea, pre, code),
    .tower-content :where(input, select, textarea, pre, code) {
        max-width: 100%;
    }

    #churchAdminPageContent :where(pre, code),
    .tower-content :where(pre, code) {
        overflow-x: auto;
        white-space: pre-wrap;
        word-break: break-word;
    }

    #churchAdminPageContent :where(img, svg, canvas, video, iframe),
    .tower-content :where(img, svg, canvas, video, iframe) {
        max-width: 100%;
    }
}

@media (max-width: 520px) {
    #churchAdminPageContent :where([class$="-grid"], [class*="-grid "], [class*="_grid"], [style*="grid-template-columns"]),
    .tower-content :where([class$="-grid"], [class*="-grid "], [class*="_grid"], [style*="grid-template-columns"]) {
        grid-template-columns: 1fr !important;
    }

    #churchAdminPageContent :where(.page-header-premium, .card-header, .filter-actions, .header-actions, .page-actions, .card-actions, .bulk-actions, [class*="actions"]) .btn,
    .tower-content :where(.tower-header, .card-header, .filter-actions, .header-actions, .page-actions, .card-actions, .bulk-actions, [class*="actions"]) .btn {
        width: 100%;
    }
}

/* ==========================================
   PREMIUM VISUAL UTILITIES & KEYFRAME ANIMATIONS
   ========================================== */

/* Fade-In-Up entrance animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Delay modifiers for staggered item list appearances */
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }

/* Premium visual card upgrades */
.card-premium {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-premium::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-premium:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: hsla(255, 65%, 60%, 0.25);
}

.card-premium:hover::before {
    opacity: 1;
}

/* Color specific gradient cards */
.card-accent-primary::before { background: var(--primary) !important; opacity: 1 !important; }
.card-accent-secondary::before { background: var(--secondary) !important; opacity: 1 !important; }
.card-accent-success::before { background: var(--success) !important; opacity: 1 !important; }
.card-accent-warning::before { background: var(--warning) !important; opacity: 1 !important; }
.card-accent-danger::before { background: var(--danger) !important; opacity: 1 !important; }

/* Premium tables with row transitions */
.table-premium tbody tr {
    transition: all var(--transition-fast) !important;
}

.table-premium tbody tr:hover {
    background-color: var(--primary-light) !important;
    transform: scale(1.001);
    box-shadow: inset 3px 0 0 0 var(--primary) !important;
}

/* Premium page header wrapper */
.page-header-premium {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page-header-premium::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* Premium empty state styling */
.empty-state-premium {
    padding: 48px 32px;
    text-align: center;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    max-width: 500px;
    margin: 40px auto;
    transition: all 0.3s ease;
}

.empty-state-premium:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.empty-state-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .page-header-premium {
        padding: 18px !important;
        margin-bottom: 18px;
        border-radius: 18px;
        align-items: stretch;
        gap: 14px;
    }

    .card,
    .card-premium,
    .empty-state-premium {
        border-radius: 18px;
    }

    .card-premium:hover,
    .table-premium tbody tr:hover,
    .empty-state-premium:hover {
        transform: none;
    }
}

/* ==========================================================================
   LARAVEL PAGINATION GIANT ARROWS AND STYLING OVERRIDES (Tailwind Override)
   ========================================================================== */
nav[role="navigation"] svg {
    width: 20px !important;
    height: 20px !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

nav[role="navigation"] .flex,
nav[role="navigation"] div[class*="flex"] {
    display: flex !important;
    align-items: center !important;
}

nav[role="navigation"] .justify-between {
    justify-content: space-between !important;
}

nav[role="navigation"] .hidden {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Base styles for pagination link elements and page number wrappers */
nav[role="navigation"] span.relative,
nav[role="navigation"] a.relative,
nav[role="navigation"] span[aria-current="page"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 14px !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border-color) !important;
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    min-width: 38px !important;
    height: 38px !important;
    box-sizing: border-box !important;
}

nav[role="navigation"] a.relative:hover {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

nav[role="navigation"] span[aria-current="page"] {
    background-color: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

nav[role="navigation"] .shadow-sm,
nav[role="navigation"] span.relative.z-0 {
    box-shadow: none !important;
    display: inline-flex !important;
    gap: 4px !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
}

nav[role="navigation"] p.text-sm {
    margin: 0 !important;
    font-size: 0.84rem !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
}

/* Ensure the page stats are separated cleanly */
nav[role="navigation"] > div:first-child {
    margin-right: 16px !important;
}
