@charset "UTF-8";

:root {
    /* Light Theme (Default) */
    --bg: #f8fafc;
    --panel: #ffffff;
    --panel-alt: #f1f5f9;
    --panel-soft: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --nav: #173042;
    --nav-soft: #21445a;
    --nav-text: #e7f0f4;
    --primary: #0d7a74;
    --primary-strong: #095a56;
    --primary-light: #47a19c;
    --primary-soft: rgba(13, 122, 116, 0.14);
    --danger: #b9473b;
    --danger-soft: rgba(185, 71, 59, 0.12);
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warning: #f97316;
    --warning-soft: rgba(249, 115, 22, 0.12);
    --shadow: 0 24px 40px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-topbar: 0 10px 28px rgba(15, 23, 42, 0.08);
    --shadow-footer: 0 -8px 20px rgba(15, 23, 42, 0.04);
    
    /* Adaptable color helpers */
    --gradient-start: #ffffff;
    --gradient-glow: rgba(13, 122, 116, 0.06);
    --topbar-bg: rgba(255, 255, 255, 0.94);
    --topbar-border: rgba(15, 23, 42, 0.06);
    --input-placeholder: #94a3b8;
    --user-bg: rgba(255, 255, 255, 0.96);
    --user-border: rgba(15, 23, 42, 0.08);
    --backdrop: rgba(10, 19, 28, 0.22);
    --brand-divider: rgba(19, 34, 44, 0.14);
    --kpi-blue-bg: #eef2ff;
    --kpi-blue-text: #4f46e5;
    --kpi-green-bg: #ecfdf5;
    --kpi-green-text: #10b981;
    --kpi-orange-bg: #fff7ed;
    --kpi-orange-text: #f97316;
    --kpi-purple-bg: #faf5ff;
    --kpi-purple-text: #a855f7;

    /* Button specific helper variables */
    --ghost-bg: rgba(15, 23, 42, 0.04);
    --ghost-bg-hover: rgba(15, 23, 42, 0.08);
    --danger-border: rgba(185, 71, 59, 0.16);
    --danger-hover: rgba(185, 71, 59, 0.18);

    /* Message UI colors */
    --message-success-text: #0d5b35;
    --message-success-border: rgba(16, 185, 129, 0.22);
    --message-error-text: #8b2a22;
    --message-error-border: rgba(185, 71, 59, 0.22);
    --message-info-text: #124d68;
    --message-info-bg: rgba(18, 77, 104, 0.10);
    --message-info-border: rgba(18, 77, 104, 0.18);
    --message-warning-text: #a14b07;
    --message-warning-border: rgba(249, 115, 22, 0.18);

    /* Table specific colors */
    --table-header: rgba(15, 23, 42, 0.03);
    --table-zebra: rgba(15, 23, 42, 0.015);
    --table-hover: rgba(13, 122, 116, 0.05);

    /* Structural variables */
    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    --sidebar-width: 336px;
    --topbar-space: 92px;
    --footer-space: 24px;
    --page-max-width: 1540px;
    --control-height: 52px;
    --font-ui: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg: #0f172a;
    --panel: #111827;
    --panel-alt: #1f2937;
    --panel-soft: #1e293b;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;
    --muted: #94a3b8;
    
    /* Slightly adjusted brand colors for dark mode contrast and accessibility */
    --primary: #14b8a6;
    --primary-strong: #0d9488;
    --primary-light: #2dd4bf;
    --primary-soft: rgba(20, 184, 166, 0.15);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.15);
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.15);
    
    --shadow: 0 24px 40px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-topbar: 0 10px 28px rgba(0, 0, 0, 0.3);
    --shadow-footer: 0 -8px 20px rgba(0, 0, 0, 0.25);

    /* Adaptable color helpers */
    --gradient-start: #0f172a;
    --gradient-glow: rgba(20, 184, 166, 0.04);
    --topbar-bg: rgba(17, 24, 39, 0.94);
    --topbar-border: rgba(255, 255, 255, 0.08);
    --input-placeholder: #475569;
    --user-bg: rgba(30, 41, 59, 0.96);
    --user-border: rgba(255, 255, 255, 0.08);
    --backdrop: rgba(0, 0, 0, 0.5);
    --brand-divider: rgba(255, 255, 255, 0.14);
    --kpi-blue-bg: rgba(79, 70, 229, 0.15);
    --kpi-blue-text: #818cf8;
    --kpi-green-bg: rgba(16, 185, 129, 0.15);
    --kpi-green-text: #34d399;
    --kpi-orange-bg: rgba(249, 115, 22, 0.15);
    --kpi-orange-text: #fb923c;
    --kpi-purple-bg: rgba(168, 85, 247, 0.15);
    --kpi-purple-text: #c084fc;

    /* Button specific helper variables */
    --ghost-bg: rgba(255, 255, 255, 0.06);
    --ghost-bg-hover: rgba(255, 255, 255, 0.12);
    --danger-border: rgba(239, 68, 68, 0.25);
    --danger-hover: rgba(239, 68, 68, 0.25);

    /* Message UI colors */
    --message-success-text: #34d399;
    --message-success-border: rgba(16, 185, 129, 0.3);
    --message-error-text: #fca5a5;
    --message-error-border: rgba(239, 68, 68, 0.3);
    --message-info-text: #7dd3fc;
    --message-info-bg: rgba(14, 165, 233, 0.15);
    --message-info-border: rgba(14, 165, 233, 0.25);
    --message-warning-text: #fdba74;
    --message-warning-border: rgba(249, 115, 22, 0.3);

    /* Table specific colors */
    --table-header: rgba(255, 255, 255, 0.03);
    --table-zebra: rgba(255, 255, 255, 0.015);
    --table-hover: rgba(20, 184, 166, 0.06);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    min-height: 100%;
}

html[dir="rtl"] {
    direction: rtl;
}

html[dir="ltr"] {
    direction: ltr;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font-ui);
    background: radial-gradient(circle at top left, var(--gradient-glow), transparent 28%),
                linear-gradient(180deg, var(--gradient-start) 0%, var(--bg) 100%);
    color: var(--text);
    direction: inherit;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    text-align: start;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

img,
svg {
    display: block;
    max-width: 100%;
}

::selection {
    background: var(--primary-soft);
}

input::placeholder,
textarea::placeholder {
    color: var(--input-placeholder);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

/* Layout Components */
.app-shell {
    min-height: 100vh;
}

.shell-layout {
    min-height: 100vh;
    position: relative;
    isolation: isolate;
}

.shell-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: var(--backdrop);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: auto;
    right: auto;
    width: min(var(--sidebar-width), calc(100vw - 28px));
    overflow: hidden;
    background: linear-gradient(180deg, #1b3a4e 0%, #102634 100%);
    color: var(--nav-text);
    padding: 30px 24px 34px;
    z-index: 40;
    box-shadow: 0 22px 48px rgba(8, 19, 28, 0.34);
    transition: transform 0.32s ease, visibility 0.32s ease;
    text-align: start;
    pointer-events: none;
    visibility: hidden;
}

.sidebar__scroll {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    padding-inline-end: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(231, 240, 244, 0.34) transparent;
}

.sidebar__scroll::-webkit-scrollbar {
    width: 8px;
}

.sidebar__scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar__scroll::-webkit-scrollbar-thumb {
    background: rgba(231, 240, 244, 0.26);
    border-radius: 999px;
}

.sidebar__scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(231, 240, 244, 0.42);
}

html[dir="ltr"] .sidebar {
    left: 0;
    right: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transform: translate3d(calc(-100% - 24px), 0, 0);
}

html[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    transform: translate3d(calc(100% + 24px), 0, 0);
}

html[dir="rtl"] .sidebar__brand,
html[dir="rtl"] .nav-item,
html[dir="rtl"] .subnav-item {
    text-align: right;
}

