/* Anudia Agency Portal — modern app shell */

:root {
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --color-bg: #f1f5f9;
    --color-surface: #ffffff;
    --color-surface-muted: #f8fafc;
    --color-border: #e2e8f0;
    --color-border-strong: #cbd5e1;
    --color-text: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #64748b;
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-accent: #8b5cf6;
    --color-success: #10b981;
    --sidebar-width: 17.5rem;
    --sidebar-bg: #0b1220;
    --sidebar-bg-elevated: rgba(255, 255, 255, 0.04);
    --sidebar-border: rgba(255, 255, 255, 0.07);
    --sidebar-text: rgba(248, 250, 252, 0.92);
    --sidebar-text-muted: rgba(148, 163, 184, 0.85);
    --sidebar-hover: rgba(255, 255, 255, 0.07);
    --sidebar-active-bg: linear-gradient(90deg, rgba(99, 102, 241, 0.28) 0%, rgba(139, 92, 246, 0.14) 100%);
    --sidebar-active-ring: rgba(129, 140, 248, 0.45);
    --sidebar-accent: #818cf8;
    --sidebar-icon-bg: rgba(255, 255, 255, 0.06);
    --sidebar-icon-active-bg: rgba(99, 102, 241, 0.35);
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    min-width: 0;
    overflow-x: hidden;
}

section {
    max-width: 100%;
}

table,
pre,
textarea,
input,
select {
    max-width: 100%;
}

/* App shell — works with existing flex h-screen markup */
body.bg-gray-100 > .flex.h-screen,
body.bg-gray-100 > .flex.min-h-screen,
.app-shell {
    display: flex;
    align-items: stretch;
    min-height: 100dvh;
    height: auto !important;
    width: 100%;
    background: var(--color-bg);
}

body.bg-gray-100 > .flex.h-screen > main,
.app-shell > main {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Gradients & surfaces */
.gradient-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
}

.gradient-dark {
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 55%, #020617 100%);
}

.glass-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.card-hover {
    transition: transform var(--transition), box-shadow var(--transition);
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

.gradient-dark {
    background: var(--sidebar-bg);
}

/* ─── Sidebar shell (agency + admin) ─── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

body.sidebar-open {
    overflow: hidden;
}

#sidebar,
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: var(--sidebar-width);
    max-width: min(88vw, 20rem);
    height: auto;
    min-height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--sidebar-text);
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(99, 102, 241, 0.14), transparent 55%),
        radial-gradient(90% 60% at 100% 100%, rgba(14, 165, 233, 0.08), transparent 50%),
        var(--sidebar-bg);
    transform: translateX(calc(-100% - 0.5rem));
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow:
        0 0 0 1px var(--sidebar-border),
        0 24px 48px rgba(2, 6, 23, 0.45);
    border-right: 1px solid var(--sidebar-border);
    overflow: hidden;
}

#sidebar.open,
.app-sidebar.open {
    transform: translateX(0);
}

@media (min-width: 768px) {
    #sidebar,
    .app-sidebar {
        position: sticky;
        top: 0;
        align-self: stretch;
        height: 200vh;
        min-height: 100%;
        max-height: none;
        transform: none;
        max-width: none;
        flex-shrink: 0;
        overflow: visible;
    }
}

.app-sidebar--admin {
    --sidebar-bg: #0a1018;
    --sidebar-accent: #60a5fa;
    --sidebar-active-bg: linear-gradient(90deg, rgba(59, 130, 246, 0.26) 0%, rgba(37, 99, 235, 0.12) 100%);
    --sidebar-active-ring: rgba(96, 165, 250, 0.4);
    --sidebar-icon-active-bg: rgba(59, 130, 246, 0.32);
}

.sidebar-brand {
    padding: 1.125rem 1rem 0.875rem;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-brand-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sidebar-brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.sidebar-brand-icon {
    width: 2.625rem;
    height: 2.625rem;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow:
        0 8px 20px rgba(99, 102, 241, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.app-sidebar--admin .sidebar-brand-icon {
    background: linear-gradient(145deg, #3b82f6 0%, #2563eb 100%);
    box-shadow:
        0 8px 20px rgba(37, 99, 235, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.sidebar-brand-title {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #fff;
    margin: 0;
}

.sidebar-brand-subtitle {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--sidebar-text-muted);
    margin: 0.125rem 0 0;
    letter-spacing: 0.02em;
}

.sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--sidebar-border);
    border-radius: 0.625rem;
    background: var(--sidebar-bg-elevated);
    color: var(--sidebar-text-muted);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.sidebar-close-btn:hover {
    background: var(--sidebar-hover);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.12);
}

@media (min-width: 768px) {
    .sidebar-close-btn {
        display: none;
    }
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.875rem;
    padding: 0.75rem;
    border-radius: 0.875rem;
    background: var(--sidebar-bg-elevated);
    border: 1px solid var(--sidebar-border);
}

.sidebar-user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.sidebar-user-meta {
    min-width: 0;
    flex: 1;
}

.sidebar-user-label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sidebar-text-muted);
    margin: 0 0 0.125rem;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.6875rem;
    color: var(--sidebar-text-muted);
    margin: 0.125rem 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.625rem 0.625rem 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 9999px;
}

.sidebar-section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sidebar-text-muted);
    padding: 1rem 0.625rem 0.375rem;
    margin-top: 0.25rem;
}

.sidebar-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--sidebar-border), transparent);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    margin-bottom: 0.125rem;
    border-radius: 0.75rem;
    color: var(--sidebar-text);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    border: 1px solid transparent;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.sidebar-link > i,
.sidebar-link > .sidebar-link-icon {
    width: 2rem !important;
    height: 2rem !important;
    border-radius: 0.625rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    background: var(--sidebar-icon-bg);
    color: rgba(226, 232, 240, 0.88);
    flex-shrink: 0;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar-link > span {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.06);
}

.sidebar-link:hover > i,
.sidebar-link:hover > .sidebar-link-icon {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-link.is-active {
    background: var(--sidebar-active-bg);
    color: #fff;
    border-color: rgba(129, 140, 248, 0.22);
    box-shadow:
        inset 0 0 0 1px rgba(129, 140, 248, 0.12),
        0 8px 20px rgba(15, 23, 42, 0.18);
}

.sidebar-link.is-active > i,
.sidebar-link.is-active > .sidebar-link-icon {
    background: var(--sidebar-icon-active-bg);
    color: #fff;
    box-shadow: 0 0 0 1px var(--sidebar-active-ring);
}

.sidebar-footer {
    padding: 0.625rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.12);
}

.sidebar-footer .sidebar-link {
    color: var(--sidebar-text-muted);
}

.sidebar-footer .sidebar-link:hover {
    color: #fff;
}

/* Legacy class support */
.mobile-sidebar {
    transform: translateX(calc(-100% - 0.5rem));
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-sidebar.open {
    transform: translateX(0);
}

@media (min-width: 768px) {
    .mobile-sidebar {
        transform: none;
    }
}

/* App topbar (page headers) */
.app-topbar,
main > header.bg-white {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border) !important;
    padding: 0.875rem 1rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

@media (min-width: 768px) {
    .app-topbar,
    main > header.bg-white {
        padding: 1rem 2rem;
    }
}

.app-topbar-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    line-height: 1.2;
}

.app-topbar-subtitle {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 0.125rem;
}

.app-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--color-text);
    color: #fff;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
    flex-shrink: 0;
}

