/*
 * OmniMDT unified visual layer
 * Loaded last on every public page so all modules share the dashboard language.
 */

:root {
    --omni-bg: #08090e;
    --omni-bg-deep: #06070b;
    --omni-sidebar: rgba(10, 11, 17, 0.94);
    --omni-surface: #101119;
    --omni-surface-soft: #141621;
    --omni-surface-raised: #181a27;
    --omni-border: rgba(255, 255, 255, 0.075);
    --omni-border-strong: rgba(255, 255, 255, 0.13);
    --omni-text: #f7f7fb;
    --omni-muted: #9196aa;
    --omni-muted-soft: #666c80;
    --omni-accent: #7567ed;
    --omni-accent-light: #9b91ff;
    --omni-accent-soft: rgba(117, 103, 237, 0.13);
    --omni-accent-border: rgba(139, 126, 255, 0.26);
    --omni-success: #53d69b;
    --omni-danger: #ff6d7e;
    --omni-radius-sm: 10px;
    --omni-radius-md: 14px;
    --omni-radius-lg: 18px;
    --omni-radius-xl: 24px;
    --omni-shadow: 0 18px 52px rgba(0, 0, 0, 0.22);
    --omni-shadow-accent: 0 14px 36px rgba(91, 73, 224, 0.2);

    --background: var(--omni-bg);
    --surface: var(--omni-surface);
    --surface-light: var(--omni-surface-soft);
    --surface-raised: var(--omni-surface-raised);
    --text: var(--omni-text);
    --muted: var(--omni-muted);
    --primary: var(--omni-accent);
    --primary-light: var(--omni-accent-light);
    --accent: var(--omni-accent);
    --border: var(--omni-border);
    --border-strong: var(--omni-border-strong);
    --radius-sm: var(--omni-radius-sm);
    --radius-md: var(--omni-radius-md);
    --radius-lg: var(--omni-radius-lg);
}

html {
    color-scheme: dark;
    background: var(--omni-bg-deep);
}

body {
    color: var(--omni-text);
    background:
        radial-gradient(circle at 78% -12%, rgba(117, 103, 237, 0.09), transparent 34rem),
        var(--omni-bg);
}

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

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 2px solid rgba(155, 145, 255, 0.72);
    outline-offset: 3px;
}

::selection {
    background: rgba(117, 103, 237, 0.38);
    color: #fff;
}

/* Shared buttons and form controls */
:is(.primary-action, .service-primary-button, .medical-primary-button, .rank-submit,
    .auth-button, .plan-button, .button:not(.button-secondary), .create-city-button,
    .create-city-secondary, .admin-modal-danger) {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: linear-gradient(135deg, #8274f7, #6556dc);
    box-shadow: 0 9px 24px rgba(87, 69, 215, 0.2), inset 0 1px rgba(255, 255, 255, 0.16);
    color: #fff;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

:is(.primary-action, .service-primary-button, .medical-primary-button, .rank-submit,
    .auth-button, .plan-button, .button:not(.button-secondary), .create-city-button,
    .create-city-secondary, .admin-modal-danger):hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: var(--omni-shadow-accent), inset 0 1px rgba(255, 255, 255, 0.18);
}

:is(.secondary-action, .button-secondary, .enterprise-back, .shop-back,
    .admin-modal-cancel, .delete-document-cancel) {
    border: 1px solid var(--omni-border-strong);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--omni-muted);
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

:is(.secondary-action, .button-secondary, .enterprise-back, .shop-back,
    .admin-modal-cancel, .delete-document-cancel):hover {
    color: #fff;
    border-color: var(--omni-accent-border);
    background: var(--omni-accent-soft);
    transform: translateY(-1px);
}

:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    border: 1px solid var(--omni-border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--omni-text);
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):hover {
    border-color: var(--omni-border-strong);
    background: rgba(255, 255, 255, 0.035);
}

:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
    border-color: rgba(139, 126, 255, 0.5);
    background: rgba(117, 103, 237, 0.045);
    box-shadow: 0 0 0 4px rgba(117, 103, 237, 0.09);
    outline: none;
}

/* Shared sidebars */
:is(.sidebar, .city-sidebar, .service-sidebar, .enterprise-sidebar) {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 18rem),
        var(--omni-sidebar);
    border-right: 1px solid var(--omni-border);
    box-shadow: 16px 0 50px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(18px);
}

:is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link) {
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--omni-muted);
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

:is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link):hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.055);
    background: rgba(255, 255, 255, 0.035);
    transform: translateX(2px);
}

:is(.sidebar-nav a.active, .city-nav-link.active, .service-nav-link.active, .enterprise-nav-link.active) {
    color: #fff;
    border-color: var(--omni-accent-border);
    background: linear-gradient(105deg, rgba(117, 103, 237, 0.2), rgba(117, 103, 237, 0.08));
    box-shadow: inset 3px 0 var(--omni-accent-light), 0 8px 24px rgba(0, 0, 0, 0.1);
}

:is(.nav-section, .enterprise-nav-section, .admin-sidebar-label, .admin-section-label) {
    color: var(--omni-muted-soft);
    letter-spacing: 0.14em;
}

:is(.city-brand, .service-identity, .enterprise-identity) {
    border-color: var(--omni-border);
    border-radius: var(--omni-radius-md);
    background: rgba(255, 255, 255, 0.018);
}

/* Shared content rhythm */
:is(.dashboard-content, .city-content, .service-content, .enterprise-content) {
    background:
        radial-gradient(circle at 88% 2%, rgba(117, 103, 237, 0.055), transparent 28rem),
        transparent;
}

:is(.dashboard-eyebrow, .city-eyebrow, .service-eyebrow, .enterprise-eyebrow,
    .shop-eyebrow, .auth-eyebrow, .eyebrow, .admin-card-eyebrow) {
    color: var(--omni-accent-light);
    letter-spacing: 0.15em;
}

:is(.city-header h1, .service-header h1, .enterprise-header h1, .admin-header h1,
    .shop-hero h1, .auth-heading h1, .section-heading h2) {
    letter-spacing: -0.045em;
}

/* Unified cards and panels */
:is(.stat-card, .service-stat-card, .admin-stat-card, .admin-panel-card, .admin-recent-card,
    .getting-card, .settings-card, .service-settings-card, .enterprise-panel, .module-panel,
    .settings-panel, .plan-card, .feature-card, .platform-box, .auth-card, .modal-card,
    .rank-modal-card, .delete-document-modal-card, .admin-modal, .enterprise-modal,
    .service-action-card, .service-home-tool, .permissions-ranks, .permissions-editor) {
    border-color: var(--omni-border);
    border-radius: var(--omni-radius-lg);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008));
    box-shadow: 0 1px rgba(255, 255, 255, 0.018), 0 18px 42px rgba(0, 0, 0, 0.1);
}

