:root {
    color-scheme: light;
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg: #e8edf2;
    --surface: #f2f5f8;
    --surface-muted: #e4ebf2;
    --surface-strong: #d4dfe9;
    --text: #1a2433;
    --muted: #5c6b7d;
    --line: #cfd8e3;
    --brand: #0f3d5e;
    --brand-strong: #09283f;
    --brand-soft: #dce9ef;
    --brand-gradient-end: #0f3d5e;
    --accent: #0f8f8c;
    --accent-strong: #0a6f6d;
    --danger: #b8323f;
    --warning: #b77713;
    --success: #20765b;
    --shadow: 0 10px 28px rgba(15, 39, 66, 0.08);
    --app-density: 0.9;
    --radius: 8px;
    --radius-input: 8px;
    --header-height: calc(72px * var(--app-density));
    --sidebar-width: calc(260px * var(--app-density));
    --sidebar-width-icons: calc(68px * var(--app-density));
    --form-control-min-height: 2.625rem;
    --form-label-size: 0.82rem;
    --form-field-gap: 0.65rem;
    --status-bar-height: 3rem;
    --app-ui-scale: 1;
    --body-glow: rgba(15, 143, 140, 0.05);
    --mobile-space-1: 0.5rem;
    --mobile-space-2: 0.75rem;
    --mobile-space-3: 1rem;
    --mobile-space-4: 1.5rem;
    --touch-target: 44px;
    --mobile-input-size: 1rem;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-template="rayan"] {
    --font-sans: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, sans-serif;
    --bg: #e8eaef;
    --surface: #f2f3f7;
    --surface-muted: #e4e7ed;
    --surface-strong: #d8dce4;
    --text: #1A1C3D;
    --muted: #5f6b7c;
    --line: #d4d9e2;
    --brand: #2A2E5F;
    --brand-strong: #1e2247;
    --brand-soft: #e4e6ef;
    --brand-gradient-end: #1e2247;
    --accent: #BF1F2D;
    --accent-strong: #9a1924;
    --danger: #BF1F2D;
    --warning: #b77713;
    --success: #20765b;
    --shadow: 0 10px 28px rgba(42, 46, 95, 0.08);
    --radius: 12px;
    --radius-input: 8px;
    --body-glow: rgba(191, 31, 45, 0.04);
}

:root[data-template="classic"] {
    --font-sans: Nunito, ui-sans-serif, system-ui, sans-serif;
    --bg: #eef0f4;
    --surface: #f5f6f9;
    --surface-muted: #e6e9ef;
    --surface-strong: #d8dce6;
    --text: #4a4d5c;
    --muted: #7a7d8c;
    --line: #d8dce6;
    --brand: #4e73df;
    --brand-strong: #2e59d9;
    --brand-soft: #e8ebf4;
    --brand-gradient-end: #224abe;
    --accent: #4e73df;
    --accent-strong: #2e59d9;
    --danger: #e74a3b;
    --warning: #f6c23e;
    --success: #1cc88a;
    --shadow: 0 0.12rem 1.25rem rgba(58, 59, 69, 0.10);
    --radius: 0.35rem;
    --radius-input: 0.35rem;
    --body-glow: rgba(78, 115, 223, 0.05);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f1419;
    --surface: #171e26;
    --surface-muted: #1c242e;
    --surface-strong: #263040;
    --text: #d4dce6;
    --muted: #8b98a8;
    --line: #283040;
    --brand: #5aabba;
    --brand-strong: #7ec4d0;
    --brand-soft: #1a2a36;
    --brand-gradient-end: #142028;
    --accent: #4aafa5;
    --accent-strong: #68c9be;
    --danger: #e07a86;
    --warning: #d9a24a;
    --success: #5ec49e;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
    --body-glow: rgba(74, 175, 165, 0.03);
}

:root[data-theme="dark"][data-template="rayan"] {
    --bg: #0f1118;
    --surface: #181a24;
    --surface-muted: #1e212c;
    --surface-strong: #2a2e3c;
    --line: #2c3040;
    --brand: #565c94;
    --brand-strong: #7078b0;
    --brand-soft: #222638;
    --brand-gradient-end: #1a1d32;
    --accent: #d44a56;
    --accent-strong: #e06a74;
    --body-glow: rgba(212, 74, 86, 0.03);
}

:root[data-theme="dark"][data-template="classic"] {
    --bg: #101218;
    --surface: #181b24;
    --surface-muted: #1e222c;
    --surface-strong: #2a3040;
    --line: #2a3040;
    --brand: #6884e8;
    --brand-strong: #8aa0f0;
    --brand-soft: #222838;
    --brand-gradient-end: #1a2240;
    --accent: #6884e8;
    --accent-strong: #8aa0f0;
    --body-glow: rgba(104, 132, 232, 0.03);
}

[data-theme="dark"] .metric-card,
[data-theme="dark"] .dashboard-hero,
[data-theme="dark"] .dashboard-card,
[data-theme="dark"] .page-hero,
[data-theme="dark"] .settings-hero,
[data-theme="dark"] .app-main > .table {
    box-shadow: none;
}

[data-theme="dark"] .page-hero {
    background: var(--surface);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: calc(100% * var(--app-density));
}

body {
    min-height: 100%;
    margin: 0;
    font-size: calc(13px * var(--app-density));
    background:
        radial-gradient(circle at top left, var(--body-glow), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.5;
}

.app-main {
    font-size: calc(13px * var(--app-density) * var(--app-ui-scale));
}

[data-theme="dark"] body {
    background: var(--bg);
}

a {
    color: var(--accent);
}

a:hover {
    color: var(--accent-strong);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
}

[data-theme="dark"] .app-header {
    background: var(--surface);
    border-bottom-color: var(--line);
}

.app-header__inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.6rem 0.75rem;
    align-items: center;
    min-height: var(--header-height);
    padding: 0.55rem 0.9rem 0.55rem 0.75rem;
}

.sidebar-toggle {
    grid-column: 1;
    grid-row: 1;
}

.global-search {
    grid-column: 2;
    grid-row: 1;
}

.header-actions {
    grid-column: 3;
    grid-row: 1;
}

.app-header__brand {
    display: none;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: calc(var(--header-height) - 1.1rem);
    padding: 0.2rem 0.35rem;
    color: var(--text);
    text-decoration: none;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 2px);
    overflow: hidden;
    transition: box-shadow 0.18s ease;
}

.brand-mark:hover {
    color: var(--text);
    box-shadow: 0 4px 14px rgba(15, 39, 66, 0.08);
}

.sidebar-brand .brand-mark:hover {
    color: inherit;
    box-shadow: none;
}

.brand-logo-img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 0;
    object-fit: contain;
    object-position: center center;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

[data-theme="dark"] .brand-mark:not(.brand-mark--app) {
    background: #ffffff;
    border-color: var(--line);
}

.global-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.6rem 0.85rem;
    color: var(--muted);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.global-search:focus-within {
    color: var(--text);
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 80%);
}

.global-search > i {
    flex-shrink: 0;
    font-size: 0.9rem;
}

.global-search input {
    width: 100%;
    min-width: 0;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 0.95rem;
}

.global-search input::placeholder {
    color: var(--muted);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.page-scale-toggle {
    position: relative;
}

.page-scale-toggle.is-active {
    color: var(--accent-strong);
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--accent), transparent 55%);
}

.page-scale-indicator {
    position: absolute;
    top: -0.15rem;
    right: -0.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.05rem;
    padding: 0 0.25rem;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    background: var(--accent);
    border: 2px solid var(--surface);
    border-radius: 999px;
    pointer-events: none;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 50%;
    box-shadow: none;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.icon-button:hover,
.icon-button:focus-visible {
    color: var(--accent-strong);
    background: var(--brand-soft);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.icon-button:active {
    transform: translateY(0);
}

.icon-button--ghost {
    background: transparent;
    border-color: transparent;
}

.icon-button--ghost:hover,
.icon-button--ghost:focus-visible {
    background: var(--surface-muted);
}

.icon-button--avatar {
    font-size: 1.15rem;
    color: var(--brand);
}

.notification-button {
    position: relative;
    text-decoration: none;
}

.notification-badge {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--danger);
    border: 2px solid var(--surface);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(184, 50, 63, 0.4);
}

.app-dropdown,
.dropdown-menu.app-dropdown {
    --bs-dropdown-bg: var(--surface);
    --bs-dropdown-color: var(--text);
    --bs-dropdown-link-color: var(--text);
    --bs-dropdown-link-hover-color: var(--text);
    --bs-dropdown-link-hover-bg: var(--surface-muted);
    --bs-dropdown-link-active-color: var(--text);
    --bs-dropdown-link-active-bg: var(--surface-muted);
    --bs-dropdown-border-color: var(--line);
    min-width: 190px;
    padding: 0.4rem;
    color: var(--text);
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.app-dropdown .dropdown-item,
.dropdown-menu.app-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    border-radius: 6px;
}

.app-dropdown .dropdown-item:hover,
.app-dropdown .dropdown-item:focus,
.dropdown-menu.app-dropdown .dropdown-item:hover,
.dropdown-menu.app-dropdown .dropdown-item:focus {
    color: var(--text);
    background-color: var(--surface-muted);
}

.app-dropdown .dropdown-item:active,
.dropdown-menu.app-dropdown .dropdown-item:active {
    color: var(--text);
    background-color: var(--surface-strong);
}

.tooltip {
    --bs-tooltip-bg: var(--surface-strong);
    --bs-tooltip-color: var(--text);
}

.app-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
}

.app-workspace {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    width: min(var(--sidebar-width), 88vw);
    height: auto;
    max-height: none;
    padding: 0;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
}

html[data-sidebar-open] .app-sidebar {
    transform: translateX(0);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1055;
    background: rgba(15, 39, 66, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

html[data-sidebar-open] .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sidebar-backdrop[hidden] {
    display: block;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.65rem;
    padding: 0.35rem 0.5rem 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand .brand-mark {
    width: 6.25rem;
    height: 6.25rem;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    transition: transform 0.18s ease;
}

.sidebar-brand .brand-mark:hover {
    box-shadow: none;
    transform: scale(1.03);
}

.sidebar-brand .brand-logo-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    border: 0;
    border-radius: 0;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.22));
}

.sidebar-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    height: 100%;
    padding: 0.85rem 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(180deg, var(--brand-strong), var(--brand-gradient-end));
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0;
    box-shadow: none;
}

[data-theme="dark"] .sidebar-panel {
    background: linear-gradient(180deg, var(--brand-gradient-end), var(--surface));
    border-right-color: var(--line);
}

