/* Kontrolo MZ system layer: desktop shell, reusable components and calmer visuals. */

:root {
    --sys-bg: #f4f7fb;
    --sys-surface: #ffffff;
    --sys-surface-2: #f8fafc;
    --sys-border: #e2e8f0;
    --sys-border-strong: #cbd5e1;
    --sys-text: #0f172a;
    --sys-muted: #64748b;
    --sys-faint: #94a3b8;
    --sys-primary: #087b31;
    --sys-primary-strong: #087b31;
    --sys-primary-soft: #e1f6e8;
    --sys-blue: #2563eb;
    --sys-amber: #b45309;
    --sys-red: #dc2626;
    --sys-radius: 10px;
    --sys-radius-lg: 16px;
    --sys-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.app-body {
    background: var(--sys-bg);
    color: var(--sys-text);
}

body.app-body .app-shell {
    grid-template-columns: 272px minmax(0, 1fr);
    background: var(--sys-bg);
}

body.sidebar-collapsed .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 12px;
    border-right: 1px solid rgba(15, 23, 42, 0.10);
    background: #0b1220;
    box-shadow: none;
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sidebar-logo {
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
    margin: 0;
    padding: 7px;
    border-radius: var(--sys-radius-lg);
    color: #fff;
}

.sidebar-logo img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    padding: 6px;
    border-radius: var(--sys-radius);
    box-shadow: none;
}

.sidebar-logo span {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.sidebar-logo strong {
    overflow: hidden;
    font-size: 0.94rem;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-logo small {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--sys-radius);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.78);
    cursor: pointer;
}

.sidebar-toggle .nav-svg {
    transform: rotate(90deg);
}

.side-nav {
    gap: 3px;
    padding-bottom: 18px;
}

.side-nav p {
    margin: 18px 10px 6px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.side-nav a {
    gap: 10px;
    min-height: 42px;
    padding: 7px 9px;
    border-radius: var(--sys-radius);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
    font-weight: 800;
}

.side-nav a.active,
.side-nav a:hover {
    background: rgba(255, 255, 255, 0.10);
    box-shadow: inset 3px 0 0 #2dd4bf;
    color: #fff;
    transform: none;
}

.side-nav .nav-svg {
    width: 32px;
    height: 32px;
    border-radius: var(--sys-radius);
    background: rgba(255, 255, 255, 0.07);
}

.side-nav a.active .nav-svg,
.side-nav a:hover .nav-svg {
    background: var(--sys-primary);
    box-shadow: none;
}

body.sidebar-collapsed .sidebar {
    padding-inline: 10px;
}

body.sidebar-collapsed .sidebar-logo {
    justify-content: center;
    padding-inline: 0;
}

body.sidebar-collapsed .sidebar-logo span,
body.sidebar-collapsed .side-nav p,
body.sidebar-collapsed .side-nav-label {
    display: none;
}

body.sidebar-collapsed .sidebar-top {
    justify-content: center;
    flex-wrap: wrap;
}

body.sidebar-collapsed .sidebar-toggle .nav-svg {
    transform: rotate(-90deg);
}

body.sidebar-collapsed .side-nav a {
    justify-content: center;
    padding-inline: 6px;
}

.main-shell {
    min-width: 0;
    background: var(--sys-bg);
}

.navbar {
    min-height: 76px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--sys-border);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.navbar-user {
    display: grid;
    gap: 2px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--sys-faint);
    font-size: 0.76rem;
    font-weight: 850;
}

.breadcrumbs a {
    color: var(--sys-primary);
}

.navbar h2 {
    color: var(--sys-text);
    font-size: 1.18rem;
    line-height: 1.15;
}

.navbar-user p {
    margin: 0;
    color: var(--sys-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.navbar-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 380px;
    max-width: 460px;
    min-width: 220px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--sys-border);
    border-radius: var(--sys-radius);
    background: var(--sys-surface-2);
}

.navbar-search .nav-svg {
    width: 20px;
    height: 20px;
    color: var(--sys-faint);
}

.navbar-search input[type="search"] {
    width: 100%;
    height: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--sys-text);
    font-weight: 750;
}

.navbar-actions {
    gap: 8px;
}

.quick-actions-menu,
.user-menu {
    position: relative;
}

.quick-actions-menu summary,
.user-menu summary {
    list-style: none;
    cursor: pointer;
}

.quick-actions-menu summary::-webkit-details-marker,
.user-menu summary::-webkit-details-marker {
    display: none;
}

.quick-actions-popover,
.user-menu-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 40;
    display: grid;
    gap: 4px;
    width: 220px;
    padding: 8px;
    border: 1px solid var(--sys-border);
    border-radius: var(--sys-radius-lg);
    background: var(--sys-surface);
    box-shadow: var(--sys-shadow);
}

.quick-actions-popover a,
.user-menu-popover a,
.user-menu-popover button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--sys-radius);
    background: transparent;
    color: var(--sys-text);
    font-size: 0.88rem;
    font-weight: 850;
    text-align: left;
    cursor: pointer;
}

.quick-actions-popover a:hover,
.user-menu-popover a:hover,
.user-menu-popover button:hover {
    background: var(--sys-surface-2);
}

.user-menu summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 4px 8px 4px 4px;
    border: 1px solid var(--sys-border);
    border-radius: var(--sys-radius);
    background: var(--sys-surface);
}

.user-menu summary > .nav-svg {
    width: 16px;
    height: 16px;
    color: var(--sys-muted);
}

.user-menu-name {
    max-width: 92px;
    overflow: hidden;
    color: var(--sys-text);
    font-size: 0.85rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-popover strong {
    padding: 8px 10px 6px;
    color: var(--sys-muted);
    font-size: 0.78rem;
}

.notification-pill,
.navbar-main-action,
.quick-actions-menu .button {
    min-height: 42px;
    border-radius: var(--sys-radius);
    box-shadow: none;
}

.notification-pill {
    padding-right: 30px;
    border-color: var(--sys-border);
}

.content {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px;
}

html:not(.is-phone-device) body.has-phone-dashboard,
html:not(.is-phone-device) body:has(.phone-dashboard) {
    background: var(--sys-bg);
}

html:not(.is-phone-device) body.has-phone-dashboard .app-shell,
html:not(.is-phone-device) body:has(.phone-dashboard) .app-shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    min-height: 100vh;
    background: var(--sys-bg);
}

html:not(.is-phone-device) body.sidebar-collapsed.has-phone-dashboard .app-shell,
html:not(.is-phone-device) body.sidebar-collapsed:has(.phone-dashboard) .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
}

html:not(.is-phone-device) body.has-phone-dashboard .sidebar,
html:not(.is-phone-device) body.has-phone-dashboard .navbar,
html:not(.is-phone-device) body:has(.phone-dashboard) .sidebar,
html:not(.is-phone-device) body:has(.phone-dashboard) .navbar {
    display: flex !important;
}

html:not(.is-phone-device) body.has-phone-dashboard .main-shell,
html:not(.is-phone-device) body:has(.phone-dashboard) .main-shell {
    width: 100%;
    min-height: 100vh;
    background: var(--sys-bg);
}

html:not(.is-phone-device) body.has-phone-dashboard .content,
html:not(.is-phone-device) body:has(.phone-dashboard) .content {
    display: block;
    width: 100%;
    max-width: 1440px;
    min-height: auto;
    margin: 0 auto;
    padding: 28px;
    background: transparent;
}

html:not(.is-phone-device) .phone-dashboard {
    width: 100%;
    max-width: none;
    min-height: auto;
    margin: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

html:not(.is-phone-device) .phone-dashboard-bg {
    display: none;
}

html:not(.is-phone-device) .phone-dashboard-content {
    display: grid;
    gap: 18px;
    padding: 0;
}

html:not(.is-phone-device) .phone-dashboard-header {
    margin: 0;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--sys-border);
    color: var(--sys-text);
}

html:not(.is-phone-device) .phone-dashboard-header h1 {
    color: var(--sys-text);
    font-size: 1.7rem;
    line-height: 1.15;
}

html:not(.is-phone-device) .phone-dashboard-header p {
    max-width: 720px;
    color: var(--sys-muted);
}

html:not(.is-phone-device) .phone-header-actions a,
html:not(.is-phone-device) .phone-header-actions button {
    border: 1px solid var(--sys-border);
    border-radius: var(--sys-radius);
    background: var(--sys-surface);
    color: var(--sys-primary);
    box-shadow: none;
}

html:not(.is-phone-device) .phone-bottom-nav {
    display: none;
}

html:not(.is-phone-device) .business-dashboard,
html:not(.is-phone-device) .personal-dashboard,
html:not(.is-phone-device) .wallets-dashboard,
html:not(.is-phone-device) .debt-dashboard,
html:not(.is-phone-device) .xitique-dashboard,
html:not(.is-phone-device) .phone-reports,
html:not(.is-phone-device) .plan-dashboard {
    width: 100%;
    min-height: auto;
    background: transparent;
}

html:not(.is-phone-device) .business-hero-card,
html:not(.is-phone-device) .phone-balance-card,
html:not(.is-phone-device) .phone-panel,
html:not(.is-phone-device) .business-panel,
html:not(.is-phone-device) .wallet-phone-panel,
html:not(.is-phone-device) .xitique-panel,
html:not(.is-phone-device) .debt-panel,
.panel {
    border: 1px solid var(--sys-border);
    border-radius: var(--sys-radius-lg);
    background: var(--sys-surface);
    box-shadow: none;
}

html:not(.is-phone-device) .business-hero-card,
html:not(.is-phone-device) .phone-balance-card {
    padding: 22px;
}

html:not(.is-phone-device) .business-kpi-grid,
html:not(.is-phone-device) .personal-kpi-grid,
html:not(.is-phone-device) .phone-report-grid,
html:not(.is-phone-device) .wallet-summary-grid,
html:not(.is-phone-device) .debt-summary-grid,
html:not(.is-phone-device) .xitique-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

html:not(.is-phone-device) .business-action-grid,
html:not(.is-phone-device) .personal-dashboard .phone-quick-actions,
html:not(.is-phone-device) .phone-quick-actions,
html:not(.is-phone-device) .business-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 12px;
}

html:not(.is-phone-device) .business-action-grid a,
html:not(.is-phone-device) .business-action-grid button,
html:not(.is-phone-device) .phone-quick-actions a,
html:not(.is-phone-device) .phone-quick-actions button,
html:not(.is-phone-device) .business-shortcut-grid a {
    min-height: 74px;
    border: 1px solid var(--sys-border);
    border-radius: var(--sys-radius-lg);
    background: var(--sys-surface);
    box-shadow: none;
}

html:not(.is-phone-device) .business-action-grid small,
html:not(.is-phone-device) .phone-quick-actions small {
    display: none;
}

html:not(.is-phone-device) .business-module-grid,
html:not(.is-phone-device) .phone-list,
html:not(.is-phone-device) .wallet-list,
html:not(.is-phone-device) .debt-list,
html:not(.is-phone-device) .xitique-list,
html:not(.is-phone-device) .business-list,
html:not(.is-phone-device) .catalog-list,
html:not(.is-phone-device) .report-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

html:not(.is-phone-device) .business-module-card,
html:not(.is-phone-device) .phone-list article,
html:not(.is-phone-device) .phone-list a,
html:not(.is-phone-device) .wallet-list article,
html:not(.is-phone-device) .debt-list article,
html:not(.is-phone-device) .xitique-list article,
html:not(.is-phone-device) .business-list article,
html:not(.is-phone-device) .catalog-list article,
html:not(.is-phone-device) .report-list article {
    border: 1px solid var(--sys-border);
    border-radius: var(--sys-radius-lg);
    background: var(--sys-surface);
    box-shadow: none;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--sys-border);
    border-radius: var(--sys-radius-lg);
    background: var(--sys-surface);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--sys-surface);
}

.data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 12px 14px;
    border-bottom: 1px solid var(--sys-border);
    background: var(--sys-surface-2);
    color: var(--sys-muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf2f7;
    color: var(--sys-text);
    vertical-align: middle;
}

.data-table tbody tr:hover td {
    background: #f8fafc;
}

.row-actions {
    justify-content: flex-end;
    gap: 8px;
}

.row-actions a,
.row-actions button {
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--sys-border);
    border-radius: var(--sys-radius);
    background: var(--sys-surface);
    color: var(--sys-primary);
    font-weight: 850;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.table-toolbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(100%, 360px);
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid var(--sys-border);
    border-radius: var(--sys-radius);
    background: var(--sys-surface);
}

.table-toolbar-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--sys-text);
}

.table-toolbar-count {
    color: var(--sys-muted);
    font-size: 0.82rem;
    font-weight: 850;
}

.business-form,
.form-card,
form.panel {
    border-radius: var(--sys-radius-lg);
}

.business-form input,
.business-form select,
.business-form textarea,
.form-card input,
.form-card select,
.form-card textarea,
.panel input,
.panel select,
.panel textarea {
    border-color: var(--sys-border);
    border-radius: var(--sys-radius);
    background: var(--sys-surface);
    color: var(--sys-text);
}

.business-form input:focus,
.business-form select:focus,
.business-form textarea:focus,
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus,
.panel input:focus,
.panel select:focus,
.panel textarea:focus,
.navbar-search:focus-within {
    border-color: rgba(15, 118, 110, 0.55);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
    outline: none;
}

.button,
button,
input[type="submit"] {
    border-radius: var(--sys-radius);
}

.button-primary,
button.button-primary {
    background: var(--sys-primary);
    color: #fff;
}

.button-primary:hover,
button.button-primary:hover {
    background: var(--sys-primary-strong);
}

.button-danger,
button.button-danger {
    background: var(--sys-red);
    color: #fff;
}

.button-danger:hover,
button.button-danger:hover {
    background: #b91c1c;
}

.status-badge,
.beta-badge,
.badge {
    border-radius: 999px;
}

.toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 220;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 36px));
    pointer-events: none;
}