:is(.getting-card, .service-action-card, .service-home-tool, .feature-card, .plan-card) {
    transition: transform 200ms ease, border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

:is(.getting-card, .service-action-card, .service-home-tool, .feature-card, .plan-card):hover {
    transform: translateY(-3px);
    border-color: var(--omni-accent-border);
    background: linear-gradient(145deg, rgba(117, 103, 237, 0.075), rgba(255, 255, 255, 0.012));
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
}

:is(.getting-icon, .service-home-tool-icon, .admin-stat-icon, .feature-icon,
    .action-icon, .admin-user-details-icon) {
    border: 1px solid rgba(139, 126, 255, 0.17);
    border-radius: 12px;
    background: rgba(117, 103, 237, 0.1);
    color: var(--omni-accent-light);
}

:is(.city-role-badge, .service-header-badge, .enterprise-type-badge, .plan-badge,
    .admin-plan-badge, .medical-confidentiality-badge) {
    border-color: var(--omni-accent-border);
    border-radius: 999px;
    background: var(--omni-accent-soft);
    color: var(--omni-accent-light);
}

/* Tables and long lists */
:is(.admin-table-list, .admin-users-list, .enterprise-list, .members-list, .ranks-list) {
    overflow: hidden;
    border: 1px solid var(--omni-border);
    border-radius: var(--omni-radius-md);
    background: rgba(255, 255, 255, 0.012);
}

:is(.admin-health-row, .admin-kv-list > *, .enterprise-list > *, .members-list > *, .ranks-list > *) {
    border-color: var(--omni-border);
}

/* Overlays */
:is(.modal-backdrop, .rank-modal-backdrop, .enterprise-modal-backdrop, .admin-modal-overlay) {
    background: rgba(3, 4, 8, 0.76);
    backdrop-filter: blur(12px);
}

:is(.modal-close, .rank-modal-close, .admin-modal-close, .icon-action) {
    border-color: var(--omni-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.028);
    color: var(--omni-muted);
}

:is(.modal-close, .rank-modal-close, .admin-modal-close, .icon-action):hover {
    border-color: var(--omni-accent-border);
    background: var(--omni-accent-soft);
    color: #fff;
}

/* Authentication */
.auth-page {
    background:
        radial-gradient(circle at 50% 0%, rgba(117, 103, 237, 0.16), transparent 32rem),
        radial-gradient(circle at 10% 90%, rgba(117, 103, 237, 0.06), transparent 28rem),
        var(--omni-bg);
}

.auth-card {
    border: 1px solid var(--omni-border);
    border-radius: var(--omni-radius-xl);
    background: rgba(16, 17, 25, 0.82);
    box-shadow: var(--omni-shadow);
    backdrop-filter: blur(20px);
}

.auth-discord-button {
    border-color: var(--omni-border-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.028);
}

/* Marketing and shop */
.navbar {
    border-bottom-color: var(--omni-border);
    background: rgba(8, 9, 14, 0.76);
    backdrop-filter: blur(18px);
}

.hero::before,
.shop-page::before {
    opacity: 0.72;
}

.plan-card.recommended {
    border-color: var(--omni-accent-border);
    background: linear-gradient(155deg, rgba(117, 103, 237, 0.14), rgba(255, 255, 255, 0.014) 52%);
    box-shadow: var(--omni-shadow-accent);
}

/* Make dense layouts breathe consistently */
:is(.city-stats, .service-stats, .enterprise-metrics, .admin-stats-grid,
    .admin-dashboard-grid, .getting-started-grid, .service-actions-grid,
    .service-home-tools, .enterprise-overview-grid, .plans-grid, .feature-grid) {
    gap: clamp(12px, 1.6vw, 20px);
}

/* City onboarding: independent cards, without the old enclosing frame. */
.getting-started-grid {
    display: grid;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.getting-started-grid .getting-card,
.getting-started-grid .getting-card:last-child {
    border: 1px solid var(--omni-border);
    border-radius: var(--omni-radius-lg);
}

@media (max-width: 900px) {
    :is(.sidebar, .city-sidebar, .service-sidebar, .enterprise-sidebar) {
        box-shadow: none;
        backdrop-filter: none;
    }

    :is(.dashboard-content, .city-content, .service-content, .enterprise-content) {
        padding-left: clamp(18px, 5vw, 34px);
        padding-right: clamp(18px, 5vw, 34px);
    }
}

@media (max-width: 640px) {
    :root {
        --omni-radius-lg: 15px;
        --omni-radius-xl: 18px;
    }

    :is(.primary-action, .service-primary-button, .medical-primary-button,
        .auth-button, .plan-button) {
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* =========================================================
   OMNIMDT VISUAL SYSTEM V5 — DASHBOARD LANGUAGE EVERYWHERE
   Reference: the soft-premium dashboard introduced in V4.
   This layer intentionally stays last in the cascade.
   ========================================================= */

:root {
    --omni-bg: #08090d;
    --omni-bg-deep: #06070b;
    --omni-sidebar: #0c0d13;
    --omni-surface: #111219;
    --omni-surface-soft: #14151e;
    --omni-surface-raised: #181a24;
    --omni-border: rgba(255, 255, 255, 0.07);
    --omni-border-strong: rgba(255, 255, 255, 0.12);
    --omni-text: #f4f4f8;
    --omni-muted: rgba(226, 228, 239, 0.54);
    --omni-muted-soft: rgba(226, 228, 239, 0.34);
    --omni-accent: #7969ff;
    --omni-accent-light: #a89eff;
    --omni-accent-soft: rgba(109, 93, 252, 0.13);
    --omni-accent-border: rgba(149, 136, 255, 0.24);
    --omni-success: #61d99b;
    --omni-danger: #ff7182;
    --omni-radius-sm: 10px;
    --omni-radius-md: 13px;
    --omni-radius-lg: 18px;
    --omni-radius-xl: 22px;
    --omni-sidebar-width: 264px;
    --omni-content-width: 1280px;
    --omni-shadow: 0 18px 50px rgba(0, 0, 0, 0.13);
    --omni-shadow-accent: 0 12px 30px rgba(75, 59, 205, 0.24);
}

html {
    min-height: 100%;
    background: var(--omni-bg-deep);
    scrollbar-color: rgba(255, 255, 255, 0.18) var(--omni-bg);
}

body {
    min-height: 100vh;
    background: var(--omni-bg) !important;
    color: var(--omni-text);
}

body::before,
body::after {
    pointer-events: none;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--omni-bg);
}

::-webkit-scrollbar-thumb {
    border: 3px solid var(--omni-bg);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.17);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.27);
}

/* Application shells */
:is(.sidebar, .city-sidebar, .service-sidebar, .enterprise-sidebar) {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 30;
    width: var(--omni-sidebar-width) !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column;
    padding: 24px 16px 18px !important;
    overflow: hidden;
    border: 0 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.065) !important;
    border-radius: 0 !important;
    background: var(--omni-sidebar) !important;
    box-shadow: 18px 0 55px rgba(0, 0, 0, 0.12) !important;
    backdrop-filter: none !important;
}

:is(.dashboard-content, .city-content, .service-content, .enterprise-content) {
    min-height: 100vh;
    margin-left: var(--omni-sidebar-width) !important;
    padding: clamp(36px, 5vw, 70px) clamp(24px, 5vw, 76px) 72px !important;
    background: transparent !important;
}