.sidebar-kicker {
    display: block;
    margin: 0.1rem 0 0.75rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.sidebar-nav {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar-nav a,
.sidebar-settings,
.sidebar-logout button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    color: rgba(255, 255, 255, 0.82);
    text-align: left;
    text-decoration: none;
    background: transparent;
    border: 0;
    border-radius: var(--radius);
}

.sidebar-nav a i,
.sidebar-settings i,
.sidebar-logout i {
    width: 1.25rem;
    font-size: 1.05rem;
    text-align: center;
}

.sidebar-nav a span,
.sidebar-settings span,
.sidebar-logout button span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

.sidebar-nav a:hover,
.sidebar-nav a.active,
.sidebar-settings:hover,
.sidebar-settings.active,
.sidebar-logout button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-nav a.active,
.sidebar-settings.active {
    box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-group {
    margin: 0;
}

.sidebar-group__details {
    margin: 0;
}

.sidebar-group__summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    color: rgba(255, 255, 255, 0.82);
    list-style: none;
    cursor: pointer;
    border-radius: var(--radius);
}

.sidebar-group__summary::-webkit-details-marker {
    display: none;
}

.sidebar-group__summary:hover,
.sidebar-group__summary.is-active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-group__summary.is-active {
    box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-group__summary i {
    width: 1.25rem;
    font-size: 1.05rem;
    text-align: center;
}

.sidebar-group__summary span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    flex: 1;
}

.sidebar-group__chevron {
    display: inline-block;
    margin-left: auto;
    font-size: 0.72rem;
    opacity: 0.75;
    transition: transform 0.15s ease;
}

.sidebar-group__details[open] .sidebar-group__chevron {
    transform: rotate(180deg);
}

.sidebar-group__items {
    display: none;
    gap: 0.2rem;
    margin: 0.2rem 0 0 0.65rem;
    padding: 0 0 0 0.65rem;
    list-style: none;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-group__details[open] .sidebar-group__items {
    display: grid;
}

.sidebar-group__items a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
    min-height: 40px;
    padding: 0.55rem 0.75rem;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    border-radius: var(--radius);
}

.sidebar-group__items a span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

.sidebar-group__items a:hover,
.sidebar-group__items a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-group__items a.active {
    box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 1rem;
}

.sidebar-logout {
    margin: 0;
}

.sidebar-about {
    display: none;
    gap: 0.2rem;
    margin-top: 0.85rem;
    padding: 0.75rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
}

.sidebar-about strong {
    color: #ffffff;
    font-size: 0.88rem;
}

.sidebar-about a {
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
}

.app-main {
    flex: 1;
    width: 100%;
    padding: 1rem;
    background: var(--bg);
}

.app-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    background: transparent;
}

.app-breadcrumbs a {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    color: var(--muted);
    text-decoration: none;
}

.app-breadcrumbs a:hover {
    color: var(--accent);
}

.breadcrumb-separator {
    color: color-mix(in srgb, var(--muted), transparent 45%);
}

.page-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1rem;
    background:
        linear-gradient(135deg, rgba(15, 143, 140, 0.12), transparent),
        var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.page-hero__content p {
    max-width: 48rem;
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.page-hero__meta {
    display: grid;
    gap: 0.2rem;
    min-width: 140px;
    padding: 0.85rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.page-hero__meta span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.page-hero__meta strong {
    color: var(--brand-strong);
    font-size: 1.4rem;
    line-height: 1;
}

.page-hero--hub {
    display: block;
    padding: 1rem 1.1rem 0.9rem;
}

.page-hero__hub-layout {
    display: grid;
    gap: 0.85rem;
}

.page-hero__intro {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    align-items: start;
}

.page-hero--hub .page-hero__content h1 {
    margin: 0.15rem 0 0;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    line-height: 1.15;
}

.page-hero__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
}

.page-hero__view-panel {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
}

.page-hero__meta--compact {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: auto;
    padding: 0.42rem 0.7rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.page-hero__meta--compact span {
    font-size: 0.65rem;
}

.page-hero__meta--compact strong {
    font-size: 1.05rem;
}

.page-hero__action-bar {
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.page-hero__action-bar .page-hero__actions {
    justify-content: flex-start;
}

.page-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.page-hero__actions .ui-command,
.page-hero__actions .btn {
    margin: 0;
}

.page-hero__actions .dashboard-actions {
    margin-top: 0;
}

.page-hero__aside {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
}

.header-trash-link {
    position: relative;
    align-self: center;
    min-height: 2.375rem;
    padding-inline: 0.85rem;
}

.header-trash-link.is-active {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger), transparent 35%);
}

.header-trash-link__count {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.28rem;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: var(--danger);
    border: 2px solid var(--surface);
    border-radius: 999px;
}

.main,
.container {
    width: 100%;
    max-width: none;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.main {
    background:
        linear-gradient(135deg, rgba(15, 143, 140, 0.12), transparent),
        var(--surface);
}

[data-theme="dark"] .main {
    background: var(--surface);
}

.customer-detail h1 {
    margin: 0 0 1rem;
}

.customer-detail__actions {
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.customer-detail__rule {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 1.25rem 0 0;
    opacity: 1;
}

.customer-detail__section {
    margin-top: 1.25rem;
    padding-top: 0.25rem;
}

.customer-detail__section h2 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-strong);
}

.customer-detail__list {
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.customer-detail__list > div {
    display: grid;
    grid-template-columns: minmax(8rem, 14rem) 1fr;
    gap: 0.35rem 1rem;
    align-items: start;
}

.customer-detail__list dt {
    margin: 0;
    font-weight: 600;
    color: var(--muted);
    font-size: 0.9rem;
}

.customer-detail__list dd {
    margin: 0;
    color: var(--text);
    word-break: break-word;
}

.customer-detail__multiline {
    white-space: pre-wrap;
}

.customer-detail__footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
    .customer-detail__list > div {
        grid-template-columns: 1fr;
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--brand-strong);
    letter-spacing: 0;
}

h1 {
    margin: 0;
    font-size: clamp(1.55rem, 4vw, 2.35rem);
    font-weight: 800;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 800;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 0.35rem;
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.dashboard-hero__aside {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1.2rem 1.2rem 0 0;
}

.dashboard-hero__content {
    padding: 1.2rem;
    grid-column: 1 / -1;
}

.dashboard-hero__content p {
    max-width: 42rem;
    margin: 0.65rem 0 0;
    color: var(--muted);
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.dashboard-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}

.customer-create-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.view-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 1.15rem;
    padding: 0.55rem 0.65rem;
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.55), rgba(191, 219, 254, 0.35));
    border: 1px solid var(--line);
    border-radius: 1rem;
}

.view-filter-bar__tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.view-filter-bar__tab {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.9rem;
    color: #0f2744;
    background: #fff;
    border: 1px solid rgba(15, 39, 68, 0.08);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.view-filter-bar__tab:hover {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.view-filter-bar__tab.is-active {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 2px 8px rgba(15, 39, 68, 0.18);
}

.view-filter-bar__trash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    margin-left: auto;
    padding: 0.45rem 0.65rem;
    color: #0f2744;
    background: #fff;
    border: 1px solid rgba(15, 39, 68, 0.12);
    border-radius: 999px;
    font-size: 1rem;
    text-decoration: none;
    flex-shrink: 0;
}

.view-filter-bar__trash:hover,
.view-filter-bar__trash.is-active {
    color: #fff;
    background: #b42318;
    border-color: #b42318;
}

.view-filter-bar__trash-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: #b42318;
    border-radius: 999px;
}

.view-filter-bar__trash.is-active .view-filter-bar__trash-count {
    background: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .view-filter-bar {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.9));
}

[data-theme="dark"] .view-filter-bar__tab {
    color: var(--text);
    background: var(--surface);
    border-color: var(--line);
}

[data-theme="dark"] .view-filter-bar__trash {
    color: var(--text);
    background: var(--surface);
    border-color: var(--line);
}

.customers-hub-filters__options {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.customers-hub-filters__options legend,
.customers-hub-filters__dates-label {
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--muted);
}

.customers-hub-active-filters {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.customers-hub-filters {
    display: grid;
    gap: 1rem;
}

.customers-hub-filters__stages {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.customers-hub-filters__stages legend {
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--muted);
}

.customers-hub-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    font-weight: 600;
}

.customers-hub-filters__dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.75rem;
}

.import-preview-errors {
    margin: 0.75rem 0 0;
    padding-left: 1.1rem;
    color: var(--danger);
}

.dashboard-hero__media {
    min-height: 180px;
    background: var(--surface-muted);
}

.dashboard-hero__media img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.metric-card {
    display: grid;
    gap: 0.35rem;
    min-height: 128px;
    padding: 1rem;
    color: var(--text);
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.metric-card:hover {
    color: var(--text);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.metric-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--brand-strong);
    background: var(--brand-soft);
    border-radius: var(--radius);
}

.metric-card__icon--danger {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger), transparent 88%);
}

.metric-card__icon--success {
    color: var(--success);
    background: color-mix(in srgb, var(--success), transparent 88%);
}

.metric-card__label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-card strong {
    color: var(--brand-strong);
    font-size: clamp(1.7rem, 6vw, 2.6rem);
    line-height: 1;
}

.section-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
    justify-content: space-between;
    margin: 1rem 0 0.75rem;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    font-weight: 900;
}