.toast-stack .alert,
.system-toast {
    pointer-events: auto;
    margin: 0;
    padding: 13px 14px;
    border: 1px solid var(--sys-border);
    border-left-width: 4px;
    border-radius: var(--sys-radius-lg);
    background: var(--sys-surface);
    color: var(--sys-text);
    box-shadow: var(--sys-shadow);
}

.toast-stack .alert-success,
.system-toast.success {
    border-left-color: var(--sys-primary);
}

.toast-stack .alert-error,
.system-toast.error {
    border-left-color: var(--sys-red);
}

.toast-stack .alert-info,
.system-toast.info {
    border-left-color: var(--sys-blue);
}

.system-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1380;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.44);
    backdrop-filter: blur(8px);
}

.system-confirm-backdrop[hidden] {
    display: none;
}

.system-confirm {
    display: grid;
    gap: 16px;
    width: min(100%, 430px);
    padding: 22px;
    border: 1px solid var(--sys-border);
    border-radius: var(--sys-radius-lg);
    background: var(--sys-surface);
    color: var(--sys-text);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.system-confirm-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--sys-radius);
    background: #fff7ed;
    color: var(--sys-amber);
    font-weight: 950;
}

.system-confirm h2 {
    margin: 4px 0 6px;
    font-size: 1.2rem;
}

.system-confirm p:not(.eyebrow) {
    margin: 0;
    color: var(--sys-muted);
    line-height: 1.5;
    white-space: pre-line;
}

.system-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

html:not(.is-phone-device) .cashier-body .cashier-shell {
    display: block;
    width: 100%;
    max-width: 1280px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px;
    background: var(--sys-bg);
}

html:not(.is-phone-device) .cashier-body .phone-dashboard {
    width: 100%;
    max-width: none;
}

/* Global contrast safety net for light surfaces across every module. */
body.app-body {
    color: var(--sys-text);
}

body.app-body input,
body.app-body select,
body.app-body textarea {
    background-color: var(--sys-surface);
    color: var(--sys-text);
}

body.app-body input::placeholder,
body.app-body textarea::placeholder {
    color: var(--sys-faint);
}

body.app-body :is(
    .content,
    .navbar,
    .dropdown-menu,
    .user-menu,
    .quick-actions-menu,
    .notification-menu,
    .panel,
    .form-card,
    .table-card,
    .stat-card,
    .summary-card,
    .app-modal,
    .form-modal,
    .quick-action-modal,
    .success-modal,
    .system-confirm,
    .modal-summary,
    .phone-panel,
    .business-panel,
    .wallet-phone-panel,
    .xitique-panel,
    .debt-panel,
    .business-kpi-grid article,
    .business-stock-row article,
    .business-action-grid a,
    .business-action-grid button,
    .business-module-card,
    .business-list article,
    .business-product-list article,
    .business-product-grid > article,
    .business-stock-history article,
    .business-cash-history article,
    .business-account-list article,
    .business-account-full-list article,
    .business-team-list article,
    .business-sale-item-row,
    .cashier-close-panel,
    .cashier-close-summary,
    .cashier-close-breakdown,
    .cashier-close-confirm,
    .phone-mini-card,
    .phone-goal-focus,
    .phone-transaction-row,
    .phone-debt-row,
    .phone-report-stats article,
    .phone-report-simple-summary article,
    .phone-protected-summary article,
    .phone-insight-card,
    .wallet-list article,
    .wallet-inline-details,
    .debt-list article,
    .xitique-list article,
    .catalog-list article,
    .report-list article,
    .plan-method-card,
    .plan-steps article
) {
    color: var(--sys-text);
}

body.app-body :is(
    .panel,
    .form-card,
    .table-card,
    .summary-card,
    .app-modal,
    .form-modal,
    .success-modal,
    .system-confirm,
    .phone-panel,
    .business-panel,
    .wallet-phone-panel,
    .xitique-panel,
    .debt-panel,
    .business-list article,
    .business-product-list article,
    .business-product-grid > article,
    .business-stock-history article,
    .business-cash-history article,
    .business-account-list article,
    .business-account-full-list article,
    .business-team-list article,
    .business-sale-item-row,
    .cashier-close-panel,
    .cashier-close-summary,
    .cashier-close-breakdown,
    .cashier-close-confirm,
    .phone-mini-card,
    .phone-goal-focus,
    .phone-transaction-row,
    .phone-debt-row,
    .phone-report-stats article,
    .phone-report-simple-summary article,
    .phone-protected-summary article,
    .phone-insight-card,
    .wallet-list article,
    .wallet-inline-details,
    .debt-list article,
    .xitique-list article,
    .catalog-list article,
    .report-list article,
    .plan-method-card,
    .plan-steps article
) :is(p, small, .muted, .table-toolbar-count) {
    color: var(--sys-muted);
}

body.app-body :is(
    .panel,
    .form-card,
    .table-card,
    .summary-card,
    .app-modal,
    .form-modal,
    .success-modal,
    .system-confirm,
    .phone-panel,
    .business-panel,
    .wallet-phone-panel,
    .xitique-panel,
    .debt-panel,
    .business-list article,
    .business-product-list article,
    .business-product-grid > article,
    .business-stock-history article,
    .business-cash-history article,
    .business-account-list article,
    .business-account-full-list article,
    .business-team-list article,
    .business-sale-item-row,
    .cashier-close-panel,
    .cashier-close-summary,
    .cashier-close-breakdown,
    .cashier-close-confirm,
    .phone-mini-card,
    .phone-goal-focus,
    .phone-transaction-row,
    .phone-debt-row,
    .phone-report-stats article,
    .phone-report-simple-summary article,
    .phone-protected-summary article,
    .phone-insight-card,
    .wallet-list article,
    .wallet-inline-details,
    .debt-list article,
    .xitique-list article,
    .catalog-list article,
    .report-list article,
    .plan-method-card,
    .plan-steps article
) :is(h1, h2, h3, h4, strong, b, label) {
    color: var(--sys-text);
}

body.app-body :is(
    .panel,
    .form-card,
    .table-card,
    .app-modal,
    .form-modal,
    .phone-panel,
    .business-panel,
    .wallet-phone-panel,
    .xitique-panel,
    .debt-panel,
    .cashier-close-panel
) :is(input, select, textarea) {
    background-color: var(--sys-surface);
    color: var(--sys-text);
}

body.app-body :is(.button-primary, .button-danger, .sidebar, .balance-card, .finance-control-panel, .app-cover, .reports-cover, .business-module-card.primary) {
    color: #ffffff;
}

body.app-body :is(.phone-debt-row b, .plan-steps b, .payment-logo, .phone-goal-focus > a) {
    color: #ffffff;
}

@media (max-width: 1120px) {
    .navbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .navbar-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }
}

@media (max-width: 820px) {
    body.app-body .app-shell,
    html:not(.is-phone-device) body.has-phone-dashboard .app-shell,
    html:not(.is-phone-device) body:has(.phone-dashboard) .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none !important;
    }

    .content,
    html:not(.is-phone-device) body.has-phone-dashboard .content,
    html:not(.is-phone-device) body:has(.phone-dashboard) .content {
        padding: 18px;
    }

    html:not(.is-phone-device) .business-kpi-grid,
    html:not(.is-phone-device) .personal-kpi-grid,
    html:not(.is-phone-device) .phone-report-grid,
    html:not(.is-phone-device) .wallet-summary-grid,
    html:not(.is-phone-device) .debt-summary-grid,
    html:not(.is-phone-device) .xitique-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-menu-name,
    .quick-actions-menu .nav-label,
    .notification-pill .nav-label {
        display: none;
    }
}

/* Visual polish: clearer hierarchy, accessible focus and reliable mobile shell. */