:is(.dashboard-content, .city-content, .service-content, .enterprise-content)
    > :is(header, section, .enterprise-view, .account-view, .admin-module-page, .admin-users-page) {
    width: 100%;
    max-width: var(--omni-content-width);
}

/* Sidebar branding and identity */
:is(.sidebar-logo.brand-link, .service-logo.brand-link, .enterprise-brand, .city-omni-logo.brand-link) {
    display: flex;
    align-items: center;
    min-height: 53px;
    margin: 0 5px 20px;
    padding: 7px 7px 19px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.city-brand {
    display: block;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

:is(.brand-logo-sidebar, .enterprise-brand img) {
    width: auto;
    max-width: 92px;
    height: 24px;
    object-fit: contain;
}

:is(.city-selector, .service-identity, .enterprise-identity) {
    min-height: 66px;
    margin: 0 5px 18px;
    padding: 11px 12px !important;
    gap: 11px;
    border: 1px solid var(--omni-border) !important;
    border-radius: 13px !important;
    background: rgba(255, 255, 255, 0.022) !important;
    box-shadow: none !important;
}

:is(.city-selector-color, .service-avatar, .enterprise-avatar) {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--omni-accent-border) !important;
    border-radius: 11px !important;
    background: var(--omni-accent-soft) !important;
    color: var(--omni-accent-light) !important;
    font-size: 12px;
    font-weight: 750;
}

:is(.city-selector-info, .service-identity > div, .enterprise-identity > div) {
    min-width: 0;
}

:is(.city-selector-info strong, .service-identity strong, .enterprise-identity strong) {
    display: block;
    overflow: hidden;
    color: var(--omni-text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(.city-selector-info span, .service-identity > div > span, .enterprise-identity > div > span) {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: var(--omni-muted-soft);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sidebar navigation */
:is(.sidebar-nav, .city-navigation, .service-navigation, .enterprise-nav) {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 7px !important;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
}

:is(.sidebar-nav, .city-navigation, .service-navigation, .enterprise-nav)::-webkit-scrollbar {
    display: none;
}

:is(.nav-section, .enterprise-nav-section, .admin-sidebar-label) {
    display: block;
    margin: 12px 12px 2px !important;
    color: rgba(226, 228, 239, 0.29) !important;
    font-size: 8px !important;
    font-weight: 700;
    letter-spacing: 0.16em !important;
}

:is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link) {
    position: relative;
    min-height: 48px !important;
    display: flex !important;
    align-items: center;
    gap: 12px !important;
    padding: 9px 12px !important;
    border: 1px solid transparent !important;
    border-radius: 13px !important;
    background: transparent !important;
    color: rgba(237, 239, 248, 0.58) !important;
    box-shadow: none !important;
    font-family: inherit;
    font-size: 12px !important;
    font-weight: 580 !important;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease !important;
}

:is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link):hover {
    border-color: rgba(255, 255, 255, 0.055) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    color: #f7f7fb !important;
    transform: translateX(2px);
}

:is(.sidebar-nav a.active, .city-nav-link.active, .service-nav-link.active, .enterprise-nav-link.active) {
    border-color: rgba(141, 128, 255, 0.22) !important;
    background: linear-gradient(135deg, rgba(109, 93, 252, 0.2), rgba(109, 93, 252, 0.085)) !important;
    color: #fff !important;
    box-shadow: 0 8px 24px rgba(36, 28, 100, 0.12), inset 0 1px rgba(255, 255, 255, 0.045) !important;
}

:is(.sidebar-nav a.active, .city-nav-link.active, .service-nav-link.active, .enterprise-nav-link.active)::before {
    content: "";
    position: absolute;
    left: -1px;
    width: 3px;
    height: 20px;
    border-radius: 0 5px 5px 0;
    background: #9588ff;
    box-shadow: 0 0 15px rgba(149, 136, 255, 0.58);
}

:is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link) > span:first-child {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.035);
    color: currentColor;
    font-size: 15px;
}

:is(.sidebar-nav a.active, .city-nav-link.active, .service-nav-link.active, .enterprise-nav-link.active) > span:first-child {
    background: rgba(149, 136, 255, 0.13);
    color: #b5adff;
}

:is(.sidebar-bottom, .city-sidebar-bottom, .service-sidebar-bottom, .enterprise-back) {
    margin-top: auto;
}

