/* ============================================
   CHURCH PWA — ChurchMgr Manager Styles
   Churchy theme with wine red & gold accents
   Font: Inter (same as godsway-sackey)
   ============================================ */

/* CSS Variables */
:root {
    /* Brand Colors (overridable via settings) */
    --primary: #991B1B;
    --primary-dark: #7F1D1D;
    --primary-light: #FEF2F2;
    --secondary: #1e3a5f;
    --secondary-dark: #162d4a;
    --secondary-light: #e8f0fe;
    --accent: #B45309;
    --accent-dark: #92400e;
    --accent-light: #FEF3C7;

    /* Gold Liturgical Accent (legacy alias) */
    --gold: var(--accent);
    --gold-light: var(--accent-light);

    /* Semantic Colors */
    --success: #16A34A;
    --warning: #D97706;
    --danger: #DC2626;
    --info: #2563EB;

    /* Apple-style Neutral Greys (from godsway-sackey) */
    --slate-50: #F9FAFB;
    --slate-100: #F3F4F6;
    --slate-200: #E5E7EB;
    --slate-300: #D1D5DB;
    --slate-400: #9CA3AF;
    --slate-500: #6B7280;
    --slate-600: #4B5563;
    --slate-700: #374151;
    --slate-800: #1F2937;
    --slate-900: #111827;

    /* Background & Surface */
    --bg: #FFFFFF;
    --bg-secondary: var(--slate-50);
    --text: var(--slate-800);
    --text-secondary: var(--slate-500);
    --border: var(--slate-200);

    /* Radius & Shadows */
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Layout */
    --header-height: 56px;
    --nav-height: 80px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dark Mode */
.dark {
    --bg: var(--slate-900);
    --bg-secondary: var(--slate-800);
    --text: var(--slate-100);
    --text-secondary: var(--slate-400);
    --border: var(--slate-700);
    --primary-light: color-mix(in srgb, var(--primary) 20%, transparent);
    --secondary-light: color-mix(in srgb, var(--secondary) 20%, transparent);
    --accent-light: color-mix(in srgb, var(--accent) 20%, transparent);
    --gold-light: var(--accent-light);
}

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

/* Base */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

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

/* Splash Screen */
.splash-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse-glow 2s infinite;
}

.splash-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 0.25rem;
}

.splash-subtitle {
    opacity: 0.8;
    font-size: 0.875rem;
}

.splash-loader {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 1.5rem auto 0;
    overflow: hidden;
}

.splash-loader::after {
    content: '';
    display: block;
    width: 50%;
    height: 100%;
    background: var(--gold);
    border-radius: 2px;
    animation: loading 1s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(200%);
    }
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Auth Screen */
.auth-screen {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 360px;
}

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

.auth-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2.5rem;
    color: white;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: white;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.auth-form {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

/* Main App Shell */
.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.5rem;
    z-index: 100;
}

.header-title {
    flex: 1;
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text);
}

.header-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
}

.header-btn:hover {
    background: var(--bg-secondary);
}