.sidebar__brand {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 30px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.brand-lockup__logos {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.brand-lockup__logo {
    width: auto;
    object-fit: contain;
    display: block;
}

.brand-lockup__logo--meem {
    height: 54px;
}

.brand-lockup__logo--sap {
    height: 26px;
}

.brand-lockup__divider {
    width: 1px;
    height: 34px;
    background: var(--brand-divider);
    flex-shrink: 0;
}

.brand-lockup__text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.sidebar__brand .brand-lockup__divider {
    height: 38px;
    background: rgba(231, 240, 244, 0.24);
}

.sidebar__brand .brand-lockup__text strong {
    display: block;
    font-size: 20px;
    line-height: 1.2;
}

.sidebar__brand .brand-lockup__text small {
    display: block;
    color: rgba(231, 240, 244, 0.72);
    line-height: 1.7;
}

.sidebar__brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.sidebar__brand-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.sidebar__brand strong {
    display: block;
    font-size: 20px;
    line-height: 1.2;
}

.sidebar__brand small {
    display: block;
    color: rgba(231, 240, 244, 0.72);
    line-height: 1.7;
}

.nav-group + .nav-group {
    margin-top: 26px;
}

.nav-group__title {
    margin: 0 0 14px;
    color: rgba(231, 240, 244, 0.72);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.14em;
}

.nav-group--secondary {
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-item,
.subnav-item {
    display: flex;
    width: 100%;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.subnav-item {
    align-items: center;
}

.nav-item + .nav-item,
.subnav-item + .subnav-item {
    margin-top: 8px;
}

.nav-item:hover,
.subnav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.10);
}

html[dir="ltr"] .nav-item:hover,
html[dir="ltr"] .subnav-item:hover {
    transform: translate3d(-2px, 0, 0);
}

html[dir="rtl"] .nav-item:hover,
html[dir="rtl"] .subnav-item:hover {
    transform: translate3d(2px, 0, 0);
}

.nav-item.is-active,
.subnav-item.is-active {
    background: rgba(13, 122, 116, 0.22);
    border-color: rgba(71, 161, 156, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav-item__badge,
.subnav-item__badge {
    min-width: 48px;
    height: 48px;
    padding: 0 8px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.10);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.subnav-item .subnav-item__badge {
    min-width: 44px;
    height: 44px;
    border-radius: 14px;
}

.nav-item__text {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.nav-item__text strong {
    font-size: 17px;
    line-height: 1.3;
}

.nav-item__text small {
    color: rgba(231, 240, 244, 0.72);
    line-height: 1.65;
}

.subnav-item > span:last-child {
    flex: 1 1 auto;
    font-weight: 600;
}

.app-shell.is-sidebar-open {
    overflow: hidden;
}

.app-shell.is-sidebar-open .sidebar {
    transform: translate3d(0, 0, 0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.app-shell.is-sidebar-open .shell-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

/* Workspace */
.workspace {
    min-width: 0;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 0;
    padding-bottom: var(--footer-space);
    text-align: start;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 18;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    min-height: 76px;
    width: 100%;
    padding-block: 12px;
    padding-inline: 30px;
    background: var(--topbar-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--topbar-border);
    box-shadow: var(--shadow-topbar);
}

.topbar__main,
.topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

.topbar__main {
    flex: 1 1 auto;
}

.topbar__actions {
    flex: 0 1 auto;
    margin-inline-start: auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    text-align: start;
}

.topbar__brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    justify-content: flex-start;
    min-width: 0;
    padding: 4px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    line-height: 1;
}

.topbar__brand .brand-lockup {
    gap: 0;
}

.topbar__brand .brand-lockup__logo--meem {
    height: 60px;
}

.topbar__brand .brand-lockup__logo--sap {
    height: 28px;
}

.topbar__brand .brand-lockup__divider {
    height: 32px;
    background: var(--border);
}

.topbar__user {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 46px;
    min-width: 0;
    padding-inline: 16px;
    border-radius: 18px;
    background: var(--user-bg);
    border: 1px solid var(--user-border);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.topbar__user-name {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar__user-separator,
.topbar__user-role {
    color: var(--muted);
}

.topbar__language-form,
.topbar__logout-form {
    margin: 0;
}

.topbar__language-form {
    display: flex;
    align-items: center;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 18px;
    background: var(--user-bg);
    border: 1px solid var(--user-border);
    box-shadow: var(--shadow-sm);
}

.language-switcher__button {
    min-width: 58px;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.language-switcher__button:hover {
    background: var(--panel-alt);
    color: var(--text);
}

.language-switcher__button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.language-switcher__button.is-active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 10px 20px var(--primary-soft);
}

/* Theme Switcher */
.theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 18px;
    background: var(--user-bg);
    border: 1px solid var(--user-border);
    box-shadow: var(--shadow-sm);
}

.theme-switcher__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-switcher__button:hover {
    background: var(--panel-alt);
    color: var(--text);
}

.theme-switcher__button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.theme-switcher__button.is-active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-soft);
}

.theme-switcher__icon {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .theme-switcher__text {
        display: none;
    }
    .theme-switcher__button {
        padding: 0 8px;
    }
}

.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 12;
    padding: 10px 24px;
    background: var(--topbar-bg);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--topbar-border);
    box-shadow: var(--shadow-footer);
}

.app-footer__inner {
    width: min(100%, var(--page-max-width));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.app-footer__logo {
    width: auto;
    height: 28px;
    object-fit: contain;
}

.app-footer__copy {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.04em;
}

.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;
}

.eyebrow {
    margin: 0 0 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    font-weight: 700;
}

.topbar__title {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
}

.topbar__subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    max-width: 780px;
}

.page-shell {
    padding-block: 26px 40px;
    padding-inline: 28px;
    width: min(100%, var(--page-max-width));
    margin: 0 auto;
}

.page-shell:has(.payment-layout) {
    width: 100%;
    max-width: none;
    padding-block: 24px 40px;
    padding-inline: 22px;
}

/* Messages */
.message-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.message {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.message--success {
    color: var(--message-success-text);
    background: var(--success-soft);
    border-color: var(--message-success-border);
}

.message--error {
    color: var(--message-error-text);
    background: var(--danger-soft);
    border-color: var(--message-error-border);
}

.message--info {
    color: var(--message-info-text);
    background: var(--message-info-bg);
    border-color: var(--message-info-border);
}

/* Buttons */
.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.menu-toggle__icon {
    font-size: 24px;
    line-height: 1;
    transform: translateY(-1px);
}

.user-chip {
    background: var(--primary-soft);
    color: var(--primary-strong);
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 600;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.button:hover {
    transform: translateY(-1px);
}

.button--primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 14px 24px var(--primary-soft);
}

.button--secondary {
    background: var(--panel);
    color: var(--text);
    border-color: var(--border);
}

.button--secondary:hover {
    background: var(--panel-alt);
}

.button--ghost {
    background: var(--ghost-bg);
    color: var(--text);
}

.button--ghost:hover {
    background: var(--ghost-bg-hover);
}

.button--danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger-border);
}

.button--danger:hover {
    background: var(--danger-hover);
}

.button--small {
    padding: 10px 14px;
}

.button--block {
    width: 100%;
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* Hero Section */
.hero,
.panel,
.metric-card,
.login-card,
.login-copy {
    background: var(--panel-soft);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.hero {
    padding: 28px;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.hero > * {
    min-width: 0;
}

.hero--compact {
    align-items: center;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.section-title {
    margin: 16px 0 12px;
    font-size: 34px;
    line-height: 1.1;
}

.section-copy {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    flex: 0 1 360px;
}

/* Metrics Grid */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
    align-items: stretch;
}

.metric-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
    padding: 22px;
    border-radius: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-card__label {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.metric-card__value {
    display: block;
    font-size: 28px;
    overflow-wrap: anywhere;
}

.metric-card__caption {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

/* Layout Grid */
.layout-grid {
    display: grid;
    gap: 22px;
    margin-bottom: 22px;
    align-items: start;
}

.layout-grid--2-1 {
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

.layout-grid--equal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

/* Panels */
.panel {
    border-radius: var(--radius-lg);
    padding: 24px;
}

.panel--fill {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.panel--nested {
    margin-top: 20px;
    background: var(--panel-alt);
    box-shadow: none;
}

.panel__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.panel__header h3 {
    margin: 0 0 6px;
    font-size: 22px;
}

.panel__header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

/* Module Grid */
.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.module-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-card {
    display: flex;
    gap: 14px;
    padding: 18px;
    height: 100%;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.module-card > div {
    min-width: 0;
    display: grid;
    gap: 6px;
    align-content: start;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.module-card.is-muted {
    opacity: 0.84;
}

.module-card__badge {
    min-width: 52px;
    height: 52px;
    padding: 0 10px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.module-card__meta {
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.module-card h4,
.stack-item h4,
.timeline__item h4,
.detail-card h4 {
    margin: 0 0 8px;
}

.module-card p,
.stack-item p,
.timeline__item p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.module-card small {
    color: var(--primary-strong);
    font-weight: 700;
}

/* Stack List */
.stack-list {
    display: grid;
    gap: 14px;
}

.stack-item {
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    height: 100%;
}

.stack-item__tag {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Tables */
.table-wrap,
.table-wrapper {
    width: 100%;
    overflow: auto;
    scrollbar-gutter: auto;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel-soft);
}

.table-wrap--balanced {
    flex: 1;
    max-height: 560px;
    overflow: auto;
}

.table-wrap--compact {
    max-height: 360px;
    overflow: auto;
}

.table-wrap--balanced .data-table th,
.table-wrap--compact .data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table--sticky-clean {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.data-table--sticky-clean thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel-alt);
    box-shadow: inset 0 -1px 0 var(--border);
    vertical-align: middle;
}

.data-table--sticky-clean td {
    vertical-align: middle;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: start;
    font-size: 14px;
    line-height: 1.6;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.data-table th {
    color: var(--muted);
    font-weight: 700;
    background: var(--table-header);
}

.data-table tbody tr:nth-child(even) {
    background: var(--table-zebra);
}

.data-table tbody tr:hover {
    background: var(--table-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

/* Timeline */
.timeline {
    display: grid;
    gap: 18px;
}

.timeline__item {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.timeline__item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.timeline__time {
    color: var(--primary-strong);
    font-weight: 700;
}

/* Forms */
.document-form {
    display: grid;
    gap: 20px;
}

.form-section {
    padding: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.form-section__header {
    margin-bottom: 14px;
}

.form-section__header h4 {
    margin: 0 0 6px;
}

.form-section__header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-field {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.form-field span {
    color: var(--text);
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: var(--radius-sm);
    padding: 14px 15px;
    color: var(--text);
    outline: none;
    min-height: var(--control-height);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-field textarea {
    min-height: 124px;
    resize: vertical;
}

.form-field input:disabled,
.form-field textarea:disabled,
.form-field select:disabled {
    background: var(--panel-alt);
    color: var(--muted);
    cursor: not-allowed;
}

.form-field__help {
    display: block;
    color: var(--muted);
    line-height: 1.5;
}

.form-field select[multiple] {
    min-height: 220px;
}

.form-field--readonly {
    align-self: stretch;
}

.readonly-box {
    padding: 14px 15px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--primary-light);
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-weight: 700;
}

.toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.toggle-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
    font-weight: 600;
    line-height: 1.5;
}

.toggle-field input[type="checkbox"] {
    width: auto;
    accent-color: var(--primary);
    margin-top: 2px;
}

.toggle-field span {
    flex: 1;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--panel-alt);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.status-pill--success {
    background: var(--success-soft);
    color: var(--message-success-text);
}

.status-pill--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-pill--muted {
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.form-field__error {
    display: block;
    color: var(--danger);
    font-weight: 600;
    line-height: 1.5;
}

.form-alert {
    border-radius: var(--radius-sm);
    background: var(--danger-soft);
    color: var(--danger);
    padding: 12px 14px;
}

.series-picker {
    display: grid;
    gap: 14px;
}

.series-picker__toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.series-picker__status {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 22px;
}

.series-picker__status.is-error,
.form-field__help.is-error {
    color: var(--danger);
}

.series-picker__groups {
    display: grid;
    gap: 14px;
}

.series-picker__group {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel);
}

.series-picker__group h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--primary-strong);
}

.series-picker__options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.series-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel-alt);
    cursor: pointer;
}

.series-option input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.series-option span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.series-option strong,
.series-option small {
    overflow-wrap: anywhere;
}

.series-option small {
    color: var(--muted);
    font-weight: 600;
}

/* Payment Workspace */
.payment-layout {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    width: 100%;
    max-width: none;
    margin-inline: 0;
}

.panel--payment-workspace {
    width: 100%;
    padding: 32px;
    background:
        radial-gradient(circle at top left, var(--gradient-glow), transparent 32%),
        linear-gradient(180deg, var(--panel), var(--panel-alt));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.payment-document-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
}

.payment-document-form {
    gap: 20px;
}

.payment-card {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--panel-soft);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.payment-card--span-full {
    grid-column: 1 / -1;
}

.payment-card__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.payment-card__header--split {
    flex-wrap: wrap;
}

.payment-card__header h4 {
    margin: 0;
    font-size: 22px;
}

.payment-card__header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.payment-header-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.payment-header-main,
.payment-header-side,
.payment-sidebar,
.checklist-list,
.totals-list {
    display: grid;
    gap: 14px;
}

.payment-grid {
    display: grid;
    gap: 16px;
}

.payment-grid--header {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payment-grid__wide {
    grid-column: 1 / -1;
}

.payment-grid--means,
.payment-grid--notes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payment-grid--means {
    grid-template-areas:
        "cash-account cash-sum transfer-account"
        "transfer-reference transfer-date transfer-sum"
        "cash-flow cash-flow doc-rate";
    align-items: start;
}

.payment-field {
    min-width: 0;
}

.payment-field--cash-account {
    grid-area: cash-account;
}

.payment-field--cash-sum {
    grid-area: cash-sum;
}

.payment-field--transfer-account {
    grid-area: transfer-account;
}

.payment-field--transfer-sum {
    grid-area: transfer-sum;
}

.payment-field--transfer-date {
    grid-area: transfer-date;
}

.payment-field--transfer-reference {
    grid-area: transfer-reference;
}

.payment-field--cash-flow {
    grid-area: cash-flow;
}

.payment-field--doc-rate {
    grid-area: doc-rate;
}

.payment-grid--footer {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    align-items: stretch;
    gap: 20px;
}

.partner-snapshot {
    padding: 20px;
    border: 1px solid var(--primary-soft);
    border-radius: 18px;
    background: linear-gradient(180deg, var(--panel), var(--primary-soft));
}

.partner-snapshot__header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.partner-snapshot__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.snapshot-item,
.detail-card,
.checklist-item,
.totals-list__row {
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
}

.snapshot-item span,
.detail-card__label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.snapshot-item strong,
.detail-card__value {
    display: block;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

.detail-card--stacked {
    display: grid;
    gap: 4px;
}

.invoice-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
}

.form-field--compact {
    min-width: 240px;
}

.form-field--action {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.payment-toggle {
    min-width: 230px;
    justify-content: flex-start;
}

.payment-toggle input[type="checkbox"] {
    width: auto;
    accent-color: var(--primary);
}

.invoices-panel {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.invoices-panel.is-hidden {
    display: none;
}

.invoice-list-wrap {
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel-soft);
    overflow: hidden;
}

.invoice-list__header {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(130px, 0.9fr) minmax(100px, 0.7fr) minmax(0, 2fr) minmax(160px, 0.9fr);
    gap: 16px;
    padding: 16px 20px;
    background: var(--table-header);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.invoice-list {
    max-height: 360px;
    overflow: auto;
    padding: 14px;
    display: grid;
    gap: 12px;
}

.invoice-list__item {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
}

.invoice-list__row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(130px, 0.9fr) minmax(100px, 0.7fr) minmax(0, 2fr) minmax(160px, 0.9fr);
    gap: 16px;
    align-items: center;
}

.invoice-list__type {
    display: inline-block;
    padding: 6px 10px;
    background: var(--panel-soft);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.invoice-list__status {
    display: inline-block;
    padding: 6px 10px;
    background: var(--panel-soft);
    color: var(--success);
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.invoice-list__item--closed {
    opacity: 0.65;
    background: var(--table-header) !important;
    border-color: var(--border-soft) !important;
}

.invoice-list__item--closed .invoice-list__status {
    color: var(--muted) !important;
    background: var(--panel) !important;
    border-color: var(--border) !important;
}

.invoice-list__item--closed strong,
.invoice-list__item--closed span,
.invoice-list__item--closed label,
.invoice-list__item--closed button {
    color: var(--muted) !important;
}



.invoice-list__primary {
    display: grid;
    gap: 12px;
}

.invoice-toggle-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    border: 1px solid var(--border);
    background: var(--ghost-bg);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
}

.invoice-list__chevron {
    font-size: 10px;
}

.invoice-list__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.invoice-list__toggle input[type="checkbox"] {
    width: auto;
    accent-color: var(--primary);
}

.invoice-list__meta {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.invoice-list__field,
.invoice-list__amount {
    display: grid;
    gap: 6px;
}

.invoice-list__field span,
.invoice-list__amount span {
    color: var(--muted);
    font-size: 12px;
}

.invoice-list__details {
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.invoice-detail-card {
    display: grid;
    gap: 12px;
}

.invoice-detail-card__header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.invoice-detail-table {
    min-width: 780px;
}

.statement-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
}

.statement-modal.is-hidden {
    display: none;
}

.statement-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.statement-modal__panel {
    position: relative;
    width: min(1120px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 24px;
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
    display: grid;
    gap: 18px;
}

.statement-modal__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.statement-modal__header h3,
.statement-modal__header p {
    margin: 0;
}

.statement-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px)) auto;
    gap: 16px;
    align-items: end;
}

.statement-toolbar__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.statement-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.statement-table-wrap {
    max-height: 360px;
    overflow: auto;
}

.statement-table {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.statement-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel-alt);
    box-shadow: inset 0 -1px 0 var(--border);
    vertical-align: middle;
}

.statement-table td {
    vertical-align: middle;
}

.invoices-table th,
.invoices-table td {
    vertical-align: middle;
}

.invoices-table__check {
    width: 72px;
    text-align: center;
}

.invoices-table__check input[type="checkbox"] {
    width: auto;
    accent-color: var(--primary);
}

.invoices-table__empty {
    padding: 32px 16px !important;
    text-align: center !important;
    color: var(--muted);
}

.invoices-table input[type="number"] {
    width: 140px;
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: 12px;
    padding: 10px 12px;
    text-align: end;
}

.invoice-summary,
.payment-status-banner {
    padding: 14px 16px;
    border-radius: 16px;
    line-height: 1.7;
    border: 1px solid transparent;
}

.payment-status-banner {
    display: flex;
    align-items: center;
    min-height: 100%;
}

.invoice-summary--success,
.payment-status-banner--success {
    background: var(--success-soft);
    color: var(--message-success-text);
    border-color: var(--message-success-border);
}

.invoice-summary--warning,
.payment-status-banner--warning {
    background: var(--warning-soft);
    color: var(--message-warning-text);
    border-color: var(--message-warning-border);
}

.invoice-summary--danger,
.payment-status-banner--danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--message-error-border);
}

.invoice-summary--muted,
.payment-status-banner--muted {
    background: var(--panel-alt);
    color: var(--muted);
    border-color: var(--border);
}

.payment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.payment-actions--footer {
    justify-content: flex-end;
    align-items: flex-end;
}

.payment-actions__hint {
    color: var(--muted);
    line-height: 1.6;
}

.totals-list__row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.totals-list__row span {
    color: var(--muted);
}

.totals-list__row strong {
    text-align: end;
}

.checklist-item {
    line-height: 1.7;
}

/* Config List */
.config-list {
    display: grid;
    gap: 12px;
}

.config-list__row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel-alt);
}

.config-list__row span {
    color: var(--muted);
}

.config-list__row strong {
    text-align: end;
    direction: ltr;
    font-size: 13px;
    overflow-wrap: anywhere;
}

/* Results */
.result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.code-block {
    margin: 0;
    padding: 16px;
    border-radius: 18px;
    background: #0f2230;
    color: #e7f0f4;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    font-size: 13px;
    line-height: 1.7;
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-shell {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 440px);
    gap: 24px;
    align-items: stretch;
}

.login-copy,
.login-card {
    border-radius: 28px;
    padding: 32px;
}

.login-copy {
    background: radial-gradient(circle at top right, var(--gradient-glow), transparent 32%),
                linear-gradient(180deg, var(--panel-soft), var(--panel-alt));
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-copy__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.login-copy__brand-image {
    width: min(100%, 420px);
    max-height: 220px;
    object-fit: contain;
}

.login-copy__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.login-copy h1 {
    margin: 16px 0 14px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.05;
}

.login-copy p {
    margin: 0;
    max-width: 520px;
    color: var(--muted);
    line-height: 1.8;
    font-size: 16px;
}

.login-card__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.login-card__header .brand-lockup {
    flex: 0 0 auto;
}

.login-card__header .brand-lockup__logo--meem {
    height: 48px;
}

.login-card__header .brand-lockup__logo--sap {
    height: 24px;
}

.login-card__header .brand-lockup__divider {
    height: 28px;
}

.login-card__header h2 {
    margin: 0 0 4px;
}

.login-card__header p {
    margin: 0;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-card form,
.login-card .message-stack {
    width: 100%;
}

/* Tabs */
.tabs__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.tabs__button {
    border: 1px solid var(--border);
    background: var(--panel-alt);
    color: var(--muted);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
}

.tabs__button.is-active {
    border-color: var(--primary-light);
    color: var(--primary-strong);
    background: var(--primary-soft);
}

.tabs__panel {
    display: none;
}

.tabs__panel.is-active {
    display: block;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge-success {
    background: var(--success-soft);
    color: var(--success);
}

/* Activity List */
.activity-list {
    padding: 8px 0;
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.success {
    background: var(--success-soft);
    color: var(--success);
}

.activity-icon.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.activity-content p {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 4px;
}

.activity-time {
    font-size: 11px;
    color: var(--muted);
}

/* Dashboard Specific */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: var(--panel);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon.blue { background: var(--kpi-blue-bg); color: var(--kpi-blue-text); }
.kpi-icon.green { background: var(--kpi-green-bg); color: var(--kpi-green-text); }
.kpi-icon.orange { background: var(--kpi-orange-bg); color: var(--kpi-orange-text); }
.kpi-icon.purple { background: var(--kpi-purple-bg); color: var(--kpi-purple-text); }

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 13px;
    color: var(--muted);
    display: block;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}

.kpi-change {
    font-size: 12px;
    color: var(--muted);
}

.actions-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s;
}

.action-btn.primary {
    background: var(--primary);
    color: white;
}

.action-btn.primary:hover {
    background: var(--primary-strong);
}

.action-btn.secondary {
    background: var(--panel);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.action-btn.secondary:hover {
    background: var(--primary-soft);
}

.action-btn.outline {
    background: var(--panel);
    color: var(--muted);
    border: 1px solid var(--border);
}

.action-btn.outline:hover {
    background: var(--panel-alt);
}

.data-panel {
    background: var(--panel);
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-bottom: 30px;
    overflow: hidden;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.panel-header h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.panel-header p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

.panel-tabs {
    display: flex;
    gap: 8px;
    background: var(--panel-alt);
    padding: 4px;
    border-radius: 12px;
}

.tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: white;
    box-shadow: var(--shadow-sm);
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.amount-due {
    color: var(--warning);
    font-weight: 500;
}

.btn-small {
    display: inline-block;
    padding: 6px 14px;
    background: var(--panel-alt);
    color: var(--primary);
    border-radius: 8px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-small:hover {
    background: var(--primary);
    color: white;
}

.module-note {
    padding: 18px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    color: var(--muted);
    line-height: 1.8;
}

/* Responsive */
@media (max-width: 1440px) {
    .partner-snapshot__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .module-grid,
    .form-grid,
    .toggle-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .layout-grid--2-1,
    .layout-grid--equal,
    .login-shell,
    .result-grid {
        grid-template-columns: 1fr;
    }
    .payment-layout,
    .payment-header-grid,
    .payment-document-grid {
        grid-template-columns: 1fr;
    }
    .payment-grid--means {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "cash-account cash-sum"
            "transfer-account transfer-account"
            "transfer-reference transfer-date"
            "transfer-sum cash-flow"
            "doc-rate doc-rate";
    }
    .payment-grid--footer {
        grid-template-columns: 1fr;
    }
    .partner-snapshot__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .invoice-list__header {
        display: none;
    }
    .invoice-list__row {
        grid-template-columns: 1fr;
    }
    .invoice-list__meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .statement-toolbar,
    .statement-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    :root {
        --topbar-space: 112px;
        --footer-space: 24px;
    }
    .hero {
        flex-direction: column;
    }
    .hero__actions {
        width: 100%;
        flex-basis: auto;
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    :root {
        --topbar-space: 138px;
    }
    .page-shell {
        padding-inline: 18px;
    }
    .hero,
    .hero__actions {
        width: 100%;
    }
    .hero,
    .panel,
    .login-card,
    .login-copy {
        padding: 20px;
    }
    .hero__actions .button {
        width: 100%;
    }
    .section-title {
        font-size: 28px;
        overflow-wrap: anywhere;
    }
    .metric-grid,
    .metric-grid--three,
    .module-grid,
    .module-grid--compact,
    .form-grid,
    .toggle-grid,
    .result-grid,
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .payment-grid--header,
    .payment-grid--means,
    .payment-grid--footer,
    .payment-grid--notes,
    .partner-snapshot__grid {
        grid-template-columns: 1fr;
    }
    .payment-grid--means {
        grid-template-areas:
            "cash-account"
            "cash-sum"
            "transfer-account"
            "transfer-sum"
            "transfer-date"
            "transfer-reference"
            "cash-flow"
            "doc-rate";
    }
    .invoice-toolbar,
    .payment-actions,
    .totals-list__row {
        flex-direction: column;
        align-items: stretch;
    }
    .login-copy__topbar {
        flex-direction: column;
        align-items: stretch;
    }
    .login-card__header .brand-lockup__logo--meem {
        height: 42px;
    }
    .login-card__header .brand-lockup__logo--sap {
        height: 22px;
    }
    .form-field--compact,
    .payment-toggle {
        min-width: 0;
    }
    .invoices-table input[type="number"] {
        width: 100%;
    }
    .invoice-list__meta {
        grid-template-columns: 1fr;
    }
    .statement-modal__panel {
        width: calc(100vw - 20px);
        padding: 18px;
    }
    .timeline__item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 560px) {
    :root {
        --topbar-space: 176px;
    }

    .module-card {
        flex-direction: column;
    }
}

.invoice-document-form,
.financial-document-form {
    display: grid;
    gap: 22px;
}

.invoice-page-grid,
.journal-page-grid {
    align-items: stretch;
}

.invoice-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.required-badge {
    display: inline-flex;
    margin-inline-start: 8px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
}

.form-field--wide {
    grid-column: 1 / -1;
}

.invoice-snapshot {
    margin-top: 22px;
}

.invoice-lines-table,
.journal-lines-table {
    min-width: 100%;
    table-layout: fixed;
}

.invoice-lines-table th,
.journal-lines-table th {
    white-space: nowrap;
}

.invoice-lines-table td,
.journal-lines-table td {
    vertical-align: top;
}

.invoice-line-input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.invoice-line-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.invoice-line-input:disabled {
    background: var(--panel-alt);
    color: var(--muted);
}

.invoice-line-input[readonly] {
    background: var(--panel-alt);
    color: var(--text);
}

.invoice-line-total {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    font-size: 14px;
}

.tracking-cell {
    display: grid;
    gap: 10px;
}

.tracking-cell__summary {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.journal-line-hint {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.tracking-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
}

.tracking-modal.is-hidden {
    display: none;
}

.tracking-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.tracking-modal__panel {
    position: relative;
    width: min(1320px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 24px;
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
    display: grid;
    gap: 18px;
}

.tracking-modal__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.tracking-modal__header h3,
.tracking-modal__header p {
    margin: 0;
}

.tracking-modal__summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.tracking-modal__bin-panel {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--primary-soft);
}

.tracking-modal__bin-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.tracking-modal__toolbar {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.tracking-modal__toolbar .invoice-summary {
    flex: 1 1 360px;
}

.tracking-modal__table-wrap {
    max-height: 430px;
    overflow: auto;
}

.tracking-modal__table {
    min-width: 1120px;
}

@media (max-width: 1180px) {
    .invoice-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tracking-modal__summary {
        grid-template-columns: 1fr;
    }

    .tracking-modal__bin-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .invoice-form-grid {
        grid-template-columns: 1fr;
    }

    .tracking-modal__panel {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        padding: 18px;
    }
}

/* Modern ERP invoice workspace */
.page-shell:has(.invoice-document-form) {
    width: 100%;
    max-width: none;
    padding-inline: clamp(16px, 2.4vw, 36px);
}

.page-shell:has(.invoice-document-form) .hero {
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.invoice-document-form {
    gap: 26px;
}

.invoice-erp-card {
    padding: clamp(20px, 2vw, 30px);
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(180deg, var(--panel), var(--panel-alt));
    box-shadow: var(--shadow);
    overflow: visible;
}

.invoice-document-card,
.invoice-party-card,
.invoice-address-card,
.invoice-lines-card {
    display: grid;
    gap: 22px;
}

.invoice-section-heading,
.invoice-lines-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.invoice-section-heading h3,
.invoice-lines-header h3 {
    margin: 4px 0 0;
    font-size: clamp(20px, 1.4vw, 26px);
    line-height: 1.25;
}

.invoice-lines-header p {
    margin: 6px 0 0;
    color: var(--muted);
    max-width: 760px;
}

.invoice-section-kicker {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.invoice-form-grid {
    display: grid;
    gap: 18px;
}

.invoice-form-grid--header {
    grid-template-columns: minmax(420px, 1.55fr) minmax(220px, 0.55fr) minmax(340px, 0.9fr);
    align-items: end;
}

.invoice-form-grid--dates {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.invoice-form-grid--remarks {
    grid-template-columns: minmax(360px, 0.95fr) minmax(460px, 1.05fr);
}

.invoice-field {
    min-width: 0;
}

.invoice-field span {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.invoice-field input,
.invoice-field textarea,
.invoice-field select {
    min-height: 56px;
    border-radius: 14px;
    border-color: var(--border);
    background: var(--panel);
    box-shadow: none;
}

.invoice-field input:focus,
.invoice-field textarea:focus,
.invoice-field select:focus,
.invoice-line-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow);
}

.invoice-field--vendor input {
    min-height: 66px;
    padding-inline: 18px;
    font-size: 18px;
    font-weight: 700;
}

.invoice-field--reference input {
    min-width: 0;
}

.invoice-form-grid--remarks textarea,
.invoice-form-grid--remarks input {
    min-height: 88px;
}

.invoice-snapshot {
    margin-top: 0;
}

.invoice-party-card.partner-snapshot {
    background: linear-gradient(180deg, var(--panel), var(--primary-soft));
}

.invoice-party-grid {
    grid-template-columns: minmax(210px, 0.8fr) minmax(360px, 1.4fr) repeat(4, minmax(160px, 0.65fr));
    gap: 14px;
}

.snapshot-item {
    min-width: 0;
    border-color: var(--border);
    border-radius: 14px;
    box-shadow: none;
}

.snapshot-item span {
    color: var(--muted);
    font-weight: 700;
}

.snapshot-item strong {
    color: var(--text);
    overflow-wrap: anywhere;
}

.snapshot-item--important {
    background: var(--panel-alt);
}

.snapshot-item--important strong {
    font-size: 18px;
    line-height: 1.45;
}

.snapshot-item--name strong {
    font-size: 19px;
}

.invoice-address-grid {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(360px, 1.45fr) repeat(3, minmax(170px, 0.72fr));
    gap: 14px;
}

.invoice-result-banner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--primary-light);
    border-radius: 18px;
    background: linear-gradient(180deg, var(--success-soft), var(--panel));
    box-shadow: var(--shadow-sm);
}

.invoice-result-banner span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.invoice-result-banner strong {
    display: block;
    margin-top: 3px;
    font-size: 15px;
}

.invoice-lines-card.panel {
    padding: clamp(18px, 1.8vw, 26px);
}

.invoice-lines-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.invoice-action-button,
.invoice-submit-button {
    min-height: 42px;
    padding-inline: 18px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.invoice-action-button:hover,
.invoice-submit-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.invoice-metrics-strip {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(180px, 0.7fr) minmax(260px, 1fr);
    gap: 12px;
}

.invoice-metric {
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
}

.invoice-metric span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.invoice-metric strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
    overflow-wrap: anywhere;
}

.invoice-metric--total {
    background: linear-gradient(180deg, var(--panel), var(--primary-soft));
}

.invoice-lines-scroll {
    max-height: 640px;
    border-radius: 18px;
    border-color: var(--border);
    background: var(--panel);
}

.invoice-lines-table {
    min-width: 2240px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.invoice-lines-table th,
.invoice-lines-table td {
    padding: 12px 10px;
    vertical-align: middle;
    overflow-wrap: normal;
}

.invoice-lines-table thead th {
    top: 0;
    z-index: 3;
    background: var(--panel-alt);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: inset 0 -1px 0 var(--border);
}

.invoice-lines-table tbody td {
    background: var(--panel);
}

.invoice-lines-table tbody tr:nth-child(even) td {
    background: var(--table-zebra);
}

.invoice-lines-table tbody tr:hover td {
    background: var(--table-hover);
}

.invoice-line-input {
    min-height: 46px;
    padding: 11px 12px;
    border-radius: 10px;
    border-color: var(--border);
    background: var(--panel);
}

.invoice-line-total {
    min-height: 46px;
    align-items: center;
    color: var(--text);
}

.invoice-lines-table input[type="checkbox"][data-line-field="without_qty_posting"] {
    width: 22px;
    height: 22px;
    accent-color: var(--primary);
}

.tracking-cell__summary {
    min-height: 46px;
    border-radius: 10px;
}

.invoice-col--code {
    width: 240px;
}

.invoice-col--description {
    width: 340px;
}

.invoice-col--quantity,
.invoice-col--price,
.invoice-col--total {
    width: 140px;
}

.invoice-col--discount {
    width: 120px;
}

.invoice-col--warehouse {
    width: 190px;
}

.invoice-col--tax,
.invoice-col--wtax-code {
    width: 170px;
}

.invoice-col--wtax-liable {
    width: 135px;
}

.invoice-col--without-qty {
    width: 160px;
}

.invoice-col--tracking {
    width: 180px;
}

.invoice-col--bin {
    width: 210px;
}

.invoice-col--cost-center {
    width: 150px;
}

.invoice-col--remove {
    width: 100px;
}

.invoice-submit-bar {
    position: sticky;
    bottom: 14px;
    z-index: 5;
    margin-top: 0;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--topbar-bg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

@media (max-width: 1280px) {
    .invoice-form-grid--header {
        grid-template-columns: minmax(360px, 1fr) minmax(200px, 0.45fr);
    }

    .invoice-field--reference {
        grid-column: 1 / -1;
    }

    .invoice-party-grid,
    .invoice-address-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .invoice-form-grid--remarks {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 840px) {
    .page-shell:has(.invoice-document-form) {
        padding-inline: 12px;
    }

    .invoice-section-heading,
    .invoice-lines-header,
    .invoice-result-banner,
    .invoice-submit-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .invoice-form-grid--header,
    .invoice-form-grid--dates,
    .invoice-form-grid--remarks,
    .invoice-party-grid,
    .invoice-address-grid,
    .invoice-metrics-strip {
        grid-template-columns: 1fr;
    }

    .invoice-field--reference {
        grid-column: auto;
    }

    .invoice-lines-actions {
        justify-content: stretch;
    }

    .invoice-lines-actions .button,
    .invoice-submit-button {
        width: 100%;
        justify-content: center;
    }

    .invoice-submit-bar {
        position: static;
    }
}

/* SAP-like compact document enhancements */
.payment-document-form,
.invoice-document-form,
.financial-document-form {
    gap: 14px;
}

.payment-document-form .panel__header,
.invoice-document-form .panel__header,
.financial-document-form .panel__header,
.payment-card__header,
.invoice-section-heading,
.invoice-lines-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.payment-document-form .form-field,
.invoice-document-form .form-field,
.financial-document-form .form-field {
    gap: 5px;
}

.payment-document-form .form-field span,
.invoice-document-form .form-field span,
.financial-document-form .form-field span {
    font-size: 12px;
    line-height: 1.25;
}

.payment-document-form input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
.payment-document-form select,
.payment-document-form textarea,
.invoice-document-form input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
.invoice-document-form select,
.invoice-document-form textarea,
.financial-document-form input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
.financial-document-form select,
.financial-document-form textarea {
    min-height: 38px;
    padding-block: 7px;
    padding-inline: 10px;
    border-radius: 8px;
}

.payment-document-form textarea,
.invoice-document-form textarea,
.financial-document-form textarea {
    min-height: 64px;
}

.payment-card,
.invoice-erp-card,
.payment-document-form .panel,
.financial-document-form .panel {
    border-radius: 8px;
}

.payment-card,
.invoice-erp-card,
.payment-document-form .panel,
.financial-document-form .panel {
    padding: 14px;
}

.payment-document-grid,
.payment-header-grid,
.invoice-form-grid,
.form-grid.invoice-form-grid {
    gap: 10px;
}

.payment-grid {
    gap: 10px;
}

.payment-means-toolbar {
    display: flex;
    align-items: end;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.payment-means-selector {
    width: min(260px, 100%);
}

[data-payment-means-section][hidden] {
    display: none !important;
}

.erp-doc-number-field input[readonly],
input[data-document-number-preview][readonly] {
    background: var(--panel-alt);
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0;
}

.invoice-form-grid--dates {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
}

.invoice-field--vendor input {
    min-height: 44px;
    font-size: 15px;
}

.invoice-lines-scroll {
    max-height: 560px;
}

.invoice-lines-table th,
.invoice-lines-table td,
.journal-lines-table th,
.journal-lines-table td {
    padding: 8px;
}

.invoice-line-input {
    min-height: 36px;
    padding: 7px 9px;
    border-radius: 8px;
}

.invoice-submit-bar {
    padding: 10px 12px;
    border-radius: 8px;
}

@media (max-width: 1280px) {
    .invoice-form-grid--dates {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
}

@media (max-width: 840px) {
    .invoice-form-grid--dates {
        grid-template-columns: 1fr;
    }

    .payment-means-selector {
        width: 100%;
    }
}

/* ==========================================================================
   Users Management Redesign Module (Stripe / Linear / SAP Web Client Inspired)
   ========================================================================== */

.users-page {
    display: grid;
    gap: 24px;
    max-width: var(--page-max-width);
    margin: 0 auto;
    padding: 0 0 40px;
}

.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.users-header__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.users-header__subtitle {
    font-size: 14px;
    color: var(--muted);
}

.users-header__actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-erp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-erp--primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-soft);
}

.btn-erp--primary:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.btn-erp--secondary {
    background: var(--panel);
    color: var(--text);
    border-color: var(--border);
}

.btn-erp--secondary:hover {
    background: var(--panel-alt);
}

.users-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.users-kpi-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.users-kpi-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.users-kpi-card__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.users-kpi-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.users-kpi-card__caption {
    font-size: 12px;
    color: var(--muted);
}

.users-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    background: var(--panel-alt);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.users-filter-bar__search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 240px;
    max-width: 480px;
}

.users-search-icon {
    position: absolute;
    left: 12px;
    color: var(--muted);
    pointer-events: none;
}

.users-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 36px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    transition: all 0.2s ease;
}

.users-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.users-filter-bar__tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
}

.filter-tab {
    height: 30px;
    padding: 0 12px;
    border-radius: 6px;
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-tab:hover {
    color: var(--text);
    background: var(--panel-alt);
}

.filter-tab--active {
    background: var(--panel-alt);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.users-filter-bar__size {
    display: flex;
    align-items: center;
}

.users-size-select {
    height: 36px;
    padding: 0 28px 0 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    outline: none;
}

.panel--users {
    overflow: hidden;
    border-radius: 12px;
}

.table-wrap--scrollable {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.data-table--users {
    table-layout: auto;
    width: 100%;
}

.data-table--users th {
    background: var(--table-header);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0 12px !important;
    vertical-align: middle !important;
    height: 44px;
    box-sizing: border-box;
}

.data-table--users td {
    vertical-align: middle !important;
    padding: 0 12px !important;
    height: 64px !important;
    line-height: 1.3 !important;
    box-sizing: border-box;
}

.data-table--users th.col-actions {
    text-align: center;
}

.data-table--users th.col-sessions,
.data-table--users td.col-sessions {
    text-align: center !important;
}

.col-username {
    white-space: nowrap;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
    letter-spacing: 0.1px;
}

.col-status {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.status-indicator-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator-dot.status-pill--success {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-indicator-dot.status-pill--warning {
    background-color: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.status-indicator-dot.status-pill--danger {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

.status-indicator-dot.status-pill--muted {
    background-color: var(--muted);
}

.col-status .status-pill {
    background: transparent;
    border: 0;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.col-role .status-pill--success {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid var(--message-success-border);
}

.col-role .status-pill {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.inline-pill-list {
    display: inline-flex;
    gap: 4px;
    margin-inline-start: 6px;
}

.col-last-login,
.col-last-activity,
.col-nowrap {
    white-space: nowrap !important;
}

.col-actions {
    white-space: nowrap;
}

.users-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.users-action-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s ease;
    text-decoration: none;
    display: inline-block;
}

.users-action-btn:hover {
    color: var(--primary-strong);
    text-decoration: underline;
}

.users-action-btn--toggle {
    color: var(--warning);
}

.users-action-btn--toggle:hover {
    color: var(--warning);
    opacity: 0.8;
}

.users-action-btn--danger {
    color: var(--danger);
}

.users-action-btn--danger:hover {
    color: var(--danger);
    opacity: 0.8;
}

.users-actions-sep {
    color: var(--border);
    font-size: 12px;
    user-select: none;
}

.users-inline-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.users-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--panel);
}

.users-pagination__info {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.users-pagination__buttons {
    display: flex;
    gap: 6px;
}

.users-pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.users-pag-btn:hover:not(:disabled) {
    background: var(--panel-alt);
    border-color: var(--muted);
}

.users-pag-btn:disabled,
.users-pag-btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--panel-alt);
}

.users-page__panels {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.table-wrap--users {
    max-height: 650px;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.table-wrap--users thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--panel-alt);
    box-shadow: inset 0 -1px 0 var(--border);
}

.table-wrap--series {
    max-height: 350px;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.table-wrap--cash {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.table-wrap--audit {
    max-height: 350px;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.table-wrap--series thead th,
.table-wrap--cash thead th,
.table-wrap--audit thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--panel-alt);
    box-shadow: inset 0 -1px 0 var(--border);
}

.users-table-empty {
    padding: 24px !important;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

/* RTL Adjustments */
html[dir="rtl"] .users-search-icon {
    left: auto;
    right: 12px;
}

html[dir="rtl"] .users-search-input {
    padding: 0 36px 0 12px;
}

.users-pagination__pages {
    display: flex;
    gap: 4px;
    align-items: center;
}

.users-pag-btn.users-pag-num.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.users-filter-bar__status-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.users-filter-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.btn-clear-filters {
    background: transparent;
    border: 0;
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 8px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s ease;
}

.btn-clear-filters:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Redesigned Filters Area Dropdowns */
.users-filter-bar__dropdowns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.users-filter-select {
    height: 36px;
    padding: 0 28px 0 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

html[dir="rtl"] .users-filter-select {
    padding: 0 12px 0 28px;
}

.users-filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Tooltip implementation */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #fff;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px);
}

/* Icon Buttons in Table */
.users-action-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.users-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.users-icon-btn:hover {
    color: var(--text);
    border-color: var(--muted);
    background: var(--panel-alt);
}

.users-icon-btn--toggle {
    color: var(--warning);
    border-color: var(--danger-border);
}

.users-icon-btn--toggle:hover {
    background: var(--warning-soft);
    color: var(--warning);
}

.users-icon-btn--danger {
    color: var(--danger);
    border-color: var(--danger-border);
}

.users-icon-btn--danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* Professional Modal Dialog for Forms */
.users-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.users-modal.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.users-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.users-modal__panel {
    position: relative;
    width: min(1000px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    z-index: 101;
    overflow: hidden;
    animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
    from {
        transform: scale(0.96) translateY(10px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.users-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-alt);
}

.users-modal__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.users-modal__close {
    background: transparent;
    border: 0;
    font-size: 24px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s ease;
    padding: 0 4px;
}

.users-modal__close:hover {
    color: var(--text);
}

.users-modal__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Modal form overrides for clean visual experience */
.users-modal__body .hero {
    display: none; /* Hide form pages redundant headers inside modal */
}

.users-modal__body .panel {
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    margin: 0;
}

.users-modal__body .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.users-modal__body .form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.users-modal__body .form-field span {
    color: var(--muted);
}

.users-modal__body .form-field input:not([type="checkbox"]):not([type="radio"]),
.users-modal__body .form-field select,
.users-modal__body .form-field textarea {
    height: 42px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 0 12px;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: all 0.15s ease;
}

.users-modal__body .form-field input:focus,
.users-modal__body .form-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.users-modal__body .form-field__error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

/* Loader spinner for modal retrieval */
.users-modal__loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    gap: 16px;
    color: var(--muted);
}

.users-modal__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
    to {
        transform: rotate(360deg);
    }
}

/* Profile View Inside Modal */
.user-profile-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Status Badge style */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
    box-sizing: border-box;
}

.status-badge.status-pill--success {
    background-color: var(--success-soft);
    color: var(--success);
    border-color: var(--message-success-border);
}

.status-badge.status-pill--muted {
    background-color: var(--panel-alt);
    color: var(--muted);
    border-color: var(--border);
}

.status-badge.status-pill--warning {
    background-color: var(--warning-soft);
    color: var(--warning);
    border-color: var(--danger-border);
}

.status-badge.status-pill--danger {
    background-color: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger-border);
}

.status-badge__dot {
    margin-inline-end: 6px;
    font-size: 10px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.status-badge .status-pill {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: inherit !important;
    line-height: 1 !important;
    display: inline !important;
}

/* Compact ERP Badge styles */
.badge-erp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    background: var(--panel-alt);
    color: var(--text);
    border: 1px solid var(--border);
    white-space: nowrap;
    box-sizing: border-box;
}

.badge-erp--success {
    background: var(--success-soft);
    color: var(--success);
    border-color: var(--message-success-border);
}

.badge-erp--danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger-border);
}

.badge-erp--warning {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: var(--danger-border);
}

.badge-erp--muted {
    background: var(--primary-soft);
    color: var(--primary-strong);
    border-color: var(--border);
}

/* Cash Accounts badge layout alignment */
.cash-accounts {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 100%;
}

.cash-badge {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 0 1 auto;
}

.cash-more {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* User Profile Dashboard styles */
.profile-dashboard-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.profile-dashboard-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-dashboard-meta h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.profile-dashboard-meta__tags {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-dashboard-stats {
    display: flex;
    gap: 24px;
    margin-inline-start: auto;
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: end;
}

.stat-box strong {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-box span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.profile-dashboard-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 24px;
}

.profile-dashboard-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-dashboard-section h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.profile-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.profile-dashboard-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel-alt);
    transition: all 0.2s ease;
}

.profile-dashboard-card:hover {
    border-color: var(--muted);
    background: var(--table-hover);
}

.card-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.card-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.profile-dashboard-empty {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    font-style: italic;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

/* Final accessibility and hover comfort styles */
.users-icon-btn:focus-visible,
.users-pag-btn:focus-visible,
.users-search-input:focus-visible,
.users-filter-select:focus-visible,
.btn-erp:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

.data-table tbody tr {
    transition: background-color 0.15s ease-in-out;
}

/* ==========================================================================
   BANKING MODULE REDESIGN
   ========================================================================== */

/* Utility Alignment and Weight Classes */
.text-right {
    text-align: right !important;
}
.text-center {
    text-align: center !important;
}
.text-left {
    text-align: left !important;
}
.font-bold {
    font-weight: 700 !important;
}

/* Page Spacing adjustments */
.users-kpi-grid {
    margin-top: 24px;
    margin-bottom: 24px;
}

/* ERP Toolbar / Treasury Filter Bar styling */
.banking-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.banking-filter-bar__inputs {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-grow: 1;
    flex-wrap: wrap;
}

.banking-filter-bar__actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.banking-filter-bar .form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    min-width: 180px;
}

.banking-filter-bar .form-field label {
    font-size: 13px;
    color: var(--muted);
}

.banking-filter-bar select,
.banking-filter-bar input[type="date"],
.banking-filter-bar button {
    height: 42px !important;
    padding: 0 12px;
    font-size: 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.banking-filter-bar select,
.banking-filter-bar input[type="date"] {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    width: 100%;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.banking-filter-bar select:focus,
.banking-filter-bar input[type="date"]:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Banking Table Scroll Wrappers & heights */
.table-wrap {
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 12px;
}

.table-wrap--treasury {
    max-height: 500px;
}

.table-wrap--customer-invoices,
.table-wrap--vendor-invoices,
.table-wrap--recent-documents {
    max-height: 320px;
}

/* Custom Scrollbar styling */
.table-wrap::-webkit-scrollbar,
.timeline-scroll-wrap::-webkit-scrollbar,
.stack-list-scroll-wrap::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-wrap::-webkit-scrollbar-track,
.timeline-scroll-wrap::-webkit-scrollbar-track,
.stack-list-scroll-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.table-wrap::-webkit-scrollbar-thumb,
.timeline-scroll-wrap::-webkit-scrollbar-thumb,
.stack-list-scroll-wrap::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 999px;
}

[data-theme="dark"] .table-wrap::-webkit-scrollbar-thumb,
[data-theme="dark"] .timeline-scroll-wrap::-webkit-scrollbar-thumb,
[data-theme="dark"] .stack-list-scroll-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.table-wrap::-webkit-scrollbar-thumb:hover,
.timeline-scroll-wrap::-webkit-scrollbar-thumb:hover,
.stack-list-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Sticky Headers & Data Table Component */
.data-table--banking {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: start;
}

.data-table--banking thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 44px;
    padding: 0 12px;
    vertical-align: middle;
    background: var(--panel-alt);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.data-table--banking tbody td {
    height: 52px;
    padding: 0 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
}

/* Fixed height for treasury report rows */
.data-table--banking--treasury tbody td {
    height: 64px;
}

.data-table--banking tbody tr:hover {
    background: var(--table-hover) !important;
    transition: background-color 0.15s ease-in-out;
}

.data-table--banking tbody tr:nth-child(even) {
    background: var(--table-zebra);
}

.data-table--banking tbody tr:last-child td {
    border-bottom: 0;
}

/* Status badge and pill uniformity in banking */
.data-table--banking .status-pill,
.panel--fill .status-pill {
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Secondary Panels scrolling wraps */
.timeline-scroll-wrap,
.stack-list-scroll-wrap {
    max-height: 300px;
    overflow-y: auto;
    padding-inline-end: 8px;
}

/* Theme color variables mapping */
.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-primary {
    color: var(--primary) !important;
}

/* Treasury Report Row styling */
.row-opening-balance {
    background: var(--kpi-blue-bg) !important;
    font-weight: bold;
}

.row-movements {
    background: var(--panel-alt) !important;
    font-weight: bold;
}

.row-closing-balance {
    background: var(--primary) !important;
    color: #ffffff !important;
    font-weight: bold;
}

[data-theme="dark"] .row-closing-balance {
    color: #0f172a !important; /* contrast on primary */
}

/* ERP Form error highlighting */
.is-invalid {
    border-color: var(--danger) !important;
    background-color: var(--danger-soft) !important;
}

.is-invalid:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.form-field--has-error span {
    color: var(--danger) !important;
}

.erp-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: erp-spin 0.75s linear infinite;
}

@keyframes erp-spin {
    to { transform: rotate(360deg); }
}

/* Bill of Lading Search & Dimension Styling */
.input-with-button {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.input-with-button .invoice-line-input,
.input-with-button input {
    flex: 1;
    min-width: 0;
}

.input-with-button .icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    height: 38px;
    border-radius: 6px;
    flex-shrink: 0;
}

.button-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: erp-spin 0.6s linear infinite;
    display: inline-block;
}

.form-field__feedback {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.2;
}

.form-field__feedback--success {
    color: var(--success, #10b981);
}

.form-field__feedback--error {
    color: var(--danger, #b9473b);
}

.form-field__feedback--info {
    color: var(--muted, #64748b);
}

.dimension-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    width: 100%;
}

.dimension-cell select {
    flex: 1;
    min-width: 0;
}

.auto-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--success-soft, rgba(16, 185, 129, 0.15));
    color: var(--success, #10b981);
    font-size: 11px;
    font-weight: bold;
    flex-shrink: 0;
    line-height: 1;
}

/* ==========================================================================
   Meem ERP — Unified Mobile Card Architecture (Design System Standard)
   Desktop (>= 769px): Displays tables with 100% desktop fidelity.
   Mobile (<= 768px): Displays compact, touch-friendly record cards.
   ========================================================================== */

/* Universal Display Toggles */
.erp-mobile-card-list {
    display: none;
}

.erp-desktop-table {
    display: block;
    width: 100%;
}

@media (max-width: 768px) {
    .erp-desktop-table {
        display: none !important;
    }

    .erp-mobile-card-list {
        display: flex !important;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.25rem 0;
        width: 100%;
    }

    /* Mobile topbar layout: see design-system.css */

    /* Page Shell Spacing on Mobile */
    .page-shell {
        padding-inline: 12px !important;
        padding-block: 14px 28px !important;
    }

    /* Responsive Form & Toolbar Controls */
    .crm-toolbar__form,
    .banking-filter-bar__form {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.5rem !important;
    }

    .crm-toolbar__search,
    .crm-toolbar__select {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Status Pill Tabs Touch Scrolling */
    .crm-pill-tabs {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .crm-pill-tabs::-webkit-scrollbar {
        display: none;
    }

    .crm-pill-tab {
        flex-shrink: 0 !important;
    }
}

/* ==========================================================================
   Standard ERP Record Card (Leads-Style Design System)
   ========================================================================== */
.erp-record-card {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    position: relative;
    box-sizing: border-box;
}

.erp-record-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.erp-record-card--archived {
    opacity: 0.75;
    background: var(--surface-subtle, #f8fafc);
}

/* Header Row: ID + Badges */
.erp-record-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.erp-record-card__id {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--primary, #0284c7);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.erp-record-card__id a {
    color: inherit;
    text-decoration: none;
}

.erp-record-card__badges {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* Card Body / Title */
.erp-record-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-color, #1e293b);
    margin: 0;
    word-break: break-word;
}

.erp-record-card__title a {
    color: inherit;
    text-decoration: none;
}

.erp-record-card__title a:hover {
    color: var(--primary, #0284c7);
}

.erp-record-card__subtitle {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin-top: -0.25rem;
    word-break: break-word;
}

/* Entity / Customer Row */
.erp-record-card__entity {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.84rem;
    color: var(--text-color, #334155);
}

.erp-record-card__entity-code {
    font-family: monospace;
    font-size: 0.76rem;
    color: var(--text-muted, #64748b);
}

/* 2-Column Meta Grid */
.erp-record-card__meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.75rem;
    padding-top: 0.45rem;
    border-top: 1px dashed var(--border-color, #e2e8f0);
    font-size: 0.78rem;
}

.erp-record-card__meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.erp-record-card__meta-label {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.erp-record-card__meta-val {
    font-weight: 600;
    color: var(--text-color, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.erp-record-card__meta-val--amount {
    color: #10b981;
    font-weight: 700;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Card Footer / Actions */
.erp-record-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--border-color, #f1f5f9);
    margin-top: 0.15rem;
    flex-wrap: wrap;
}

.erp-record-card__footer-info {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

.erp-record-card__actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-inline-start: auto;
}

.erp-record-card__actions .button {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    min-height: 32px;
}