.app-menu-btn:hover {
    opacity: 0.9;
    transform: scale(1.03);
}

@media (min-width: 768px) {
    .app-menu-btn {
        display: none;
    }
}

.app-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* Forms */
.modern-field,
input.modern-field,
select.modern-field,
textarea.modern-field {
    width: 100%;
    background: var(--color-surface) !important;
    color: var(--color-text) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 0.75rem 0.875rem !important;
    font-size: 0.9375rem !important;
    line-height: 1.5 !important;
    outline: none !important;
    transition: border-color var(--transition), box-shadow var(--transition);
    min-height: 2.75rem;
}

textarea.modern-field {
    min-height: 9rem;
    resize: vertical;
}

.modern-field::placeholder {
    color: #94a3b8 !important;
}

.modern-field:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

/* Buttons */
button.gradient-primary,
button.whatsapp-gradient,
.btn-primary {
    color: #fff !important;
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: opacity var(--transition), transform var(--transition);
}

button.gradient-primary:hover,
button.whatsapp-gradient:hover,
.btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* Cards & content areas */
main > section,
.app-content {
    padding: 1rem;
}

@media (min-width: 768px) {
    main > section,
    .app-content {
        padding: 1.5rem 2rem;
    }
}

.bg-white.rounded-3xl,
.bg-white.rounded-xl {
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

/* Notification bell spacing on mobile */
@media (max-width: 767px) {
    main > header.bg-white {
        padding-right: 3.75rem;
    }

    #agency-notification-center {
        top: 0.875rem !important;
        right: 0.875rem !important;
    }
}

#agency-notification-center button {
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-md) !important;
}

#agency-notification-panel {
    max-width: calc(100vw - 1.5rem);
}

/* Auth pages */
.auth-page {
    min-height: 100dvh;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.12), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(168, 85, 247, 0.1), transparent 40%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.auth-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
}

.input-focus:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
    outline: none;
}

/* Client portal mobile nav */
.client-mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

.client-mobile-nav.is-open {
    opacity: 1;
    visibility: visible;
}

.client-mobile-nav-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(18rem, 88vw);
    height: 100%;
    background: #fff;
    padding: 1rem;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
}

.client-mobile-nav.is-open .client-mobile-nav-panel {
    transform: translateX(0);
}

/* Admin shell — inherits app-sidebar styles */
.admin-sidebar {
    /* width/position handled by .app-sidebar */
}

@media (min-width: 768px) {
    .admin-sidebar {
        /* sticky via .app-sidebar */
    }
}

/* PWA safe areas */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Responsive utilities */
@media (max-width: 767px) {
    .app-shell > .flex-1 {
        padding-top: 3.5rem;
    }
}