/* Content Area */
.content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.nav-item {
    flex: 1;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item i {
    font-size: 1.5rem;
}

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

/* Cards */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

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

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

.card-title {
    font-weight: 700;
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-gold:hover {
    background: #92400E;
}

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

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

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

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

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--primary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.badge-gold {
    background: var(--gold-light);
    color: var(--gold);
}

.badge-success {
    background: #DCFCE7;
    color: #166534;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

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

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

.stat-icon.green {
    background: #DCFCE7;
    color: #166534;
}

.stat-icon.red {
    background: #FEE2E2;
    color: #991B1B;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: var(--bg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
}

.modal-title {
    font-weight: 700;
    font-size: 1.125rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.table {
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
}

.table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.table th {
    padding: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.table tbody tr {
    border-bottom: 1px solid var(--border);
}

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

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

.table td {
    padding: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 1rem;
}

/* Presentation Mode */
.presentation-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    user-select: none;
}

.presentation-header {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.presentation-counter {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    font-family: monospace;
}

.presentation-controls {
    display: flex;
    gap: 0.5rem;
}

.presentation-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background 0.2s;
}

.presentation-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.presentation-content {
    max-width: 900px;
    width: 100%;
    padding: 2rem;
    text-align: center;
}

.presentation-subtitle {
    color: var(--gold);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.presentation-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .presentation-title {
        font-size: 3.5rem;
    }
}

.presentation-text {
    font-size: 1.25rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    white-space: pre-line;
}

@media (min-width: 768px) {
    .presentation-text {
        font-size: 1.5rem;
    }
}

.presentation-nav {
    position: absolute;
    bottom: 2rem;
    display: flex;
    gap: 1rem;
}

.presentation-nav-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: background 0.2s;
}

.presentation-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.presentation-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Utility Classes */
.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

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

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

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

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

.space-y-3>*+* {
    margin-top: 0.75rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

.space-y-6>*+* {
    margin-top: 1.5rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.flex {
    display: flex;
}

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

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

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

.grid {
    display: grid;
}

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

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

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

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

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

.font-extrabold {
    font-weight: 800;
}

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

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

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

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

.rounded-full {
    border-radius: 9999px;
}

.bg-white {
    background: var(--bg);
}

.border {
    border: 1px solid var(--border);
}

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

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

.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

/* Color utilities */
.text-primary {
    color: var(--primary);
}

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

.text-slate-400 {
    color: var(--slate-400);
}

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

.text-slate-600 {
    color: var(--slate-600);
}

.text-slate-800 {
    color: var(--text);
}

.text-green-600 {
    color: #16A34A;
}

.text-red-600 {
    color: #DC2626;
}

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

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

.bg-gold {
    background: var(--gold);
}

.bg-gold-light {
    background: var(--gold-light);
}

.bg-slate-50 {
    background: var(--slate-50);
}

.bg-slate-100 {
    background: var(--slate-100);
}

.bg-green-50 {
    background: #DCFCE7;
}

.bg-green-100 {
    background: #BBF7D0;
}

.bg-red-50 {
    background: #FEE2E2;
}

.bg-red-100 {
    background: #FECACA;
}

.bg-blue-50 {
    background: #EFF6FF;
}

.bg-blue-100 {
    background: #DBEAFE;
}

.bg-purple-50 {
    background: #F3E8FF;
}

.bg-purple-100 {
    background: #E9D5FF;
}

.bg-pink-50 {
    background: #FDF2F8;
}

.bg-yellow-50 {
    background: #FEF9C3;
}

/* Animations */
.anim-fade {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Scrollbar */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Safe area for iOS */
.safe-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Active/press state */
.active\:scale-90:active {
    transform: scale(0.9);
}

.active\:scale-95:active {
    transform: scale(0.95);
}

/* Transition utilities */
.transition-all {
    transition: all 0.2s ease;
}

.transition-transform {
    transition: transform 0.2s ease;
}

/* Hover states */
.hover\:bg-slate-50:hover {
    background: var(--slate-50);
}

.hover\:bg-slate-100:hover {
    background: var(--slate-100);
}

.hover\:bg-primary-light:hover {
    background: var(--primary-light);
}

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

.hover\:text-red-600:hover {
    color: #DC2626;
}

.hover\:shadow-md:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Group hover */
.group:hover .group-hover\:opacity-100 {
    opacity: 1;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border);
    margin: 0.75rem 0;
}

/* =========================
   Additional Styles for ES6 Modules
   ========================= */

/* App Header (fixed top bar for main app) */
.app-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.5rem;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.app-header .header-title {
    flex: 1;
    font-size: 1.125rem;
    font-weight: 800;
    color: white;
}

.app-header .btn-icon {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    width: 36px;
    height: 36px;
}

.app-header .btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    pointer-events: none;
    width: 90%;
    max-width: 360px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    background: var(--bg);
    color: var(--text);
    border-left: 4px solid;
    transition: opacity 0.3s, transform 0.3s;
    animation: toastIn 0.3s ease-out;
}

.toast.success {
    border-color: #16A34A;
    background: #F0FDF4;
    color: #166534;
}

.toast.warning {
    border-color: #EAB308;
    background: #FEFCE8;
    color: #854D0E;
}

.toast.error {
    border-color: #DC2626;
    background: #FEF2F2;
    color: #991B1B;
}

.toast.info {
    border-color: #2563EB;
    background: #EFF6FF;
    color: #1D4ED8;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* Menu Item (for More page) */
.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

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

.menu-item i:first-child {
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
}

/* Grid Stats (dashboard) */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.grid-stat {
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.grid-stat:active {
    transform: scale(0.96);
}

.grid-stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.grid-stat-value {
    font-size: 1.25rem;
    font-weight: 800;
}

/* Form Select */
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.form-select:focus {
    border-color: var(--primary);
}

/* Additional Button Variants */
.btn-success {
    background: #16A34A;
    color: white;
}

.btn-success:hover {
    background: #15803D;
}

.btn-danger {
    background: #DC2626;
    color: white;
}

.btn-danger:hover {
    background: #B91C1C;
}

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

.btn-secondary:hover {
    background: var(--border);
}

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

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

/* Form Error */
.form-error {
    font-size: 0.8125rem;
    color: #DC2626;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Loading Spinner */
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 2rem auto;
}

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

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    background: var(--primary-light);
    color: var(--primary);
    flex-shrink: 0;
}

/* Badge Draft */
.badge-draft {
    background: var(--slate-100);
    color: var(--slate-600);
}

/* Input Icon Wrapper (auth form) */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-input {
    padding-left: 2.5rem;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.125rem;
    pointer-events: none;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

/* Fade out animation for splash */
.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Space-y-5 helper */
.space-y-5>*+* {
    margin-top: 1.25rem;
}

/* Space-y-2 helper */
.space-y-2>*+* {
    margin-top: 0.5rem;
}

/* Min-w-0 */
.min-w-0 {
    min-width: 0;
}

/* Flex-1 */
.flex-1 {
    flex: 1;
}

/* Content padding top for header */
.app-shell .content {
    padding-top: 0;
}

/* ============================================
   OFFLINE STATUS BADGE
   ============================================ */
.offline-badge {
    position: fixed;
    top: 12px;
    right: 12px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10000;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.badge--caching {
    background: #2563EB;
    color: white;
    animation: badge-pulse 1.5s ease-in-out infinite;
}

.badge--ready {
    background: #16A34A;
    color: white;
}

.badge--offline {
    background: var(--gold);
    color: white;
}

.badge--error {
    background: #DC2626;
    color: white;
}

.badge--hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

@keyframes badge-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ============================================
   INLINE ICON SYSTEM
   ============================================ */
.icon,
[data-icon],
i[class*="ph-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    vertical-align: middle;
}

.icon svg,
[data-icon] svg,
i[class*="ph-"] svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.icon-sm {
    width: 1em;
    height: 1em;
}

.icon-lg {
    width: 1.5em;
    height: 1.5em;
}

.icon-xl {
    width: 2em;
    height: 2em;
}

/* Scrollbar Hide Utility */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}