:is(.city-sidebar-bottom, .service-sidebar-bottom) {
    padding: 13px 5px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

:is(.back-dashboard, .back-city, .enterprise-back, #logout-button) {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border: 1px solid var(--omni-border) !important;
    border-radius: 11px !important;
    background: transparent !important;
    color: var(--omni-muted) !important;
    font-size: 10px;
    text-decoration: none;
    transition: border-color 180ms ease, color 180ms ease, background 180ms ease !important;
}

:is(.back-dashboard, .back-city, .enterprise-back, #logout-button):hover {
    border-color: var(--omni-accent-border) !important;
    background: var(--omni-accent-soft) !important;
    color: #fff !important;
}

/* Page headings */
:is(.dashboard-header, .city-header, .service-header, .enterprise-header, .admin-module-header, .account-header) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 38px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

:is(.dashboard-header, .city-header, .service-header, .enterprise-header, .admin-module-header, .account-header) h1 {
    margin: 9px 0 0;
    color: #f7f7fb;
    font-size: clamp(30px, 3vw, 42px) !important;
    font-weight: 760;
    line-height: 1.08;
    letter-spacing: -0.045em !important;
}

:is(.dashboard-header, .city-header, .service-header, .enterprise-header, .admin-module-header, .account-header) p {
    max-width: 620px;
    margin: 11px 0 0;
    color: var(--omni-muted) !important;
    font-size: 13px;
    line-height: 1.65;
}

:is(.dashboard-eyebrow, .city-eyebrow, .service-eyebrow, .enterprise-eyebrow,
    .shop-eyebrow, .auth-eyebrow, .eyebrow, .admin-card-eyebrow, .activity-eyebrow,
    .admin-section-label) {
    color: var(--omni-accent-light) !important;
    font-size: 9px !important;
    font-weight: 750 !important;
    letter-spacing: 0.17em !important;
    text-transform: uppercase;
}

:is(.city-role-badge, .service-header-badge, .enterprise-type-badge, .admin-status,
    .account-badge, .medical-confidentiality-badge) {
    padding: 7px 10px !important;
    border: 1px solid var(--omni-accent-border) !important;
    border-radius: 999px !important;
    background: var(--omni-accent-soft) !important;
    color: var(--omni-accent-light) !important;
    box-shadow: none !important;
    font-size: 8px !important;
    font-weight: 750;
    letter-spacing: 0.08em;
}

/* Statistics */
:is(.city-stats, .service-stats, .enterprise-metrics, .admin-stats-grid, .account-stats) {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px !important;
    margin-bottom: 32px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

:is(.stat-card, .service-stat-card, .enterprise-metrics > article, .admin-stat-card, .account-stat) {
    min-height: 122px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px !important;
    border: 1px solid var(--omni-border) !important;
    border-radius: 16px !important;
    background: rgba(17, 18, 25, 0.82) !important;
    box-shadow: none !important;
}

:is(.stat-card, .service-stat-card, .enterprise-metrics > article, .admin-stat-card, .account-stat) strong {
    color: #f7f7fb !important;
    font-size: clamp(23px, 2vw, 31px) !important;
    letter-spacing: -0.035em;
}

:is(.stat-card, .service-stat-card, .enterprise-metrics > article, .admin-stat-card, .account-stat)
    :is(span, p, small) {
    color: var(--omni-muted-soft) !important;
}

/* Panels and cards */
.getting-started-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

.getting-started-grid .getting-card {
    min-height: 218px;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-areas:
        "icon"
        "title"
        "description"
        "action" !important;
    grid-template-rows: auto auto 1fr auto;
    align-content: start;
    align-items: start;
    gap: 0 !important;
    padding: 22px !important;
}

.getting-started-grid .getting-icon {
    grid-area: icon;
    margin: 0 0 17px !important;
}

.getting-started-grid .getting-card h3 {
    grid-area: title;
    align-self: auto;
    font-size: 14px;
}

.getting-started-grid .getting-card p {
    grid-area: description;
    max-width: none;
    margin: 8px 0 20px !important;
    font-size: 11px;
    line-height: 1.6;
}

.getting-started-grid .getting-card button {
    grid-area: action;
    min-width: 112px;
    justify-self: start;
}

:is(.dashboard-card, .account-card, .activity-chart-card, .recent-activity-card,
    .getting-card, .settings-card, .service-settings-card, .enterprise-panel,
    .module-panel, .settings-panel, .admin-panel-card, .admin-module-card,
    .service-action-card, .service-home-tool, .permissions-ranks, .permissions-editor,
    .citizens-card,
    .member-organization-card, .service-card, .enterprise-card, .rank-card,
    .member-card, .product-card, .finance-summary > article, .discord-config-card,
    .billing-card, .account-profile-card, .account-subscription-card) {
    border: 1px solid var(--omni-border) !important;
    border-radius: var(--omni-radius-lg) !important;
    background: rgba(17, 18, 25, 0.82) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

/* A module is a page, not a card. Keep the canvas open and reserve framed
   surfaces for the toolbar, result list and forms inside the module. */
:is(.service-module-view, .medical-module-view) {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

/* The search field already carries its own surface and border. Its layout
   wrapper must stay invisible to avoid a nested, double-framed control. */
.citizens-search {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

:is(.getting-card, .service-action-card, .service-home-tool, .member-organization-card,
    .service-card, .enterprise-card, .rank-card, .member-card, .product-card) {
    transition: transform 190ms ease, border-color 190ms ease, background 190ms ease !important;
}

:is(.getting-card, .service-action-card, .service-home-tool, .member-organization-card,
    .service-card, .enterprise-card, .rank-card, .member-card, .product-card):hover {
    border-color: var(--omni-accent-border) !important;
    background: rgba(20, 21, 30, 0.96) !important;
    box-shadow: none !important;
    transform: translateY(-3px);
}

:is(.section-heading, .enterprise-panel-head, .activity-card-header, .module-toolbar) {
    border-color: var(--omni-border) !important;
}

:is(.section-heading h2, .enterprise-panel-head h2, .activity-card-header h2,
    .module-toolbar h2, .admin-module-card h2) {
    color: #f5f5f9;
    letter-spacing: -0.025em;
}

:is(.section-heading p, .enterprise-panel-head p, .activity-card-header p,
    .module-toolbar p, .admin-module-card p) {
    color: var(--omni-muted);
}

/* Lists and table-like content */
:is(.admin-table-list, .admin-users-list, .enterprise-list, .members-list, .ranks-list,
    .citizens-results, .billing-list, .admin-kv-list, .admin-health-list) {
    overflow: hidden;
    border: 1px solid var(--omni-border) !important;
    border-radius: 14px !important;
    background: rgba(9, 10, 15, 0.24) !important;
    box-shadow: none !important;
}

:is(.list-row, .admin-health-row, .admin-user-row, .billing-row, .recent-activity-item,
    .discord-mapping-row, .rank-row) {
    border-color: var(--omni-border) !important;
    background: transparent !important;
}

:is(.list-row, .admin-health-row, .admin-user-row, .billing-row, .recent-activity-item,
    .discord-mapping-row, .rank-row):hover {
    background: rgba(255, 255, 255, 0.025) !important;
}

/* Buttons */
:is(.primary-action, .service-primary-button, .medical-primary-button, .rank-submit,
    .auth-button, .plan-button:not(.secondary), .button:not(.button-secondary),
    .create-city-button, .create-city-secondary, .admin-modal-danger) {
    min-height: 44px;
    padding: 10px 17px;
    border: 1px solid rgba(177, 168, 255, 0.28) !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #7969ff, #6254dc) !important;
    color: #fff !important;
    box-shadow: var(--omni-shadow-accent), inset 0 1px rgba(255, 255, 255, 0.18) !important;
    font-weight: 650;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease !important;
}

:is(.primary-action, .service-primary-button, .medical-primary-button, .rank-submit,
    .auth-button, .plan-button:not(.secondary), .button:not(.button-secondary),
    .create-city-button, .create-city-secondary, .admin-modal-danger):hover {
    filter: brightness(1.08);
    box-shadow: 0 15px 34px rgba(75, 59, 205, 0.29), inset 0 1px rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px);
}

:is(.secondary-action, .button-secondary, .plan-button.secondary, .shop-back,
    .admin-modal-cancel, .delete-document-cancel, .cancel-action, .icon-action, .text-action) {
    border: 1px solid var(--omni-border-strong) !important;
    border-radius: 11px !important;
    background: rgba(255, 255, 255, 0.025) !important;
    color: var(--omni-muted) !important;
    box-shadow: none !important;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease !important;
}

:is(.secondary-action, .button-secondary, .plan-button.secondary, .shop-back,
    .admin-modal-cancel, .delete-document-cancel, .cancel-action, .icon-action, .text-action):hover {
    border-color: var(--omni-accent-border) !important;
    background: var(--omni-accent-soft) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

button:disabled,
.button[aria-disabled="true"] {
    opacity: 0.48;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none !important;
}

/* Forms */
:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    min-height: 44px;
    border: 1px solid var(--omni-border) !important;
    border-radius: 11px !important;
    background: rgba(255, 255, 255, 0.025) !important;
    color: var(--omni-text) !important;
    box-shadow: none !important;
}

textarea {
    min-height: 108px;
}

:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea)::placeholder {
    color: rgba(226, 228, 239, 0.27);
}

:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):hover {
    border-color: var(--omni-border-strong) !important;
    background: rgba(255, 255, 255, 0.035) !important;
}

:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
    border-color: rgba(139, 126, 255, 0.5) !important;
    background: rgba(117, 103, 237, 0.045) !important;
    box-shadow: 0 0 0 4px rgba(117, 103, 237, 0.09) !important;
    outline: none;
}

/* Search bars own the single visible surface; the input inside stays seamless,
   including its hover and focus states. */
.citizens-search-box input[type="search"],
.citizens-search-box input[type="search"]:hover,
.citizens-search-box input[type="search"]:focus {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

:is(label, .form-group label) {
    color: rgba(237, 239, 248, 0.72);
}

/* Dialogs */
:is(.modal-backdrop, .rank-modal-backdrop, .enterprise-modal-backdrop, .admin-modal-overlay,
    .delete-document-modal) {
    background: rgba(3, 4, 8, 0.78) !important;
    backdrop-filter: blur(10px) !important;
}

:is(.modal-card, .rank-modal-card, .delete-document-modal-card, .admin-modal, .enterprise-modal) {
    border: 1px solid var(--omni-border-strong) !important;
    border-radius: 20px !important;
    background: #111219 !important;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48) !important;
}

/* Modal actions should finish the form, not create a second oversized panel. */
:is(.justice-modal-footer, .ops-form-actions, .enterprise-modal .form-actions,
    .modal-card .form-actions, .rank-modal-card .form-actions, .admin-modal-actions,
    .delete-document-actions) {
    min-height: 0 !important;
    margin-top: 16px !important;
    padding-top: 0 !important;
    border-top: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.justice-modal-form {
    padding-bottom: 24px !important;
}

/* Authentication */
.auth-page {
    background: var(--omni-bg) !important;
}

.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% -12%, rgba(109, 93, 252, 0.11), transparent 34rem);
}

.auth-logo {
    z-index: 1;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(440px, calc(100vw - 32px));
    padding: clamp(28px, 5vw, 42px) !important;
    border: 1px solid var(--omni-border) !important;
    border-radius: 20px !important;
    background: rgba(17, 18, 25, 0.9) !important;
    box-shadow: var(--omni-shadow) !important;
    backdrop-filter: blur(18px) !important;
}

.auth-heading h1 {
    color: #f7f7fb;
    font-size: clamp(30px, 7vw, 40px) !important;
    letter-spacing: -0.045em !important;
}

.auth-heading p,
.auth-switch,
.auth-terms {
    color: var(--omni-muted) !important;
}

.auth-switch {
    margin-top: 22px !important;
    line-height: 1.5;
}

.auth-discord-button {
    min-height: 48px;
    border: 1px solid var(--omni-border-strong) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    color: #f4f4f8 !important;
}

.auth-discord-button:hover {
    border-color: var(--omni-accent-border) !important;
    background: var(--omni-accent-soft) !important;
}

/* Marketing */
.navbar {
    border-bottom: 1px solid var(--omni-border) !important;
    background: rgba(8, 9, 13, 0.9) !important;
    box-shadow: none !important;
    backdrop-filter: blur(18px);
}

.hero {
    background: var(--omni-bg) !important;
}

.hero::before {
    background: radial-gradient(circle, rgba(109, 93, 252, 0.12), transparent 66%) !important;
    opacity: 0.72;
}

.hero h1 {
    color: #f7f7fb;
    letter-spacing: -0.06em !important;
}

.hero h1 span {
    color: var(--omni-accent-light) !important;
    -webkit-text-fill-color: currentColor !important;
}

.hero p,
.section-heading p,
.platform-box p,
.feature-card p {
    color: var(--omni-muted) !important;
}

:is(.feature-card, .platform-box) {
    border: 1px solid var(--omni-border) !important;
    border-radius: var(--omni-radius-lg) !important;
    background: rgba(17, 18, 25, 0.8) !important;
    box-shadow: none !important;
}

.feature-card:hover {
    border-color: var(--omni-accent-border) !important;
    background: rgba(20, 21, 30, 0.96) !important;
    box-shadow: none !important;
    transform: translateY(-3px);
}

.platform-box::before,
.platform-box::after {
    opacity: 0.35;
}

body > footer {
    border-top-color: var(--omni-border) !important;
    background: var(--omni-bg) !important;
}

/* Shop */
.shop-page {
    min-height: 100vh;
    background: var(--omni-bg) !important;
}

.shop-page::before {
    background: radial-gradient(circle at 50% 0%, rgba(109, 93, 252, 0.09), transparent 32rem) !important;
}

.shop-topbar {
    border-bottom-color: var(--omni-border) !important;
}

.shop-hero h1 {
    color: #f7f7fb;
    letter-spacing: -0.045em;
}

.shop-hero p {
    color: var(--omni-muted) !important;
}

.plan-card {
    border: 1px solid var(--omni-border) !important;
    border-radius: var(--omni-radius-lg) !important;
    background: rgba(17, 18, 25, 0.84) !important;
    box-shadow: none !important;
}

.plan-card.featured,
.plan-card.recommended {
    border-color: var(--omni-accent-border) !important;
    background: linear-gradient(155deg, rgba(109, 93, 252, 0.13), rgba(17, 18, 25, 0.9) 52%) !important;
    box-shadow: 0 18px 48px rgba(41, 32, 112, 0.16) !important;
}

.plan-price strong,
.plan-header h2 {
    color: #f7f7fb !important;
}

/* Responsive application shell */
@media (max-width: 1100px) {
    :is(.city-stats, .service-stats, .enterprise-metrics, .admin-stats-grid, .account-stats) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    :root {
        --omni-sidebar-width: 82px;
    }

    :is(.sidebar, .city-sidebar, .service-sidebar, .enterprise-sidebar) {
        padding-inline: 11px !important;
    }

    :is(.sidebar-logo.brand-link, .service-logo.brand-link, .enterprise-brand, .city-omni-logo.brand-link) {
        justify-content: center;
        margin-inline: 0;
        padding-inline: 0;
    }

    :is(.brand-logo-sidebar, .enterprise-brand img) {
        width: 42px;
        object-fit: contain;
        object-position: left;
    }

    :is(.city-selector, .service-identity, .enterprise-identity, .nav-section,
        .enterprise-nav-section, .admin-sidebar-label) {
        display: none !important;
    }

    :is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link) {
        justify-content: center;
        gap: 0 !important;
        padding-inline: 8px !important;
        font-size: 0 !important;
    }

    :is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link) > span:first-child {
        font-size: 15px !important;
    }

    :is(.sidebar-user > :last-child, .sidebar-nav .nav-label) {
        display: none !important;
    }

    :is(.dashboard-content, .city-content, .service-content, .enterprise-content) {
        padding-inline: 28px !important;
    }

    :is(.dashboard-header, .city-header, .service-header, .enterprise-header, .admin-module-header, .account-header) {
        align-items: flex-start;
    }
}