/* Legacy page hamburger buttons */
main > header.bg-white button.md\:hidden {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--color-text);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    main > header.bg-white button.md\:hidden {
        display: none;
    }
}

@media (max-width: 768px) {
    .rounded-3xl {
        border-radius: var(--radius-xl);
    }

    .text-4xl {
        font-size: 1.875rem;
    }

    .text-3xl {
        font-size: 1.5rem;
    }
}

/* ─── Extended design system ─── */

/* Sidebar nav badges */
.sidebar-link [data-notification-badge],
.sidebar-link .bg-red-500,
.sidebar-link .bg-green-500 {
    margin-left: auto;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    min-width: 1.25rem;
    text-align: center;
    border-radius: 9999px;
    line-height: 1.2;
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.sidebar-link .bg-green-500 {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.sidebar-link span.ml-3 {
    margin-left: 0 !important;
}

/* Global form controls inside app content */
main input[type="text"],
main input[type="email"],
main input[type="password"],
main input[type="url"],
main input[type="tel"],
main input[type="number"],
main input[type="search"],
main input[type="date"],
main input[type="datetime-local"],
main select,
main textarea,
.app-content input[type="text"],
.app-content input[type="email"],
.app-content input[type="password"],
.app-content select,
.app-content textarea {
    border-radius: var(--radius-lg);
    border-color: var(--color-border);
    transition: border-color var(--transition), box-shadow var(--transition);
}

main input:focus,
main select:focus,
main textarea:focus,
.app-content input:focus,
.app-content select:focus,
.app-content textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    outline: none;
}

/* Primary action buttons */
a.gradient-primary,
button.gradient-primary,
input.gradient-primary[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

/* Alert / flash banners */
main .bg-green-50,
main .bg-red-50,
main .bg-yellow-50,
main .bg-blue-50,
main .bg-amber-50,
.app-content .bg-green-50,
.app-content .bg-red-50 {
    border-radius: var(--radius-lg);
}

/* Tables — improved styling; wrap wide tables in .table-responsive */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.table-responsive table {
    margin: 0;
    min-width: 640px;
}

main table thead th,
.app-content table thead th {
    background: var(--color-surface-muted);
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

main table tbody td,
.app-content table tbody td {
    padding: 0.875rem 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
    vertical-align: middle;
}

@media (max-width: 767px) {
    main table,
    .app-content table {
        font-size: 0.8125rem;
    }

    main table th,
    main table td,
    .app-content table th,
    .app-content table td {
        padding: 0.5rem 0.75rem;
    }
}

/* Responsive grids used across CRM pages */
@media (max-width: 1279px) {
    .xl\:grid-cols-12 {
        grid-template-columns: 1fr !important;
    }

    .xl\:col-span-4,
    .xl\:col-span-8 {
        grid-column: span 1 / span 1 !important;
    }
}

@media (max-width: 767px) {
    .grid.md\:grid-cols-2,
    .grid.md\:grid-cols-3,
    .grid.lg\:grid-cols-2,
    .grid.lg\:grid-cols-3,
    .grid.lg\:grid-cols-4 {
        grid-template-columns: 1fr !important;
    }

    main .flex.gap-3,
    main .flex.gap-4 {
        flex-wrap: wrap;
    }

    main .flex.gap-3 > button,
    main .flex.gap-3 > a,
    main .flex.gap-4 > button,
    main .flex.gap-4 > a {
        flex: 1 1 auto;
        min-width: fit-content;
    }
}

/* Stat / hero cards on mobile */
@media (max-width: 640px) {
    [class*="-stat-card"] h3,
    [class*="-stat-card"] .stat-value {
        font-size: 1.5rem !important;
    }

    [class*="-gradient"] {
        border-radius: var(--radius-xl) !important;
        padding: 1.25rem !important;
    }
}

/* Auth login card */
.auth-page .bg-white.rounded-2xl,
.auth-page .auth-card {
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

.auth-page .gradient-primary.rounded-xl,
.auth-page button.gradient-primary {
    min-height: 2.75rem;
    border-radius: var(--radius-lg);
}

/* PWA install banner — mobile safe area */
#pwa-install-banner {
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: max(1rem, env(safe-area-inset-left));
    right: max(1rem, env(safe-area-inset-right));
    max-width: calc(100vw - 2rem);
}

/* Notification toasts — mobile */
#agency-notification-toasts {
    left: 1rem;
    right: 1rem;
    max-width: none;
}

@media (min-width: 640px) {
    #agency-notification-toasts {
        left: auto;
        right: 1rem;
        max-width: 24rem;
    }
}

/* Focus visible for keyboard users */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.app-menu-btn:focus-visible,
.sidebar-link:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}

/* Empty states */
main .border-dashed,
.app-content .border-dashed {
    border-radius: var(--radius-2xl);
}

/* Page content max width helper */
.page-container {
    width: 100%;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
}

.page-container-narrow {
    width: 100%;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

#mobile-nav-fab {
    box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
    #mobile-nav-fab {
        display: none !important;
    }
}

body.sidebar-open #mobile-nav-fab {
    opacity: 0;
    pointer-events: none;
}