.section-heading__meta {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.dashboard-card {
    min-width: 0;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.chart-frame {
    position: relative;
    min-height: 280px;
}

.renewal-list {
    display: grid;
    gap: 0.55rem;
}

.renewal-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem;
    color: var(--text);
    text-decoration: none;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.renewal-item:hover {
    color: var(--text);
    border-color: var(--accent);
}

.renewal-item span:first-child {
    display: grid;
    min-width: 0;
}

.renewal-item small,
.empty-state {
    color: var(--muted);
}

.report-summary {
    display: grid;
    gap: 0.75rem;
}

.report-summary > div {
    display: grid;
    gap: 0.25rem;
    padding: 0.85rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.report-summary span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.report-summary strong {
    color: var(--brand-strong);
    font-size: 1.35rem;
}

.report-kpis {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.report-kpi {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    padding: 0.9rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.report-kpi span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.report-kpi strong {
    color: var(--brand-strong);
    font-size: 1.45rem;
    line-height: 1.1;
}

.report-table td[data-label="Sum"] {
    color: var(--brand-strong);
}

.report-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.85rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.report-filters label {
    display: grid;
    gap: 0.3rem;
    margin: 0;
}

.report-filters label span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.report-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: end;
}

.settings-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1.25rem;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(9, 40, 63, 0.98) 0%, rgba(15, 61, 94, 0.94) 42%, rgba(15, 143, 140, 0.9) 100%),
        var(--brand);
    border: 1px solid color-mix(in srgb, var(--brand), #ffffff 18%);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.settings-hero h1,
.settings-hero h2,
.settings-hero h3 {
    color: #ffffff;
}

.settings-hero h1 {
    max-width: 42rem;
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(9, 40, 63, 0.35);
}

.settings-hero p {
    max-width: 48rem;
    margin: 0.75rem 0 0;
    color: rgba(255, 255, 255, 0.88);
}

.settings-hero .eyebrow {
    color: #bdf4ef;
}

.settings-hero__logo-panel {
    min-width: 0;
}

.settings-hero__logo-form {
    height: 100%;
}

.settings-hero__logo-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 8.5rem;
    padding: 1rem 1.15rem 2.35rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius);
}

.settings-hero__logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 6.75rem;
    object-fit: contain;
}

.settings-hero__logo-actions {
    position: absolute;
    right: 0.55rem;
    bottom: 0.55rem;
    display: inline-flex;
    gap: 0.35rem;
}

.settings-hero__logo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    color: #ffffff;
    background: rgba(9, 40, 63, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.settings-hero__logo-btn:hover,
.settings-hero__logo-btn:focus-visible {
    color: #ffffff;
    background: rgba(9, 40, 63, 0.92);
    transform: translateY(-1px);
}

.settings-hero__logo-btn--danger {
    background: rgba(176, 42, 55, 0.88);
}

.settings-hero__logo-btn--danger:hover,
.settings-hero__logo-btn--danger:focus-visible {
    background: rgba(176, 42, 55, 1);
}

.settings-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

.settings-menu {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.55rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.settings-menu a {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-height: var(--touch-target, 44px);
    padding: 0.65rem 0.85rem;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: calc(var(--radius) + 2px);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.settings-menu a i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: var(--accent);
    font-size: 0.9rem;
    background: var(--surface-muted);
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}

.settings-menu a:hover {
    color: var(--text);
    background: var(--surface-muted);
    border-color: var(--line);
}

.settings-menu a.active {
    color: var(--brand-strong);
    font-weight: 800;
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--accent), transparent 65%);
    box-shadow: inset 3px 0 0 var(--accent);
}

.settings-menu a.active i {
    color: #fff;
    background: var(--accent);
}

.settings-menu__divider {
    flex: 0 0 1px;
    width: 1px;
    min-height: 42px;
    background: var(--line);
}

.settings-sections,
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.settings-card {
    display: grid;
    gap: 1.25rem;
    scroll-margin-top: calc(var(--header-height) + 1rem);
    padding: 1.5rem 1.65rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow);
}