/* =========================================================
   OMNIMDT RESPONSIVE SYSTEM V6
   Phone, FiveM tablet, desktop and television layouts.
   This layer stays last so every product area shares the same breakpoints.
   ========================================================= */

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

:where(.dashboard-content, .city-content, .service-content, .enterprise-content) *,
:where(.shop-page, .auth-container, body > main) * {
    min-width: 0;
}

img,
video,
canvas {
    max-width: 100%;
    height: auto;
}

:is(.dashboard-content, .city-content, .service-content, .enterprise-content)
    > :is(header, section, .enterprise-view, .account-view, .admin-module-page, .admin-users-page) {
    margin-inline: auto;
}

:is(.admin-table-list, .admin-users-list, .admin-users-full-list, .enterprise-list,
    .members-list, .ranks-list, .citizens-results, .billing-list, .admin-kv-list) {
    max-width: 100%;
}

@media (min-width: 1800px) {
    :root {
        --omni-content-width: 1440px;
    }

    :is(.dashboard-content, .city-content, .service-content, .enterprise-content) {
        padding-inline: clamp(72px, 6vw, 112px) !important;
    }

    :is(.dashboard-header, .city-header, .service-header, .enterprise-header,
        .admin-module-header, .account-header) h1 {
        font-size: clamp(40px, 2.5vw, 48px) !important;
    }
}