body.app-body .navbar,
body.app-body :is(
    .panel,
    .form-card,
    .table-card,
    .summary-card,
    .phone-panel,
    .business-panel,
    .wallet-phone-panel,
    .xitique-panel,
    .debt-panel
) {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

body.app-body :is(a, button, input, select, textarea, summary) {
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

body.app-body :is(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.28);
    outline-offset: 2px;
}

body.app-body :is(.button, button, input[type="submit"]):active {
    transform: translateY(1px);
}

body.app-body :is(input, select, textarea)::placeholder {
    color: #94a3b8;
    opacity: 1;
}

body.app-body .sidebar-toggle:hover,
body.app-body .sidebar-toggle:focus-visible {
    border-color: rgba(45, 212, 191, 0.42);
    background: rgba(45, 212, 191, 0.12);
    color: #ffffff;
}

body.app-body .quick-actions-popover,
body.app-body .user-menu-popover,
body.app-body :is(.app-modal, .form-modal, .quick-action-modal, .business-action-modal, .success-modal, .system-confirm) {
    border-color: var(--sys-border);
    border-radius: var(--sys-radius-lg);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

body.app-body :is(.app-modal, .form-modal, .quick-action-modal, .business-action-modal, .success-modal, .system-confirm) {
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
}

body.app-body #employee-access-link {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.app-body .history-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

body.app-body .history-search-form {
    display: flex;
    align-items: end;
    gap: 10px;
    width: min(100%, 720px);
}

body.app-body .history-search-form label {
    display: grid;
    flex: 1 1 320px;
    gap: 6px;
    margin: 0;
}

body.app-body .history-search-form label > span {
    color: var(--sys-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

body.app-body .history-search-form input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--sys-border);
    border-radius: var(--sys-radius);
    background: var(--sys-surface);
    color: var(--sys-text);
}

body.app-body .history-toolbar > p,
body.app-body .history-pagination > p {
    margin: 0;
    color: var(--sys-muted);
    font-size: 0.82rem;
    font-weight: 750;
    white-space: nowrap;
}

body.app-body .history-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 16px;
}

body.app-body .history-pagination > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.app-body .history-pagination > div > span {
    color: var(--sys-text);
    font-size: 0.82rem;
    font-weight: 850;
}

@media (min-width: 821px) {
    html:not(.is-phone-device) body.app-body .phone-report-filter {
        border-color: var(--sys-border);
        background: var(--sys-surface);
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
        backdrop-filter: none;
    }

    html:not(.is-phone-device) body.app-body .phone-report-filter :is(select, input[type="date"]) {
        border: 1px solid var(--sys-border);
        background: var(--sys-surface-2);
        color: var(--sys-text);
    }

    html:not(.is-phone-device) body.app-body .phone-report-filter button {
        border: 1px solid var(--sys-primary);
        background: var(--sys-primary);
        color: #ffffff;
        box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
    }

    html:not(.is-phone-device) body.app-body .phone-report-filter button:hover {
        border-color: var(--sys-primary-strong);
        background: var(--sys-primary-strong);
    }

    html:not(.is-phone-device) body.app-body .phone-export-button {
        border: 1px solid var(--sys-border);
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    }

    html:not(.is-phone-device) body.app-body .phone-report-balance .phone-income-expense > div:first-child {
        border-color: #a7f3d0;
        background: #ecfdf5;
        color: #047857;
    }

    html:not(.is-phone-device) body.app-body .phone-report-balance .phone-income-expense > div:last-child {
        border-color: #fed7aa;
        background: #fff7ed;
        color: #c2410c;
    }

    html:not(.is-phone-device) body.app-body .phone-report-balance .phone-income-expense span {
        color: #475569;
    }

    html:not(.is-phone-device) body.app-body .phone-report-balance .phone-income-expense strong {
        color: var(--sys-text);
    }
}

@media (max-width: 820px) {
    html body.app-body .app-shell,
    html:not(.is-phone-device) body.has-phone-dashboard .app-shell,
    html:not(.is-phone-device) body:has(.phone-dashboard) .app-shell {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    html body.app-body .sidebar,
    html:not(.is-phone-device) body.has-phone-dashboard .sidebar,
    html:not(.is-phone-device) body:has(.phone-dashboard) .sidebar {
        display: none !important;
    }

    html:not(.is-phone-device) body.has-phone-dashboard .navbar,
    html:not(.is-phone-device) body:has(.phone-dashboard) .navbar {
        display: none !important;
    }

    html:not(.is-phone-device) body.app-body .phone-bottom-nav {
        display: grid !important;
    }

    html body.app-body .main-shell,
    html body.app-body .content {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none;
    }

    html body.app-body .content,
    html:not(.is-phone-device) body.has-phone-dashboard .content,
    html:not(.is-phone-device) body:has(.phone-dashboard) .content {
        padding: 14px 12px 92px;
    }

    body.app-body .business-link-copy,
    body.app-body .business-access-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    body.app-body .business-link-copy .button,
    body.app-body .business-access-actions .button {
        width: 100%;
    }

    body.app-body .history-toolbar,
    body.app-body .history-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    body.app-body .history-search-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }

    body.app-body .history-search-form label {
        grid-column: 1 / -1;
    }

    body.app-body .history-pagination > div {
        justify-content: space-between;
    }

    html:not(.is-phone-device) body.app-body .phone-report-balance {
        border-color: rgba(255, 255, 255, 0.58);
        background:
            radial-gradient(circle at 84% 20%, rgba(45, 212, 191, 0.26), transparent 30%),
            linear-gradient(135deg, rgba(8, 31, 84, 0.98), rgba(23, 68, 160, 0.96) 56%, rgba(8, 122, 70, 0.96));
        color: #ffffff;
    }

    html:not(.is-phone-device) body.app-body .phone-report-balance :is(p, span, strong) {
        color: #ffffff;
    }

    html:not(.is-phone-device) body.app-body .phone-report-balance .phone-income-expense > div {
        border-color: rgba(255, 255, 255, 0.18);
        background: rgba(2, 6, 23, 0.30);
    }

    body.app-body .phone-report-filter {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-color: var(--sys-border);
        background: var(--sys-surface);
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
        backdrop-filter: none;
    }

    body.app-body .phone-report-filter :is(select, input[type="date"]) {
        width: 100%;
        max-width: none;
        border: 1px solid var(--sys-border);
        background: var(--sys-surface-2);
        color: var(--sys-text);
    }

    body.app-body .phone-report-filter button {
        width: 100%;
        border: 1px solid var(--sys-primary);
        background: var(--sys-primary);
        color: #ffffff;
    }

    body.app-body .phone-report-filter:not(:has(input[type="date"])) button {
        grid-column: 1 / -1;
    }

    body.app-body .phone-dashboard-header > div > p,
    body.app-body .personal-kpi-grid article small,
    body.app-body .business-kpi-grid article small {
        color: #475569;
    }

    body.app-body .phone-bottom-nav :is(a, button) {
        color: #64748b;
    }
}

body.app-body .notification-badge {
    background: #dc2626 !important;
    color: #ffffff !important;
}

@media (prefers-reduced-motion: reduce) {
    body.app-body *,
    body.app-body *::before,
    body.app-body *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Personal dashboard v2 - faithful implementation of the approved green mobile concept. */
body.app-body .km-dashboard-v2 {
    --km-green: #087b31;
    --km-green-dark: #087b31;
    --km-green-soft: #dff6e7;
    --km-ink: #0b1425;
    --km-muted: #69717e;
    --km-line: #e8eaed;
    width: min(100%, 1120px);
    min-height: 100vh;
    overflow: hidden;
    border: 0;
    border-radius: 28px;
    background: #f8f9fa;
    color: var(--km-ink, #0f172a);
    box-shadow: 0 24px 70px rgba(11, 20, 37, 0.12);
}

html body.app-body .km-dashboard-v2 .km-dashboard-bg {
    display: block;
    height: 370px;
    border-radius: 0 0 72px 0;
    background:
        radial-gradient(circle at 77% 22%, rgba(255, 255, 255, 0.13), transparent 31%),
        linear-gradient(140deg, #078a35 0%, #14953d 57%, #42a94c 100%);
}

body.app-body .km-dashboard-v2 .km-dashboard-content {
    position: relative;
    z-index: 2;
    padding: 0 28px;
}

body.app-body .km-dashboard-hero {
    position: relative;
    min-height: 276px;
    padding: 34px 14px 24px;
    color: #ffffff;
}

body.app-body .km-dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.app-body .km-hamburger {
    display: grid;
    gap: 5px;
    width: 40px;
    padding: 4px 0;
    color: #ffffff;
}

body.app-body .km-hamburger span {
    display: block;
    width: 27px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
}

body.app-body .km-hamburger span:nth-child(2) {
    width: 22px;
}

body.app-body .km-dashboard-v2 .km-notification-link {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
}

body.app-body .km-dashboard-v2 .km-notification-link .nav-svg svg {
    width: 29px;
    height: 29px;
    stroke-width: 1.8;
}

body.app-body .km-dashboard-v2 .km-notification-link .notification-badge {
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid #15963e;
    font-size: 0.62rem;
}

body.app-body .km-welcome {
    margin-top: 28px;
}

body.app-body .km-welcome h1,
body.app-body .km-welcome p {
    margin: 0;
    color: #ffffff;
}

body.app-body .km-welcome h1 {
    font-size: clamp(1.85rem, 7vw, 2.35rem);
    font-weight: 900;
    letter-spacing: -0.04em;
}

body.app-body .km-welcome p {
    margin-top: 5px;
    font-size: 1.12rem;
    font-weight: 650;
}

body.app-body .km-trial-chip {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    min-height: 52px;
    margin-top: 18px;
    padding: 11px 12px 11px 15px;
    border: 1px solid #f2c94c;
    border-radius: 14px;
    background: #fff1a8;
    color: #3b2a00;
    font-size: 0.82rem;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(120, 75, 0, 0.18);
    touch-action: manipulation;
}

body.app-body .km-trial-chip span {
    color: inherit;
    text-decoration: none;
}

body.app-body .km-trial-chip .km-trial-days {
    min-width: 0;
    line-height: 1.25;
}

body.app-body .km-trial-chip .km-trial-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    font-size: 0.74rem;
    white-space: nowrap;
}

body.app-body .km-balance-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 176px;
    margin-top: -22px;
    padding: 26px 30px;
    border: 1px solid rgba(11, 20, 37, 0.05);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 38px rgba(9, 35, 20, 0.12);
}

body.app-body .km-balance-copy {
    min-width: 0;
}

body.app-body .km-balance-copy p {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #343943;
    font-size: 1rem;
    font-weight: 750;
    text-transform: none;
}

body.app-body .km-balance-copy p button {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #80858e;
}

body.app-body .km-balance-copy p button .nav-svg svg {
    width: 21px;
    height: 21px;
}

body.app-body .km-balance-copy > strong {
    display: block;
    overflow-wrap: anywhere;
    margin-top: 10px;
    color: var(--km-ink);
    font-size: clamp(2rem, 7vw, 3rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

body.app-body .km-balance-copy > small {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    font-size: 0.86rem;
    font-weight: 850;
}

body.app-body .km-balance-copy > small span {
    color: var(--km-muted, #68707d);
    font-weight: 600;
}

body.app-body .km-balance-breakdown {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    width: 100%;
    margin-top: 2px;
}

body.app-body .km-balance-breakdown > span {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    background: #f7f9fb;
}

body.app-body .km-balance-breakdown small,
body.app-body .km-balance-breakdown strong {
    display: block;
}

body.app-body .km-balance-breakdown small {
    color: var(--km-muted, #68707d);
    font-size: 0.69rem;
    font-weight: 750;
}

body.app-body .km-balance-breakdown strong {
    overflow-wrap: anywhere;
    margin-top: 3px;
    color: var(--km-ink);
    font-size: clamp(0.78rem, 3vw, 0.94rem);
    font-variant-numeric: tabular-nums lining-nums;
}

body.app-body .km-dashboard-v2 .good,
body.app-body .km-dashboard-v2 .positive {
    color: #09913a;
}

body.app-body .km-dashboard-v2 .bad,
body.app-body .km-dashboard-v2 .negative {
    color: #d62929;
}

body.app-body .km-balance-wallet {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    border-radius: 20px;
    background: #f4f5f6;
    color: var(--km-green);
}

body.app-body .km-balance-wallet .nav-svg svg {
    width: 40px;
    height: 40px;
    stroke-width: 1.7;
}

body.app-body .km-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

body.app-body .km-kpi-grid article {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    min-height: 132px;
    padding: 19px;
    border: 1px solid rgba(11, 20, 37, 0.04);
    border-radius: 23px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(11, 20, 37, 0.055);
}

body.app-body .km-kpi-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--km-green-soft);
    color: var(--km-green);
}

body.app-body .km-kpi-icon .nav-svg svg {
    width: 31px;
    height: 31px;
    stroke-width: 1.9;
}

body.app-body .km-kpi-grid p {
    margin: 0;
    color: #242a34;
    font-size: 0.88rem;
    font-weight: 850;
}

body.app-body .km-kpi-grid strong {
    display: block;
    overflow: hidden;
    margin-top: 7px;
    color: var(--km-ink);
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.app-body .km-kpi-grid small {
    display: block;
    margin-top: 8px;
    font-size: 0.76rem;
    font-weight: 850;
}

body.app-body .km-goal-spotlight {
    position: relative;
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid rgba(15, 143, 61, 0.13);
    border-radius: 25px;
    background:
        radial-gradient(circle at 91% 10%, rgba(31, 191, 91, 0.16), transparent 29%),
        linear-gradient(135deg, #ffffff 0%, #f2fbf5 100%);
    box-shadow: 0 13px 32px rgba(7, 91, 39, 0.09);
}

body.app-body .km-goal-spotlight > a {
    display: block;
    padding: 21px 23px 18px;
    color: inherit;
    text-decoration: none;
}

body.app-body .km-goal-spotlight-head {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

body.app-body .km-goal-spotlight-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(145deg, #14a64b, #08722e);
    color: #fff;
    box-shadow: 0 11px 24px rgba(15, 143, 61, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

body.app-body .km-goal-spotlight-icon .nav-svg svg {
    width: 27px;
    height: 27px;
}

body.app-body .km-goal-spotlight-head p {
    margin: 0 0 3px;
    color: #0f8f3d;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

body.app-body .km-goal-spotlight-head h2 {
    margin: 0;
    color: #111827;
    font-size: 1.06rem;
    font-weight: 900;
    letter-spacing: -0.025em;
}

body.app-body .km-goal-spotlight-head small {
    display: block;
    margin-top: 4px;
    color: #526071;
    font-size: 0.78rem;
    font-weight: 750;
}

body.app-body .km-goal-spotlight-percent {
    color: #087b35;
    font-size: 1.65rem;
    font-weight: 950;
    letter-spacing: -0.045em;
}

body.app-body .km-goal-spotlight-start {
    padding: 8px 12px;
    border-radius: 999px;
    background: #dff7e7;
    color: #087b35;
    font-size: 0.78rem;
}

body.app-body .km-goal-spotlight-progress {
    height: 8px;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: #dce7df;
}

body.app-body .km-goal-spotlight-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1744a0, #16a34a);
    box-shadow: 0 0 10px rgba(22, 163, 74, 0.22);
}

body.app-body .km-goal-spotlight-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 11px;
    color: #667085;
    font-size: 0.76rem;
    font-weight: 700;
}

body.app-body .km-goal-spotlight-foot > strong {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
    color: #087b35;
    font-size: 0.76rem;
}

body.app-body .km-goal-spotlight-foot .nav-svg svg {
    width: 15px;
    height: 15px;
    transform: rotate(-90deg);
}

body.app-body .km-goal-spotlight.is-empty {
    background: linear-gradient(135deg, #ffffff, #f4faf6);
}

body.app-body .km-dashboard-card {
    margin-top: 16px;
    padding: 25px;
    border: 1px solid rgba(11, 20, 37, 0.04);
    border-radius: 25px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(11, 20, 37, 0.055);
}

@media (max-width: 760px) {
    body.app-body .km-goal-spotlight {
        margin-top: 8px;
        border-radius: 19px;
    }

    body.app-body .km-goal-spotlight > a {
        padding: 13px 14px 12px;
    }

    body.app-body .km-goal-spotlight-head {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        gap: 10px;
    }

    body.app-body .km-goal-spotlight-icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    body.app-body .km-goal-spotlight-icon .nav-svg svg {
        width: 22px;
        height: 22px;
    }

    body.app-body .km-goal-spotlight-head h2 {
        overflow: hidden;
        font-size: 0.9rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.app-body .km-goal-spotlight-head small {
        font-size: 0.69rem;
    }

    body.app-body .km-goal-spotlight-percent {
        font-size: 1.35rem;
    }

    body.app-body .km-goal-spotlight-progress {
        height: 6px;
        margin-top: 11px;
    }

    body.app-body .km-goal-spotlight-foot {
        margin-top: 8px;
        font-size: 0.68rem;
    }

    body.app-body .km-goal-spotlight-foot > strong {
        font-size: 0.68rem;
    }
}

body.app-body .km-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

body.app-body .km-dashboard-card h2 {
    margin: 0;
    color: var(--km-ink);
    font-size: 1.18rem;
    font-weight: 900;
    letter-spacing: -0.025em;
}

body.app-body .km-section-heading small {
    display: block;
    margin-top: 2px;
    color: var(--km-muted);
    font-size: 0.78rem;
    font-weight: 650;
}

body.app-body .km-notice-card {
    padding: 18px;
    border-color: #dceee5;
    background: linear-gradient(135deg, #ffffff, #f4fbf7);
}

body.app-body .km-notice-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

body.app-body .km-notice-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    min-width: 0;
    padding: 12px;
    border: 1px solid #e6eee9;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
}

body.app-body .km-notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: #e7f7ed;
    color: #0f8f3d;
}

body.app-body .km-notice-item.alta .km-notice-icon {
    background: #ffe9e7;
    color: #d9342b;
}

body.app-body .km-notice-item.media .km-notice-icon {
    background: #fff4d7;
    color: #a96f00;
}

body.app-body .km-notice-item strong,
body.app-body .km-notice-item p {
    overflow-wrap: anywhere;
}

body.app-body .km-notice-item strong {
    display: block;
    color: var(--km-ink);
    font-size: 0.92rem;
    font-weight: 900;
}

body.app-body .km-notice-item p {
    margin: 4px 0 0;
    color: var(--km-muted);
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.45;
}

body.app-body .km-advice-summary-card {
    padding: 20px;
}

body.app-body .km-advice-summary-body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 12px;
    margin-top: 16px;
}

body.app-body .km-advice-main,
body.app-body .km-advice-action {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 15px;
    border: 1px solid #e7ece9;
    border-radius: 18px;
    background: #f8faf9;
}

body.app-body .km-advice-main {
    grid-template-columns: 44px minmax(0, 1fr);
}

body.app-body .km-advice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: #def5e6;
    color: #0f8f3d;
}

body.app-body .km-advice-main.km-advice-alta .km-advice-icon {
    background: #ffe8e6;
    color: #d9342b;
}

body.app-body .km-advice-main.km-advice-media .km-advice-icon {
    background: #fff4d7;
    color: #a96f00;
}

body.app-body .km-advice-main small,
body.app-body .km-advice-action small {
    color: var(--km-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

body.app-body .km-advice-main strong,
body.app-body .km-advice-action strong {
    display: block;
    margin-top: 4px;
    color: var(--km-ink);
    font-size: 0.98rem;
    font-weight: 900;
}

body.app-body .km-advice-main p,
body.app-body .km-advice-action p {
    margin: 5px 0 0;
    color: #4b5563;
    font-size: 0.84rem;
    line-height: 1.45;
}

body.app-body .km-advice-action {
    align-content: space-between;
}

body.app-body .km-advice-action > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 13px;
    background: #0f8f3d;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 850;
}

body.app-body .km-section-heading > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #e2e4e7;
    border-radius: 13px;
    color: #333842;
    font-size: 0.82rem;
    font-weight: 750;
}

body.app-body .km-section-heading > .km-period-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #e2e4e7;
    border-radius: 13px;
    color: #333842;
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
}

body.app-body .km-section-heading > .km-period-link:hover,
body.app-body .km-section-heading > .km-period-link:focus-visible {
    border-color: rgba(15, 143, 61, 0.35);
    color: var(--km-green-dark, #08722e);
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 143, 61, 0.10);
}

body.app-body .km-section-heading > span .nav-svg svg,
body.app-body .km-section-heading > .km-period-link .nav-svg svg {
    width: 16px;
    height: 16px;
}

body.app-body .km-chart-wrap {
    position: relative;
    width: 100%;
    margin-top: 18px;
}

body.app-body .km-chart {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

body.app-body .km-grid-line {
    stroke: #e8eaed;
    stroke-width: 1;
    stroke-dasharray: 4 5;
}

body.app-body .km-axis-label {
    fill: #777e88;
    font: 600 12px system-ui, sans-serif;
}

body.app-body .km-income-line,
body.app-body .km-expense-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

body.app-body .km-income-line {
    stroke: var(--km-green);
    stroke-width: 3.5;
}

body.app-body .km-expense-line {
    stroke: #a6a8ad;
    stroke-width: 2.5;
    stroke-dasharray: 8 6;
}

body.app-body .km-chart-value {
    position: absolute;
    top: 1px;
    right: 0;
    padding: 6px 8px;
    border-radius: 5px;
    background: var(--km-green);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 850;
}

body.app-body .km-chart-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-top: 4px;
    color: #555b65;
    font-size: 0.78rem;
    font-weight: 700;
}

body.app-body .km-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

body.app-body .km-chart-legend i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

body.app-body .km-chart-legend i.income {
    background: var(--km-green);
}

body.app-body .km-chart-legend i.expense {
    background: #a6a8ad;
}

body.app-body .km-actions-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

body.app-body .km-actions-grid :is(a, button) {
    display: grid;
    justify-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 104px;
    padding: 13px 7px;
    border: 1px solid #e4e6e9;
    border-radius: 19px;
    background: transparent;
    color: var(--km-ink, #0f172a);
    font: inherit;
    text-align: center;
    cursor: pointer;
}

body.app-body .km-actions-grid :is(a, button) > span {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f3f4f5;
    color: #454a52;
}

body.app-body .km-actions-grid :is(a, button) > span.primary {
    background: var(--km-green);
    color: #ffffff;
}

body.app-body .km-actions-grid :is(a, button) > span.soft {
    background: var(--km-green-soft);
    color: var(--km-green);
}

body.app-body .km-actions-grid .nav-svg svg {
    width: 25px;
    height: 25px;
}

body.app-body .km-actions-grid b {
    overflow-wrap: anywhere;
    font-size: 0.77rem;
    line-height: 1.15;
}

body.app-body .km-actions-grid .km-dots {
    padding-bottom: 8px;
    font-size: 1.25rem;
    letter-spacing: 0.08em;
}

body.app-body .km-recent-card .km-section-heading a {
    color: var(--km-green-dark, #08722e);
    font-size: 0.82rem;
    font-weight: 850;
}

body.app-body .km-recent-list {
    margin-top: 13px;
}

body.app-body .km-recent-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto minmax(105px, auto);
    gap: 12px;
    align-items: center;
    min-height: 74px;
    padding: 11px 0;
    border-bottom: 1px solid var(--km-line);
}

body.app-body .km-recent-row:last-child {
    border-bottom: 0;
}

body.app-body .km-recent-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

body.app-body .km-recent-icon.income {
    background: var(--km-green-soft);
    color: var(--km-green);
}

body.app-body .km-recent-icon.expense {
    background: #ffe8e8;
    color: #f02d2d;
}

body.app-body .km-recent-icon.pending {
    background: #fff4d7;
    color: #b77900;
}

body.app-body .km-recent-icon .nav-svg svg {
    width: 25px;
    height: 25px;
}

body.app-body .km-recent-row div {
    min-width: 0;
}

body.app-body .km-recent-row div strong,
body.app-body .km-recent-row div small {
    display: block;
}

body.app-body .km-recent-row div strong {
    overflow: hidden;
    color: var(--km-ink);
    font-size: 0.91rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.app-body .km-recent-row div small,
body.app-body .km-recent-row time {
    margin-top: 3px;
    color: var(--km-muted, #68707d);
    font-size: 0.75rem;
    font-weight: 650;
}

body.app-body .km-recent-row > b {
    justify-self: end;
    font-size: 0.88rem;
    white-space: nowrap;
}

body.app-body .km-recent-row > b.negative,
body.app-body .km-recent-row > b.neutral {
    color: var(--km-ink);
}

body.app-body .km-empty-state {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 30px 18px 22px;
    color: var(--km-muted, #68707d);
    text-align: center;
}

body.app-body .km-empty-state > span {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--km-green-soft);
    color: var(--km-green);
}

body.app-body .km-empty-state strong {
    color: var(--km-ink);
}

body.app-body .km-empty-state small {
    max-width: 310px;
    line-height: 1.45;
}

body.app-body .business-ranking-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

body.app-body .business-ranking-column {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e8eaed;
    border-radius: 19px;
    background: linear-gradient(180deg, #ffffff, #fbfcfc);
}

body.app-body .business-ranking-column > header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 70px;
    padding: 13px 14px;
    border-bottom: 1px solid #eceef0;
}

body.app-body .business-ranking-column > header .phone-icon {
    flex: 0 0 auto;
}

body.app-body .business-ranking-column > header div,
body.app-body .business-ranking-row > div {
    min-width: 0;
}

body.app-body .business-ranking-column > header strong,
body.app-body .business-ranking-column > header small,
body.app-body .business-ranking-row strong,
body.app-body .business-ranking-row small {
    display: block;
}

body.app-body .business-ranking-column > header strong {
    color: var(--km-ink, #0f172a);
    font-size: 0.86rem;
    font-weight: 850;
}

body.app-body .business-ranking-column > header small,
body.app-body .business-ranking-row small {
    margin-top: 3px;
    color: var(--km-muted, #68707d);
    font-size: 0.69rem;
    font-weight: 650;
    line-height: 1.35;
}

body.app-body .business-ranking-list {
    padding: 3px 13px 8px;
}

body.app-body .business-ranking-row {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    min-height: 58px;
    padding: 9px 0;
    border-bottom: 1px solid #eceef0;
}

body.app-body .business-ranking-row:last-child {
    border-bottom: 0;
}

body.app-body .business-ranking-position {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #edf8f1;
    color: var(--km-green-dark, #08722e);
    font-size: 0.7rem;
    font-weight: 900;
}

body.app-body .business-ranking-row strong {
    overflow: hidden;
    color: var(--km-ink, #0f172a);
    font-size: 0.79rem;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.app-body .business-ranking-row > b {
    color: var(--km-green-dark, #08722e);
    font-size: 0.76rem;
    font-weight: 900;
    white-space: nowrap;
}

body.app-body .business-ranking-row .negative {
    color: #c73b3b;
}

body.app-body .business-ranking-empty {
    min-height: 72px;
    padding: 20px 10px;
    color: var(--km-muted, #68707d);
    font-size: 0.75rem;
    line-height: 1.45;
    text-align: center;
}

body.app-body .km-ranking-card .km-section-heading > div > small {
    display: block;
    margin-top: 4px;
    color: var(--km-muted, #68707d);
    font-size: 0.75rem;
    font-weight: 650;
}

body.app-body .km-ranking-card .km-section-heading > a {
    color: var(--km-green-dark, #08722e);
    font-size: 0.82rem;
    font-weight: 850;
    white-space: nowrap;
}

body.app-body .km-ranking-card .km-ranking-grid {
    margin-top: 16px;
}

@media (max-width: 1120px) {
    body.app-body .business-ranking-grid {
        grid-template-columns: 1fr;
    }
}

body.app-body .km-bottom-nav {
    border-color: #e6e8eb;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -8px 26px rgba(11, 20, 37, 0.06);
}

body.app-body .km-bottom-nav :is(a, button) {
    color: #858990;
}

body.app-body .km-bottom-nav a.active {
    color: var(--km-green);
}

body.app-body .km-bottom-nav :is(a, button).special {
    color: #ffffff;
}

body.app-body .km-bottom-nav :is(a, button).special .nav-svg {
    width: 58px;
    height: 58px;
    background: linear-gradient(140deg, #0b8534, #10a441);
    box-shadow: 0 12px 28px rgba(12, 150, 59, 0.32);
}

body.app-body .km-bottom-nav :is(a, button).special .nav-svg svg {
    width: 29px;
    height: 29px;
}

@media (min-width: 761px) {
    body.app-body .km-dashboard-v2 .km-kpi-grid article {
        grid-template-columns: 62px minmax(0, 1fr);
    }

    body.app-body .km-dashboard-v2 .km-dashboard-card {
        padding: 30px 34px;
    }

    body.app-body .km-dashboard-v2 .km-bottom-nav {
        display: none;
    }
}

@media (max-width: 760px) {
    body.app-body.has-phone-dashboard,
    body.app-body:has(.km-dashboard-v2) {
        min-width: 0;
        background: #f8f9fa;
    }

    body.app-body.has-phone-dashboard .app-shell,
    body.app-body:has(.km-dashboard-v2) .app-shell {
        display: block;
        width: 100%;
        min-height: 100vh;
    }

    body.app-body.has-phone-dashboard .sidebar,
    body.app-body.has-phone-dashboard .navbar,
    body.app-body.has-phone-dashboard > .mobile-menu,
    body.app-body.has-phone-dashboard > .floating-add,
    body.app-body:has(.km-dashboard-v2) .sidebar,
    body.app-body:has(.km-dashboard-v2) .navbar,
    body.app-body:has(.km-dashboard-v2) > .mobile-menu,
    body.app-body:has(.km-dashboard-v2) > .floating-add {
        display: none !important;
    }

    body.app-body.has-phone-dashboard .main-shell,
    body.app-body:has(.km-dashboard-v2) .main-shell,
    body.app-body.has-phone-dashboard .content,
    body.app-body:has(.km-dashboard-v2) .content {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    body.app-body .km-dashboard-v2 {
        width: 100%;
        max-width: none;
        margin: 0;
        overflow: visible;
        border-radius: 0;
        box-shadow: none;
        touch-action: pan-y;
    }

    html body.app-body .km-dashboard-v2 .km-dashboard-bg {
        height: 232px;
        border-radius: 0 0 48px 0;
    }

    body.app-body .km-dashboard-v2 .km-dashboard-content {
        padding: 0 16px;
    }

    body.app-body .km-dashboard-hero {
        min-height: 144px;
        padding: calc(24px + env(safe-area-inset-top)) 10px 14px;
    }

    body.app-body .km-welcome {
        margin-top: 10px;
    }

    body.app-body .km-welcome h1 {
        font-size: clamp(1.65rem, 7vw, 1.95rem);
    }

    body.app-body .km-welcome p {
        margin-top: 2px;
        font-size: 1rem;
    }

    body.app-body .km-trial-chip {
        min-height: 50px;
        margin-top: 14px;
        padding: 10px 11px 10px 13px;
        font-size: 0.76rem;
        white-space: normal;
    }

    body.app-body .km-trial-chip .km-trial-action {
        min-height: 32px;
        padding-inline: 10px;
        font-size: 0.68rem;
    }

    body.app-body .km-balance-card {
        min-height: 112px;
        margin-top: -14px;
        padding: 17px 18px;
        border-radius: 19px;
    }

    body.app-body .km-balance-copy > strong {
        margin-top: 7px;
        font-size: clamp(1.68rem, 7.5vw, 2.12rem);
    }

    body.app-body .km-balance-copy > small {
        margin-top: 10px;
        font-size: 0.72rem;
    }

    body.app-body .km-balance-wallet {
        width: 54px;
        height: 54px;
        border-radius: 15px;
    }

    body.app-body .km-balance-wallet .nav-svg svg {
        width: 29px;
        height: 29px;
    }

    body.app-body .km-kpi-grid {
        gap: 7px;
        margin-top: 8px;
    }

    body.app-body .km-kpi-grid article {
        grid-template-columns: 37px minmax(0, 1fr);
        gap: 7px;
        min-height: 86px;
        padding: 10px 8px;
        border-radius: 17px;
    }

    body.app-body .km-kpi-icon {
        width: 37px;
        height: 37px;
    }

    body.app-body .km-kpi-icon .nav-svg svg {
        width: 22px;
        height: 22px;
    }

    body.app-body .km-kpi-grid p {
        font-size: 0.74rem;
    }

    body.app-body .km-kpi-grid strong {
        margin-top: 5px;
        font-size: clamp(0.66rem, 2.8vw, 0.82rem);
    }

    body.app-body .km-kpi-grid small {
        margin-top: 5px;
        font-size: 0.62rem;
    }

    body.app-body .km-dashboard-card {
        margin-top: 8px;
        padding: 15px 14px;
        border-radius: 19px;
    }

    body.app-body .km-advice-summary-body {
        grid-template-columns: 1fr;
        gap: 9px;
        margin-top: 12px;
    }

    body.app-body .km-advice-main,
    body.app-body .km-advice-action {
        padding: 12px;
        border-radius: 16px;
    }

    body.app-body .business-ranking-grid {
        gap: 9px;
        margin-top: 12px;
    }

    body.app-body .business-ranking-column {
        border-radius: 16px;
    }

    body.app-body .business-ranking-column > header {
        min-height: 61px;
        padding: 10px 11px;
    }

    body.app-body .business-ranking-list {
        padding-inline: 11px;
    }

    body.app-body .business-ranking-row {
        min-height: 53px;
        padding-block: 7px;
    }

    body.app-body .km-chart-card {
        padding-inline: 13px;
    }

    body.app-body .km-chart-card .km-section-heading {
        padding-inline: 5px;
    }

    body.app-body .km-axis-label {
        font-size: 11px;
    }

    body.app-body .km-actions-grid {
        gap: 7px;
        margin-top: 11px;
    }

    body.app-body .km-actions-grid :is(a, button) {
        min-height: 76px;
        padding: 9px 4px;
        border-radius: 15px;
    }

    body.app-body .km-actions-grid :is(a, button) > span {
        width: 35px;
        height: 35px;
    }

    body.app-body .km-actions-grid b {
        font-size: clamp(0.58rem, 2.45vw, 0.7rem);
    }

    body.app-body .km-recent-row {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 9px;
        min-height: 62px;
        padding-block: 7px;
    }

    body.app-body .km-recent-icon {
        width: 38px;
        height: 38px;
    }

    body.app-body .km-recent-row time {
        grid-column: 2;
        grid-row: 2;
        margin-top: -13px;
    }

    body.app-body .km-recent-row > b {
        grid-column: 3;
        grid-row: 1 / span 2;
        max-width: 118px;
        overflow: hidden;
        font-size: 0.78rem;
        text-overflow: ellipsis;
    }

    body.app-body .km-recent-row div strong {
        font-size: 0.84rem;
    }

    body.app-body .km-bottom-nav {
        right: 0;
        left: 0;
        padding: 9px 14px calc(10px + env(safe-area-inset-bottom));
    }

    body.app-body .km-dashboard-v2 .phone-bottom-space {
        height: calc(106px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 365px) {
    body.app-body .km-dashboard-v2 .km-dashboard-content {
        padding-inline: 11px;
    }

    body.app-body .km-balance-card {
        padding-inline: 17px;
    }

    body.app-body .km-balance-wallet {
        width: 54px;
        height: 54px;
    }

    body.app-body .km-kpi-grid article {
        padding-inline: 8px;
    }

    body.app-body .km-actions-grid {
        gap: 4px;
    }
}

/*
 * Kontrolo MZ unified green interface (v2)
 * This is the active application shell. It deliberately lives after the
 * legacy component rules so every authenticated area shares one visual
 * language without changing business behaviour or form contracts.
 */
body.km-layout-v2 {
    --sys-bg: #f6f8f7;
    --sys-surface: #ffffff;
    --sys-surface-2: #f7faf8;
    --sys-border: #e3e9e5;
    --sys-border-strong: #ccd8d0;
    --sys-text: #0b1425;
    --sys-muted: #667085;
    --sys-faint: #8c9690;
    --sys-primary: #087b31;
    --sys-primary-strong: #087b31;
    --sys-primary-soft: #dff6e7;
    --sys-radius: 14px;
    --sys-radius-lg: 22px;
    --sys-shadow: 0 14px 38px rgba(16, 44, 27, 0.07);
    color-scheme: light;
    min-width: 0;
    background: var(--sys-bg);
    color: var(--sys-text);
}

body.km-layout-v2 .app-shell {
    grid-template-columns: 258px minmax(0, 1fr);
    background: var(--sys-bg);
}

@media screen and (min-width: 821px) {
    body.km-layout-v2 .app-shell > .sidebar {
        grid-column: 1;
        grid-row: 1;
    }

    body.km-layout-v2 .app-shell > .main-shell {
        grid-column: 2;
        grid-row: 1;
    }
}

body.km-layout-v2.sidebar-collapsed .app-shell {
    grid-template-columns: 84px minmax(0, 1fr);
}

body.km-layout-v2 .sidebar {
    gap: 14px;
    padding: 18px 12px;
    border: 0;
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.18), transparent 24%),
        linear-gradient(165deg, #0da241 0%, #0b8d38 46%, #076d2d 100%);
    box-shadow: 10px 0 32px rgba(7, 109, 45, 0.12);
}

body.km-layout-v2 .sidebar-logo {
    min-height: 58px;
    padding: 7px 8px;
    background: rgba(255, 255, 255, 0.10);
}

body.km-layout-v2 .sidebar-logo img {
    width: 42px;
    height: 42px;
    padding: 5px;
    background: #ffffff;
}

body.km-layout-v2 .sidebar-logo small,
body.km-layout-v2 .side-nav p {
    color: rgba(255, 255, 255, 0.66);
}

body.km-layout-v2 .sidebar-toggle {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

body.km-layout-v2 .side-nav a {
    min-height: 45px;
    padding: 7px 9px;
    border-radius: 13px;
    color: rgba(255, 255, 255, 0.82);
}

body.km-layout-v2 .side-nav .nav-svg {
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.10);
}

body.km-layout-v2 .side-nav a.active,
body.km-layout-v2 .side-nav a:hover {
    background: #ffffff;
    box-shadow: 0 9px 22px rgba(4, 75, 28, 0.17);
    color: var(--sys-primary-strong);
}

body.km-layout-v2 .side-nav a.active .nav-svg,
body.km-layout-v2 .side-nav a:hover .nav-svg {
    background: var(--sys-primary-soft);
    color: var(--sys-primary);
}

body.km-layout-v2 .main-shell {
    background:
        radial-gradient(circle at 94% -8%, rgba(12, 150, 59, 0.08), transparent 24%),
        var(--sys-bg);
}

body.km-layout-v2 .navbar {
    position: sticky;
    top: 0;
    z-index: 45;
    min-height: 80px;
    padding: 13px 28px;
    border: 0;
    border-bottom: 1px solid rgba(12, 150, 59, 0.10);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 30px rgba(16, 44, 27, 0.055);
    backdrop-filter: blur(18px);
}

body.km-layout-v2 .breadcrumbs a,
body.km-layout-v2 .navbar h2 {
    color: var(--sys-text);
}

body.km-layout-v2 .breadcrumbs a {
    color: var(--sys-primary);
}

body.km-layout-v2 .navbar-search,
body.km-layout-v2 .user-menu summary,
body.km-layout-v2 .notification-pill,
body.km-layout-v2 .quick-actions-menu .button {
    border-color: var(--sys-border);
    background: #ffffff;
}

body.km-layout-v2 .navbar-search {
    height: 46px;
    border-radius: 15px;
    background: #f7faf8;
}

body.km-layout-v2 .notification-pill,
body.km-layout-v2 .user-menu summary,
body.km-layout-v2 .navbar-main-action,
body.km-layout-v2 .quick-actions-menu .button {
    min-height: 46px;
    border-radius: 14px;
}

body.km-layout-v2 .navbar-main-action,
body.km-layout-v2 .button-primary,
body.km-layout-v2 button.button-primary {
    border-color: var(--sys-primary);
    background: linear-gradient(135deg, #0a8735, #10a743);
    box-shadow: 0 10px 22px rgba(12, 150, 59, 0.20);
    color: #ffffff;
}

body.km-layout-v2 .content {
    max-width: 1480px;
    padding: 28px clamp(20px, 2.5vw, 38px) 44px;
}

body.km-layout-v2 .page-header {
    align-items: center;
    min-height: 112px;
    margin: 0 0 18px;
    padding: 22px 24px;
    border: 1px solid var(--sys-border);
    border-radius: 24px;
    background:
        radial-gradient(circle at 96% 8%, rgba(12, 150, 59, 0.13), transparent 28%),
        linear-gradient(135deg, #ffffff, #f4fbf6);
    box-shadow: var(--sys-shadow);
}

body.km-layout-v2 .page-header h1 {
    margin: 3px 0 0;
    color: var(--sys-text);
    font-size: clamp(1.55rem, 2.4vw, 2.15rem);
    line-height: 1.08;
}

body.km-layout-v2 .page-header :is(p, .admin-page-subtitle) {
    color: var(--sys-muted);
}

body.km-layout-v2 .eyebrow {
    color: var(--sys-primary-strong);
    letter-spacing: 0.10em;
}

body.km-layout-v2 :is(
    .panel,
    .form-card,
    .table-card,
    .stat-card,
    .summary-card,
    .phone-panel,
    .business-panel,
    .wallet-phone-panel,
    .xitique-panel,
    .debt-panel
) {
    border: 1px solid var(--sys-border);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: var(--sys-shadow);
}

body.km-layout-v2 :is(.panel, .form-card, .table-card) {
    padding: clamp(17px, 2vw, 24px);
}

body.km-layout-v2 .stat-card {
    min-height: 132px;
    padding: 18px;
    overflow: hidden;
    position: relative;
}

body.km-layout-v2 .stat-card::after {
    position: absolute;
    right: -22px;
    bottom: -30px;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--sys-primary-soft);
    content: "";
    opacity: 0.68;
}

body.km-layout-v2 .stat-card strong {
    position: relative;
    z-index: 1;
    color: var(--sys-text);
    font-size: clamp(1.25rem, 2vw, 1.85rem);
}

body.km-layout-v2 .stat-card.positive strong {
    color: var(--sys-primary-strong);
}

body.km-layout-v2 .panel-header {
    align-items: center;
    margin-bottom: 17px;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf1ee;
}

body.km-layout-v2 .panel-header h3 {
    color: var(--sys-text);
}

body.km-layout-v2 :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    min-height: 48px;
    border: 1px solid var(--sys-border-strong);
    border-radius: 14px;
    background: #ffffff;
    color: var(--sys-text);
}

body.km-layout-v2 textarea {
    min-height: 110px;
}

body.km-layout-v2 :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
    border-color: rgba(12, 150, 59, 0.64);
    box-shadow: 0 0 0 4px rgba(12, 150, 59, 0.11);
    outline: 0;
}

body.km-layout-v2 .button,
body.km-layout-v2 button,
body.km-layout-v2 input[type="submit"] {
    min-height: 44px;
    border-radius: 13px;
    font-weight: 800;
}

body.km-layout-v2 .button-ghost {
    border-color: var(--sys-border-strong);
    background: #ffffff;
    color: var(--sys-text);
}

body.km-layout-v2 .button-ghost:hover {
    border-color: rgba(12, 150, 59, 0.34);
    background: var(--sys-primary-soft);
    color: var(--sys-primary-strong);
}

body.km-layout-v2 .table-wrap {
    border: 1px solid var(--sys-border);
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(16, 44, 27, 0.045);
}

body.km-layout-v2 .data-table th {
    padding: 14px 16px;
    background: #f2f8f4;
    color: #526158;
}

body.km-layout-v2 .data-table td {
    padding: 15px 16px;
    border-bottom-color: #edf1ee;
    color: var(--sys-text);
}

body.km-layout-v2 .data-table tbody tr:hover td {
    background: #f7fbf8;
}

body.km-layout-v2 .status-badge,
body.km-layout-v2 .badge,
body.km-layout-v2 .beta-badge {
    padding: 6px 10px;
    border-radius: 999px;
}

body.km-layout-v2 .quick-actions-popover,
body.km-layout-v2 .user-menu-popover,
body.km-layout-v2 :is(.app-modal, .form-modal, .quick-action-modal, .business-action-modal, .success-modal, .system-confirm) {
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(11, 20, 37, 0.20);
}

/* Existing specialised pages now inherit the approved green cover and cards. */
body.km-layout-v2 .phone-dashboard:not(.km-dashboard-v2) .phone-dashboard-bg {
    background:
        radial-gradient(circle at 84% 10%, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(150deg, #0da241 0%, #0b8d38 54%, #087630 100%);
}

body.km-layout-v2 .phone-dashboard:not(.km-dashboard-v2) :is(
    .phone-balance-card,
    .phone-panel,
    .business-hero-card,
    .business-module-card,
    .wallet-phone-panel,
    .xitique-panel,
    .debt-panel
) {
    border-color: rgba(227, 233, 229, 0.94);
    border-radius: 22px;
    box-shadow: 0 14px 36px rgba(16, 44, 27, 0.075);
}

body.km-layout-v2 .phone-dashboard:not(.km-dashboard-v2) :is(.phone-icon, .nav-svg) {
    color: var(--sys-primary);
}

body.km-layout-v2[data-theme="escuro"] {
    --bg: #f6f8f7;
    --surface: #ffffff;
    --surface-soft: #f0faf3;
    --text: #0b1425;
    --muted: #667085;
    --line: #e3e9e5;
    background: var(--sys-bg);
    color: var(--sys-text);
}

body.km-layout-v2[data-theme="escuro"] :is(.main-shell, .content, .panel, .form-card, .table-card, .stat-card) {
    color: var(--sys-text);
}

@media (max-width: 1120px) {
    body.km-layout-v2 .navbar-search {
        display: none;
    }
}

@media (max-width: 820px) {
    body.km-layout-v2 {
        background: #f8f9fa;
    }

    html body.km-layout-v2 .app-shell {
        display: block !important;
    }

    html body.km-layout-v2 .sidebar {
        display: none !important;
    }

    html body.km-layout-v2:not(.has-phone-dashboard) .navbar {
        display: flex !important;
        align-items: center;
        min-height: 112px;
        padding: calc(18px + env(safe-area-inset-top)) 16px 24px;
        border: 0;
        border-radius: 0 0 38px 0;
        background:
            radial-gradient(circle at 84% 5%, rgba(255, 255, 255, 0.18), transparent 30%),
            linear-gradient(145deg, #0da241, #0b8535);
        box-shadow: 0 13px 32px rgba(7, 109, 45, 0.18);
    }

    body.km-layout-v2:not(.has-phone-dashboard) .navbar-user {
        min-width: 0;
        flex: 1 1 auto;
    }

    body.km-layout-v2:not(.has-phone-dashboard) .breadcrumbs,
    body.km-layout-v2:not(.has-phone-dashboard) .navbar-user p {
        display: none;
    }

    body.km-layout-v2:not(.has-phone-dashboard) .navbar h2 {
        overflow: hidden;
        color: #ffffff;
        font-size: clamp(1.35rem, 6vw, 1.72rem);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.km-layout-v2:not(.has-phone-dashboard) .navbar-actions {
        flex: 0 0 auto;
    }

    body.km-layout-v2:not(.has-phone-dashboard) .navbar-actions > :not(.notification-pill):not(.user-menu) {
        display: none;
    }

    body.km-layout-v2:not(.has-phone-dashboard) .notification-pill,
    body.km-layout-v2:not(.has-phone-dashboard) .user-menu summary {
        width: 44px;
        min-width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.27);
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }

    body.km-layout-v2:not(.has-phone-dashboard) .notification-pill {
        display: grid;
        place-items: center;
    }

    body.km-layout-v2:not(.has-phone-dashboard) .user-menu summary > .nav-svg,
    body.km-layout-v2:not(.has-phone-dashboard) .user-menu-name {
        display: none;
    }

    body.km-layout-v2:not(.has-phone-dashboard) .notification-pill .nav-svg {
        display: grid;
        width: 22px;
        height: 22px;
        color: #ffffff;
    }

    body.km-layout-v2:not(.has-phone-dashboard) .avatar {
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        background: #ffffff;
        color: var(--sys-primary-strong);
    }

    html body.km-layout-v2 .content {
        padding: 14px 13px calc(108px + env(safe-area-inset-bottom));
    }

    body.km-layout-v2 .page-header {
        min-height: auto;
        padding: 18px;
        border-radius: 21px;
    }

    body.km-layout-v2 .page-header h1 {
        font-size: 1.42rem;
    }

    body.km-layout-v2 .page-header .header-actions {
        width: 100%;
    }

    body.km-layout-v2 .page-header .header-actions .button {
        flex: 1 1 auto;
    }

    body.km-layout-v2 :is(.panel, .form-card, .table-card) {
        padding: 16px;
        border-radius: 20px;
    }

    body.km-layout-v2 .stat-card {
        min-height: 112px;
        padding: 15px;
        border-radius: 19px;
    }

    body.km-layout-v2 .table-wrap {
        border-radius: 18px;
    }

    body.km-layout-v2 .mobile-menu {
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 90;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        width: 100%;
        min-height: 78px;
        padding: 8px 12px calc(9px + env(safe-area-inset-bottom));
        border: 0;
        border-top: 1px solid #e8ece9;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 -12px 32px rgba(16, 44, 27, 0.08);
        backdrop-filter: blur(18px);
    }

    body.km-layout-v2 .mobile-menu a {
        gap: 4px;
        min-width: 0;
        padding: 3px 2px;
        background: transparent !important;
        box-shadow: none !important;
        color: #626a65;
    }

    body.km-layout-v2 .mobile-menu a.active {
        background: transparent !important;
        color: var(--sys-primary);
    }

    body.km-layout-v2 .mobile-menu .nav-svg {
        width: 31px;
        height: 31px;
        border-radius: 10px;
        background: transparent;
    }

    body.km-layout-v2 .mobile-menu a.active .nav-svg {
        background: var(--sys-primary-soft);
        color: var(--sys-primary);
    }

    body.km-layout-v2 .mobile-menu .mobile-add {
        background: transparent !important;
        color: var(--sys-primary);
    }

    body.km-layout-v2 .mobile-menu .mobile-add .nav-svg {
        width: 54px;
        height: 54px;
        margin-top: -25px;
        border-radius: 50%;
        background: linear-gradient(140deg, #0b8534, #10a743);
        box-shadow: 0 11px 25px rgba(12, 150, 59, 0.30);
        color: #ffffff;
    }

    body.km-layout-v2 .mobile-menu-label {
        overflow: hidden;
        font-size: 0.66rem;
        font-weight: 800;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.km-layout-v2 .floating-add {
        display: none !important;
    }
}

/* Login and registration use the same approved green/white language. */
body.km-auth-v2 {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.17), transparent 23%),
        linear-gradient(145deg, #0da241 0%, #087b31 50%, #f6f8f7 50%);
    color: #0b1425;
}

body.km-auth-v2 .auth-shell {
    gap: clamp(28px, 5vw, 76px);
    width: min(1180px, calc(100% - 32px));
    padding-block: 36px;
}

body.km-auth-v2 .auth-brand {
    color: #ffffff;
}

body.km-auth-v2 .auth-brand :is(h1, p, strong, small) {
    color: #ffffff;
}

body.km-auth-v2 .auth-benefits div {
    border-color: rgba(255, 255, 255, 0.20);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
    backdrop-filter: blur(12px);
}

body.km-auth-v2 .auth-card {
    border: 1px solid rgba(227, 233, 229, 0.92);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 30px 80px rgba(11, 20, 37, 0.17);
}

body.km-auth-v2 .auth-card :is(input, select, textarea) {
    min-height: 50px;
    border-color: #ccd8d0;
    border-radius: 14px;
    background: #ffffff;
    color: #0b1425;
}

body.km-auth-v2 .auth-card :is(input, select, textarea):focus {
    border-color: rgba(12, 150, 59, 0.65);
    box-shadow: 0 0 0 4px rgba(12, 150, 59, 0.11);
}

body.km-auth-v2 .auth-submit {
    min-height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0a8735, #10a743);
    box-shadow: 0 11px 24px rgba(12, 150, 59, 0.22);
}

body.km-auth-v2 .choice-card {
    border-radius: 17px;
}

body.km-auth-v2 .choice-card:has(input:checked) {
    border-color: var(--sys-primary);
    background: #eefaf2;
    box-shadow: 0 0 0 3px rgba(12, 150, 59, 0.09);
}

@media (max-width: 760px) {
    body.km-auth-v2 {
        background:
            radial-gradient(circle at 80% 2%, rgba(255, 255, 255, 0.17), transparent 26%),
            linear-gradient(180deg, #0da241 0, #0b8535 220px, #f6f8f7 220px);
    }

    body.km-auth-v2 .auth-shell {
        width: 100%;
        padding: calc(26px + env(safe-area-inset-top)) 13px 28px;
    }

    body.km-auth-v2 .auth-card {
        padding: 22px 18px;
        border-radius: 24px;
    }
}

/* Final dashboard geometry: shared 1:1 frame for Singular and Negocio. */
body.km-layout-v2 .km-dashboard-v2 .km-dashboard-content {
    display: block;
    gap: 0;
}

body.km-layout-v2 .km-dashboard-v2 .km-balance-copy p button {
    min-height: 0;
    border-radius: 0;
}

@media (max-width: 760px) {
    html body.km-layout-v2.has-phone-dashboard .content,
    html body.km-layout-v2:has(.km-dashboard-v2) .content {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    body.km-layout-v2 .km-dashboard-v2 {
        width: 100%;
        min-height: 100vh;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-balance-card {
        min-height: 100px;
        padding: 10px 16px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-balance-copy > strong {
        margin-top: 5px;
        font-size: clamp(1.65rem, 7vw, 1.9rem);
    }

    body.km-layout-v2 .km-dashboard-v2 .km-balance-copy > small {
        margin-top: 6px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-kpi-grid article {
        min-height: 78px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-kpi-grid {
        margin-top: 6px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-chart-card {
        padding-block: 11px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-chart-card .km-chart-wrap {
        margin-top: 10px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-section-heading > :is(span, .km-period-link) {
        min-height: 36px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-actions-grid :is(a, button) {
        gap: 6px;
        min-height: 61px;
        padding-block: 6px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-actions-grid :is(a, button) > span {
        width: 31px;
        height: 31px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-actions-grid .nav-svg svg {
        width: 21px;
        height: 21px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-actions-card {
        padding: 11px 10px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-actions-card h2 {
        font-size: 1.05rem;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-actions-card .km-actions-grid {
        margin-top: 8px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-actions-grid b {
        font-size: 0.57rem;
        white-space: nowrap;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-bottom-nav {
        min-height: 72px;
        padding: 10px 14px calc(11px + env(safe-area-inset-bottom));
    }

    body.km-layout-v2 .km-dashboard-v2 .km-bottom-nav :is(a, button).special .nav-svg {
        width: 48px;
        height: 48px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-bottom-nav :is(a, button).special .nav-svg svg {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 365px) {
    body.km-layout-v2 .km-dashboard-v2 .km-kpi-grid article {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 5px;
        padding-inline: 6px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-kpi-icon {
        width: 34px;
        height: 34px;
    }

    body.km-layout-v2 .km-dashboard-v2 .km-actions-grid b {
        font-size: 0.53rem;
    }
}

/* Dashboard source fidelity: tokens and icon treatment from the supplied all-in-one HTML. */
body.km-layout-v2 .km-dashboard-v2 {
    --km-green: #0f8f3d;
    --km-green-dark: #08722e;
    --km-green-soft: #def5e6;
    --km-ink: #0f172a;
    --km-muted: #68707d;
    --km-line: #e9ecef;
    background: #f4f6f5;
    color: var(--km-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html body.km-layout-v2 .km-dashboard-v2 .km-dashboard-bg {
    background:
        radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.12), transparent 36%),
        linear-gradient(145deg, #0f8f3d 0%, #20a443 100%);
}

body.km-layout-v2 .km-dashboard-v2 :is(.km-balance-card, .km-kpi-grid article, .km-dashboard-card) {
    border-color: rgba(15, 23, 42, 0.04);
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(16, 24, 40, 0.08);
}

body.km-layout-v2 .km-dashboard-v2 .km-balance-copy p {
    color: #2a2f39;
    font-weight: 600;
}

body.km-layout-v2 .km-dashboard-v2 .km-balance-copy p button,
body.km-layout-v2 .km-dashboard-v2 .km-balance-copy p button .nav-svg {
    color: #68707d;
}

body.km-layout-v2 .km-dashboard-v2 .km-balance-wallet {
    border-radius: 22px;
    background: linear-gradient(145deg, #f4f7f5, #edf2ef);
    color: #0f8f3d;
}

body.km-layout-v2 .km-dashboard-v2 :is(.good, .positive) {
    color: #10a34a;
}

body.km-layout-v2 .km-dashboard-v2 .bad {
    color: #eb4d4b;
}

body.km-layout-v2 .km-dashboard-v2 .negative,
body.km-layout-v2 .km-dashboard-v2 .neutral {
    color: #0f172a;
}

body.km-layout-v2 .km-dashboard-v2 .km-kpi-grid p {
    color: #384152;
    font-weight: 700;
}

body.km-layout-v2 .km-dashboard-v2 .km-grid-line {
    stroke: #e2e8e5;
    stroke-dasharray: 5 6;
}

body.km-layout-v2 .km-dashboard-v2 .km-axis-label {
    fill: #717a86;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

body.km-layout-v2 .km-dashboard-v2 .km-income-line {
    stroke: #0f8f3d;
    stroke-width: 4;
}

body.km-layout-v2 .km-dashboard-v2 .km-expense-line {
    stroke: #a9afb5;
    stroke-width: 3;
    stroke-dasharray: 8 7;
}

body.km-layout-v2 .km-dashboard-v2 .km-chart-value {
    background: #0f8f3d;
}

body.km-layout-v2 .km-dashboard-v2 .km-chart-legend {
    color: #555e68;
}

body.km-layout-v2 .km-dashboard-v2 .km-chart-legend i.income {
    background: #10a34a;
}

body.km-layout-v2 .km-dashboard-v2 .km-chart-legend i.expense {
    background: #9ca3af;
}

body.km-layout-v2 .km-dashboard-v2 .km-actions-grid :is(a, button) {
    border-color: #e6ebe8;
    background: #ffffff;
    transition: transform 120ms ease;
}

body.km-layout-v2 .km-dashboard-v2 .km-actions-grid :is(a, button):active {
    transform: scale(0.98);
}

body.km-layout-v2 .km-dashboard-v2 .km-actions-grid :is(a, button) > span {
    background: #f2f4f3;
    color: #333b44;
}

body.km-layout-v2 .km-dashboard-v2 .km-actions-grid :is(a, button) > span.primary {
    background: #10a34a;
    color: #ffffff;
}

body.km-layout-v2 .km-dashboard-v2 .km-actions-grid :is(a, button) > span.soft {
    background: #def5e6;
    color: #0f8f3d;
}

body.km-layout-v2 .km-dashboard-v2 .km-recent-icon.income {
    background: #def5e6;
    color: #0f8f3d;
}

body.km-layout-v2 .km-dashboard-v2 .km-recent-icon.expense {
    background: #ffe8e6;
    color: #eb4d4b;
}

body.km-layout-v2 .km-dashboard-v2 .km-recent-icon.pending {
    background: #fff4d7;
    color: #b77900;
}

body.km-layout-v2 .km-dashboard-v2 .nav-svg svg {
    stroke-width: 1.8;
}

body.km-layout-v2 .km-dashboard-v2 .km-notification-link .notification-badge {
    top: 8px;
    right: 8px;
    width: 7px;
    min-width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(15, 143, 61, 0.45);
    color: transparent !important;
    font-size: 0;
}

body.km-layout-v2 .km-dashboard-v2 .km-bottom-nav {
    border-color: #e7ece9;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(20px);
}

body.km-layout-v2 .km-dashboard-v2 .km-bottom-nav :is(a, button) {
    color: #7a8188;
    font-weight: 600;
}

body.km-layout-v2 .km-dashboard-v2 .km-bottom-nav a.active {
    color: #0f8f3d;
}

body.km-layout-v2 .km-dashboard-v2 .km-bottom-nav a.active::after {
    content: "";
    width: 34px;
    height: 3px;
    border-radius: 3px;
    background: #0f8f3d;
}

body.km-layout-v2 .km-dashboard-v2 .km-bottom-nav :is(a, button).special .nav-svg {
    background: linear-gradient(145deg, #10a34a, #08722e);
    box-shadow: 0 10px 24px rgba(15, 143, 61, 0.32);
}

@media (max-width: 760px) {
    body.km-layout-v2:has(.km-dashboard-v2) {
        background: #f4f6f5;
    }

    html body.km-layout-v2 .km-dashboard-v2 .km-dashboard-bg {
        border-radius: 0 0 44px 44px;
    }
}

/* Native iPhone polish for customer-facing Singular, Negocio and Caixa areas. */
:root {
    --km-ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", sans-serif;
    --km-ios-bg: #f2f2f7;
    --km-ios-surface: rgba(255, 255, 255, 0.94);
    --km-ios-surface-solid: #ffffff;
    --km-ios-label: #111827;
    --km-ios-secondary: #6b7280;
    --km-ios-separator: rgba(60, 60, 67, 0.13);
    --km-ios-green: #0f8f3d;
    --km-ios-green-strong: #08722e;
    --km-ios-blue: #0a84ff;
    --km-ios-radius: 18px;
    --km-ios-radius-lg: 26px;
    --km-ios-shadow: 0 12px 34px rgba(17, 24, 39, 0.07);
    --km-ios-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

body.km-ios-shell {
    font-family: var(--km-ios-font);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}

body.km-ios-shell :is(button, input, select, textarea) {
    font-family: inherit;
}

body.km-ios-shell :is(a, button, summary, label, input, select, textarea) {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (max-width: 820px) {
    html.is-phone-device,
    html.is-phone-device body.km-client-area.km-layout-v2,
    html.is-phone-device body.km-client-area.km-layout-v2 .app-shell,
    html.is-phone-device body.km-client-area.km-layout-v2 .main-shell,
    html.is-phone-device body.km-client-area.km-layout-v2 .content {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    html.is-phone-device body.km-client-area.km-layout-v2.modal-open {
        overflow: hidden;
    }

    html.is-phone-device body.km-client-area.km-layout-v2.has-phone-dashboard .content,
    html.is-phone-device body.km-client-area.km-layout-v2:has(.km-dashboard-v2) .content {
        display: block;
        min-height: auto;
        overflow: visible;
    }

    html.is-phone-device body.km-client-area.km-layout-v2.has-phone-dashboard .phone-dashboard,
    html.is-phone-device body.km-client-area.km-layout-v2 .km-dashboard-v2,
    html.is-phone-device body.km-client-area.km-layout-v2 .km-dashboard-content,
    html.is-phone-device body.km-client-area.km-layout-v2 .km-dashboard-card,
    html.is-phone-device body.km-client-area.km-layout-v2 .km-chart-wrap,
    html.is-phone-device body.km-client-area.km-layout-v2 .km-chart {
        touch-action: pan-y pinch-zoom;
    }

    html.is-phone-device body.km-client-area.km-layout-v2 :is(a, button, summary, label, input, select, textarea) {
        touch-action: auto;
    }

    html.is-phone-device body.km-client-area.km-layout-v2 :is(.mobile-menu, .phone-bottom-nav, .km-bottom-nav) :is(a, button) {
        touch-action: manipulation;
    }
}

body.km-ios-shell ::selection {
    background: rgba(15, 143, 61, 0.20);
}

body.km-ios-shell .nav-svg svg {
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.km-client-area.km-layout-v2 {
    --sys-bg: var(--km-ios-bg);
    --sys-surface: var(--km-ios-surface-solid);
    --sys-text: var(--km-ios-label);
    --sys-muted: var(--km-ios-secondary);
    --sys-border: var(--km-ios-separator);
    --sys-border-strong: rgba(60, 60, 67, 0.20);
    --sys-radius: var(--km-ios-radius);
    --sys-radius-lg: var(--km-ios-radius-lg);
    --sys-shadow: var(--km-ios-shadow);
    background: var(--km-ios-bg);
}

body.km-client-area.km-layout-v2 .main-shell {
    background:
        radial-gradient(circle at 92% -8%, rgba(15, 143, 61, 0.075), transparent 26%),
        var(--km-ios-bg);
}

body.km-client-area.km-layout-v2 .navbar {
    background: rgba(255, 255, 255, 0.82);
    border-bottom-color: var(--km-ios-separator);
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.045);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
}

body.km-client-area.km-layout-v2 :is(
    .page-header,
    .panel,
    .form-card,
    .table-card,
    .stat-card,
    .summary-card,
    .phone-panel,
    .business-panel,
    .wallet-phone-panel,
    .xitique-panel,
    .debt-panel
) {
    border-color: var(--km-ios-separator);
    background: var(--km-ios-surface);
    box-shadow: var(--km-ios-shadow);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
}

body.km-client-area.km-layout-v2 .page-header {
    border-radius: var(--km-ios-radius-lg);
    background:
        radial-gradient(circle at 94% 6%, rgba(15, 143, 61, 0.12), transparent 32%),
        rgba(255, 255, 255, 0.92);
}

body.km-client-area.km-layout-v2 :is(.page-header h1, .panel h2, .panel h3, .form-header h2) {
    color: var(--km-ios-label);
    font-weight: 760;
    letter-spacing: -0.028em;
}

body.km-client-area.km-layout-v2 :is(
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea
) {
    min-height: 52px;
    border-color: var(--km-ios-separator);
    border-radius: 14px;
    background: rgba(242, 242, 247, 0.74);
    color: var(--km-ios-label);
    font-size: 1rem;
    font-weight: 510;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

body.km-client-area.km-layout-v2 :is(
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea
):focus {
    border-color: rgba(15, 143, 61, 0.62);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(15, 143, 61, 0.11);
}

body.km-client-area.km-layout-v2 :is(.button, button, input[type="submit"]) {
    border-radius: 14px;
    font-weight: 720;
    letter-spacing: -0.012em;
    transition: transform 160ms var(--km-ios-spring), filter 160ms ease, box-shadow 160ms ease;
}

body.km-client-area.km-layout-v2 :is(.button, button, input[type="submit"]):active {
    transform: scale(0.975);
    filter: brightness(0.97);
}

body.km-client-area.km-layout-v2 :is(.button-primary, button.button-primary, input[type="submit"]) {
    background: linear-gradient(145deg, #10a34a, #08722e);
    box-shadow: 0 10px 24px rgba(15, 143, 61, 0.22);
}

body.km-client-area.km-layout-v2 .button-ghost {
    border-color: var(--km-ios-separator);
    background: rgba(255, 255, 255, 0.86);
}

body.km-client-area.km-layout-v2 :is(
    [data-sensitive-money],
    .stat-card strong,
    .summary-card strong,
    .money,
    .amount
) {
    font-variant-numeric: tabular-nums lining-nums;
    letter-spacing: -0.026em;
}

body.km-client-area.km-layout-v2 .table-wrap {
    border-color: var(--km-ios-separator);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 26px rgba(17, 24, 39, 0.045);
}

body.km-client-area.km-layout-v2 .data-table th {
    background: rgba(242, 242, 247, 0.80);
    color: var(--km-ios-secondary);
    font-size: 0.76rem;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

body.km-client-area.km-layout-v2 .data-table td {
    border-bottom-color: var(--km-ios-separator);
}

/* The main financial dashboard keeps its geometry while adopting native iOS type and glass. */
body.km-client-area.km-layout-v2 .km-dashboard-v2 {
    background: var(--km-ios-bg);
    font-family: var(--km-ios-font);
}

body.km-client-area.km-layout-v2 .km-dashboard-v2 :is(
    .km-balance-card,
    .km-kpi-grid article,
    .km-dashboard-card
) {
    border-color: rgba(60, 60, 67, 0.10);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 34px rgba(17, 24, 39, 0.075);
}

body.km-client-area.km-layout-v2 .km-dashboard-v2 :is(
    .km-balance-card,
    .km-kpi-grid article,
    .km-dashboard-card,
    .km-actions-grid a,
    .km-actions-grid button,
    .km-bottom-nav a,
    .km-bottom-nav button,
    .km-hamburger,
    .km-notification-link
) {
    transition: transform 180ms var(--km-ios-spring), box-shadow 180ms ease, background 180ms ease;
}

body.km-client-area.km-layout-v2 .km-dashboard-v2 :is(
    .km-actions-grid a,
    .km-actions-grid button,
    .km-bottom-nav a,
    .km-bottom-nav button,
    .km-hamburger,
    .km-notification-link
):active {
    transform: scale(0.955);
}

body.km-client-area.km-layout-v2 .km-dashboard-v2 .km-welcome h1 {
    font-weight: 780;
    letter-spacing: -0.045em;
}

body.km-client-area.km-layout-v2 .km-dashboard-v2 .km-welcome p {
    font-weight: 560;
    letter-spacing: -0.015em;
}

body.km-client-area.km-layout-v2 .km-dashboard-v2 .km-trial-chip {
    background: #fff1a8;
    box-shadow: 0 14px 30px rgba(120, 75, 0, 0.18);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.km-client-area.km-layout-v2 .km-dashboard-v2 .km-balance-copy > strong,
body.km-client-area.km-layout-v2 .km-dashboard-v2 .km-kpi-grid strong {
    font-weight: 780;
    font-variant-numeric: tabular-nums lining-nums;
}

body.km-client-area.km-layout-v2 .km-dashboard-v2 .km-section-heading > :is(span, .km-period-link) {
    border-color: var(--km-ios-separator);
    background: rgba(242, 242, 247, 0.72);
}

body.km-client-area.km-layout-v2 .km-dashboard-v2 .km-bottom-nav {
    border-top-color: var(--km-ios-separator);
    background: rgba(249, 249, 251, 0.84);
    box-shadow: 0 -8px 28px rgba(17, 24, 39, 0.07);
    backdrop-filter: blur(30px) saturate(190%);
    -webkit-backdrop-filter: blur(30px) saturate(190%);
}

body.km-client-area.km-layout-v2 .km-dashboard-v2 .km-bottom-nav :is(a, button) {
    font-weight: 590;
    letter-spacing: -0.01em;
}

body.km-client-area.km-layout-v2 .km-dashboard-v2 .km-bottom-nav :is(a, button).special .nav-svg {
    box-shadow: 0 10px 26px rgba(15, 143, 61, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* Login, registration, onboarding and employee cash screens share the native type system. */
body.km-auth-v2.km-ios-shell,
body.onboarding-body.km-ios-shell,
body.cashier-body.km-ios-shell {
    font-family: var(--km-ios-font);
}

body.km-auth-v2.km-ios-shell .auth-card,
body.onboarding-body.km-ios-shell :is(.onboarding-card, .panel),
body.cashier-body.km-ios-shell :is(.cashier-card, .panel, .form-card) {
    border-color: var(--km-ios-separator);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 70px rgba(17, 24, 39, 0.15);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
}

body.km-auth-v2.km-ios-shell .auth-card :is(input, select, textarea),
body.onboarding-body.km-ios-shell :is(input, select, textarea),
body.cashier-body.km-ios-shell :is(input, select, textarea) {
    min-height: 52px;
    border-color: var(--km-ios-separator);
    border-radius: 14px;
    background: rgba(242, 242, 247, 0.76);
    font-size: 1rem;
}

body.km-auth-v2.km-ios-shell :is(.button, button, input[type="submit"]),
body.onboarding-body.km-ios-shell :is(.button, button, input[type="submit"]),
body.cashier-body.km-ios-shell :is(.button, button, input[type="submit"]) {
    min-height: 50px;
    border-radius: 14px;
    font-weight: 720;
    transition: transform 160ms var(--km-ios-spring), filter 160ms ease;
}

body.km-auth-v2.km-ios-shell :is(.button, button, input[type="submit"]):active,
body.onboarding-body.km-ios-shell :is(.button, button, input[type="submit"]):active,
body.cashier-body.km-ios-shell :is(.button, button, input[type="submit"]):active {
    transform: scale(0.975);
}

@keyframes km-ios-page-enter {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.992);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes km-ios-sheet-enter {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.km-client-area.km-layout-v2 .content > :is(.page-header, .panel, .form-card, .table-card) {
    animation: km-ios-page-enter 420ms var(--km-ios-spring) both;
}

@media (max-width: 820px) {
    body.km-client-area.km-layout-v2 {
        background: var(--km-ios-bg);
    }

    body.km-client-area.km-layout-v2:not(.has-phone-dashboard) .navbar {
        position: sticky;
        top: 0;
        min-height: 104px;
        padding: calc(14px + env(safe-area-inset-top)) 16px 21px;
        border-radius: 0 0 30px 30px;
        background:
            radial-gradient(circle at 84% 4%, rgba(255, 255, 255, 0.17), transparent 30%),
            linear-gradient(145deg, #0f8f3d, #08722e);
        box-shadow: 0 12px 30px rgba(8, 114, 46, 0.20);
    }

    body.km-client-area.km-layout-v2:not(.has-phone-dashboard) :is(.notification-pill, .user-menu summary) {
        border-color: rgba(255, 255, 255, 0.24);
        background: rgba(255, 255, 255, 0.15);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
        backdrop-filter: blur(18px) saturate(170%);
        -webkit-backdrop-filter: blur(18px) saturate(170%);
    }

    html body.km-client-area.km-layout-v2:not(.has-phone-dashboard) .content {
        padding: 15px 13px calc(102px + env(safe-area-inset-bottom));
    }

    body.km-client-area.km-layout-v2 .page-header {
        border-radius: 22px;
    }

    body.km-client-area.km-layout-v2 :is(.panel, .form-card, .table-card, .stat-card) {
        border-radius: 20px;
    }

    body.km-client-area.km-layout-v2 .mobile-menu {
        min-height: 72px;
        padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
        border-top: 0.5px solid var(--km-ios-separator);
        background: rgba(249, 249, 251, 0.84);
        box-shadow: 0 -8px 28px rgba(17, 24, 39, 0.07);
        backdrop-filter: blur(30px) saturate(190%);
        -webkit-backdrop-filter: blur(30px) saturate(190%);
    }

    body.km-client-area.km-layout-v2 .mobile-menu a {
        font-weight: 560;
        transition: transform 160ms var(--km-ios-spring), color 160ms ease;
    }

    body.km-client-area.km-layout-v2 .mobile-menu a:active {
        transform: scale(0.94);
    }

    body.km-client-area.km-layout-v2 .mobile-menu .mobile-add .nav-svg {
        width: 52px;
        height: 52px;
        box-shadow: 0 10px 25px rgba(15, 143, 61, 0.29), inset 0 1px 0 rgba(255, 255, 255, 0.27);
    }

    body.km-client-area.km-layout-v2 .mobile-menu-label {
        font-size: 0.64rem;
        font-weight: 600;
        letter-spacing: -0.01em;
    }

    body.km-client-area.km-layout-v2 :is(
        .modal-backdrop,
        .form-modal-backdrop,
        .quick-action-backdrop,
        .business-action-modal-backdrop,
        .success-modal-backdrop,
        .system-confirm-backdrop
    ) {
        align-items: flex-end;
        padding: 0;
        background: rgba(13, 18, 28, 0.38);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    body.km-client-area.km-layout-v2 :is(
        .app-modal,
        .form-modal,
        .quick-action-modal,
        .business-action-modal,
        .success-modal,
        .system-confirm
    ) {
        width: 100%;
        max-width: none;
        max-height: calc(92dvh - env(safe-area-inset-top));
        margin: 0;
        padding-bottom: calc(22px + env(safe-area-inset-bottom));
        border: 0;
        border-radius: 28px 28px 0 0;
        background: rgba(250, 250, 252, 0.98);
        box-shadow: 0 -20px 60px rgba(17, 24, 39, 0.20);
        animation: km-ios-sheet-enter 340ms var(--km-ios-spring) both;
    }

    body.km-client-area.km-layout-v2 .km-dashboard-v2 .km-dashboard-hero {
        padding-top: calc(23px + env(safe-area-inset-top));
    }

    body.km-client-area.km-layout-v2 .km-dashboard-v2 .km-bottom-nav {
        min-height: calc(72px + env(safe-area-inset-bottom));
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
}

@media (display-mode: standalone) and (max-width: 820px) {
    body.km-ios-shell {
        overscroll-behavior-y: auto;
    }

    body.km-client-area.km-layout-v2 .km-dashboard-v2 {
        min-height: 100dvh;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.km-ios-shell *,
    body.km-ios-shell *::before,
    body.km-ios-shell *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Motivating notification permission invitation. */
.notification-optin-backdrop {
    position: fixed;
    inset: 0;
    z-index: 4200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 18, 13, 0.46);
    backdrop-filter: blur(14px) saturate(125%);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
}

.notification-optin-backdrop[hidden] {
    display: none;
}

.notification-optin-card {
    position: relative;
    width: min(100%, 450px);
    padding: 34px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 30px;
    background:
        radial-gradient(circle at 88% 4%, rgba(30, 177, 84, 0.13), transparent 31%),
        rgba(255, 255, 255, 0.97);
    box-shadow: 0 28px 80px rgba(5, 35, 17, 0.28), inset 0 1px 0 #fff;
    text-align: center;
    animation: km-ios-sheet-enter 360ms var(--km-ios-spring, cubic-bezier(0.2, 0.8, 0.2, 1)) both;
}

.notification-optin-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.06);
    color: #667085;
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
}

.notification-optin-icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border-radius: 25px;
    color: #fff;
    background: linear-gradient(145deg, #19a44d, #08722e);
    box-shadow: 0 16px 32px rgba(15, 143, 61, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.notification-optin-icon .nav-svg {
    width: 34px;
    height: 34px;
}

.notification-optin-card .eyebrow {
    margin-bottom: 8px;
    color: #0f8f3d;
}

.notification-optin-card h2 {
    margin: 0 auto 12px;
    max-width: 340px;
    color: #101828;
    font-size: clamp(1.55rem, 5vw, 2rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.notification-optin-card > p:not(.eyebrow) {
    margin: 0 auto;
    max-width: 370px;
    color: #596579;
    line-height: 1.55;
}

.notification-optin-benefits {
    display: grid;
    gap: 10px;
    margin: 22px 0;
    padding: 16px;
    border: 1px solid rgba(15, 143, 61, 0.12);
    border-radius: 20px;
    background: rgba(231, 248, 237, 0.62);
    text-align: left;
}

.notification-optin-benefits span {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #344054;
    font-size: 0.9rem;
    font-weight: 650;
}

.notification-optin-benefits span::before {
    content: "✓";
    display: grid;
    flex: 0 0 24px;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #0f8f3d;
    background: #d9f5e3;
    font-weight: 800;
}

.notification-optin-card .notification-optin-activate,
.notification-optin-card .notification-optin-later {
    width: 100%;
    justify-content: center;
}

.notification-optin-card .notification-optin-activate {
    min-height: 52px;
    box-shadow: 0 13px 28px rgba(15, 143, 61, 0.22);
}

.notification-optin-card .notification-optin-later {
    margin-top: 8px;
}

.notification-optin-card > small {
    display: block;
    margin: 12px auto 0;
    color: #7d8796;
    line-height: 1.4;
}

@media (max-width: 620px) {
    .notification-optin-backdrop {
        align-items: end;
        padding: 0;
    }

    .notification-optin-card {
        width: 100%;
        padding: 30px 22px calc(22px + env(safe-area-inset-bottom));
        border-width: 0;
        border-radius: 30px 30px 0 0;
    }

    .notification-optin-icon {
        width: 68px;
        height: 68px;
        border-radius: 22px;
    }
}

/* Administrative communication centre. */
.admin-communication-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(270px, 0.7fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.admin-communication-compose .panel-header {
    align-items: flex-start;
}

.admin-communication-compose .panel-header p:not(.eyebrow) {
    max-width: 720px;
    margin: 5px 0 0;
    color: var(--sys-muted);
}

.admin-communication-form {
    gap: 18px;
}

.admin-audience-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.admin-audience-fieldset legend {
    color: var(--sys-text);
    font-weight: 850;
}

.admin-audience-fieldset > p {
    margin: 4px 0 12px;
    color: var(--sys-muted);
    font-size: 0.86rem;
}

.admin-audience-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.admin-audience-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    min-height: 92px;
    padding: 14px;
    border: 1px solid var(--sys-border);
    border-radius: 17px;
    background: #ffffff;
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.admin-audience-option:hover {
    transform: translateY(-1px);
    border-color: rgba(12, 150, 59, 0.30);
}

.admin-audience-option:has(input:checked) {
    border-color: rgba(12, 150, 59, 0.62);
    background: #eefaf2;
    box-shadow: 0 0 0 3px rgba(12, 150, 59, 0.09);
}

.admin-audience-option input {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--sys-primary);
}

.admin-audience-option span {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.admin-audience-option strong {
    color: var(--sys-text);
    font-size: 0.9rem;
}

.admin-audience-option small {
    color: var(--sys-muted);
    font-size: 0.74rem;
    line-height: 1.35;
}

.admin-specific-recipient {
    padding: 14px;
    border: 1px solid rgba(12, 150, 59, 0.18);
    border-radius: 17px;
    background: #f3fbf5;
}

.admin-specific-recipient small,
.admin-communication-form label > small {
    display: block;
    margin-top: 6px;
    color: var(--sys-muted);
    font-size: 0.76rem;
}

.admin-communication-form textarea {
    resize: vertical;
}

.admin-communication-rule {
    margin: 0;
}

.admin-communication-form > .button-primary {
    justify-self: start;
    min-width: 220px;
}

.admin-guide-list {
    display: grid;
    gap: 11px;
}

.admin-guide-list article {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--sys-border);
    border-radius: 15px;
    background: #f8fbf9;
}

.admin-guide-list article > span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--sys-primary-soft);
    color: var(--sys-primary-strong);
    font-weight: 900;
}

.admin-guide-list article div {
    display: grid;
    gap: 3px;
}

.admin-guide-list small {
    color: var(--sys-muted);
    line-height: 1.4;
}

.admin-communication-history .table-wrap {
    margin-top: 0;
}

.admin-communication-history td:first-child {
    min-width: 250px;
}

@media (max-width: 1080px) {
    .admin-communication-layout {
        grid-template-columns: 1fr;
    }

    .admin-audience-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .admin-audience-grid {
        grid-template-columns: 1fr;
    }

    .admin-audience-option {
        min-height: 72px;
    }

    .admin-communication-form > .button-primary {
        width: 100%;
        min-width: 0;
    }
}

/* Checkout keeps its customer-facing cover even in a narrow desktop window. */
html:not(.is-phone-device) .plan-checkout-page .plan-logout-button {
    border: 1px solid var(--sys-border);
    background: #ffffff;
    color: var(--sys-primary-strong);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

@media (max-width: 560px) {
    html:not(.is-phone-device) .plan-checkout-page {
        min-height: 100vh;
        background: #f4f7f6;
    }

    html:not(.is-phone-device) .plan-checkout-page .phone-dashboard-bg {
        display: block;
        height: 250px;
        border-radius: 0 0 42px 42px;
        background:
            radial-gradient(circle at 82% 18%, rgba(134, 239, 172, 0.34), transparent 30%),
            linear-gradient(145deg, #08783f 0%, #0b9a50 58%, #30aa64 100%);
    }

    html:not(.is-phone-device) .plan-checkout-page .phone-dashboard-content {
        display: block;
        padding: 22px 14px 0;
    }

    html:not(.is-phone-device) .plan-checkout-page .plan-checkout-header {
        min-height: 62px;
        margin: 0 0 18px;
        padding: 0;
        border: 0;
        color: #ffffff;
    }

    html:not(.is-phone-device) .plan-checkout-page .plan-checkout-header h1,
    html:not(.is-phone-device) .plan-checkout-page .plan-checkout-header p {
        color: #ffffff;
    }

    html:not(.is-phone-device) .plan-checkout-page .plan-checkout-header p {
        opacity: 0.82;
    }

    html:not(.is-phone-device) .plan-checkout-page .plan-logout-button {
        border-color: rgba(255, 255, 255, 0.38);
        background: rgba(255, 255, 255, 0.17);
        color: #ffffff;
        box-shadow: none;
        backdrop-filter: blur(12px);
    }
}

/* Permanent overview of open debts and receivables. */
body.app-body .km-debt-overview {
    display: grid;
    gap: 14px;
}

body.app-body .km-debt-overview .km-section-heading > div {
    display: grid;
    gap: 3px;
}

body.app-body .km-debt-overview .km-section-heading small {
    color: var(--sys-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

body.app-body .km-debt-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.app-body .km-debt-overview-grid > a {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    min-width: 0;
    padding: 13px;
    border: 1px solid #fecaca;
    border-radius: 17px;
    background: #fff7f7;
    color: inherit;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

body.app-body .km-debt-overview-grid > a.receive {
    border-color: #bbf7d0;
    background: #f2fcf6;
}

body.app-body .km-debt-overview-grid > a:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 22px rgba(15, 23, 42, 0.07);
}

body.app-body .km-debt-overview-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #fee2e2;
    color: #c24141;
}

body.app-body .km-debt-overview-grid .receive .km-debt-overview-icon {
    background: #dcfce7;
    color: #07813a;
}

body.app-body .km-debt-overview-icon .nav-svg svg {
    width: 22px;
    height: 22px;
}

body.app-body .km-debt-overview-grid a > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

body.app-body .km-debt-overview-grid small,
body.app-body .km-debt-overview-grid strong,
body.app-body .km-debt-overview-grid a > div > span {
    display: block;
}

body.app-body .km-debt-overview-grid small {
    color: #7f1d1d;
    font-size: 0.72rem;
    font-weight: 800;
}

body.app-body .km-debt-overview-grid .receive small {
    color: #047857;
}

body.app-body .km-debt-overview-grid strong {
    overflow-wrap: anywhere;
    color: var(--sys-text);
    font-size: 1.02rem;
    font-variant-numeric: tabular-nums lining-nums;
}

body.app-body .km-debt-overview-grid a > div > span {
    color: var(--sys-muted);
    font-size: 0.67rem;
    line-height: 1.35;
}

@media (max-width: 440px) {
    body.app-body .km-debt-overview-grid {
        grid-template-columns: 1fr;
    }
}

/* Due-date alerts shown immediately after the main financial summary. */
body.app-body .km-due-card {
    display: grid;
    gap: 15px;
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
}

body.app-body .km-due-heading {
    align-items: flex-start;
}

body.app-body .km-due-heading > div {
    display: grid;
    gap: 3px;
}

body.app-body .km-due-heading p {
    margin: 0;
    color: var(--sys-muted);
    font-size: 0.78rem;
}

body.app-body .km-due-kicker {
    color: #b45309;
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

body.app-body .km-due-totals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.app-body .km-due-totals > span {
    display: grid;
    gap: 3px;
    padding: 11px 13px;
    border: 1px solid #fed7aa;
    border-radius: 15px;
    background: #fff7ed;
}

body.app-body .km-due-totals > span.receive {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

body.app-body .km-due-totals small {
    color: #7c6552;
    font-size: 0.7rem;
    font-weight: 800;
}

body.app-body .km-due-totals strong {
    color: #9a3412;
    font-size: 1rem;
}

body.app-body .km-due-totals .receive strong {
    color: #047857;
}

body.app-body .km-due-list {
    display: grid;
    gap: 8px;
}

body.app-body .km-due-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
    gap: 11px;
    align-items: center;
    min-height: 66px;
    padding: 10px 12px;
    border: 1px solid var(--sys-border);
    border-radius: 16px;
    background: #ffffff;
    color: var(--sys-text);
    text-decoration: none;
}

body.app-body .km-due-row:hover {
    border-color: rgba(15, 118, 80, 0.28);
    box-shadow: 0 9px 22px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px);
}

body.app-body .km-due-row.overdue {
    border-color: #fecaca;
    box-shadow: inset 4px 0 #dc2626;
}

body.app-body .km-due-row.urgent {
    border-color: #fed7aa;
    box-shadow: inset 4px 0 #ea580c;
}

body.app-body .km-due-row.warning {
    border-color: #fde68a;
    box-shadow: inset 4px 0 #d97706;
}

body.app-body .km-due-row.soon {
    box-shadow: inset 4px 0 #eab308;
}

body.app-body .km-due-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: #fff7ed;
    color: #c2410c;
}

body.app-body .km-due-row.receive .km-due-icon {
    background: #ecfdf5;
    color: #047857;
}

body.app-body .km-due-row > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

body.app-body .km-due-row > div strong,
body.app-body .km-due-row > div small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.app-body .km-due-row > div strong {
    color: var(--sys-text);
    font-size: 0.84rem;
}

body.app-body .km-due-row > div small {
    color: var(--sys-muted);
    font-size: 0.71rem;
}

body.app-body .km-due-date {
    padding: 6px 9px;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.68rem;
    font-weight: 900;
    white-space: nowrap;
}

body.app-body .km-due-row.overdue .km-due-date {
    background: #fef2f2;
    color: #b91c1c;
}

body.app-body .km-due-row > b {
    color: #9a3412;
    font-size: 0.82rem;
    white-space: nowrap;
}

body.app-body .km-due-row.receive > b {
    color: #047857;
}

@media (max-width: 620px) {
    body.app-body .km-due-totals {
        grid-template-columns: 1fr 1fr;
    }

    body.app-body .km-due-row {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 9px;
    }

    body.app-body .km-due-date {
        grid-column: 2;
        justify-self: start;
        padding: 4px 7px;
    }

    body.app-body .km-due-row > b {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
}