.template-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.template-card {
    position: relative;
    display: grid;
    gap: 0.65rem;
    padding: 1.15rem 1.2rem;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: calc(var(--radius) + 2px);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.template-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.template-card:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.template-card--selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.template-card__swatches {
    display: flex;
    gap: 0.4rem;
}

.template-card__swatch {
    width: 1.35rem;
    height: 1.35rem;
    border: 1px solid color-mix(in srgb, var(--line), #000 8%);
    border-radius: 999px;
}

.template-card__label {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
}

.template-card__description {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.template-picker-status {
    min-height: 1.25rem;
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.template-picker-status--busy {
    color: var(--muted);
}

.template-picker-status--success {
    color: var(--success);
    font-weight: 600;
}

.template-picker-status--error {
    color: var(--danger);
    font-weight: 600;
}

.settings-section__header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: start;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid var(--line);
}

.settings-section__header--nested {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.settings-field-note {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: normal;
    text-transform: none;
    color: var(--muted);
}

.settings-field-note--block {
    margin-top: 0.75rem;
}

.settings-label-optional {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: lowercase;
}

.settings-form--user input[disabled] {
    cursor: not-allowed;
    opacity: 0.72;
    background: var(--surface-muted, #f4f6f8);
}

.email-local-field {
    display: flex;
    align-items: stretch;
    max-width: 100%;
}

.email-local-field .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}

.email-local-field__domain {
    display: inline-flex;
    align-items: center;
    padding: 0 0.85rem;
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
    background: var(--surface-muted, #f4f6f8);
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.settings-form__actions--split,
.settings-form__footer--split {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.settings-form--stacked,
.settings-form--general,
.settings-form--company,
.settings-form--email,
.settings-form--user {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.settings-preference-block {
    margin-bottom: 1rem;
    padding: 1.25rem 1.35rem 1.35rem;
    background: var(--surface-muted);
    border: 1px solid color-mix(in srgb, var(--line), transparent 25%);
    border-radius: calc(var(--radius) + 2px);
}

.settings-preference-block:last-of-type {
    margin-bottom: 0;
}

.settings-preference-block__heading {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.15rem;
}

.settings-preference-block__heading i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    color: var(--accent-strong);
    font-size: 0.95rem;
    background: color-mix(in srgb, var(--accent), transparent 88%);
    border-radius: 999px;
}

.settings-preference-block__heading h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
}

.settings-form__row {
    display: grid;
    gap: 1rem 1.25rem;
    align-items: start;
}

.settings-form__row--1 {
    grid-template-columns: minmax(12rem, 16rem);
}

.settings-form__field {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
    margin: 0;
}

@media (min-width: 768px) {
    .settings-form__row--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-form__row--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .settings-form--general .settings-form__row--2 {
        grid-template-columns: repeat(2, minmax(0, 14rem));
    }
}

.settings-form__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--line);
}

.settings-page .settings-form .form-control,
.settings-page .settings-form select.form-control {
    width: 100%;
    min-height: var(--form-control-min-height);
    max-height: var(--form-control-min-height);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.25;
    background: var(--surface);
    border-color: color-mix(in srgb, var(--line), var(--text) 12%);
    box-shadow: inset 0 1px 2px rgba(15, 39, 66, 0.04);
}

.settings-page .settings-form select.form-control {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 16px) calc(50% + 1px),
        calc(100% - 11px) calc(50% + 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.settings-page .settings-form label,
.settings-page .settings-form .settings-form__field {
    gap: 0.45rem;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.settings-page .settings-form label .settings-field-note,
.settings-page .settings-form .settings-form__field .settings-field-note {
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
}

.settings-page .settings-form .form-control:focus,
.settings-page .settings-form select.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 82%);
}

.settings-page .settings-form textarea.form-control {
    min-height: 6.5rem;
    max-height: none;
    resize: vertical;
}

.settings-page .app-alert {
    margin-bottom: 1rem;
    border-radius: calc(var(--radius) + 2px);
}

.settings-input-with-icon {
    display: flex;
    align-items: stretch;
}

.settings-input-with-icon > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    color: var(--muted);
    background: var(--surface-muted, #f4f6f8);
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
}

.settings-input-with-icon .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-bottom: 0;
}

.settings-input-with-icon--time > i {
    min-width: 2.2rem;
    font-size: 0.85rem;
}

.settings-logo-preview-wrap {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.settings-logo-preview {
    display: block;
    max-width: 180px;
    max-height: 72px;
    padding: 0.35rem;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.opening-hours-table {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.opening-hours-table__head,
.opening-hours-table__row {
    display: grid;
    grid-template-columns: minmax(6rem, 1fr) minmax(7rem, 1fr) minmax(7rem, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.opening-hours-table__row:nth-child(even) {
    padding: 0.35rem 0.25rem;
    background: color-mix(in srgb, var(--surface-muted), transparent 35%);
    border-radius: calc(var(--radius) - 2px);
}

.opening-hours-table__head {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.opening-hours-table__day {
    font-weight: 700;
    color: var(--text, #0f2742);
}

.opening-hours-table__closed {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    color: var(--text, #0f2742);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.opening-hours-table__closed input {
    margin: 0;
}

.opening-hours-table__time {
    margin: 0;
}

.ui-command--save i {
    margin-right: 0.25rem;
}

@media (max-width: 767px) {
    .opening-hours-table__head {
        display: none;
    }

    .opening-hours-table__row {
        grid-template-columns: 1fr;
        padding: 0.75rem;
        border: 1px solid var(--line);
        border-radius: var(--radius);
    }
}

.settings-card h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 900;
}

.settings-card p {
    max-width: 48rem;
    margin: 0;
    color: var(--muted);
}

.settings-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    color: var(--accent-strong);
    font-size: 1.15rem;
    background: color-mix(in srgb, var(--accent), transparent 88%);
    border: 1px solid color-mix(in srgb, var(--accent), transparent 70%);
    border-radius: calc(var(--radius) + 2px);
}

.settings-card .eyebrow {
    display: inline-block;
    margin-bottom: 0.2rem;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-card dl {
    display: grid;
    gap: 0.65rem;
    margin: 0;
}

.settings-card dt {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.settings-card dd {
    margin: 0;
}

.settings-actions,
.settings-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.settings-subsection {
    display: grid;
    gap: 0.85rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-soft);
}

.settings-subsection h3 {
    margin: 0;
    font-size: 1.05rem;
}

.settings-subsection > p {
    margin: 0;
    color: var(--text-muted);
}

.developer-log-excerpt {
    max-height: 20rem;
    overflow: auto;
    padding: 0.85rem;
    border-radius: 0.75rem;
    background: rgba(15, 39, 66, 0.06);
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.settings-contact a {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    color: var(--brand-strong);
    font-weight: 800;
    text-decoration: none;
}

.settings-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.settings-form label {
    display: grid;
    gap: 0.45rem;
    margin: 0;
}

.settings-form__actions {
    display: flex;
    justify-content: flex-end;
}

.settings-form__wide {
    grid-column: 1 / -1;
}

.ui-command--ghost {
    color: var(--brand-strong) !important;
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    box-shadow: none !important;
}

.ui-command--ghost:hover {
    color: var(--accent-strong) !important;
    border-color: color-mix(in srgb, var(--accent), transparent 55%) !important;
    background: var(--brand-soft) !important;
}

.settings-import-form {
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.settings-export-summary {
    display: grid;
    gap: 0.65rem;
    margin: 0;
}

.settings-export-summary div {
    display: grid;
    gap: 0.2rem;
    padding: 0.75rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.settings-export-summary dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.settings-export-summary dd {
    margin: 0;
}

.settings-note-list,
.settings-app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.settings-note-list > div,
.settings-app-grid > div {
    display: grid;
    gap: 0.25rem;
    padding: 0.85rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.settings-note-list strong,
.settings-app-grid strong {
    color: var(--brand-strong);
    font-weight: 900;
}

.settings-note-list span,
.settings-app-grid span {
    color: var(--muted);
}

.help-guide__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.help-guide__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.65rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.help-guide__nav a {
    padding: 0.35rem 0.65rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.help-guide__nav a:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent), transparent 55%);
}

.help-guide__content {
    display: grid;
    gap: 1.25rem;
}

.help-guide__section {
    padding: 1rem 1.1rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.help-guide__section h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

.help-guide__section p,
.help-guide__section ul {
    margin: 0 0 0.65rem;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.help-guide__section ul {
    padding-left: 1.15rem;
}

.help-guide__section p:last-child {
    margin-bottom: 0;
}

.help-guide__defs {
    display: grid;
    gap: 0.55rem;
    margin: 0 0 0.65rem;
}

.help-guide__defs div {
    display: grid;
    gap: 0.12rem;
}

.help-guide__defs dt {
    color: var(--brand-strong);
    font-size: 0.82rem;
    font-weight: 800;
}

.help-guide__defs dd {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.help-guide__contact a {
    font-weight: 700;
}

.help-guide__meta {
    font-size: 0.78rem !important;
    opacity: 0.85;
}

@media (min-width: 992px) {
    .help-guide__layout {
        grid-template-columns: minmax(11rem, 0.32fr) minmax(0, 1fr);
        align-items: start;
    }

    .help-guide__nav {
        position: sticky;
        top: calc(var(--header-height) + 1rem);
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0.25rem;
    }

    .help-guide__nav a {
        border-radius: calc(var(--radius) - 2px);
    }
}

.settings-app-grid i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--brand-strong);
    background: var(--brand-soft);
    border-radius: var(--radius);
}

.app-alert {
    border-radius: var(--radius);
}

.page-panel,
.customer-create-panel {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.customer-create-panel[hidden] {
    display: none !important;
}

.panel-copy {
    max-width: 46rem;
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.page-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.page-stat {
    display: grid;
    gap: 0.25rem;
    max-width: 220px;
    padding: 0.85rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.page-stat span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.page-stat strong {
    color: var(--brand-strong);
    font-size: 1.45rem;
    line-height: 1;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.customer-modal .modal-content {
    display: flex;
    flex-direction: column;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(9, 40, 63, 0.22);
    max-height: calc(100vh - 2rem);
}

.customer-modal .modal-header,
.customer-modal .modal-footer {
    border-color: var(--line);
}

.customer-modal .modal-header {
    align-items: flex-start;
    padding: 1rem;
    background: var(--surface);
}

.customer-modal .modal-title {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.9rem);
    font-weight: 900;
}

.customer-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem;
    overflow-y: auto;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--brand-soft), transparent 42%), transparent 18rem),
        var(--bg);
}

.customer-modal form[data-customer-wizard] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.modal-intro {
    margin: 0 0 1rem;
    color: var(--muted);
}

.customer-long-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.customer-long-form h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 0.25rem;
    padding-top: 1rem;
    font-size: 1.05rem;
    font-weight: 900;
    border-top: 1px solid var(--line);
}

.customer-long-form h3::before {
    content: "";
    width: 0.65rem;
    height: 0.65rem;
    background: var(--accent);
    border-radius: 999px;
}

.customer-long-form br {
    display: none;
}

.customer-long-form .form-group,
.customer-long-form .mb-3 {
    display: grid;
    gap: 0.3rem;
    margin: 0 !important;
}

.customer-long-form label {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.customer-long-form textarea {
    min-height: 150px;
}

.modal-form-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
    padding: 0.85rem 1rem;
    background: var(--surface);
}

.wizard-shell {
    display: grid;
    gap: 1rem;
}

.wizard-steps-wrap {
    position: sticky;
    top: -1rem;
    z-index: 3;
    margin: -0.25rem 0 1rem;
    padding: 0.75rem 0;
    background: color-mix(in srgb, var(--bg), transparent 4%);
    border-bottom: 1px solid var(--line);
}

.wizard-steps {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0;
}

.wizard-steps button {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.7rem 0.85rem;
    color: var(--text);
    font-weight: 800;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
}

.wizard-steps button i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: var(--brand-strong);
    background: var(--brand-soft);
    border-radius: 999px;
}

.wizard-steps button.active {
    color: #ffffff;
    background: var(--brand);
    border-color: var(--accent);
    box-shadow: 0 10px 22px rgba(15, 61, 94, 0.2);
}

.wizard-steps button.active i {
    color: var(--brand);
    background: #ffffff;
}

.wizard-content,
.wizard-panel,
.wizard-subform,
.subform-list,
.wizard-captured {
    min-width: 0;
}

.wizard-captured {
    display: grid;
    gap: 0.75rem;
    align-content: start;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.wizard-captured h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
}

.wizard-captured-list {
    display: grid;
    gap: 0.55rem;
}

.wizard-captured-list > div {
    display: grid;
    gap: 0.15rem;
    padding: 0.65rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.wizard-captured-list span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.wizard-captured-list strong {
    overflow-wrap: anywhere;
    font-size: 0.85rem;
}

.wizard-panel {
    display: none;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.wizard-panel.active {
    display: grid;
}

.wizard-panel h3,
.wizard-panel h4 {
    margin: 0;
    font-weight: 900;
}

.wizard-panel h3 {
    font-size: 1.25rem;
}

.wizard-panel h4 {
    font-size: 1rem;
}

.wizard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.wizard-grid label,
.wizard-panel > label {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.wizard-grid .form-control,
.wizard-panel > label .form-control,
.customer-long-form .form-control {
    min-height: 42px;
}

.wizard-subform {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.wizard-subform .section-heading {
    margin: 0;
    align-items: center;
}

.subform-list {
    display: grid;
    gap: 0.75rem;
}

.subform-item {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.subform-item__header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    justify-content: space-between;
}

.wizard-overview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

.wizard-overview > div {
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.wizard-overview span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.wizard-overview strong {
    overflow-wrap: anywhere;
}

.wizard-footer {
    gap: 0.55rem;
    justify-content: flex-end;
    padding: 0.85rem 1rem;
    background: var(--surface);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    margin-top: 1rem;
}

.table-responsive {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.customers-hub-table {
    width: 100%;
    min-width: 48rem;
    margin-bottom: 0;
}

.table-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    align-items: end;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.table-tools::before {
    content: "Table filters";
    color: var(--brand-strong);
    font-size: 0.86rem;
    font-weight: 900;
}

.table-tool {
    min-height: 42px;
    width: 100%;
    color: var(--text);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

label.table-tool {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

label.table-tool span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.table-tool input,
.table-tools select {
    min-height: 42px;
    padding: 0.55rem 0.7rem;
}

.table-reset {
    min-height: 42px;
    color: var(--brand-strong);
    font-weight: 800;
    background: var(--brand-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.table-count {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.app-main > .table {
    display: block;
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.app-main > .table thead,
.app-main > .table tbody,
.app-main > .table tr {
    width: 100%;
}

.table {
    margin-bottom: 0;
    color: var(--text);
    vertical-align: middle;
}

.table thead,
.table-striped thead {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand-strong), var(--brand));
}

[data-theme="dark"] .table thead,
[data-theme="dark"] .table-striped thead {
    color: var(--text);
    background: linear-gradient(135deg, var(--surface-strong), var(--surface-muted));
}

.table th {
    padding: 0.85rem;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
    border: 0;
}

.table-sort {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 34px;
    color: inherit;
    font: inherit;
    text-transform: inherit;
    white-space: nowrap;
    background: transparent;
    border: 0;
}

.table-sort:hover,
.table-sort:focus {
    color: #ffffff;
    text-decoration: underline;
}

.table td {
    padding: 0.85rem;
    color: var(--text);
    border-color: var(--line);
}

.table-actions-cell {
    min-width: auto;
    white-space: nowrap;
}

.table-actions-cell__primary,
.table-actions-cell__more {
    margin: 0.25rem 0.25rem 0.25rem 0;
}

.table-actions-cell__desktop {
    gap: 0.35rem;
    align-items: center;
}

.table-actions-cell__desktop .btn,
.table-actions-cell__desktop .ui-command {
    margin: 0 !important;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
}

.action-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    min-height: 34px;
    padding: 0.42rem 0.65rem !important;
    color: var(--text) !important;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    background: var(--surface-muted) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius);
    box-shadow: none;
}

.action-btn i {
    font-size: 0.8rem;
}

.action-btn:hover,
.action-btn:focus {
    color: var(--brand-strong) !important;
    background: var(--brand-soft) !important;
    border-color: var(--accent) !important;
}

.action-btn--primary {
    color: var(--brand-strong) !important;
    background: var(--brand-soft) !important;
}

.action-btn--info {
    color: var(--accent-strong) !important;
    background: color-mix(in srgb, var(--accent), transparent 86%) !important;
}

.action-btn--success {
    color: var(--success) !important;
    background: color-mix(in srgb, var(--success), transparent 88%) !important;
}

.action-btn--warning {
    color: var(--warning) !important;
    background: color-mix(in srgb, var(--warning), transparent 88%) !important;
}

.action-btn--danger {
    color: var(--danger) !important;
    background: color-mix(in srgb, var(--danger), transparent 88%) !important;
}

.ui-command {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 0.25rem 0.25rem 0.25rem 0;
    color: #ffffff !important;
    background: var(--brand) !important;
    border-color: var(--brand) !important;
}

.ui-command--info {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}

.ui-command--success {
    background: var(--success) !important;
    border-color: var(--success) !important;
}

.ui-command--warning {
    background: var(--warning) !important;
    border-color: var(--warning) !important;
}

.ui-command--danger {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
}

.ui-command[hidden] {
    display: none !important;
}

.ui-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.28rem 0.58rem;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 999px;
}

.ui-badge--primary {
    color: var(--brand-strong);
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand), transparent 70%);
}

.ui-badge--info {
    color: var(--accent-strong);
    background: color-mix(in srgb, var(--accent), transparent 88%);
    border-color: color-mix(in srgb, var(--accent), transparent 68%);
}

.ui-badge--success {
    color: var(--success);
    background: color-mix(in srgb, var(--success), transparent 88%);
    border-color: color-mix(in srgb, var(--success), transparent 68%);
}

.ui-badge--warning {
    color: var(--warning);
    background: color-mix(in srgb, var(--warning), transparent 88%);
    border-color: color-mix(in srgb, var(--warning), transparent 68%);
}

.ui-badge--danger {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger), transparent 88%);
    border-color: color-mix(in srgb, var(--danger), transparent 68%);
}

.ui-badge--neutral {
    color: var(--muted);
    background: var(--surface-muted);
    border-color: var(--line);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    color: var(--text);
    background-color: color-mix(in srgb, var(--surface-muted), transparent 42%);
}

.table tbody tr:hover > * {
    background: var(--brand-soft);
}

.btn {
    min-height: 40px;
    padding: 0.55rem 0.9rem;
    font-weight: 700;
    border-radius: var(--radius);
}

.btn-primary,
.btn-primary-custom,
.btn-info-custom {
    color: #ffffff !important;
    background: var(--brand) !important;
    border-color: var(--brand) !important;
}

.btn-danger,
.btn-danger-custom,
.btn-warning {
    color: #ffffff !important;
    background: var(--danger) !important;
    border-color: var(--danger) !important;
}

.btn:hover {
    filter: brightness(0.96);
}

.btn-group {
    gap: 0.45rem;
}

.btn-group .btn {
    margin-right: 0 !important;
}

.form-control,
input,
select,
textarea {
    color: var(--text);
    background-color: var(--surface);
    border-color: var(--line);
    border-radius: var(--radius-input);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    color: var(--text);
    background-color: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 0.18rem color-mix(in srgb, var(--accent) 22%, transparent);
}

body.app-shell {
    padding-bottom: var(--status-bar-height);
}

.app-status-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    height: var(--status-bar-height);
    overflow: hidden;
    color: var(--text);
    background: color-mix(in srgb, var(--surface), var(--bg) 35%);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(15, 39, 66, 0.08);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .app-status-bar {
    background: color-mix(in srgb, var(--surface), #000 18%);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28);
}

.app-status-bar__shell {
    width: 100%;
    height: 100%;
    padding-inline: 0.75rem;
}

.app-status-bar__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.status-bar__cluster {
    display: flex;
    align-items: center;
    min-width: 0;
}

.status-bar__cluster--clock {
    grid-column: 3;
    flex-shrink: 0;
    justify-content: flex-end;
    justify-self: end;
}

.status-bar__cluster--kpis {
    grid-column: 1;
    flex-wrap: nowrap;
    gap: 0.35rem;
    justify-content: flex-start;
    justify-self: start;
}

.status-bar__cluster--tools {
    grid-column: 2;
    flex-shrink: 0;
    gap: 0.45rem;
    justify-content: center;
    justify-self: center;
}

.status-bar__sep {
    color: color-mix(in srgb, var(--muted), transparent 35%);
    font-size: 0.72rem;
    font-weight: 300;
    line-height: 1;
    user-select: none;
}

.status-bar__datetime {
    display: inline-flex;
    flex-shrink: 0;
    gap: 0.45rem;
    align-items: center;
    padding: 0.28rem 0.55rem;
    line-height: 1.1;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.status-bar__datetime-icon {
    color: var(--accent);
    font-size: 0.72rem;
}

.status-bar__datetime-copy {
    display: grid;
    gap: 0;
    min-width: 4.25rem;
}

.status-bar__datetime-copy strong {
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.status-bar__datetime-copy small {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 700;
}

.status-bar__health-badge {
    display: inline-flex;
    flex-shrink: 0;
    gap: 0.35rem;
    align-items: center;
    padding: 0.28rem 0.55rem;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.status-bar__health-copy {
    display: grid;
    gap: 0;
    line-height: 1.05;
}

.status-bar__health-copy strong {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.status-bar__health-copy small {
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.status-bar__health-badge:hover {
    color: inherit;
    border-color: var(--accent);
}

.status-bar__health-badge--pass {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success), transparent 65%);
}

.status-bar__health-badge--pass .status-bar__health-copy strong {
    color: var(--success);
}

.status-bar__health-badge--warn {
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning), transparent 65%);
}

.status-bar__health-badge--warn .status-bar__health-copy strong {
    color: var(--warning);
}

.status-bar__health-badge--fail {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger), transparent 65%);
}

.status-bar__health-badge--fail .status-bar__health-copy strong {
    color: var(--danger);
}

.status-bar__kpis {
    display: contents;
}

.status-kpi {
    display: inline-flex;
    flex-shrink: 0;
    gap: 0.35rem;
    align-items: center;
    min-width: 0;
    padding: 0.15rem 0.2rem;
    color: inherit;
    text-decoration: none;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.status-kpi__copy {
    display: inline-flex;
    gap: 0.3rem;
    align-items: baseline;
    line-height: 1.05;
}

.status-kpi__copy small {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-kpi i {
    display: none;
}

.status-kpi strong {
    font-size: 0.82rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.status-kpi:hover {
    color: var(--accent-strong);
}

.status-kpi:hover small {
    color: var(--accent);
}

.status-kpi--success i,
.status-kpi--success strong {
    color: var(--success);
}

.status-kpi--warn i,
.status-kpi--warn strong {
    color: var(--warning);
}

.status-kpi--danger i,
.status-kpi--danger strong {
    color: var(--danger);
}

.status-bar__actions {
    display: inline-flex;
    flex-shrink: 0;
    gap: 0.5rem;
    align-items: center;
}

.status-bar__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    color: #fff !important;
    font-size: 0.72rem;
    line-height: 1;
    text-decoration: none;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 999px;
}

.status-bar__btn-count {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0.95rem;
    height: 0.95rem;
    padding: 0 0.2rem;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    background: var(--danger);
    border: 2px solid var(--surface);
    border-radius: 999px;
}

.status-bar__btn--alert {
    background: var(--danger);
    border-color: var(--danger);
}

.status-bar__btn:hover {
    color: #fff !important;
    filter: brightness(1.06);
}

.status-bar__btn--ghost {
    color: var(--text) !important;
    background: var(--surface);
    border-color: var(--line);
}

.status-bar__btn--ghost:hover {
    color: var(--text) !important;
    border-color: var(--danger);
}

.app-mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    color: var(--text);
    background: color-mix(in srgb, var(--surface), var(--bg) 20%);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(15, 39, 66, 0.1);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .app-mobile-nav {
    background: color-mix(in srgb, var(--surface), #000 18%);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28);
}

.app-mobile-nav__inner {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.15rem;
    align-items: end;
    min-height: var(--mobile-nav-height, 3.35rem);
    padding: 0.35rem 0.35rem calc(0.2rem + var(--safe-area-bottom));
}

.app-mobile-nav__item {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    gap: 0.12rem;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    min-height: var(--touch-target, 44px);
    padding: 0.2rem 0.1rem 0.05rem;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    background: transparent;
    border: 0;
}

.app-mobile-nav__item > i {
    font-size: 1.05rem;
    line-height: 1;
}

.app-mobile-nav__item.is-active {
    color: var(--accent);
}

.app-mobile-nav__item--action {
    gap: 0.2rem;
    padding-top: 0;
}

.app-mobile-nav__action-icon {
    display: grid;
    place-items: center;
    width: 2.85rem;
    height: 2.85rem;
    margin-top: -0.95rem;
    color: #fff;
    background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent), #000 18%));
    border-radius: 999px;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--accent), transparent 55%);
}

.app-mobile-nav__action-icon i {
    font-size: 1.1rem;
}

.app-mobile-nav__badge {
    position: absolute;
    top: 0.15rem;
    right: calc(50% - 1.05rem);
    width: 0.45rem;
    height: 0.45rem;
    background: var(--danger);
    border: 2px solid var(--surface);
    border-radius: 50%;
}

.app-mobile-nav__more {
    position: relative;
    display: flex;
    justify-content: center;
}

.app-mobile-nav__more > .app-mobile-nav__item {
    width: 100%;
}

.app-mobile-nav__menu {
    min-width: 12.5rem;
    margin-bottom: 0.35rem;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: var(--shadow);
}

.app-mobile-nav__menu .dropdown-item {
    display: inline-flex;
    gap: 0.55rem;
    align-items: center;
    min-height: var(--touch-target, 44px);
    padding-inline: 0.75rem;
    font-weight: 700;
}

.app-mobile-nav__menu .dropdown-item i {
    width: 1rem;
    color: var(--accent);
    text-align: center;
}

.hub-view-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
}

.hub-view-switcher--icons {
    gap: 0.35rem;
    justify-content: flex-end;
}

.hub-view-switcher__tab {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    padding: 0.42rem 0.75rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.hub-view-switcher--icons .hub-view-switcher__tab {
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border-radius: calc(var(--radius) - 2px);
}

.hub-view-switcher--icons .hub-view-switcher__tab span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hub-view-switcher--icons .hub-view-switcher__tab i {
    font-size: 0.92rem;
}

.hub-view-switcher--segmented {
    padding: 0.2rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 2px);
    gap: 0.15rem;
}

.hub-view-switcher--segmented .hub-view-switcher__tab {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.hub-view-switcher--segmented .hub-view-switcher__tab:hover {
    color: var(--brand);
    background: color-mix(in srgb, var(--brand-soft), transparent 35%);
}

.hub-view-switcher__tab.is-active {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.hub-view-switcher--segmented .hub-view-switcher__tab.is-active {
    box-shadow: 0 1px 6px rgba(9, 40, 63, 0.18);
}

.hub-view-switcher--segmented .hub-view-switcher__tab.is-active:hover {
    color: #fff;
    background: var(--brand);
}

.customers-calendar {
    display: grid;
    gap: 0.85rem;
}

.customers-calendar__toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.customers-calendar__nav {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.customers-calendar__nav-btn {
    min-width: 2.35rem;
    padding-inline: 0.55rem !important;
}

.customers-calendar__period {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: end;
    justify-content: center;
    min-width: 0;
}

.customers-calendar__period-field {
    display: grid;
    gap: 0.25rem;
    min-width: 7.5rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.customers-calendar__period-field .form-control {
    min-height: 2.25rem;
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.customers-calendar__heading {
    display: grid;
    gap: 0.15rem;
    justify-items: end;
    min-width: 0;
    text-align: right;
}

.customers-calendar__heading h2 {
    margin: 0;
    font-size: 1.1rem;
}

.customers-calendar__today {
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 800;
    text-decoration: none;
}

.customers-calendar__today:hover {
    color: var(--accent);
}

.customers-agenda {
    display: grid;
    gap: 0.85rem;
}

.customers-agenda__list {
    display: grid;
    gap: 0.75rem;
}

.customers-agenda__group {
    padding: 0.85rem 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) - 1px);
}

.customers-agenda__group header {
    margin-bottom: 0.55rem;
    color: var(--brand-strong);
    font-size: 0.88rem;
    font-weight: 800;
}

.customers-agenda__group ul {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.customers-agenda__item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.customers-agenda__badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    border-radius: 999px;
}

.customers-agenda__item--start .customers-agenda__badge {
    color: var(--accent-strong);
    background: color-mix(in srgb, var(--accent), transparent 88%);
}

.customers-agenda__item--renewal .customers-agenda__badge {
    color: var(--warning);
    background: color-mix(in srgb, var(--warning), transparent 88%);
}

.customers-agenda__item a {
    color: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.customers-agenda__item a:hover {
    color: var(--accent-strong);
}

.customers-timeline {
    display: grid;
    gap: 0.85rem;
}

.customers-timeline__list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.customers-timeline__item {
    display: grid;
    grid-template-columns: 1.1rem 1fr;
    gap: 0.85rem;
    padding: 0.65rem 0;
}

.customers-timeline__item:not(:last-child) {
    border-bottom: 1px solid var(--line);
}

.customers-timeline__marker {
    position: relative;
    width: 0.75rem;
    height: 0.75rem;
    margin-top: 0.35rem;
    background: var(--brand);
    border: 2px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand), transparent 70%);
}

.customers-timeline__item--renewal .customers-timeline__marker {
    background: var(--warning);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning), transparent 70%);
}

.customers-timeline__content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    align-items: center;
}

.customers-timeline__content time {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.customers-timeline__badge {
    padding: 0.15rem 0.45rem;
    color: var(--brand);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--brand-soft);
    border-radius: 999px;
}

.customers-timeline__item--renewal .customers-timeline__badge {
    color: #8a5a00;
    background: color-mix(in srgb, var(--warning), transparent 82%);
}

.customers-timeline__content a {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.customers-timeline__content a:hover {
    color: var(--accent-strong);
}

@media (max-width: 991.98px) {
    .customers-calendar__toolbar {
        grid-template-columns: 1fr;
    }

    .customers-calendar__period {
        justify-content: flex-start;
    }

    .customers-calendar__heading {
        justify-items: start;
        text-align: left;
    }
}

.customers-calendar__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.customers-calendar__dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 0.25rem;
    border-radius: 50%;
    vertical-align: -0.05rem;
}

.customers-calendar__dot--start {
    background: var(--accent);
}

.customers-calendar__dot--renewal {
    background: var(--warning);
}

.customers-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.45rem;
}

.customers-calendar__dow {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.customers-calendar__day {
    display: grid;
    gap: 0.25rem;
    min-height: 5.5rem;
    padding: 0.45rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) - 2px);
}

.customers-calendar__day.is-muted {
    opacity: 0.45;
}

.customers-calendar__day.is-today {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent), transparent 70%);
}

.customers-calendar__day header {
    font-size: 0.78rem;
    font-weight: 800;
}

.customers-calendar__day ul {
    display: grid;
    gap: 0.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.customers-calendar__event a {
    display: block;
    overflow: hidden;
    padding: 0.15rem 0.3rem;
    color: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 999px;
}

.customers-calendar__event--start a {
    background: color-mix(in srgb, var(--accent), transparent 88%);
}

.customers-calendar__event--renewal a {
    background: color-mix(in srgb, var(--warning), transparent 88%);
}

.customers-calendar__empty {
    color: var(--muted);
    font-size: 0.68rem;
}

.customers-hub-active-filters {
    margin: 0 0 0.85rem;
    color: var(--muted);
    font-size: 0.82rem;
}

@media (max-width: 991.98px) {
    .settings-hero {
        grid-template-columns: 1fr;
        padding: var(--mobile-space-3, 1rem);
    }

    .settings-hero p {
        display: none;
    }

    .settings-hero__logo-panel {
        justify-self: start;
    }

    .settings-hero__logo-frame {
        max-width: 7.5rem;
    }

    .settings-workspace {
        grid-template-columns: 1fr;
        gap: var(--mobile-space-2, 0.75rem);
    }

    .settings-menu {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        max-height: none;
        overflow: visible;
        padding: 0.65rem;
    }

    .settings-menu a {
        min-height: var(--touch-target, 44px);
    }

    .settings-menu a span {
        line-height: 1.2;
    }

    .app-status-bar__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.5rem;
    }

    .status-bar__cluster--kpis {
        grid-column: 1;
        order: 1;
        overflow-x: auto;
        padding-bottom: 0.05rem;
        scrollbar-width: none;
    }

    .status-bar__cluster--clock {
        grid-column: 2;
        order: 2;
        justify-self: end;
    }

    .status-bar__cluster--tools {
        grid-column: 1 / -1;
        order: 3;
        justify-self: stretch;
        justify-content: space-between;
        gap: 0.5rem;
        padding-top: 0.15rem;
    }

    .status-bar__btn {
        width: 2.35rem;
        height: 2.35rem;
        font-size: 0.82rem;
    }

    .status-bar__cluster--kpis::-webkit-scrollbar {
        display: none;
    }

    .status-kpi__copy small,
    .status-bar__health-copy small {
        font-size: 0.62rem;
    }
}

@media (max-width: 575.98px) {
    .settings-menu {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    :root {
        --mobile-nav-height: calc(3.35rem + var(--safe-area-bottom));
        --status-bar-height: var(--mobile-nav-height);
    }

    body.app-shell {
        padding-bottom: calc(var(--mobile-nav-height) + 0.35rem);
    }
}

@media (max-width: 767.98px) {
    .customers-calendar__grid {
        gap: 0.25rem;
    }

    .customers-calendar__day {
        min-height: 4.25rem;
        padding: 0.3rem;
    }
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background:
        linear-gradient(90deg, rgba(13, 20, 32, 0.68), rgba(13, 20, 32, 0.22)),
        url("/images/design/insurance-dashboard-hero.png") center / cover no-repeat;
}

.auth-card {
    display: grid;
    width: min(100%, 940px);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

[data-theme="dark"] .auth-card {
    background: rgba(19, 30, 43, 0.94);
}

.auth-intro {
    padding: 1.4rem;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(9, 40, 63, 0.96), rgba(15, 143, 140, 0.86));
}

.auth-intro__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    font-size: 1.5rem;
}

.auth-intro img {
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
}

.auth-intro h1 {
    color: #ffffff;
}

.auth-intro p {
    max-width: 28rem;
    margin: 0.75rem 0 0;
    color: rgba(255, 255, 255, 0.78);
}

.auth-form {
    padding: 1.4rem;
}

.settings-pwa-install__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.settings-pwa-install__help {
    margin-top: 0.85rem;
    padding: 0.85rem 1rem;
    color: var(--text);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.88rem;
    line-height: 1.5;
}

.settings-pwa-install__help strong {
    display: block;
    margin-bottom: 0.45rem;
}

.settings-pwa-install__help ol {
    margin: 0;
    padding-left: 1.2rem;
}

.settings-pwa-install__help li + li {
    margin-top: 0.35rem;
}

.settings-pwa-install__actions--remove {
    margin-top: 0.15rem;
}

.auth-form label {
    margin-bottom: var(--form-field-gap);
    color: var(--muted);
    font-size: var(--form-label-size);
    font-weight: 800;
}

.auth-form input {
    width: 100%;
    min-height: var(--form-control-min-height);
    padding: 0.55rem 0.8rem;
    margin-bottom: 1rem;
}

.auth-field-error {
    display: block;
    margin: -0.65rem 0 0.85rem;
    color: #b8323f;
    font-size: 0.85rem;
}

.auth-form button {
    width: 100%;
    min-height: 46px;
    color: #ffffff;
    font-weight: 800;
    background: var(--brand);
    border: 0;
    border-radius: var(--radius);
}

.auth-status {
    margin: 0 0 1rem;
    padding: 0.75rem 0.85rem;
    color: var(--text);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.auth-form__note {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-form__links {
    margin: -0.35rem 0 1rem;
    text-align: right;
    font-size: 0.88rem;
}

.auth-form__links a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.auth-form__links a:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .app-header__inner {
        padding: 0.5rem 0.75rem 0.5rem 0.65rem;
        gap: 0.55rem;
    }

    .brand-mark {
        height: calc(var(--header-height) - 0.95rem);
        padding: 0.15rem 0.25rem;
    }

    .header-actions {
        gap: 0.25rem;
    }

    .icon-button {
        width: 40px;
        height: 40px;
    }

    .btn-group,
    .btn-toolbar {
        display: grid !important;
        width: 100%;
    }

    .btn-group .btn,
    .btn-toolbar .btn {
        width: 100%;
    }

    .table-responsive {
        overflow: visible;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .table-responsive .table {
        min-width: 0;
    }

    .table-responsive .table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .table-responsive .table,
    .table-responsive .table tbody,
    .table-responsive .table tr,
    .table-responsive .table td {
        display: block;
        width: 100%;
    }

    .table-responsive .table tbody {
        display: grid;
        gap: 0.85rem;
    }

    .table-responsive .table tr {
        overflow: hidden;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .table-responsive .table td {
        display: grid;
        grid-template-columns: minmax(7.5rem, 42%) minmax(0, 1fr);
        gap: 0.75rem;
        align-items: center;
        min-height: 44px;
        padding: 0.7rem 0.85rem;
        border-bottom: 1px solid var(--line);
    }

    .table-responsive .table td:last-child {
        border-bottom: 0;
    }

    .table-responsive .table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 900;
        line-height: 1.2;
        text-transform: uppercase;
    }

    .table-responsive .table td.empty-state {
        display: block;
    }

    .table-responsive .table td.empty-state::before {
        content: none;
    }

    .table-responsive .table-actions-cell {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .table-responsive .table-actions-cell::before {
        margin-bottom: -0.25rem;
    }

    .row-actions {
        justify-content: flex-start;
    }

    .action-btn span {
        max-width: 9rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (min-width: 768px) {
    .app-header__inner {
        grid-template-columns: auto minmax(220px, 1fr) auto;
        gap: 1rem;
        padding-inline: 1.25rem;
    }

    .global-search {
        max-width: 560px;
        justify-self: stretch;
    }

    .app-main {
        padding: 1.25rem;
    }

    .main,
    .container,
    .auth-form,
    .auth-intro {
        padding: 1.5rem;
    }

    .customers-hub-table {
        min-width: 38rem;
    }

    .table-responsive .table th:last-child,
    .table-responsive .table td:last-child {
        position: sticky;
        right: 0;
        z-index: 2;
    }

    .table-responsive .table thead th:last-child {
        z-index: 3;
        background: linear-gradient(135deg, var(--brand-strong), var(--brand));
    }

    [data-theme="dark"] .table-responsive .table thead th:last-child {
        background: linear-gradient(135deg, var(--surface-strong), var(--surface-muted));
    }

    .table-responsive .table tbody td:last-child {
        background: var(--surface);
        box-shadow: -8px 0 14px rgba(15, 39, 66, 0.08);
    }

    .table-striped tbody tr:nth-of-type(odd) td:last-child {
        background: color-mix(in srgb, var(--surface), var(--surface-muted) 40%);
    }

    .table-tools {
        grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) auto auto;
    }

    .page-hero:not(.page-hero--hub) {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .page-hero:not(.page-hero--hub) .page-hero__aside {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .page-hero__intro {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .page-hero__toolbar {
        justify-content: flex-end;
    }

    .page-hero__action-bar .page-hero__actions {
        justify-content: flex-end;
    }

    .settings-form:not(.settings-form--stacked) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-form:not(.settings-form--stacked) .settings-form__wide,
    .settings-form:not(.settings-form--stacked) .settings-form__actions {
        grid-column: 1 / -1;
    }

    .settings-hero {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
        padding: 1.5rem;
    }

    .settings-app-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-filters {
        grid-template-columns: minmax(150px, 0.75fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) minmax(260px, 1.2fr);
        align-items: end;
    }

    .auth-card {
        grid-template-columns: 0.95fr 1fr;
    }

    .dashboard-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-hero__content {
        padding: 1.5rem;
    }

    .customer-modal .modal-header,
    .customer-modal .modal-body {
        padding: 1.25rem;
    }

    .customer-long-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.9rem;
        padding: 1.25rem;
    }

    .customer-long-form h3 {
        grid-column: 1 / -1;
    }

    .customer-long-form .mb-3:has(textarea) {
        grid-column: 1 / -1;
    }

    .wizard-shell {
        grid-template-columns: minmax(190px, 0.32fr) minmax(0, 1fr);
        align-items: start;
    }

    .wizard-captured {
        position: sticky;
        top: 0.75rem;
        align-self: start;
    }

    .wizard-steps button {
        min-width: 145px;
    }

    .wizard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wizard-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-panel,
    .customer-create-panel {
        padding: 1.5rem;
    }

    .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-card--wide {
        grid-column: 1 / -1;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .customers-hub-table {
        min-width: 32rem;
    }

    .customers-hub-table__col-optional,
    .customers-hub-table__col-status {
        display: none;
    }

    .customers-hub-table th,
    .customers-hub-table td {
        padding: 0.32rem 0.5rem;
        font-size: 0.76rem;
        line-height: 1.15;
        vertical-align: middle;
    }

    .customers-hub-table th {
        font-size: 0.68rem;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .customers-hub-table td:not(:last-child) {
        max-width: 10rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .customers-hub-table td:first-child {
        max-width: 12rem;
        font-weight: 700;
    }

    .customers-hub-table .ui-badge {
        min-height: 20px;
        padding: 0.14rem 0.38rem;
        font-size: 0.58rem;
    }

    [data-table-actions-compact] {
        display: inline-flex;
        flex-wrap: nowrap;
        gap: 0.3rem;
        align-items: center;
        min-width: 0;
        white-space: nowrap;
    }

    [data-table-actions-compact] .table-actions-cell__desktop {
        display: none !important;
    }

    .table-actions-cell {
        display: inline-flex;
        flex-wrap: nowrap;
        gap: 0.3rem;
        align-items: center;
        min-width: 0;
        white-space: nowrap;
    }

    .table-actions-cell__primary,
    .table-actions-cell__more {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 2.15rem;
        min-width: 2.15rem;
        height: 2.15rem;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 0.82rem;
        line-height: 1;
    }

    .table-actions-cell__label {
        display: none !important;
    }

    .table-actions-cell__more {
        min-width: 2.15rem;
    }

    .table-responsive .table tbody td:last-child {
        width: 5.25rem;
        min-width: 5.25rem;
        max-width: 5.25rem;
        padding-inline: 0.35rem;
        box-shadow: -4px 0 10px rgba(15, 39, 66, 0.06);
    }

    .table-responsive .table thead th:last-child {
        width: 5.25rem;
        min-width: 5.25rem;
        max-width: 5.25rem;
        padding-inline: 0.35rem;
    }

    .hub-actions--mobile .hub-actions__primary span,
    .hub-actions--mobile .hub-actions__more span {
        display: inline;
    }

    .settings-form:not(.settings-form--stacked) {
        grid-template-columns: 1fr;
    }

    .settings-form__row--2,
    .settings-form__row--3 {
        grid-template-columns: 1fr;
    }

    .customer-long-form {
        grid-template-columns: 1fr;
        gap: 0.7rem;
        padding: 1rem;
    }

    .customer-long-form .form-control,
    .settings-page .settings-form .form-control,
    .settings-page .settings-form select.form-control {
        min-height: 2.35rem;
        padding: 0.45rem 0.65rem;
        font-size: 0.88rem;
    }

    .settings-page .settings-form label,
    .settings-page .settings-form .settings-form__field {
        gap: 0.35rem;
        font-size: 0.78rem;
    }

    .page-panel,
    .customer-create-panel {
        padding: 1rem;
    }
}

@media (min-width: 1200px) {
    .customers-hub-table {
        min-width: 52rem;
    }

    .table-actions-cell {
        min-width: 15rem;
    }
}

@media (min-width: 992px) {
    .sidebar-toggle {
        display: none !important;
    }

    .sidebar-backdrop {
        display: none !important;
    }

    .app-header__inner {
        grid-template-columns: minmax(240px, 1fr) auto;
        gap: 1rem;
        padding: 0.65rem 1.25rem;
    }

    .global-search {
        grid-column: 1;
        max-width: 560px;
        justify-self: start;
    }

    .header-actions {
        grid-column: 2;
    }

    .table-tools {
        grid-template-columns: auto minmax(240px, 1.2fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr) auto auto;
    }

    .settings-workspace {
        grid-template-columns: minmax(12.5rem, 14.5rem) minmax(0, 1fr);
    }

    .settings-menu {
        position: sticky;
        top: calc(var(--header-height) + 1rem);
        display: grid;
        gap: 0.25rem;
        align-content: start;
        max-height: calc(100dvh - var(--header-height) - var(--status-bar-height) - 2rem);
        padding: 0.65rem;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .settings-menu a {
        width: 100%;
    }

    .settings-menu__divider {
        width: 100%;
        min-height: 1px;
        height: 1px;
    }

    .app-layout {
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
        align-items: stretch;
    }

    .app-sidebar {
        grid-column: 1;
        grid-row: 1;
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--sidebar-width);
        height: auto;
        max-height: none;
        padding: 0;
        transform: none;
    }

    .app-workspace {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        width: 100%;
    }

    .sidebar-brand .brand-mark {
        width: 7rem;
        height: 7rem;
    }

    .sidebar-panel {
        padding: 1rem;
        border: 0;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
        box-shadow: none;
    }

    [data-theme="dark"] .sidebar-panel {
        border-right-color: var(--line);
    }

    .sidebar-kicker {
        display: block;
    }

    .sidebar-nav a,
    .sidebar-settings,
    .sidebar-logout button {
        justify-content: flex-start;
        gap: 0.75rem;
        min-height: 42px;
        padding: 0.65rem 0.75rem;
    }

    .sidebar-nav a span,
    .sidebar-settings span,
    .sidebar-logout button span {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }

    .sidebar-group__summary {
        justify-content: flex-start;
        gap: 0.75rem;
        min-height: 42px;
        padding: 0.65rem 0.75rem;
    }

    .sidebar-group__summary span {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        white-space: normal;
        flex: 1;
    }

    .sidebar-group__chevron {
        display: inline-block;
        margin-left: auto;
        font-size: 0.72rem;
        opacity: 0.75;
        transition: transform 0.15s ease;
    }

    .sidebar-group__details[open] .sidebar-group__chevron {
        transform: rotate(180deg);
    }

    .sidebar-group__items {
        margin: 0.15rem 0 0.35rem 0.75rem;
        padding-left: 0.65rem;
        border-left: 1px solid rgba(255, 255, 255, 0.14);
    }

    .sidebar-group__items a {
        justify-content: flex-start;
        gap: 0.65rem;
        min-height: 38px;
        padding: 0.5rem 0.65rem;
    }

    .sidebar-group__items a span {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }

    .sidebar-about {
        display: grid;
    }

    .app-main {
        min-width: 0;
        padding: 1.5rem;
    }

    .page-hero:not(.page-hero--hub) {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .page-hero:not(.page-hero--hub) .page-hero__content {
        grid-area: auto;
    }

    .page-hero:not(.page-hero--hub) .page-hero__aside {
        grid-area: auto;
        grid-column: auto;
        justify-content: flex-end;
        align-self: end;
    }

    .page-hero:not(.page-hero--hub) .page-hero__actions {
        justify-content: flex-end;
    }

    .metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .report-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .app-status-bar {
        left: var(--sidebar-width);
    }
}

/* Health & Security status page */
.health-section {
    display: grid;
    gap: 1.5rem;
}

.health-section__header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "icon intro"
        "gauge gauge";
    gap: 0.75rem 1rem;
    align-items: start;
}

.health-section__header .settings-card__icon {
    grid-area: icon;
}

.health-section__intro {
    grid-area: intro;
}

.health-gauge {
    grid-area: gauge;
    justify-self: start;
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background:
        conic-gradient(var(--gauge-color, var(--accent)) calc(var(--score, 0) * 1%), var(--surface-strong) 0);
}

.health-gauge::after {
    content: "";
    position: absolute;
    inset: 12px;
    background: var(--surface);
    border-radius: 50%;
}

.health-gauge--pass {
    --gauge-color: var(--success);
}

.health-gauge--warn {
    --gauge-color: var(--warning);
}

.health-gauge--fail {
    --gauge-color: var(--danger);
}

.health-gauge__value {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
}

.health-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.health-summary__card {
    display: grid;
    gap: 0.3rem;
    padding: 0.85rem 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-left: 3px solid var(--muted);
    border-radius: var(--radius);
}

.health-summary__card--pass {
    border-left-color: var(--success);
}

.health-summary__card--warn {
    border-left-color: var(--warning);
}

.health-summary__card--info {
    border-left-color: var(--accent);
}

.health-summary__card--fail {
    border-left-color: var(--danger);
}

.health-summary__label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.health-summary__value {
    font-size: 1.05rem;
    font-weight: 700;
}

.health-block {
    display: grid;
    gap: 0.85rem;
}

.health-block__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 800;
    border-bottom: 1px solid var(--line);
}

.health-block__title i {
    color: var(--accent);
}

.health-block__title--actions i {
    color: var(--danger);
}

.health-block__lead {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.health-cache-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.health-cache-actions__form {
    margin: 0;
}

.health-cache-status {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.health-checks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.health-check {
    display: grid;
    gap: 0.4rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--muted);
    border-radius: var(--radius);
}

.health-check--pass {
    border-top-color: var(--success);
}

.health-check--warn {
    border-top-color: var(--warning);
}

.health-check--info {
    border-top-color: var(--accent);
}

.health-check--fail {
    border-top-color: var(--danger);
}

.health-check__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.health-check__label {
    font-weight: 700;
    line-height: 1.25;
}

.health-check__value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
}

.health-check__detail {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.health-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.health-badge i {
    font-size: 0.62rem;
}

.health-badge--pass {
    color: var(--success);
    background: color-mix(in srgb, var(--success), transparent 86%);
}

.health-badge--warn {
    color: var(--warning);
    background: color-mix(in srgb, var(--warning), transparent 84%);
}

.health-badge--info {
    color: var(--accent-strong);
    background: color-mix(in srgb, var(--accent), transparent 86%);
}

.health-badge--fail {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger), transparent 84%);
}

.health-actions {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text);
}

.health-actions li {
    line-height: 1.45;
}

@media (min-width: 640px) {
    .health-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .health-checks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .health-section__header {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "icon intro gauge";
        align-items: center;
    }

    .health-gauge {
        justify-self: end;
    }

    .health-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .health-checks {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Debug mode (APP_DEBUG=true only) */
html[data-app-debug="true"] body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    box-shadow: inset 0 0 0 2px #d93030;
}

html[data-theme="dark"][data-app-debug="true"] body::before {
    box-shadow: inset 0 0 0 2px #f06060;
}

.debug-mode-indicator {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 10000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    color: #ffffff;
    background: #d93030;
    border-bottom-left-radius: calc(var(--radius) - 2px);
    pointer-events: none;
    font-size: 0.72rem;
    line-height: 1;
}

html[data-theme="dark"] .debug-mode-indicator {
    color: #1a1a1a;
    background: #f06060;
}

.debug-mode-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0 0 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    border: 1px solid #f0ad4e;
    background: rgba(240, 173, 78, 0.15);
    color: var(--text-primary, #1a2b3c);
    font-size: 0.9rem;
    line-height: 1.45;
}

.debug-mode-banner i.fa-bug {
    color: #b77713;
    margin-top: 0.15rem;
}

.debug-form-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

.debug-fill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: 0.375rem;
    border: 1px dashed #f0ad4e;
    background: rgba(240, 173, 78, 0.12);
    color: #b77713;
}

.debug-fill-btn:hover,
.debug-fill-btn:focus {
    background: rgba(240, 173, 78, 0.28);
    color: #8a5a0c;
    border-color: #b77713;
}

form.modal-content > .debug-form-toolbar,
.customer-modal form > .debug-form-toolbar {
    margin: 0 1rem 0.5rem;
}

.error-page {
    padding: 1.5rem;
}

.error-card {
    width: min(100%, 32rem);
    padding: 2rem 1.75rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

[data-theme="dark"] .error-card {
    background: rgba(19, 30, 43, 0.94);
    border-color: rgba(255, 255, 255, 0.08);
}

.error-card__brand img {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px rgba(15, 143, 140, 0.18);
}

.error-card__code {
    margin: 0 0 0.35rem;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--accent);
}

.error-card__title {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
}

.error-card__message {
    margin: 0 0 1.35rem;
    color: var(--text-muted);
}

.error-card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
}

.confirm-modal__message {
    margin: 0;
    color: var(--text);
}

.confirm-modal__message p {
    margin: 0 0 0.85rem;
    color: var(--muted);
    line-height: 1.55;
}

.confirm-modal__message p:last-child {
    margin-bottom: 0;
}

.confirm-modal__message .confirm-modal__lead {
    color: var(--text);
    font-weight: 700;
    font-size: 1.05rem;
}

.confirm-modal .modal-header .eyebrow {
    color: var(--warning, #b77713);
}

.confirm-modal[data-confirm-tone="danger"] .modal-header .eyebrow {
    color: var(--danger, #c1292f);
}

/* -------------------------------------------------------------------------- */
/* Mobile-native UI (≤767px)                                                  */
/* -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    .app-main {
        padding: var(--mobile-space-2);
        padding-bottom: calc(var(--mobile-space-3) + var(--safe-area-bottom));
    }

    .app-header__inner {
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "menu search actions"
            "panel panel panel";
        gap: var(--mobile-space-1);
        padding: var(--mobile-space-1) var(--mobile-space-2);
    }

    .sidebar-toggle {
        grid-area: menu;
    }

    [data-mobile-search-toggle] {
        grid-area: search;
        justify-self: start;
    }

    .header-actions {
        grid-area: actions;
        gap: 0.2rem;
    }

    .global-search {
        grid-area: panel;
        display: none;
        width: 100%;
        min-height: var(--touch-target);
        margin-top: 0.15rem;
    }

    .app-header.is-search-open .global-search {
        display: flex;
    }

    .app-header.is-search-open [data-mobile-search-toggle] {
        color: var(--accent);
        background: color-mix(in srgb, var(--accent), transparent 88%);
    }

    .global-search input {
        font-size: var(--mobile-input-size);
        min-height: var(--touch-target);
    }

    .global-search__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: var(--touch-target);
        height: var(--touch-target);
        margin-left: 0.15rem;
        padding: 0;
        border: 0;
        border-radius: calc(var(--radius) - 2px);
        background: transparent;
        color: var(--muted);
    }

    .page-hero--hub {
        padding: var(--mobile-space-3);
        border-radius: var(--radius);
    }

    .page-hero--hub .page-hero__content p {
        display: none;
    }

    .page-hero__intro {
        gap: var(--mobile-space-2);
    }

    .page-hero__toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--mobile-space-2);
    }

    .page-hero__view-panel {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0 calc(var(--mobile-space-2) * -1);
        padding: 0 var(--mobile-space-2) 0.15rem;
    }

    .page-hero__view-panel::-webkit-scrollbar {
        display: none;
    }

    .hub-view-switcher--segmented {
        flex-wrap: nowrap;
        width: max-content;
        min-width: 100%;
    }

    .page-hero__action-bar {
        padding-top: var(--mobile-space-2);
    }

    .page-hero__action-bar .page-hero__actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--mobile-space-2);
        align-items: stretch;
    }

    .page-hero__actions {
        align-items: stretch;
    }

    .hub-actions--mobile {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--mobile-space-2);
        width: 100%;
        min-width: 0;
    }

    .hub-actions--mobile .hub-actions__primary,
    .hub-actions--mobile .hub-actions__more {
        min-height: var(--touch-target);
        margin: 0;
    }

    .page-hero--hub .header-trash-link {
        width: auto;
        min-width: var(--touch-target);
        min-height: var(--touch-target);
        padding-inline: 0.85rem;
        justify-content: center;
        align-self: stretch;
    }

    .page-hero:not(.page-hero--hub) {
        padding: var(--mobile-space-3);
        gap: var(--mobile-space-2);
    }

    .page-hero:not(.page-hero--hub) .page-hero__content p {
        display: none;
    }

    .page-hero:not(.page-hero--hub) .page-hero__aside {
        width: 100%;
    }

    .dashboard-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--mobile-space-2);
        width: 100%;
        margin-top: 0;
    }

    .dashboard-actions .btn {
        justify-content: center;
        width: 100%;
        min-height: var(--touch-target);
        margin: 0;
    }

    .metric-grid {
        gap: var(--mobile-space-2);
        margin-bottom: var(--mobile-space-3);
    }

    .metric-card {
        min-height: 6.75rem;
        padding: var(--mobile-space-2);
    }

    .metric-card strong {
        font-size: 1.75rem;
    }

    .metric-card__icon {
        width: 34px;
        height: 34px;
    }

    .dashboard-card {
        padding: var(--mobile-space-3);
    }

    .chart-frame {
        min-height: 220px;
    }

    .section-heading {
        margin-top: 0.5rem;
    }

    .mobile-record-list {
        display: grid;
        gap: var(--mobile-space-2);
    }

    .mobile-record-list__empty {
        margin: 0;
        padding: var(--mobile-space-4) var(--mobile-space-2);
        color: var(--muted);
        text-align: center;
        background: var(--surface);
        border: 1px dashed var(--line);
        border-radius: var(--radius);
    }

    .mobile-record-card {
        display: grid;
        gap: var(--mobile-space-2);
        padding: var(--mobile-space-3);
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .mobile-record-card__header {
        display: flex;
        gap: var(--mobile-space-2);
        align-items: flex-start;
        justify-content: space-between;
    }

    .mobile-record-card__title {
        color: var(--brand-strong);
        font-size: 1.05rem;
        font-weight: 800;
        line-height: 1.25;
        text-decoration: none;
    }

    .mobile-record-card__title:hover {
        color: var(--accent);
    }

    .mobile-record-card__meta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--mobile-space-2) var(--mobile-space-3);
        margin: 0;
    }

    .mobile-record-card__meta > div {
        display: grid;
        gap: 0.15rem;
        min-width: 0;
    }

    .mobile-record-card__meta dt {
        margin: 0;
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .mobile-record-card__meta dd {
        margin: 0;
        overflow: hidden;
        font-size: 0.92rem;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-record-card__actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--mobile-space-2);
        padding-top: 0.15rem;
    }

    .mobile-record-card__open,
    .mobile-record-card__more {
        min-height: var(--touch-target);
        margin: 0;
    }

    .mobile-action-menu {
        min-width: 12.5rem;
        padding: 0.35rem;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .mobile-action-menu .dropdown-item {
        display: flex;
        gap: 0.55rem;
        align-items: center;
        min-height: var(--touch-target);
        padding: 0.55rem 0.75rem;
        border-radius: calc(var(--radius) - 2px);
        font-weight: 700;
    }

    .mobile-action-menu .dropdown-item i {
        width: 1rem;
        text-align: center;
    }

    form[data-customer-form] .row > [class*="col-"] {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }

    form[data-customer-form] label {
        display: grid;
        gap: 0.35rem;
        margin-bottom: 0;
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 800;
    }

    form[data-customer-form] .form-control,
    form[data-customer-form] select.form-control,
    form[data-customer-form] textarea.form-control {
        min-height: var(--touch-target);
        font-size: var(--mobile-input-size);
    }

    .customer-detail__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--mobile-space-2);
    }

    .customer-detail__actions .btn {
        min-height: var(--touch-target);
        margin: 0 !important;
    }

    .customer-detail__footer {
        position: sticky;
        bottom: calc(var(--safe-area-bottom) + 0.5rem);
        z-index: 5;
        margin-top: var(--mobile-space-3);
        padding: var(--mobile-space-2) 0 0;
        background: linear-gradient(180deg, transparent, var(--bg) 28%);
    }

    .settings-form:not(.settings-form--stacked) {
        grid-template-columns: 1fr;
    }

    .settings-form label,
    .settings-form .settings-form__field {
        gap: 0.35rem;
    }

    .settings-page .settings-form .form-control,
    .settings-page .settings-form select.form-control {
        min-height: var(--touch-target);
        font-size: var(--mobile-input-size);
    }

    .wizard-shell {
        grid-template-columns: 1fr;
    }

    .wizard-captured {
        position: static;
        order: 2;
    }

    .wizard-steps-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .wizard-steps {
        flex-wrap: nowrap;
        width: max-content;
        min-width: 100%;
    }

    .wizard-footer {
        position: sticky;
        bottom: 0;
        z-index: 2;
        flex-wrap: wrap;
        gap: var(--mobile-space-2);
        padding-bottom: calc(var(--mobile-space-2) + var(--safe-area-bottom));
        background: var(--surface);
        border-top: 1px solid var(--line);
    }

    .wizard-footer .btn {
        min-height: var(--touch-target);
        flex: 1 1 calc(50% - var(--mobile-space-2));
    }

    .customer-modal .modal-footer.modal-form-footer {
        position: sticky;
        bottom: 0;
        z-index: 2;
        flex-wrap: wrap;
        gap: var(--mobile-space-2);
        padding-bottom: calc(var(--mobile-space-2) + var(--safe-area-bottom));
        background: var(--surface);
    }

    .customers-calendar__grid {
        grid-template-columns: repeat(7, minmax(2.4rem, 1fr));
    }

    .customers-calendar__day {
        min-height: 3.5rem;
    }

    .page-scale-toggle {
        display: none !important;
    }
}

@media (min-width: 768px) {
    [data-mobile-search-toggle],
    .global-search__close {
        display: none !important;
    }
}