/* Tablet / FiveM: preserve the navigation while returning useful width to data. */
@media (max-width: 1180px) and (min-width: 641px) {
    :is(.sidebar, .city-sidebar, .service-sidebar, .enterprise-sidebar) {
        overflow: visible !important;
    }

    :is(.sidebar-logo.brand-link, .service-logo.brand-link,
        .enterprise-brand, .city-omni-logo.brand-link) {
        overflow: hidden;
    }

    :is(.brand-logo-sidebar, .enterprise-brand img) {
        width: 20px !important;
        max-width: 20px !important;
        height: 24px !important;
        object-fit: cover !important;
        object-position: left center !important;
    }

    :is(.city-sidebar-bottom .back-dashboard,
        .service-sidebar-bottom .back-city,
        .enterprise-back) {
        width: 52px !important;
        min-width: 52px !important;
        height: 52px !important;
        min-height: 52px !important;
        display: grid !important;
        place-items: center;
        margin-inline: auto !important;
        padding: 0 !important;
        border-radius: 13px !important;
        color: transparent !important;
        font-size: 0 !important;
    }

    :is(.city-sidebar-bottom .back-dashboard,
        .service-sidebar-bottom .back-city,
        .enterprise-back)::before {
        content: "←";
        color: var(--omni-text);
        font-size: 18px;
        line-height: 1;
    }

    :is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link) {
        position: relative;
    }

    :is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link)[aria-label]:hover::after {
        content: attr(aria-label);
        position: absolute;
        left: calc(100% + 10px);
        top: 50%;
        z-index: 60;
        width: max-content;
        max-width: 220px;
        padding: 8px 10px;
        border: 1px solid var(--omni-border-strong);
        border-radius: 9px;
        background: #151620;
        color: var(--omni-text);
        box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
        font-size: 10px;
        line-height: 1.25;
        white-space: nowrap;
        transform: translateY(-50%);
        pointer-events: none;
    }

    :is(.dashboard-content, .city-content, .service-content, .enterprise-content) {
        padding: 38px clamp(24px, 4vw, 46px) 64px !important;
    }
}

@media (max-width: 960px) {
    :is(.dashboard-grid, .admin-dashboard-grid, .enterprise-overview-grid,
        .city-admin-grid, .permissions-layout, .admin-users-layout) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    :is(.activity-chart-card, .recent-activity-card, .admin-panel-card,
        .permissions-ranks, .permissions-editor) {
        position: static !important;
    }

    :is(.admin-table-list, .admin-users-full-list) {
        overflow-x: auto;
        overscroll-behavior-x: contain;
    }
}

@media (max-width: 760px) {
    :is(.module-header, .service-module-header, .module-toolbar,
        .admin-users-header, .admin-page-heading, .medical-toolbar) {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    :is(.module-header-actions, .city-header-actions, .service-header-actions,
        .member-management-actions, .subscription-actions) {
        width: 100%;
        flex-wrap: wrap;
    }

    :is(.module-header-actions, .city-header-actions, .service-header-actions) > :is(button, a),
    :is(.module-header, .service-module-header, .module-toolbar) > :is(button, a) {
        flex: 1 1 180px;
        justify-content: center;
    }

    :is(.form-grid, .settings-grid, .service-settings-grid, .justice-form-grid,
        .discord-mapping-form, .permission-grid) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    :is(.form-full, .settings-full, .service-settings-form .settings-full,
        .justice-field-full, .discord-custom-permissions, .discord-modal-actions,
        .permission-grid .permission-all) {
        grid-column: auto !important;
    }

    :is(.member-card, .rank-row, .admin-list-row, .enterprise-member-row,
        .citizen-record-header, .ops-card-top) {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    :is(.member-actions, .rank-actions, .rank-row-actions, .row-actions,
        .ops-actions, .citizen-offense-actions, .member-management-actions) {
        width: 100%;
        flex-wrap: wrap;
    }

    :is(.member-actions, .rank-actions, .rank-row-actions, .row-actions,
        .ops-actions, .citizen-offense-actions, .member-management-actions) > :is(button, a, select) {
        flex: 1 1 130px;
        min-width: 0 !important;
    }

    .medical-confidentiality-badge {
        align-self: flex-start;
    }
}

/* Phone: bottom navigation, single-column data and thumb-friendly controls. */
@media (max-width: 640px) {
    body:is(.dashboard-page, .city-page, .service-page, .enterprise-page) {
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    :is(.sidebar, .city-sidebar, .service-sidebar, .enterprise-sidebar) {
        right: max(8px, env(safe-area-inset-right)) !important;
        bottom: max(8px, env(safe-area-inset-bottom)) !important;
        left: max(8px, env(safe-area-inset-left)) !important;
        width: auto !important;
        max-width: none !important;
        height: 68px !important;
        padding: 7px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    :is(.sidebar, .city-sidebar, .service-sidebar, .enterprise-sidebar)::-webkit-scrollbar {
        display: none;
    }

    :is(.admin-sidebar-separator, .admin-sidebar-label, .nav-section, .enterprise-nav-section) {
        display: none !important;
    }

    :is(.sidebar-nav, .city-navigation, .service-navigation, .enterprise-nav) {
        width: max-content !important;
        min-width: max-content !important;
        flex: 0 0 auto !important;
        justify-content: flex-start !important;
        overflow: visible !important;
    }

    :is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link) {
        width: 52px;
        min-width: 52px !important;
        flex: 0 0 52px !important;
        scroll-snap-align: center;
    }

    :is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link):hover {
        transform: none !important;
    }

    :is(.dashboard-content, .city-content, .service-content, .enterprise-content) {
        padding: 26px clamp(14px, 4.5vw, 20px) calc(108px + env(safe-area-inset-bottom)) !important;
    }

    :is(.dashboard-header, .city-header, .service-header, .enterprise-header,
        .admin-module-header, .account-header, .admin-users-header, .admin-page-heading) {
        gap: 17px !important;
        margin-bottom: 26px !important;
    }

    :is(.dashboard-header, .city-header, .service-header, .enterprise-header,
        .admin-module-header, .account-header, .service-module-header,
        .module-header, .admin-users-header, .admin-page-heading) h1 {
        overflow-wrap: anywhere;
        font-size: clamp(27px, 8vw, 32px) !important;
        line-height: 1.08 !important;
    }

    :is(.dashboard-header, .city-header, .service-header, .enterprise-header,
        .admin-module-header, .account-header, .service-module-header,
        .module-header, .admin-users-header, .admin-page-heading) p {
        font-size: 12px !important;
        line-height: 1.6;
    }

    :is(.dashboard-grid, .admin-dashboard-grid, .getting-started-grid,
        .service-actions-grid, .service-home-tools, .enterprise-overview-grid,
        .products-grid, .plans-grid, .feature-grid, .admin-module-grid,
        .admin-module-two-cols, .city-admin-grid, .permissions-layout,
        .admin-users-layout, .account-grid) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    :is(.admin-stats-secondary, .platform-stats) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    :is(.service-module-header, .module-header, .module-toolbar) > :is(button, a),
    :is(.module-header-actions, .city-header-actions, .service-header-actions) > :is(button, a),
    :is(.dashboard-header, .city-header, .service-header, .enterprise-header) > :is(button, a) {
        width: 100% !important;
        flex-basis: 100%;
    }

    :is(.stat-card, .service-stat-card, .admin-stat-card, .account-stat,
        .getting-card, .service-action-card, .service-home-tool,
        .admin-panel-card, .admin-module-card, .module-card,
        .enterprise-panel, .permissions-ranks, .permissions-editor) {
        padding: clamp(16px, 5vw, 21px) !important;
    }

    .citizens-search {
        margin-top: 22px !important;
    }

    .citizens-search-box {
        gap: 8px;
        padding-inline: 12px;
    }

    .citizens-search-box input[type="search"] {
        min-width: 0;
        font-size: 12px;
    }

    :is(.form-actions, .service-settings-actions, .justice-modal-footer,
        .ops-form-actions, .enterprise-modal .form-actions, .rank-form-actions,
        .admin-modal-actions, .delete-document-actions, .subscription-cancel-actions,
        .discord-modal-actions) {
        align-items: stretch !important;
        flex-direction: column-reverse !important;
        gap: 10px !important;
    }

    :is(.form-actions, .service-settings-actions, .justice-modal-footer,
        .ops-form-actions, .enterprise-modal .form-actions, .rank-form-actions,
        .admin-modal-actions, .delete-document-actions, .subscription-cancel-actions,
        .discord-modal-actions) > :is(button, a) {
        width: 100% !important;
        justify-content: center;
    }

    :is(.modal-backdrop, .rank-modal-backdrop, .enterprise-modal-backdrop,
        .admin-modal-overlay, .omni-discord-modal-backdrop, .delete-document-modal,
        .ops-modal, .justice-modal-backdrop) {
        align-items: flex-end !important;
        padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)) !important;
    }

    :is(.modal-card, .rank-modal-card, .enterprise-modal, .admin-modal,
        .omni-discord-modal, .ops-modal-card, .justice-modal-card,
        .delete-document-modal-card) {
        width: 100% !important;
        max-width: none !important;
        max-height: calc(100dvh - max(16px, env(safe-area-inset-top) + env(safe-area-inset-bottom))) !important;
        overflow-y: auto !important;
        border-radius: 17px 17px 11px 11px !important;
    }

    .auth-container {
        padding: 84px 14px 36px !important;
    }

    .auth-card {
        padding: 26px 20px !important;
    }

    .auth-logo {
        top: 20px;
        left: 18px;
    }

    .shop-page {
        width: min(100% - 24px, 1180px);
        padding-top: 22px;
    }

    .shop-topbar {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 14px;
    }

    body > footer {
        padding: 38px 18px;
    }
}

@media (max-width: 380px) {
    :is(.dashboard-content, .city-content, .service-content, .enterprise-content) {
        padding-inline: 12px !important;
    }

    :is(.sidebar, .city-sidebar, .service-sidebar, .enterprise-sidebar) {
        right: 6px !important;
        bottom: max(6px, env(safe-area-inset-bottom)) !important;
        left: 6px !important;
    }

    :is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link) {
        width: 49px;
        min-width: 49px !important;
        flex-basis: 49px !important;
    }

    .auth-card {
        padding-inline: 17px !important;
    }
}

@media (max-height: 620px) and (min-width: 641px) and (max-width: 1180px) {
    :is(.sidebar, .city-sidebar, .service-sidebar, .enterprise-sidebar) {
        padding-top: 14px !important;
        padding-bottom: 12px !important;
    }

    :is(.sidebar-logo.brand-link, .service-logo.brand-link,
        .enterprise-brand, .city-omni-logo.brand-link) {
        min-height: 42px;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    :is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link) {
        min-height: 42px !important;
        padding-block: 5px !important;
    }
}

@media (max-width: 640px) {
    :root {
        --omni-sidebar-width: 0px;
    }

    body:is(.dashboard-page, .city-page, .service-page, .enterprise-page) {
        padding-bottom: 82px;
    }

    :is(.sidebar, .city-sidebar, .service-sidebar, .enterprise-sidebar) {
        width: auto !important;
        height: 66px !important;
        inset: auto 10px 10px !important;
        padding: 7px !important;
        flex-direction: row;
        align-items: center;
        border: 1px solid rgba(255, 255, 255, 0.09) !important;
        border-radius: 18px !important;
        background: rgba(12, 13, 19, 0.96) !important;
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45) !important;
    }

    :is(.sidebar-logo, .city-brand, .service-logo, .enterprise-brand, .sidebar-bottom,
        .city-sidebar-bottom, .service-sidebar-bottom, .enterprise-back) {
        display: none !important;
    }

    :is(.sidebar-nav, .city-navigation, .service-navigation, .enterprise-nav) {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 3px !important;
        overflow-x: auto;
        overflow-y: hidden;
    }

    :is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link) {
        min-width: 51px;
        min-height: 50px !important;
        flex: 1 0 51px;
        border-radius: 13px !important;
    }

    :is(.sidebar-nav a.active, .city-nav-link.active, .service-nav-link.active, .enterprise-nav-link.active)::before {
        display: none;
    }

    :is(.dashboard-content, .city-content, .service-content, .enterprise-content) {
        margin-left: 0 !important;
        padding: 30px 17px 100px !important;
    }

    :is(.dashboard-header, .city-header, .service-header, .enterprise-header, .admin-module-header, .account-header) {
        flex-direction: column;
        gap: 20px;
        margin-bottom: 28px;
    }

    :is(.dashboard-header, .city-header, .service-header, .enterprise-header, .admin-module-header, .account-header) h1 {
        font-size: 30px !important;
    }

    :is(.city-stats, .service-stats, .enterprise-metrics, .admin-stats-grid, .account-stats) {
        grid-template-columns: 1fr;
    }

    :is(.stat-card, .service-stat-card, .enterprise-metrics > article, .admin-stat-card, .account-stat) {
        min-height: 104px;
    }

    :is(.primary-action, .service-primary-button, .medical-primary-button, .auth-button,
        .create-city-button, .create-city-secondary) {
        min-height: 46px;
    }

    .navbar nav {
        display: none;
    }

    .auth-card {
        padding: 28px 22px !important;
    }

    .getting-started-grid {
        grid-template-columns: 1fr !important;
    }

    .getting-started-grid .getting-card {
        min-height: 0;
    }
}

/* V6 phone rules must remain the final word after the legacy shell fallback. */
@media (max-width: 640px) {
    body:is(.dashboard-page, .city-page, .service-page, .enterprise-page) {
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    :is(.sidebar, .city-sidebar, .service-sidebar, .enterprise-sidebar) {
        right: max(8px, env(safe-area-inset-right)) !important;
        bottom: max(8px, env(safe-area-inset-bottom)) !important;
        left: max(8px, env(safe-area-inset-left)) !important;
        width: auto !important;
        height: 68px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    :is(.sidebar-nav, .city-navigation, .service-navigation, .enterprise-nav) {
        width: max-content !important;
        min-width: max-content !important;
        flex: 0 0 auto !important;
        overflow: visible !important;
    }

    :is(.sidebar-nav a, .city-nav-link, .service-nav-link, .enterprise-nav-link) {
        width: 52px;
        min-width: 52px !important;
        flex: 0 0 52px !important;
    }

    :is(.dashboard-content, .city-content, .service-content, .enterprise-content) {
        padding: 26px clamp(14px, 4.5vw, 20px) calc(108px + env(safe-area-inset-bottom)) !important;
    }

    :is(.city-sidebar-bottom, .service-sidebar-bottom) {
        display: flex !important;
        align-items: center;
        flex: 0 0 auto;
        margin: 0 0 0 4px !important;
        padding: 0 0 0 6px !important;
        border: 0 !important;
        border-left: 1px solid var(--omni-border) !important;
    }

    :is(.city-sidebar-bottom .back-dashboard,
        .service-sidebar-bottom .back-city,
        .enterprise-back) {
        width: 52px !important;
        min-width: 52px !important;
        height: 52px !important;
        min-height: 52px !important;
        display: grid !important;
        place-items: center;
        flex: 0 0 52px;
        margin: 0 0 0 4px !important;
        padding: 0 !important;
        border: 1px solid var(--omni-border-strong) !important;
        border-radius: 13px !important;
        background: rgba(255, 255, 255, 0.035) !important;
        color: transparent !important;
        box-shadow: none !important;
        font-size: 0 !important;
        text-decoration: none;
        scroll-snap-align: end;
    }

    :is(.city-sidebar-bottom .back-dashboard,
        .service-sidebar-bottom .back-city,
        .enterprise-back)::before {
        content: "←";
        color: var(--omni-text);
        font-size: 19px;
        line-height: 1;
    }

    :is(.city-sidebar-bottom .back-dashboard,
        .service-sidebar-bottom .back-city,
        .enterprise-back):hover {
        border-color: var(--omni-accent-border) !important;
        background: var(--omni-accent-soft) !important;
        transform: none !important;
    }

    :is(.city-sidebar, .service-sidebar, .enterprise-sidebar) {
        overflow-x: hidden !important;
    }

    :is(.city-sidebar .city-navigation,
        .service-sidebar .service-navigation,
        .enterprise-sidebar .enterprise-nav) {
        width: auto !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    :is(.city-sidebar .city-navigation,
        .service-sidebar .service-navigation,
        .enterprise-sidebar .enterprise-nav)::-webkit-scrollbar {
        display: none;
    }

    :is(.city-sidebar-bottom, .service-sidebar-bottom, .enterprise-back) {
        position: relative;
        z-index: 5;
        flex-shrink: 0;
        background: var(--omni-sidebar) !important;
        box-shadow: -12px 0 20px var(--omni-sidebar) !important;
    }

    .admin-page .sidebar {
        overflow-x: hidden !important;
    }

    .admin-page .sidebar > .sidebar-nav:first-of-type {
        width: auto !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none;
    }

    .admin-page .sidebar > .sidebar-nav:first-of-type::-webkit-scrollbar {
        display: none;
    }

    .admin-page .sidebar > .sidebar-nav:last-of-type {
        width: auto !important;
        min-width: 62px !important;
        flex: 0 0 62px !important;
        margin-left: 4px;
        padding-left: 6px;
        overflow: visible !important;
        border-left: 1px solid var(--omni-border);
        background: var(--omni-sidebar);
        box-shadow: -12px 0 20px var(--omni-sidebar);
    }

    .admin-page .sidebar > .sidebar-nav:last-of-type a {
        width: 52px;
        min-width: 52px !important;
        flex: 0 0 52px !important;
        border-color: var(--omni-border-strong) !important;
        background: rgba(255, 255, 255, 0.035) !important;
    }
}

/* =========================================================
   NAVIGATION SECONDAIRE ET PAGE 404
   ========================================================= */

.page-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    color: #6f7281;
    font-size: 12px;
    line-height: 1.4;
}

.page-breadcrumbs a {
    color: #9b9eae;
    text-decoration: none;
    transition: color 160ms ease;
}

.page-breadcrumbs a:hover,
.page-breadcrumbs a:focus-visible,
.error-text-link:hover,
.error-text-link:focus-visible {
    color: #a79bff;
}

.page-breadcrumbs [aria-current="page"] {
    color: #d9dae3;
}

.auth-breadcrumbs {
    width: min(100%, 480px);
    margin-inline: auto;
}

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

.shop-breadcrumbs {
    width: min(100%, 1180px);
    margin: 14px auto 8px;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin: 14px 0;
}

.footer-links a {
    color: #8f92a2;
    text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: #a79bff;
}

.error-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 50% 15%, rgba(121, 105, 255, 0.13), transparent 36%),
        #08090d;
    color: #f8f8fb;
}

.error-topbar {
    width: min(100% - 40px, 1180px);
    margin: 0 auto;
    padding: 28px 0;
}

.error-main {
    width: min(100% - 40px, 900px);
    margin: 8vh auto 0;
}

.error-card {
    position: relative;
    overflow: hidden;
    padding: clamp(34px, 7vw, 76px);
    border: 1px solid rgba(151, 153, 173, 0.19);
    border-radius: 28px;
    background: rgba(15, 16, 23, 0.88);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.error-code {
    position: absolute;
    top: -34px;
    right: 24px;
    color: rgba(121, 105, 255, 0.08);
    font-size: clamp(150px, 30vw, 300px);
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
}

.error-eyebrow {
    position: relative;
    color: #9184ff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.error-card h1 {
    position: relative;
    max-width: 680px;
    margin: 14px 0 18px;
    font-size: clamp(38px, 7vw, 68px);
    letter-spacing: -0.045em;
}

.error-card > p:not(.error-eyebrow) {
    position: relative;
    max-width: 620px;
    color: #9a9cab;
    font-size: 16px;
    line-height: 1.75;
}

.error-actions {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.error-text-link {
    padding: 12px;
    color: #aeb0bd;
    text-decoration: none;
}

@media (max-width: 640px) {
    .page-breadcrumbs {
        margin-bottom: 14px;
    }

    .error-topbar,
    .error-main {
        width: min(100% - 28px, 900px);
    }

    .error-main {
        margin-top: 4vh;
    }

    .error-card {
        border-radius: 22px;
    }

    .error-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .error-actions .button,
    .error-text-link {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}
