@font-face {
    font-family: 'Speda';
    src: url('../fonts/Speda-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;
    --sidebar-width: 260px;
    --body-bg: #f0f2f5;
    --card-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --font-latin: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-rtl: "Speda", "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
    --bs-body-font-family: var(--font-rtl);
    --bs-font-sans-serif: var(--font-rtl);
}

* { box-sizing: border-box; }

.min-w-0 { min-width: 0; }

html {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-rtl);
    background: var(--body-bg);
    margin: 0;
    color: #1e293b;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
}

/* English / LTR: do not use Speda (it breaks Latin glyphs) */
html[dir="ltr"] body,
html[lang="en"] body,
body.is-ltr {
    font-family: var(--font-latin);
    --bs-body-font-family: var(--font-latin);
    --bs-font-sans-serif: var(--font-latin);
    letter-spacing: -0.011em;
}

html[dir="rtl"] body,
body.is-rtl {
    font-family: var(--font-rtl);
    --bs-body-font-family: var(--font-rtl);
    --bs-font-sans-serif: var(--font-rtl);
    letter-spacing: 0;
}

body.sidebar-open { overflow: hidden; }

button, input, select, textarea, .btn, .form-control, .form-select {
    font-family: inherit;
}

.money-wrap {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    white-space: nowrap;
}

.money-usd,
.money-iqd {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
}

.money-usd { color: #0f172a; }
.money-iqd { color: #64748b; font-size: 0.85em; font-weight: 500; }
.money-sep { color: #cbd5e1; font-weight: 500; }

.currency-flag {
    display: inline-block;
    object-fit: cover;
    flex-shrink: 0;
    vertical-align: middle;
}

.currency-flag-usd {
    border-radius: 999px;
}

.currency-flag-iqd {
    border-radius: 3px;
}

.currency-flag-xs { width: 14px; height: 14px; }
.currency-flag-sm { width: 18px; height: 18px; }
.currency-flag-md { width: 22px; height: 22px; }
.currency-flag-lg { width: 28px; height: 28px; }

.currency-input-flag {
    width: 18px;
    height: 18px;
}

td .money-wrap, .stat-value .money-wrap { display: inline-flex; }
.stat-value .money-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}
.stat-value .money-sep { display: none; }
.stat-value .money-iqd {
    display: inline-flex;
    font-size: 0.75rem;
    margin-top: 0.05rem;
}
.currency-sync-group .input-group-text { min-width: 48px; justify-content: center; }

/* Login */
.login-page {
    position: relative;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 45%, #f1f5f9 100%);
    color: #0f172a;
}

.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 2.25rem 2rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.login-card-top {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo {
    width: 68px;
    height: 68px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.login-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.login-card-top h1 {
    margin: 0 0 0.4rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.login-card-top p {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
}

.login-field {
    margin-bottom: 1.1rem;
}

.login-field label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap i {
    position: absolute;
    top: 50%;
    right: 0.95rem;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
}

.login-input-wrap .form-control {
    height: 48px;
    padding-right: 2.75rem;
    padding-left: 1rem;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-input-wrap .form-control:focus {
    background: #fff;
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.875rem;
    line-height: 1.5;
}

.login-alert i {
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.login-submit {
    width: 100%;
    height: 48px;
    margin-top: 0.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.34);
}

.login-submit:active {
    transform: translateY(0);
}

.login-footer-note {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #eef2f7;
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; }

.app-sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: #cbd5e1;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    height: 100vh;
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-top {
    padding: 0.9rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0f172a;
}

.sidebar-brand {
    padding: 0.35rem 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
}

.sidebar-brand:hover {
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
}

.sidebar-brand:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(96, 165, 250, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-icon i { font-size: 1.15rem; color: #60a5fa; }

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
    line-height: 1.25;
}

.sidebar-brand-text strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
}

.sidebar-brand-text small {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
}

.sidebar-user-chip {
    margin-top: 0.55rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.55rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.sidebar-user-meta strong {
    font-size: 0.84rem;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-meta small {
    font-size: 0.7rem;
    color: #94a3b8;
}

.sidebar-nav.sidebar-list {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-nav .nav-link:hover {
    background: #1e293b;
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.sidebar-nav .nav-link i {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    opacity: 0.95;
}

.app-content {
    flex: 1;
    margin-right: 0;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.app-wrapper.no-sidebar .app-sidebar,
.app-wrapper.no-sidebar .sidebar-overlay {
    display: none !important;
}

.header-home-btn {
    color: #334155;
    padding: 0.15rem 0.35rem;
    text-decoration: none;
    border-radius: 10px;
}

.header-home-btn:hover {
    color: #2563eb;
    background: #eff6ff;
}

.header-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    min-width: 0;
    grid-column: 3;
}

.header-lang {
    position: relative;
}

.header-theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    line-height: 1;
    font-size: 1.15rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

.header-theme-btn:hover,
.header-theme-btn:focus {
    border-color: #bfdbfe;
    background: #f8fbff;
    color: #1d4ed8;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.header-theme-btn .theme-icon-sun { display: none; color: #fbbf24; }
.header-theme-btn .theme-icon-moon { display: inline-block; color: #6366f1; }

.header-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.header-lang-btn:hover,
.header-lang-btn:focus,
.header-lang-btn.show {
    border-color: #bfdbfe;
    background: #f8fbff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.header-lang-btn::after {
    display: none;
}

.header-lang-flag {
    width: 26px;
    height: 18px;
    border-radius: 5px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f1f5f9;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
}

.header-lang-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header-lang-menu {
    min-width: 13.5rem;
    border-radius: 16px;
    border-color: #e2e8f0;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    padding: 0.45rem;
    margin-top: 0.45rem !important;
}

.header-lang-menu-head {
    padding: 0.45rem 0.7rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.header-lang-item {
    display: flex !important;
    align-items: center;
    gap: 0.7rem;
    border-radius: 12px !important;
    padding: 0.55rem 0.65rem !important;
    font-weight: 600;
}

.header-lang-item-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}

.header-lang-item-text strong {
    font-size: 0.88rem;
    color: #0f172a;
}

.header-lang-item-text small {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
}

.header-lang-check {
    color: #2563eb;
    font-size: 1rem;
}

.header-lang-menu .dropdown-item.active,
.header-lang-menu .dropdown-item:active {
    background: #eff6ff;
    color: #1d4ed8;
}

.header-lang-menu .dropdown-item:hover {
    background: #f8fafc;
}

.login-lang {
    position: absolute;
    top: 1rem;
    inset-inline-end: 1rem;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 3px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.header-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 10px;
}

.header-logo:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
}

.app-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-start {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    grid-column: 1;
}

.header-center {
    grid-column: 2;
    justify-self: center;
}

.header-title {
    flex: 1;
    min-width: 0;
}

.header-title h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-rate {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    max-width: 100%;
}

.header-rate-widget {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 42px;
    max-width: 100%;
    padding: 0.28rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px rgba(15, 23, 42, 0.03);
    color: #0f172a;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

a.header-rate-widget:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
    color: #0f172a;
}

.header-rate-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.35rem 0.55rem;
    border-radius: 10px;
}

.header-rate-cell-usd {
    background: linear-gradient(180deg, #fffbeb 0%, #fefce8 100%);
}

.header-rate-cell-iqd {
    background: linear-gradient(180deg, #ecfdf5 0%, #f0fdf4 100%);
}

.header-rate-flag {
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.header-rate-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    min-width: 0;
}

.header-rate-code {
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    color: #94a3b8;
}

.header-rate-amount {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #0f172a;
    white-space: nowrap;
}

.header-rate-cell-usd .header-rate-amount {
    color: #92400e;
}

.header-rate-cell-iqd .header-rate-amount {
    color: #065f46;
}

.header-rate-unit {
    font-size: 0.68rem;
    font-weight: 700;
    color: #059669;
}

.header-rate-bridge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.68rem;
    flex-shrink: 0;
}

.header-rate-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-inline-start: 0.15rem;
    margin-inline-end: 0.2rem;
    border-radius: 8px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #2563eb;
    font-size: 0.82rem;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

a.header-rate-widget:hover .header-rate-edit {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    transform: scale(1.04);
}

.header-user { position: relative; }

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.55rem 0.35rem 0.45rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.user-menu-trigger:hover,
.user-menu-trigger.show {
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.user-menu-trigger::after { display: none; }

.user-avatar,
.user-dropdown-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.user-avatar-admin,
.user-dropdown-avatar.user-avatar-admin {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.user-avatar-cashier,
.user-dropdown-avatar.user-avatar-cashier {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    min-width: 0;
    text-align: right;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.1rem;
}

.user-menu-chevron {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-inline-start: 0.15rem;
}

.user-dropdown-menu {
    min-width: 240px;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.user-dropdown-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
}

.user-dropdown-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-dropdown-info strong {
    font-size: 0.9rem;
    color: #0f172a;
}

.user-dropdown-info small {
    color: #64748b;
    font-size: 0.78rem;
    direction: ltr;
    text-align: left;
}

.user-dropdown-menu .dropdown-divider {
    margin: 0.35rem 0;
}

.user-dropdown-logout {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    color: #dc2626;
    font-weight: 600;
}

.user-dropdown-logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

@media (max-width: 575.98px) {
    .user-meta { display: none; }
    .user-menu-trigger { padding: 0.35rem; border-radius: 50%; }
    .user-menu-chevron { display: none; }
}

.sidebar-toggle { color: #334155; padding: 0; }

.app-main {
    flex: 1;
    padding: 1.5rem max(1.5rem, env(safe-area-inset-right)) 1.5rem max(1.5rem, env(safe-area-inset-left));
}

.app-footer {
    margin-top: auto;
    flex-shrink: 0;
    padding: 1rem max(1.5rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
    border-top: 1px solid #e2e8f0;
    background: #fff;
    text-align: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

/* Cards & Stats */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    border: 1px solid #e2e8f0;
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.stat-card .stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 0.85rem;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
}

.bg-primary-soft { background: #dbeafe; color: #2563eb; }
.bg-success-soft { background: #dcfce7; color: #16a34a; }
.bg-danger-soft { background: #fee2e2; color: #dc2626; }
.bg-warning-soft { background: #fef3c7; color: #d97706; }
.bg-info-soft { background: #e0f2fe; color: #0284c7; }
.bg-purple-soft { background: #ede9fe; color: #7c3aed; }

/* Dashboard */
/* ===== Home menu (flat card grid) ===== */
.home-menu-page {
    max-width: 1280px;
    margin: 0 auto;
}

.home-menu-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding: 1.15rem 1.35rem;
    border-radius: 20px;
    background:
        radial-gradient(520px 140px at 100% 0%, rgba(37, 99, 235, 0.08), transparent 60%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 12px 32px rgba(15, 23, 42, 0.06);
    position: relative;
    overflow: hidden;
}

.home-menu-topbar::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 45%, #38bdf8 100%);
}

.home-menu-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.home-menu-brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background: transparent;
    box-shadow:
        0 10px 22px rgba(37, 99, 235, 0.28),
        0 0 0 4px rgba(37, 99, 235, 0.08);
}

.home-menu-brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.home-menu-brand-text {
    min-width: 0;
}

.home-menu-brand-kicker {
    display: inline-block;
    margin-bottom: 0.2rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.home-menu-brand-text h1 {
    margin: 0;
    font-size: clamp(1.28rem, 2.2vw, 1.7rem);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.home-menu-brand-text p {
    margin: 0.28rem 0 0;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 600;
}

.home-menu-meta {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.home-menu-meta-chip,
.home-menu-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.6rem 0.85rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(6px);
}

.home-menu-meta-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    font-size: 1rem;
    flex-shrink: 0;
}

.home-menu-meta-chip > div,
.home-menu-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.home-menu-meta-chip strong,
.home-menu-user-text strong {
    font-size: 0.94rem;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.home-menu-meta-chip small,
.home-menu-user-text small {
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-menu-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1e3a8a);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px #eff6ff;
}

.home-menu-user-status {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px #dcfce7;
    flex-shrink: 0;
    align-self: center;
}

.home-menu-sections {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.home-menu-section {
    padding: 1rem 1.05rem 1.15rem;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.home-menu-section-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.95rem;
}

.home-menu-section-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex: 0 0 auto;
}

.home-menu-section-shop .home-menu-section-icon {
    background: #eff6ff;
    color: #2563eb;
}

.home-menu-section-construction .home-menu-section-icon {
    background: #f0fdfa;
    color: #0f766e;
}

.home-menu-section-system .home-menu-section-icon {
    background: #f8fafc;
    color: #475569;
}

.home-menu-section-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    color: #0f172a;
}

.home-menu-section-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    color: #64748b;
}

.home-menu-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.85rem;
}

.home-menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 118px;
    padding: 1rem 0.65rem;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 16px;
    text-decoration: none;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.home-menu-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    color: #0f172a;
    background: #f8fbff;
}

.home-menu-card.active {
    border-width: 2px;
    background: #e7f1ff;
}

.home-menu-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #0f172a;
}

.home-menu-card-icon i {
    font-size: 1.35rem;
    line-height: 1;
    color: inherit;
}

.home-menu-card-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    color: #1e293b;
}

.home-menu-card.tone-blue { border-color: #60a5fa; }
.home-menu-card.tone-orange { border-color: #fb923c; }
.home-menu-card.tone-purple { border-color: #c084fc; }
.home-menu-card.tone-teal { border-color: #2dd4bf; }
.home-menu-card.tone-green { border-color: #4ade80; }
.home-menu-card.tone-pink { border-color: #f472b6; }
.home-menu-card.tone-amber { border-color: #fbbf24; }
.home-menu-card.tone-cyan { border-color: #22d3ee; }
.home-menu-card.tone-indigo { border-color: #818cf8; }
.home-menu-card.tone-rose { border-color: #fb7185; }
.home-menu-card.tone-sky { border-color: #38bdf8; }
.home-menu-card.tone-lime { border-color: #a3e635; }

.home-menu-card.tone-blue .home-menu-card-icon { background: #eff6ff; color: #2563eb; }
.home-menu-card.tone-orange .home-menu-card-icon { background: #fff7ed; color: #ea580c; }
.home-menu-card.tone-purple .home-menu-card-icon { background: #f5f3ff; color: #7c3aed; }
.home-menu-card.tone-teal .home-menu-card-icon { background: #f0fdfa; color: #0d9488; }
.home-menu-card.tone-green .home-menu-card-icon { background: #f0fdf4; color: #16a34a; }
.home-menu-card.tone-pink .home-menu-card-icon { background: #fdf2f8; color: #db2777; }
.home-menu-card.tone-amber .home-menu-card-icon { background: #fffbeb; color: #d97706; }
.home-menu-card.tone-cyan .home-menu-card-icon { background: #ecfeff; color: #0891b2; }
.home-menu-card.tone-indigo .home-menu-card-icon { background: #eef2ff; color: #4f46e5; }
.home-menu-card.tone-rose .home-menu-card-icon { background: #fff1f2; color: #e11d48; }
.home-menu-card.tone-sky .home-menu-card-icon { background: #f0f9ff; color: #0284c7; }
.home-menu-card.tone-lime .home-menu-card-icon { background: #f7fee7; color: #65a30d; }

.home-menu-stats-toggle {
    display: flex;
    justify-content: center;
    margin: 1.25rem 0 0.5rem;
}

.home-menu-stats {
    margin-top: 0.75rem;
}

@media (max-width: 1199.98px) {
    .home-menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .home-menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
    .home-menu-card { min-height: 100px; }
    .home-menu-topbar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.95rem 1rem;
    }
    .home-menu-meta {
        width: 100%;
    }
    .home-menu-meta-chip,
    .home-menu-user {
        flex: 1;
        min-width: 0;
    }
}

.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.5rem;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.22);
}

.dashboard-hero-label {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    color: #bfdbfe;
}

.dashboard-hero-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
}

.dashboard-hero-date {
    margin: 0.35rem 0 0;
    color: #cbd5e1;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}

.dashboard-hero-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.15rem;
    border-radius: 12px;
    background: #fff;
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.dashboard-hero-action:hover {
    color: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
}

.dashboard-hero-action-debts {
    background: #f5f3ff;
    color: #6d28d9;
}

.dashboard-hero-action-debts:hover {
    color: #5b21b6;
    background: #ede9fe;
}

.dashboard-hero-action-products {
    background: #ecfeff;
    color: #0e7490;
}

.dashboard-hero-action-products:hover {
    color: #155e75;
    background: #cffafe;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-page .stat-card-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-page .stat-card .stat-value {
    margin-top: 1rem;
}

.dashboard-debt-value .money-usd,
.dashboard-debt-value .money-iqd { color: #7c3aed; }

.dashboard-quick-links {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1rem 1.15rem 1.15rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.dashboard-quick-links-head h3 {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.dashboard-quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 0.75rem;
}

.dashboard-quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 96px;
    padding: 0.85rem 0.65rem;
    border-radius: 14px;
    border: 1px solid #e8edf4;
    background: #fafbfd;
    text-decoration: none;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-quick-link:hover {
    transform: translateY(-2px);
    background: #fff;
    border-color: #cbd5e1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.dashboard-quick-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.dashboard-quick-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.35;
}

.dashboard-quick-link-blue .dashboard-quick-icon { background: #eff6ff; color: #2563eb; }
.dashboard-quick-link-slate .dashboard-quick-icon { background: #f1f5f9; color: #475569; }
.dashboard-quick-link-amber .dashboard-quick-icon { background: #fffbeb; color: #d97706; }
.dashboard-quick-link-indigo .dashboard-quick-icon { background: #eef2ff; color: #4f46e5; }
.dashboard-quick-link-teal .dashboard-quick-icon { background: #f0fdfa; color: #0d9488; }
.dashboard-quick-link-purple .dashboard-quick-icon { background: #f5f3ff; color: #7c3aed; }
.dashboard-quick-link-cyan .dashboard-quick-icon { background: #ecfeff; color: #0891b2; }
.dashboard-quick-link-green .dashboard-quick-icon { background: #f0fdf4; color: #16a34a; }
.dashboard-quick-link-pink .dashboard-quick-icon { background: #fdf2f8; color: #db2777; }
.dashboard-quick-link-red .dashboard-quick-icon { background: #fef2f2; color: #dc2626; }
.dashboard-quick-link-orange .dashboard-quick-icon { background: #fff7ed; color: #ea580c; }

.dashboard-notice {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem;
    border-radius: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.dashboard-notice i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.dashboard-notice div {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-panels {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1rem;
}

.dashboard-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.dashboard-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.dashboard-panel-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.dashboard-panel-title h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.dashboard-panel-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}

.dashboard-panel-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
}

.dashboard-panel-icon-warning {
    background: #fffbeb;
    color: #d97706;
}

.dashboard-panel-link {
    font-size: 0.82rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-panel-link:hover { color: #1d4ed8; }

.dashboard-panel-body { padding: 0; }

.dashboard-recent-sales {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.75rem;
}

.dash-sale-item {
    display: block;
    padding: 0.75rem 0.85rem;
    border: 1px solid #e8edf4;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.dash-sale-item:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
    color: inherit;
}

.dash-sale-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.dash-sale-invoice {
    font-size: 0.88rem;
    font-weight: 800;
    color: #1e40af;
    word-break: break-word;
    text-decoration: none;
}

.dash-sale-invoice:hover {
    color: #1d4ed8;
}

.dash-sale-total {
    flex-shrink: 0;
    direction: ltr;
    text-align: left;
    font-size: 0.86rem;
    color: #0f172a;
    white-space: nowrap;
}

.dash-sale-total .money-iqd {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
}

.dash-sale-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
    font-size: 0.76rem;
    color: #64748b;
}

.dash-sale-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.dash-sale-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #15803d;
    text-decoration: none;
    font-weight: 700;
}

.dash-sale-phone:hover {
    color: #166534;
    text-decoration: underline;
}

.dashboard-table th {
    background: #fff;
    border-bottom: 1px solid #eef2f7;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.dashboard-table td {
    vertical-align: middle;
    border-bottom: 1px solid #f8fafc;
}

.dashboard-invoice-link {
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.dashboard-invoice-link:hover { color: #1d4ed8; }

.payment-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.payment-pill-cash {
    background: #dcfce7;
    color: #15803d;
}

.payment-pill-credit {
    background: #fef3c7;
    color: #b45309;
}

.payment-pill-bank,
.payment-pill-other {
    background: #e2e8f0;
    color: #475569;
}

.dashboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 220px;
    padding: 2rem 1rem;
    text-align: center;
    color: #94a3b8;
}

.dashboard-empty i { font-size: 2rem; opacity: 0.75; }
.dashboard-empty p { margin: 0; font-size: 0.92rem; }

.dashboard-empty-success { color: #16a34a; }
.dashboard-empty-success i { color: #22c55e; }

/* Responsive */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(100%); }
    .app-sidebar.show { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .app-content { margin-right: 0; }
    .pos-page {
        margin: 0;
        min-width: 0;
    }
    .pos-container {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    .pos-results-list {
        max-height: min(36vh, 280px);
        min-height: 0;
    }
    .pos-category-bar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    .dashboard-panels { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
    .dashboard-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-hero-actions {
        justify-content: stretch;
    }

    .dashboard-hero-action {
        justify-content: center;
        flex: 1 1 calc(50% - 0.35rem);
    }

    .dashboard-stats-grid { grid-template-columns: 1fr; }

    .dashboard-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-quick-links-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .dashboard-quick-link {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        min-height: 54px;
        padding: 0.65rem 0.7rem;
        gap: 0.6rem;
        text-align: start;
    }

    .dashboard-quick-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .dashboard-quick-label {
        font-size: 0.74rem;
        line-height: 1.25;
    }

    .dashboard-quick-links {
        padding: 0.85rem 0.85rem 0.95rem;
    }

    .content-card .card-header-custom {
        flex-direction: column;
        align-items: stretch;
    }

    .content-card .card-header-custom > .d-flex,
    .content-card .card-header-custom > form,
    .content-card .card-header-custom > .toolbar-search-form,
    .content-card .card-header-custom > .row,
    .content-card .card-header-custom > .card-header-actions {
        width: 100%;
    }

    .toolbar-search-form,
    .toolbar-search-input {
        max-width: none;
        width: 100%;
    }

    .card-header-actions {
        width: 100%;
    }

    .card-header-actions .btn,
    .content-card .card-header-custom > .btn {
        flex: 1 1 auto;
    }

    .invoice-box {
        padding: 1.25rem;
    }

    .pos-search-input,
    .form-control,
    .form-select {
        font-size: 16px;
    }

    .pos-qty-control button {
        width: 36px;
        height: 36px;
    }

    .pos-page .pos-panel-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .pos-search-wrap {
        margin-bottom: 0.75rem;
    }

    .pos-cart-head,
    .pos-cart-foot,
    .pos-cart-body {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }
}

@media (max-width: 575.98px) {
    .app-main {
        padding: 1rem max(1rem, env(safe-area-inset-right)) 1rem max(1rem, env(safe-area-inset-left));
    }

    .app-header {
        padding-top: max(0.65rem, env(safe-area-inset-top));
        gap: 0.55rem;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
    }

    .header-start {
        grid-column: 1;
        grid-row: 1;
        gap: 0.55rem;
    }

    .header-end {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-end;
    }

    .header-center {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: center;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .header-rate {
        max-width: 100%;
    }

    .header-rate-widget {
        gap: 0.28rem;
        min-height: 40px;
        padding: 0.24rem;
    }

    .header-rate-cell {
        padding: 0.3rem 0.45rem;
        gap: 0.35rem;
    }

    .header-rate-code {
        display: none;
    }

    .header-rate-amount {
        font-size: 0.82rem;
    }

    .header-rate-unit {
        font-size: 0.62rem;
    }

    .header-rate-bridge {
        width: 22px;
        height: 22px;
        font-size: 0.62rem;
    }

    .header-rate-edit {
        width: 26px;
        height: 26px;
        font-size: 0.78rem;
    }

    .header-title h1 {
        font-size: 1rem;
    }

    .stat-card .stat-value { font-size: 1.25rem; }

    .dashboard-stats-grid { grid-template-columns: 1fr; }

    .dashboard-hero-action {
        flex: 1 1 100%;
    }

    .content-card .card-body-custom {
        padding: 1rem;
    }

    .table-responsive .table {
        font-size: 0.82rem;
    }

    .table-responsive .table th,
    .table-responsive .table td {
        padding: 0.55rem 0.65rem;
    }

    .table-responsive .btn-sm {
        padding: 0.35rem 0.55rem;
    }

    .pos-cart-item-bottom {
        flex-wrap: wrap;
    }

    .pos-product-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .pos-product-price {
        text-align: right;
    }

    .pos-page {
        margin: 0;
    }

    .pos-panel,
    .pos-cart {
        border-radius: 16px;
    }

    .pos-results-list {
        min-height: 0;
        max-height: min(40vh, 260px);
    }

    .login-card {
        padding: 1.75rem 1.25rem;
        border-radius: 18px;
    }

    .login-section {
        padding: 1rem;
        align-items: flex-start;
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    .no-print.d-flex,
    .no-print.d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .no-print.d-flex .btn {
        flex: 1 1 calc(50% - 0.25rem);
    }
}

.content-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e2e8f0;
}

.content-card .card-header-custom {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.content-card .card-body-custom { padding: 1.25rem; }

.toolbar-search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.toolbar-search-input {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 280px;
}

.card-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.btn,
.form-control,
.form-select,
.nav-link,
.pos-toggle-btn,
.pos-product-item,
.pos-qty-control button {
    touch-action: manipulation;
}

.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border-bottom-width: 1px;
}

.badge-stock-low { background: #fef3c7; color: #b45309; }
.badge-stock-ok { background: #dcfce7; color: #15803d; }
.badge-stock-out { background: #fee2e2; color: #b91c1c; }

/* POS */
.pos-page {
    margin: 0;
    min-width: 0;
    overflow-x: hidden;
}

.pos-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 0.85rem;
    align-items: start;
}

.pos-cart-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 96px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.pos-cart-column .pos-cart,
.pos-cart-column .pos-cart-checkout {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.pos-products { min-width: 0; }

.pos-products .pos-search-wrap {
    margin-bottom: 0.65rem;
}

.pos-search-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.pos-search-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
}

.pos-products .pos-search-input {
    height: 46px;
    padding: 0 2.75rem 0 0.85rem;
    border-radius: 12px;
    font-size: 0.92rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.pos-search-input {
    width: 100%;
    height: 54px;
    padding: 0 3rem 0 1rem;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #fff;
    font-size: 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pos-search-input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.pos-panel,
.pos-cart {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.pos-panel {
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.pos-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.pos-panel-head h2 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}

.pos-panel-hint {
    font-size: 0.72rem;
    color: #94a3b8;
}

.pos-results-list {
    min-height: 0;
    max-height: min(320px, calc(100vh - 340px));
    overflow-y: auto;
    transition: opacity 0.15s ease;
}

.pos-results-list.is-loading {
    opacity: 0.72;
    pointer-events: none;
    position: relative;
}

.pos-results-list.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0.75));
    pointer-events: none;
}

.pos-category-bar {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.pos-category-chip {
    flex: 0 0 auto;
    border: 1px solid #dbe3ee;
    background: #f8fafc;
    color: #475569;
    border-radius: 999px;
    padding: 0.32rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pos-category-chip:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.pos-category-chip.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

.pos-category-group + .pos-category-group {
    border-top: 1px solid #eef2f7;
}

.pos-category-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 2;
}

.pos-category-head i {
    color: #2563eb;
}

.pos-category-head em {
    margin-right: auto;
    font-style: normal;
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
}

.pos-product-info span {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    color: #64748b;
    font-size: 0.72rem;
}

.pos-product-category {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
}

.pos-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 120px;
    padding: 1.25rem 1rem;
    text-align: center;
    color: #94a3b8;
}

.pos-empty-state i {
    font-size: 1.5rem;
    opacity: 0.7;
}

.pos-empty-state p {
    margin: 0;
    font-size: 0.85rem;
}

.pos-empty-state-sm {
    min-height: 160px;
    padding: 1.5rem 1rem;
}

.pos-empty-state-sm i { font-size: 1.5rem; }

.pos-product-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    text-align: right;
    transition: background 0.15s ease;
}

.pos-product-item:hover {
    background: #f8fafc;
}

.pos-product-info {
    min-width: 0;
    flex: 1;
}

.pos-product-info strong {
    display: block;
    color: #0f172a;
    font-size: 0.86rem;
    margin-bottom: 0.1rem;
}

.pos-product-price {
    text-align: left;
    flex-shrink: 0;
}

.pos-product-price strong {
    display: block;
    color: #2563eb;
    font-size: 0.88rem;
}

.pos-product-price small {
    display: block;
    color: #64748b;
    font-size: 0.68rem;
    margin-top: 0.1rem;
}

.pos-cart {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    background: #fff;
    overflow: hidden;
}

.pos-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.pos-cart-head-title {
    min-width: 0;
}

.pos-cart-head-title h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.pos-cart-count {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.74rem;
    color: #64748b;
}

.pos-cart-clear {
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pos-cart-clear:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #ef4444;
}

.pos-cart-body {
    padding: 0.65rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 72px;
    background: #f8fafc;
}

.pos-cart-foot {
    padding: 0.75rem;
    border-top: 1px solid #eef2f7;
    background: #fff;
    flex: 0 0 auto;
    overflow: visible;
}

.pos-cart-header,
.pos-cart-footer {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
    font-weight: 700;
    font-size: 0.95rem;
}

.pos-cart-footer {
    border-bottom: 0;
    border-top: 1px solid #eef2f7;
    background: #fff;
    font-weight: 400;
}

.pos-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 120px;
    padding: 1.25rem 0.75rem;
    text-align: center;
    color: #94a3b8;
}

.pos-cart-empty i {
    font-size: 1.5rem;
    color: #cbd5e1;
}

.pos-cart-empty p {
    margin: 0;
    font-size: 0.84rem;
}

.pos-cart-item {
    padding: 0.85rem;
    margin-bottom: 0.65rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e8edf4;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.pos-cart-item:last-child { margin-bottom: 0; }

.pos-cart-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.pos-cart-item-info { min-width: 0; flex: 1; }

.pos-cart-item-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.pos-cart-item-price {
    margin-top: 0.2rem;
    font-size: 0.74rem;
    color: #64748b;
}

.pos-cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.pos-cart-item-total {
    text-align: left;
}

.pos-cart-item-total strong {
    display: block;
    font-size: 0.92rem;
    color: #2563eb;
}

.pos-cart-item-total small {
    display: block;
    color: #64748b;
    font-size: 0.7rem;
}

.pos-qty-control {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.pos-qty-control button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.pos-qty-control button:hover {
    background: #eff6ff;
    color: #2563eb;
}

.pos-qty-control span {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 0.88rem;
}

.pos-cart-remove {
    border: 0;
    background: #fef2f2;
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.pos-cart-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

.pos-cart-settings {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.pos-cart-settings .pos-cart-checkout {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 1px solid #eef2f7;
    background: transparent;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
}

.pos-setting-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pos-setting-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.pos-seg {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.25rem;
    border-radius: 10px;
    background: #f1f5f9;
}

.pos-customer-debt {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.74rem;
    font-weight: 600;
}

.pos-customer-debt i { flex-shrink: 0; }
.posx-balance-hint {
    display: block;
    padding: 0.45rem;
    border-color: #dbe3ee;
    background: #f8fafc;
    color: #334155;
}
.posx-balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 0.35rem;
}
.posx-balance-metric {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.4rem 0.45rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
}
.posx-balance-metric em {
    font-style: normal;
    font-size: 0.64rem;
    font-weight: 700;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.posx-balance-metric strong {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: #0f172a;
}
.posx-balance-metric .money-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.04rem;
    white-space: normal;
}
.posx-balance-metric .money-sep { display: none; }
.posx-balance-metric .money-usd {
    font-size: 0.78rem;
    font-weight: 800;
    color: inherit;
}
.posx-balance-metric .money-iqd {
    font-size: 0.62rem;
    font-weight: 650;
    color: #94a3b8;
}
.posx-balance-metric.is-in .money-usd { color: #15803d; }
.posx-balance-metric.is-out .money-usd { color: #b91c1c; }
.posx-balance-metric.is-balance .money-usd { color: #0f766e; }

.pos-select-sm {
    height: 36px;
    border-radius: 10px;
    border-color: #dbe3ee;
    background: #fff;
    font-size: 0.84rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.pos-credit-row {
    gap: 0;
}

.pos-credit-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
    border: 1px solid #fde68a;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.08);
}

.pos-credit-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.pos-credit-head-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fef3c7;
    color: #d97706;
    font-size: 1rem;
    flex-shrink: 0;
}

.pos-credit-head-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.pos-credit-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #92400e;
    line-height: 1.2;
}

.pos-credit-subtitle {
    font-size: 0.68rem;
    font-weight: 600;
    color: #b45309;
}

.pos-credit-card .currency-sync-group {
    direction: ltr;
}

.pos-credit-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.pos-credit-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.pos-credit-input-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.pos-credit-input-wrap .pos-money-input-sm {
    width: 100%;
    min-width: 0;
}

.pos-credit-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.pos-credit-stat {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    min-width: 0;
}

.pos-credit-stat-paid {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
}

.pos-credit-stat-debt {
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.pos-credit-stat-label {
    font-size: 0.64rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1.2;
}

.pos-credit-stat-paid .pos-credit-stat-label {
    color: #047857;
}

.pos-credit-stat-debt .pos-credit-stat-label {
    color: #c2410c;
}

.pos-credit-stat-value {
    min-height: 2.35rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #0f172a;
    direction: ltr;
    text-align: left;
    line-height: 1.35;
}

.money-compact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
}

.money-compact-usd {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
}

.money-compact-iqd {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
}

.pos-credit-stat-paid .money-compact-usd {
    color: #047857;
}

.pos-credit-stat-debt .money-compact-usd {
    color: #c2410c;
}

.pos-cart-total {
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e8edf4;
}

.pos-checkout-rows {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.pos-checkout-row {
    display: grid;
    grid-template-columns: minmax(4.5rem, 34%) minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
}

.pos-checkout-label {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    line-height: 1.2;
}

.pos-checkout-control {
    min-width: 0;
}

.pos-checkout-total-value {
    direction: ltr;
    text-align: left;
    color: #2563eb;
    font-weight: 800;
}

.pos-checkout-total-value .money-wrap {
    justify-content: flex-start;
    gap: 0.25rem;
    font-size: 0.92rem;
}

.pos-checkout-total-value .money-usd,
.pos-checkout-total-value .money-iqd {
    font-size: inherit;
}

.pos-checkout-row .pos-money-input-sm {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.pos-grand-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
}

.pos-grand-total strong {
    color: #2563eb;
    font-size: 1.2rem;
    direction: ltr;
    text-align: left;
}

.pos-total-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    margin-top: 0.45rem;
    font-size: 0.76rem;
    color: #64748b;
}

.pos-total-meta .pos-rate-note {
    width: auto;
    margin-top: 0;
    justify-content: flex-start;
}

.pos-discount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-top: 0.45rem;
}

.pos-discount-field {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 600;
    color: #64748b;
    flex-shrink: 0;
}

.pos-discount-row .pos-money-input-sm {
    width: auto;
    min-width: 110px;
    flex: 0 1 130px;
}

.pos-cart-checkout {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex-shrink: 0;
    padding: 0.75rem;
    background: #fff;
    border-top: 1px solid #eef2f7;
}

.pos-cart-checkout .pos-alert {
    margin: 0;
    padding: 0.7rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
}

.pos-cart-checkout .pos-alert span {
    flex: 1;
    min-width: 0;
}

.pos-rate-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 0.68rem;
    color: #94a3b8;
}

.pos-money-input {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.45rem 0.65rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #dbe3ee;
    direction: ltr;
}

.pos-money-input-xs {
    min-width: 88px;
    padding: 0.2rem 0.45rem;
}

.pos-money-input-xs .form-control {
    height: 24px;
    font-size: 0.82rem;
}

.pos-money-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pos-money-input .form-control {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    height: 32px;
    min-width: 0;
    flex: 1;
    text-align: left;
    direction: ltr;
    font-size: 0.95rem;
    font-weight: 700;
}

.pos-money-input-sm {
    min-width: 110px;
    padding: 0.3rem 0.5rem;
}

.pos-money-input-sm .form-control {
    height: 28px;
    font-size: 0.86rem;
}

.pos-money-input .form-control:focus {
    box-shadow: none;
}

.pos-field-group {
    margin-bottom: 0.9rem;
}

.pos-field-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
}

.pos-select,
.pos-discount-field .form-control {
    height: 42px;
    border-radius: 10px;
    border-color: #dbe3ee;
    background: #fff;
    font-size: 0.88rem;
}

.pos-toggle-group,
.pos-seg {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.25rem;
    border-radius: 10px;
    background: #f1f5f9;
}

.pos-toggle-group {
    gap: 0.5rem;
    padding: 0.35rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.pos-toggle {
    display: block;
    margin: 0;
    min-width: 0;
    cursor: pointer;
}

.pos-toggle input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pos-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    min-height: 34px;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.pos-toggle-group .pos-toggle-btn {
    min-height: 40px;
    border: 1px solid #dbe3ee;
    background: #fff;
    border-radius: 10px;
    font-size: 0.82rem;
}

.pos-seg .pos-toggle:hover .pos-toggle-btn {
    color: #334155;
}

.pos-seg input:checked + .pos-toggle-btn {
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.pos-seg input[name="saleType"]:checked + .pos-toggle-btn {
    color: #1d4ed8;
}

.pos-seg .pos-toggle-cash input:checked + .pos-toggle-btn {
    color: #15803d;
}

.pos-seg .pos-toggle-credit input:checked + .pos-toggle-btn {
    color: #b45309;
}

.pos-toggle input:focus-visible + .pos-toggle-btn {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.pos-field-required .pos-select-sm {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.pos-field-required .pos-setting-label::after {
    content: ' *';
    color: #d97706;
}

.pos-field-error .pos-select-sm {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.pos-field-error .pos-setting-label {
    color: #b91c1c;
}

.pos-complete-btn {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.pos-complete-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.34);
}

.pos-complete-btn:disabled {
    box-shadow: none;
    opacity: 0.55;
}

.pos-alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
}

.pos-alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.pos-alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
}

/* Invoice print */
@media print {
    .app-sidebar, .app-header, .app-footer, .no-print, .sidebar-overlay { display: none !important; }
    .app-content { margin-right: 0 !important; margin-left: 0 !important; }
    .app-main { padding: 0 !important; }
    body { background: #fff; }

    .invoice-items-table thead {
        display: table-header-group !important;
    }

    .invoice-items-table tbody tr,
    .invoice-items-table tfoot tr {
        display: table-row !important;
    }

    .invoice-items-table tbody td,
    .invoice-items-table tfoot td {
        display: table-cell !important;
    }

    .invoice-items-table tbody td::before {
        content: none !important;
    }

    .invoice-items-table tbody td:first-child {
        display: table-cell !important;
    }

    .content-card {
        box-shadow: none !important;
        border: 0 !important;
    }

    .invoice-box {
        max-width: none;
        padding: 0;
    }
}

.invoice-box {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
}

@media (max-width: 1199.98px) {
    .dashboard-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* POS mobile — must stay after base POS rules */
@media (max-width: 991.98px) {
    .pos-page {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .pos-page .pos-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .pos-page .pos-products { order: 1; }

    .pos-page .pos-cart-column {
        order: 2;
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
        border-radius: 16px;
    }

    .pos-page .pos-cart {
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
    }

    .pos-page .pos-cart-body {
        max-height: none;
        min-height: 0;
    }

    .pos-page .pos-cart-foot {
        max-height: none;
        overflow: visible;
        padding-bottom: 0.85rem;
    }

    .pos-page .pos-cart-settings .pos-cart-checkout {
        position: static;
        margin-top: 0.5rem;
        padding: 0.85rem 0 0;
        box-shadow: none;
        border-top: 1px solid #eef2f7;
    }

    .pos-page .pos-cart-settings .pos-cart-total {
        padding: 0.55rem 0.65rem;
        margin: 0;
        border-radius: 12px;
    }

    .pos-page .pos-cart-settings .pos-checkout-row {
        grid-template-columns: minmax(4rem, 30%) minmax(0, 1fr);
        gap: 0.45rem;
    }

    .pos-page .pos-cart-settings .pos-checkout-label {
        font-size: 0.76rem;
    }

    .pos-page .pos-cart-settings .pos-checkout-total-value .money-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.1rem;
        font-size: 0.84rem;
    }

    .pos-page .pos-cart-settings .pos-checkout-total-value .money-sep {
        display: none;
    }

    .pos-page .pos-cart-settings .pos-money-input-sm {
        padding: 0.3rem 0.45rem;
    }

    .pos-page .pos-cart-settings .pos-money-input-sm .form-control {
        height: 34px;
        min-height: 34px;
        font-size: 16px;
    }

    .pos-page .pos-cart-settings .pos-alert {
        font-size: 0.78rem;
        padding: 0.6rem 0.7rem;
    }

    .pos-page .pos-cart-settings .pos-complete-btn {
        height: 46px;
        margin: 0;
    }

    .pos-page .pos-cart-empty {
        min-height: 56px;
        padding: 0.65rem 0.5rem;
        flex-direction: row;
        gap: 0.4rem;
    }

    .pos-page .pos-cart-empty i {
        font-size: 1rem;
    }

    .pos-page .pos-cart-settings {
        gap: 0.7rem;
    }

    .pos-page .pos-select-sm {
        height: 44px;
        font-size: 16px;
    }

    .pos-page .pos-seg .pos-toggle-btn {
        min-height: 44px;
        font-size: 0.8rem;
    }
}

@media (max-width: 575.98px) {
    .pos-page {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .pos-page .pos-cart-settings .pos-checkout-total-value .money-wrap {
        font-size: 0.8rem;
    }

    .pos-page .pos-seg .pos-toggle-btn {
        min-height: 46px;
        padding: 0.45rem 0.3rem;
        font-size: 0.76rem;
        line-height: 1.25;
    }
}

/* Purchase cart price field */
.pos-purchase-price-label {
    display: block;
    margin-top: 0.35rem;
    margin-bottom: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}

.pos-cart-item-info .pos-money-input-sm {
    max-width: 140px;
}

.sale-picker-list {
    max-height: min(50vh, 500px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* App-wide mobile fixes — keep at end of file */
@media (max-width: 767.98px) {
    .sale-picker-list {
        max-height: min(40vh, 320px);
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .invoice-body {
        padding: 0.75rem !important;
    }

    .invoice-box {
        padding: 1rem;
    }

    .invoice-header {
        flex-direction: column;
        gap: 0.85rem;
    }

    .invoice-header-meta,
    .invoice-meta-side {
        text-align: start !important;
    }

    .invoice-toolbar .btn {
        flex: 1 1 calc(50% - 0.35rem);
    }

    .invoice-table-wrap {
        overflow: visible;
    }

    .invoice-items-table thead {
        display: none;
    }

    .invoice-items-table tbody tr {
        display: block;
        margin-bottom: 0.65rem;
        padding: 0.65rem 0.75rem;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px;
        background: #fff;
    }

    .invoice-items-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.35rem 0;
        border: 0 !important;
        text-align: start !important;
    }

    .invoice-items-table tbody td::before {
        content: attr(data-label);
        font-size: 0.74rem;
        font-weight: 700;
        color: #64748b;
        flex-shrink: 0;
    }

    .invoice-items-table tbody td:first-child {
        display: none;
    }

    .invoice-items-table tfoot tr {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.45rem 0;
        border-top: 1px dashed #e2e8f0;
    }

    .invoice-items-table tfoot td {
        border: 0 !important;
        padding: 0;
    }

    .invoice-items-table tfoot td[colspan] {
        flex: 1 1 auto;
        text-align: start !important;
    }

    .invoice-items-table tfoot td:last-child {
        flex: 0 0 auto;
        text-align: end !important;
        white-space: nowrap;
    }

    .invoice-items-table tfoot tr.table-primary {
        margin-top: 0.35rem;
        padding-top: 0.65rem;
        border-top: 2px solid #dbeafe;
        font-size: 1rem;
    }

    .dashboard-notice {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .dashboard-notice .btn {
        width: 100%;
    }

    .card-header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-header-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
    }

    .toolbar-search-form {
        width: 100%;
    }

    .content-card .card-header-custom form.row {
        width: 100%;
    }

    .content-card .card-header-custom form.row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .currency-sync-group .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .reports-page .reports-main {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .list-group-item-action .d-flex {
        flex-wrap: wrap;
    }
}

@media (max-width: 575.98px) {
    .invoice-toolbar .btn {
        flex: 1 1 100%;
    }

    .invoice-box {
        padding: 0.85rem;
    }

    .invoice-header .h3 {
        font-size: 1.15rem;
    }

    .card-header-actions .btn {
        flex: 1 1 100%;
    }

    .dashboard-quick-links-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .dashboard-quick-link {
        min-height: 50px;
        padding: 0.55rem 0.6rem;
        border-radius: 12px;
    }

    .dashboard-quick-icon {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .dashboard-quick-label {
        font-size: 0.7rem;
    }
}

/* Sales history page */
.sales-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.sales-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.sales-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.sales-page-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.sales-page-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.sales-filters-card .card-body-custom,
.sales-filters-card {
    padding: 0;
}

.sales-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    align-items: end;
}

.sales-filter-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.sales-search-wrap {
    position: relative;
}

.sales-search-wrap i {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.sales-search-wrap .form-control {
    padding-right: 2.25rem;
}

.sales-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sales-filter-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}

.sales-list-card {
    overflow: hidden;
}

.sales-table-wrap {
    -webkit-overflow-scrolling: touch;
}

.sales-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.sales-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.sales-table tbody tr:hover {
    background: #f8fbff;
}

.sales-table tbody tr:last-child td {
    border-bottom: 0;
}

.sales-invoice-link,
.sales-card-invoice {
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.sales-invoice-link:hover,
.sales-card-invoice:hover {
    color: #1d4ed8;
}

.sales-amount,
.sales-card-total {
    color: #0f172a;
    white-space: nowrap;
}

.sales-meta {
    font-size: 0.86rem;
    color: #64748b;
    white-space: nowrap;
}

.sale-type-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.sale-type-retail {
    background: #eff6ff;
    color: #1d4ed8;
}

.sale-type-wholesale {
    background: #f5f3ff;
    color: #6d28d9;
}

.sales-row-actions {
    display: inline-flex;
    gap: 0.35rem;
}

.sales-action-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
}

.sales-action-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.sales-action-return:hover {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.sales-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #94a3b8;
}

.sales-empty-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px dashed #dbe3ee;
    color: #cbd5e1;
    font-size: 1.5rem;
}

.sales-empty p {
    margin: 0;
    font-size: 0.92rem;
}

.sales-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem;
}

.sales-card {
    padding: 0.9rem;
    border: 1px solid #e8edf4;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.sales-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.sales-card-invoice {
    font-size: 0.92rem;
    line-height: 1.35;
    word-break: break-word;
}

.sales-card-total {
    font-size: 0.95rem;
    flex-shrink: 0;
    direction: ltr;
    text-align: left;
}

.sales-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.65rem;
    font-size: 0.8rem;
    color: #64748b;
}

.sales-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.sales-card-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.sales-card-cashier {
    font-size: 0.74rem;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sales-card-actions {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 991.98px) {
    .sales-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sales-filter-search,
    .sales-filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767.98px) {
    .sales-page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .sales-page-cta {
        justify-content: center;
        width: 100%;
    }

    .sales-filters {
        grid-template-columns: 1fr;
        padding: 0.85rem;
    }

    .sales-filter-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
    }

    .sales-cards {
        padding: 0.75rem;
    }

    .sales-card-actions {
        flex-direction: column;
    }

    .sales-card-actions .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .sales-page-title {
        font-size: 1.15rem;
    }

    .sales-filter-actions .btn {
        flex: 1 1 100%;
    }
}

/* Customers page */
.customers-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.customers-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.customers-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.customers-page-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.customers-page-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    border-radius: 12px;
    white-space: nowrap;
}

.customers-filters-card {
    padding: 0;
}

.customers-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    align-items: end;
}

.customers-filter-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.customers-search-wrap {
    position: relative;
}

.customers-search-wrap i {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.customers-search-wrap .form-control {
    padding-right: 2.25rem;
}

.customers-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.customers-filter-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}

.customers-list-card {
    overflow: hidden;
}

.customers-table-wrap {
    -webkit-overflow-scrolling: touch;
}

.customers-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.customers-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.customers-table tbody tr:hover {
    background: #f8fbff;
}

.customers-table tbody tr:last-child td {
    border-bottom: 0;
}

.customer-name {
    font-weight: 700;
    color: #0f172a;
}

.customer-name.is-project-owner,
.customer-card-name.is-project-owner {
    color: #2563eb;
    font-weight: 800;
    text-decoration: none;
}

.customer-name.is-project-owner:hover,
.customer-card-name.is-project-owner:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.customer-owner-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.customer-owner-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 700;
}

.customers-owner-hint {
    color: #2563eb;
    font-weight: 700;
}

.customers-table tr.is-project-owner-row {
    background: rgba(37, 99, 235, 0.05);
}

.customers-table tr.is-project-owner-row td:first-child code {
    display: inline-flex;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
}

.customers-action-owner {
    color: #2563eb !important;
    border-color: rgba(37, 99, 235, 0.4) !important;
    background: rgba(37, 99, 235, 0.1) !important;
}

.customers-action-owner-btn {
    color: #2563eb !important;
    border-color: rgba(37, 99, 235, 0.45) !important;
}

.customer-card.is-project-owner-card {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.customer-balance-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 0.2rem;
}

.customer-owner-balance {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
}

.customer-owner-balance.is-clear {
    background: #f1f5f9;
    color: #64748b;
}

.customer-project-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    font-size: 0.82rem;
    font-weight: 800;
}

.customer-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #15803d;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.customer-phone-link:hover {
    color: #166534;
    text-decoration: underline;
}

.customers-address {
    max-width: 220px;
    color: #64748b;
    font-size: 0.88rem;
}

.customers-muted {
    color: #94a3b8;
}

.customer-debt-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.customer-debt-pill-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.customer-debt-pill-clear {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.customer-purchase-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.45rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
}

.customers-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.customers-row-actions-labeled .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    white-space: nowrap;
}

.customers-row-actions-labeled form {
    display: inline-flex;
    margin: 0;
}


.customers-action-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    background: #fff;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.customers-action-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.customers-action-pay:hover {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.customers-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #94a3b8;
}

.customers-empty-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px dashed #dbe3ee;
    color: #cbd5e1;
    font-size: 1.5rem;
}

.customers-empty p {
    margin: 0;
    font-size: 0.92rem;
}

.customers-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem;
}

.customer-card {
    padding: 0.9rem;
    border: 1px solid #e8edf4;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.customer-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.customer-card-name {
    font-size: 0.95rem;
    color: #0f172a;
    word-break: break-word;
}

.customer-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
}

.customer-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.customer-card-actions {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 991.98px) {
    .customers-filters {
        grid-template-columns: 1fr;
    }

    .customers-filter-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
    }

    .customer-card-actions {
        flex-direction: column;
    }

    .customer-card-actions .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .customers-page-title {
        font-size: 1.15rem;
    }

    .customers-filter-actions .btn {
        flex: 1 1 100%;
    }
}

/* Debts page */
.debts-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.debts-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.debts-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.debts-page-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.debts-page-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    border-radius: 12px;
    white-space: nowrap;
}

.debts-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.debts-stat-card {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.debts-stat-customers {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fff 0%, #fef2f2 100%);
}

.debts-stat-suppliers {
    border-color: #fde68a;
    background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
}

.debts-stat-top {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.55rem;
}

.debts-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
}

.debts-stat-customers .debts-stat-icon {
    color: #dc2626;
}

.debts-stat-suppliers .debts-stat-icon {
    color: #d97706;
}

.debts-stat-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
}

.debts-stat-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    direction: ltr;
    text-align: start;
}

.debts-stat-customers .debts-stat-value .money-usd {
    color: #b91c1c;
}

.debts-stat-suppliers .debts-stat-value .money-usd {
    color: #b45309;
}

.debts-stat-note {
    margin: 0.35rem 0 0;
    font-size: 0.76rem;
    color: #64748b;
}

.debts-section-card {
    overflow: hidden;
    padding: 0;
}

.debts-section-head {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.debts-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.debts-section-title h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.debts-section-title p {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    color: #64748b;
}

.debts-section-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    flex-shrink: 0;
}

.debts-section-icon-supplier {
    background: #fffbeb;
    color: #d97706;
}

.debts-table-wrap {
    -webkit-overflow-scrolling: touch;
}

.debts-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.debts-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.debts-table tbody tr:hover {
    background: #f8fbff;
}

.debts-table tbody tr:last-child td {
    border-bottom: 0;
}

.debts-name {
    font-weight: 700;
    color: #0f172a;
}

.debts-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #15803d;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.debts-phone-link:hover {
    color: #166534;
    text-decoration: underline;
}

.debts-muted {
    color: #94a3b8;
}

.debts-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.45rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
}

.debts-paid .money-usd {
    color: #15803d;
    font-weight: 700;
}

.debts-amount-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.debts-amount-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.debts-amount-clear {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.debts-action-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    background: #fff;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.debts-action-pay:hover {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.debts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #94a3b8;
}

.debts-empty-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px dashed #dbe3ee;
    color: #cbd5e1;
    font-size: 1.35rem;
}

.debts-empty p {
    margin: 0;
    font-size: 0.92rem;
}

.debts-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem;
}

.debts-card {
    padding: 0.9rem;
    border: 1px solid #e8edf4;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.debts-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.debts-card-name {
    font-size: 0.95rem;
    color: #0f172a;
    word-break: break-word;
}

.debts-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
}

.debts-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

@media (max-width: 767.98px) {
    .debts-stats-grid {
        grid-template-columns: 1fr;
    }

    .debts-page-cta {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .debts-page-title {
        font-size: 1.15rem;
    }
}

/* Products page */
.products-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.products-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.products-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.products-page-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.products-page-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    border-radius: 12px;
    white-space: nowrap;
}

.products-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.products-stat-card {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.products-stat-warning {
    border-color: #fde68a;
    background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
}

.products-stat-danger {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fff 0%, #fef2f2 100%);
}

.products-stat-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.products-stat-value {
    font-size: 1.2rem;
    color: #0f172a;
}

.products-stat-warning .products-stat-value {
    color: #b45309;
}

.products-stat-danger .products-stat-value {
    color: #b91c1c;
}

.products-filters-card {
    padding: 0;
}

.products-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    align-items: end;
}

.products-filter-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.products-search-wrap {
    position: relative;
}

.products-search-wrap i {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.products-search-wrap .form-control {
    padding-right: 2.25rem;
}

.products-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.products-filter-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.2rem;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.products-filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 9px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.products-filter-chip:hover {
    color: #334155;
    background: rgba(255, 255, 255, 0.7);
}

.products-filter-chip.is-active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.products-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    margin-inline-start: 0.25rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
    font-size: 0.68rem;
    font-weight: 800;
}

.products-filter-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}

.products-list-card {
    overflow: hidden;
}

.products-table-wrap {
    -webkit-overflow-scrolling: touch;
}

.products-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.products-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.products-table tbody tr:hover {
    background: #f8fbff;
}

.products-table tbody tr:last-child td {
    border-bottom: 0;
}

.product-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #94a3b8;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.product-thumb.has-image {
    background: #fff;
}

.product-thumb i {
    font-size: 1.15rem;
}

.product-name {
    font-weight: 700;
    color: #0f172a;
}

.product-card-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 140px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #94a3b8;
    overflow: hidden;
}

.product-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.product-card-media.has-image {
    background: #fff;
}

.product-card-media i {
    font-size: 2rem;
}

.product-barcode {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.78rem;
}

.product-category {
    display: inline-flex;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 700;
}

.product-price {
    white-space: nowrap;
    font-size: 0.86rem;
}

.product-price-sale .money-usd {
    color: #2563eb;
    font-weight: 700;
}

.products-row-actions {
    display: inline-flex;
    gap: 0.35rem;
}

.products-action-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    background: #fff;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.products-action-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.products-action-delete:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.products-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #94a3b8;
}

.products-empty-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px dashed #dbe3ee;
    color: #cbd5e1;
    font-size: 1.5rem;
}

.products-empty p {
    margin: 0;
    font-size: 0.92rem;
}

.products-cards {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.75rem;
}

.product-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border: 1px solid #e8edf4;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.product-card-body,
.product-card-actions {
    padding: 0.75rem 0.85rem;
}

.product-card-body {
    min-width: 0;
}

.product-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.product-card-name {
    font-size: 0.92rem;
    color: #0f172a;
    word-break: break-word;
}

.product-card-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
}

.product-card-prices {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.product-card-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.product-card-price-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
    flex-shrink: 0;
}

.product-card-price-value {
    direction: ltr;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.product-card-price-value .money-wrap {
    display: inline;
}

.product-card-price-value .money-iqd {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
}

.product-card-price-row-sale .product-card-price-value .money-usd {
    color: #2563eb;
    font-size: 0.84rem;
}

.product-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding-top: 0.55rem;
    border-top: 1px solid #f1f5f9;
}

.product-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.product-card-action-edit {
    color: #2563eb;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.product-card-action-delete {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.product-card-action:active {
    transform: scale(0.98);
}

@media (max-width: 991.98px) {
    .products-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .products-filters {
        grid-template-columns: 1fr;
    }

    .products-filter-actions {
        width: 100%;
    }

    .products-filter-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .products-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .products-page-cta {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .products-page-title {
        font-size: 1.15rem;
    }

    .products-filter-actions .btn {
        flex: 1 1 100%;
    }

    .products-filter-chips {
        width: 100%;
    }

    .products-filter-chip {
        flex: 1;
        justify-content: center;
    }
}

/* Product add/edit form */
.product-form-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    max-width: 920px;
    margin: 0 auto;
}

.product-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.product-form-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.product-form-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.product-form-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    border-radius: 12px;
    white-space: nowrap;
}

.product-form-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-form-section {
    overflow: hidden;
    padding: 0;
}

.product-form-section-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.product-form-section-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    flex-shrink: 0;
}

.product-form-section-icon-price {
    background: #f0fdf4;
    color: #16a34a;
}

.product-form-section-icon-stock {
    background: #fffbeb;
    color: #d97706;
}

.product-form-section-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.product-form-section-head p {
    margin: 0.15rem 0 0;
    font-size: 0.76rem;
    color: #64748b;
}

.product-form-section-body {
    padding: 1rem 1.15rem 1.15rem;
}

.product-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.product-form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-form-field-wide {
    grid-column: 1 / -1;
}


.product-form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 38px;
    padding: 0.45rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 650;
    cursor: pointer;
    user-select: none;
    width: 100%;
}
.product-form-check .form-check-input {
    margin: 0;
    float: none;
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
}
.product-form-check:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.product-form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

.product-barcode-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.02em;
}

.product-image-upload {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-width: 420px;
}

.product-image-input-native,
.product-image-remove-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.product-image-dropzone {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    text-align: start;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.product-image-dropzone:hover,
.product-image-dropzone:focus-visible {
    border-color: #93c5fd;
    background: #f0f7ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
    outline: none;
}

.product-image-upload.has-image .product-image-dropzone {
    border-style: solid;
    border-color: #e2e8f0;
    background: #fff;
}

.product-image-upload.has-image .product-image-preview {
    width: 88px;
    height: 88px;
}

.product-image-preview {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-image-placeholder {
    color: #94a3b8;
    font-size: 1.55rem;
    line-height: 1;
}

.product-image-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.product-image-copy strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}

.product-image-copy small {
    font-size: 0.76rem;
    color: #94a3b8;
    line-height: 1.35;
}

.product-image-clear {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    border-radius: 10px;
}

.product-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.product-price-field {
    padding: 0.85rem;
    border: 1px solid #e8edf4;
    border-radius: 14px;
    background: #fcfdff;
}

.product-price-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.product-money-field {
    display: flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.product-money-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 0 0.65rem;
    background: #f8fafc;
    border-inline-end: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.product-money-field .form-control {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    direction: ltr;
    text-align: left;
}

.product-money-field .form-control:focus {
    box-shadow: none;
}

.product-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.25rem 0 0.5rem;
}

.product-form-submit,
.product-form-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 46px;
    padding-inline: 1.15rem;
    font-weight: 700;
    border-radius: 12px;
}

.product-form-submit {
    flex: 1 1 220px;
}

@media (max-width: 991.98px) {
    .product-pricing-grid {
        grid-template-columns: 1fr;
    }

    .product-form-grid,
    .product-form-grid-2 {
        grid-template-columns: 1fr;
    }

    .product-form-field-wide {
        grid-column: auto;
    }
}

@media (max-width: 767.98px) {
    .product-form-page {
        max-width: none;
    }

    .product-form-actions {
        position: sticky;
        bottom: 0;
        z-index: 20;
        margin: 0 -0.15rem;
        padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 0.92) 24%, #f8fafc 100%);
        backdrop-filter: blur(8px);
    }

    .product-form-submit,
    .product-form-cancel {
        flex: 1 1 calc(50% - 0.35rem);
    }

    .product-form-section-body .form-control,
    .product-form-section-body .form-select {
        font-size: 16px;
        min-height: 46px;
    }
}

@media (max-width: 575.98px) {
    .product-form-title {
        font-size: 1.15rem;
    }

    .product-form-submit,
    .product-form-cancel {
        flex: 1 1 100%;
    }
}

/* Categories page */
.categories-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.categories-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.categories-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.categories-page-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.categories-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.categories-form-card,
.categories-list-card {
    overflow: hidden;
    padding: 0;
}

.categories-form-head,
.categories-list-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.categories-form-icon,
.categories-list-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f5f3ff;
    color: #7c3aed;
    flex-shrink: 0;
}

.categories-list-icon {
    background: #eff6ff;
    color: #2563eb;
}

.categories-form-head h3,
.categories-list-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.categories-form-head p,
.categories-list-head p {
    margin: 0.15rem 0 0;
    font-size: 0.76rem;
    color: #64748b;
}

.categories-form-body {
    padding: 1rem 1.15rem 1.15rem;
}

.categories-form-field {
    margin-bottom: 0.85rem;
}

.categories-form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

.categories-form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 46px;
    font-weight: 700;
    border-radius: 12px;
}

.categories-table-wrap {
    -webkit-overflow-scrolling: touch;
}

.categories-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.categories-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.categories-table tbody tr:hover {
    background: #f8fbff;
}

.categories-table tbody tr:last-child td {
    border-bottom: 0;
}

.category-name {
    font-weight: 700;
    color: #0f172a;
}

.category-desc {
    max-width: 320px;
    color: #64748b;
    font-size: 0.88rem;
}

.category-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 0.5rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
}

.categories-row-actions {
    display: inline-flex;
    gap: 0.35rem;
}

.categories-action-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    background: #fff;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.categories-action-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.categories-action-delete:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.categories-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #94a3b8;
}

.categories-empty-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px dashed #dbe3ee;
    color: #cbd5e1;
    font-size: 1.35rem;
}

.categories-empty p {
    margin: 0;
    font-size: 0.92rem;
}

.categories-cards {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem;
}

.category-card {
    padding: 0.85rem;
    border: 1px solid #e8edf4;
    border-radius: 12px;
    background: #fff;
}

.category-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.category-card-title-wrap {
    min-width: 0;
}

.category-card-name {
    display: block;
    font-size: 0.95rem;
    color: #0f172a;
    word-break: break-word;
}

.category-card-desc {
    margin: 0.25rem 0 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

.category-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding-top: 0.55rem;
    border-top: 1px solid #f1f5f9;
}

.category-card-delete-form {
    display: contents;
}

.category-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.category-card-action-edit {
    color: #2563eb;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.category-card-action-delete {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.categories-edit-modal .modal-footer,
.categories-modal-footer {
    gap: 0.5rem;
}

@media (max-width: 991.98px) {
    .categories-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .categories-form-body .form-control,
    .categories-edit-modal .form-control {
        font-size: 16px;
        min-height: 46px;
    }

    .categories-modal-footer {
        flex-direction: column;
    }

    .categories-modal-footer .btn {
        width: 100%;
        min-height: 44px;
    }
}

@media (max-width: 575.98px) {
    .categories-page-title {
        font-size: 1.15rem;
    }

    .category-card-actions {
        grid-template-columns: 1fr;
    }
}

/* Suppliers page */
.suppliers-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.suppliers-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.suppliers-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.suppliers-page-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.suppliers-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suppliers-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    border-radius: 12px;
    white-space: nowrap;
}

.suppliers-filters-card {
    padding: 0;
}

.suppliers-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    align-items: end;
}

.suppliers-filter-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.suppliers-search-wrap {
    position: relative;
}

.suppliers-search-wrap i {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.suppliers-search-wrap .form-control {
    padding-right: 2.25rem;
}

.suppliers-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suppliers-filter-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}

.suppliers-list-card {
    overflow: hidden;
}

.suppliers-table-wrap {
    -webkit-overflow-scrolling: touch;
}

.suppliers-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.suppliers-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.suppliers-table tbody tr:hover {
    background: #f8fbff;
}

.suppliers-table tbody tr:last-child td {
    border-bottom: 0;
}

.supplier-name {
    font-weight: 700;
    color: #0f172a;
}

.supplier-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #15803d;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.supplier-phone-link:hover {
    color: #166534;
    text-decoration: underline;
}

.suppliers-address {
    max-width: 220px;
    color: #64748b;
    font-size: 0.88rem;
}

.suppliers-muted {
    color: #94a3b8;
}

.supplier-debt-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.supplier-debt-pill-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.supplier-debt-pill-clear {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.supplier-purchase-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.45rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
}

.suppliers-row-actions {
    display: inline-flex;
    gap: 0.35rem;
}

.suppliers-action-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    background: #fff;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.suppliers-action-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.suppliers-action-pay:hover {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.suppliers-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #94a3b8;
}

.suppliers-empty-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px dashed #dbe3ee;
    color: #cbd5e1;
    font-size: 1.5rem;
}

.suppliers-empty p {
    margin: 0;
    font-size: 0.92rem;
}

.suppliers-cards {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem;
}

.supplier-card {
    padding: 0.85rem;
    border: 1px solid #e8edf4;
    border-radius: 12px;
    background: #fff;
}

.supplier-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.supplier-card-name {
    font-size: 0.95rem;
    color: #0f172a;
    word-break: break-word;
}

.supplier-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    font-size: 0.8rem;
    color: #64748b;
}

.supplier-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.supplier-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding-top: 0.55rem;
    border-top: 1px solid #f1f5f9;
}

.supplier-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.supplier-card-action-pay {
    color: #15803d;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.supplier-card-action-edit {
    color: #2563eb;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.supplier-form-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    max-width: 640px;
    margin: 0 auto;
}

.supplier-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.supplier-form-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.supplier-form-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.supplier-form-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    border-radius: 12px;
}

.supplier-form-section {
    overflow: hidden;
    padding: 0;
}

.supplier-form-section-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.supplier-form-section-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff7ed;
    color: #ea580c;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.supplier-form-section-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.supplier-form-section-head p {
    margin: 0.15rem 0 0;
    font-size: 0.76rem;
    color: #64748b;
}

.supplier-form-section-body {
    padding: 1rem 1.15rem 1.15rem;
}

.supplier-form-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.supplier-form-field-wide {
    width: 100%;
}

.supplier-form-field {
    margin-bottom: 0;
}

.supplier-form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

.supplier-phone-field {
    display: flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.supplier-phone-field:focus-within {
    border-color: #86efac;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.supplier-phone-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    background: #f0fdf4;
    border-inline-end: 1px solid #e2e8f0;
    color: #15803d;
    flex-shrink: 0;
}

.supplier-phone-field .form-control {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    direction: ltr;
    text-align: left;
}

.supplier-phone-field .form-control:focus {
    box-shadow: none;
}

.supplier-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid #f1f5f9;
}

.supplier-form-submit,
.supplier-form-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 46px;
    padding-inline: 1.15rem;
    font-weight: 700;
    border-radius: 12px;
}

.supplier-form-submit {
    flex: 1 1 220px;
}

@media (max-width: 991.98px) {
    .suppliers-filters {
        grid-template-columns: 1fr;
    }

    .suppliers-filter-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .suppliers-page-actions {
        width: 100%;
    }

    .suppliers-page-btn {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
    }

    .supplier-form-section-body .form-control,
    .supplier-form-section-body textarea {
        font-size: 16px;
        min-height: 46px;
    }

    .supplier-form-actions {
        position: sticky;
        bottom: 0;
        z-index: 20;
        padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 0.92) 24%, #f8fafc 100%);
    }

    .supplier-form-submit,
    .supplier-form-cancel {
        flex: 1 1 calc(50% - 0.35rem);
    }
}

@media (max-width: 575.98px) {
    .suppliers-page-title,
    .supplier-form-title {
        font-size: 1.15rem;
    }

    .suppliers-page-btn,
    .suppliers-filter-actions .btn,
    .supplier-form-submit,
    .supplier-form-cancel {
        flex: 1 1 100%;
    }

    .supplier-card-actions {
        grid-template-columns: 1fr;
    }
}

/* Purchase orders page */
.purchase-orders-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.purchase-orders-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.purchase-orders-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.purchase-orders-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.purchase-orders-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    border-radius: 12px;
    white-space: nowrap;
}

.purchase-orders-filters-card {
    padding: 0;
}

.purchase-orders-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    align-items: end;
}

.purchase-orders-filter-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.purchase-orders-search-wrap {
    position: relative;
}

.purchase-orders-search-wrap i {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.purchase-orders-search-wrap .form-control {
    padding-right: 2.25rem;
}

.purchase-orders-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.purchase-orders-filter-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}

.purchase-orders-list-card {
    overflow: hidden;
}

.purchase-orders-table-wrap {
    -webkit-overflow-scrolling: touch;
}

.purchase-orders-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.purchase-orders-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.purchase-orders-table tbody tr:hover {
    background: #f8fbff;
}

.purchase-orders-table tbody tr:last-child td {
    border-bottom: 0;
}

.purchase-order-invoice-link,
.purchase-order-card-invoice {
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.purchase-order-invoice-link:hover,
.purchase-order-card-invoice:hover {
    color: #1d4ed8;
}

.purchase-order-supplier {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.purchase-order-supplier-name {
    font-weight: 600;
    color: #0f172a;
}

.purchase-order-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #15803d;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
}

.purchase-order-phone:hover {
    color: #166534;
    text-decoration: underline;
}

.purchase-order-total,
.purchase-order-card-total {
    color: #0f172a;
    white-space: nowrap;
    direction: ltr;
    text-align: left;
}

.purchase-order-meta {
    font-size: 0.86rem;
    color: #64748b;
    white-space: nowrap;
}

.purchase-orders-action-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    background: #fff;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.purchase-orders-action-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.purchase-orders-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #94a3b8;
}

.purchase-orders-empty-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px dashed #dbe3ee;
    color: #cbd5e1;
    font-size: 1.5rem;
}

.purchase-orders-empty p {
    margin: 0;
    font-size: 0.92rem;
}

.purchase-orders-cards {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem;
}

.purchase-order-card {
    padding: 0.85rem;
    border: 1px solid #e8edf4;
    border-radius: 12px;
    background: #fff;
}

.purchase-order-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.purchase-order-card-invoice {
    font-size: 0.9rem;
    word-break: break-word;
}

.purchase-order-card-total {
    font-size: 0.88rem;
    flex-shrink: 0;
}

.purchase-order-card-supplier {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.45rem;
    font-size: 0.8rem;
    color: #64748b;
}

.purchase-order-card-supplier > span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.purchase-order-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    margin-bottom: 0.65rem;
}

.purchase-order-card-date {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.74rem;
    color: #94a3b8;
}

.purchase-order-card-btn {
    min-height: 44px;
    font-weight: 700;
    border-radius: 10px;
}

@media (max-width: 991.98px) {
    .purchase-orders-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .purchase-orders-filter-search,
    .purchase-orders-filter-actions {
        grid-column: 1 / -1;
    }

    .purchase-orders-filter-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .purchase-orders-cta {
        width: 100%;
        justify-content: center;
    }

    .purchase-orders-filters {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .purchase-orders-title {
        font-size: 1.15rem;
    }

    .purchase-orders-filter-actions .btn {
        flex: 1 1 100%;
    }
}

/* Product returns page */
.returns-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.returns-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.returns-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.returns-page-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.returns-invoice-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.returns-page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.returns-mode-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem;
    border-radius: 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.returns-mode-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.9rem;
    border-radius: 11px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #64748b;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.returns-mode-tab:hover {
    color: #334155;
    background: rgba(255, 255, 255, 0.7);
}

.returns-mode-tab.is-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.returns-direct-page .pos-complete-btn {
    background: #f59e0b;
    border-color: #f59e0b;
}

.returns-direct-page .pos-complete-btn:hover:not(:disabled) {
    background: #d97706;
    border-color: #d97706;
}

.returns-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.returns-picker {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.returns-panel-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.returns-panel-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.returns-panel-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.returns-panel-head p {
    margin: 0.1rem 0 0;
    font-size: 0.74rem;
    color: #64748b;
}

.returns-sale-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    max-height: min(62vh, 560px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.returns-sale-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.88rem;
}

.returns-sale-item {
    display: block;
    padding: 0.75rem 0.85rem;
    border: 1px solid #e8edf4;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.returns-sale-item:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
    color: inherit;
}

.returns-sale-item.is-active {
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.returns-sale-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.4rem;
}

.returns-sale-invoice {
    font-size: 0.88rem;
    font-weight: 700;
    color: #2563eb;
    word-break: break-word;
    line-height: 1.35;
}

.returns-sale-item.is-active .returns-sale-invoice {
    color: #1d4ed8;
}

.returns-sale-total {
    font-size: 0.86rem;
    color: #0f172a;
    flex-shrink: 0;
    direction: ltr;
    text-align: left;
    white-space: nowrap;
}

.returns-sale-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.74rem;
    color: #64748b;
}

.returns-sale-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.returns-main {
    min-width: 0;
}

.returns-form-card {
    overflow: hidden;
}

.returns-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.returns-form-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.returns-form-head p {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.returns-form {
    padding: 1rem 1.15rem 1.15rem;
}

.return-items-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 0.76rem;
}

.return-items-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.return-max-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.45rem;
    border-radius: 8px;
    background: #f1f5f9;
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
}

.return-qty-input {
    width: 100%;
    max-width: 110px;
    min-height: 42px;
    font-weight: 700;
    text-align: center;
}

.return-items-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.return-item-card {
    padding: 0.85rem;
    border: 1px solid #e8edf4;
    border-radius: 12px;
    background: #f8fafc;
}

.return-item-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.45rem;
}

.return-item-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.65rem;
    font-size: 0.78rem;
    color: #64748b;
}

.return-item-qty-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.return-items-cards .return-qty-input {
    max-width: none;
}

.returns-form-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.returns-option-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.returns-option-wide {
    grid-column: span 1;
}

.returns-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}

.returns-state-card {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.returns-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #94a3b8;
}

.returns-state-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px dashed #dbe3ee;
    color: #cbd5e1;
    font-size: 1.5rem;
}

.returns-state-info .returns-state-icon {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.returns-state p {
    margin: 0;
    font-size: 0.92rem;
    max-width: 280px;
}

@media (max-width: 991.98px) {
    .returns-layout {
        grid-template-columns: 1fr;
    }

    .returns-sale-list {
        max-height: min(36vh, 320px);
    }
}

@media (max-width: 767.98px) {
    .returns-page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .returns-page-actions {
        width: 100%;
    }

    .returns-mode-tabs {
        width: 100%;
    }

    .returns-mode-tab {
        flex: 1;
        justify-content: center;
    }

    .returns-invoice-link {
        justify-content: center;
        width: 100%;
    }

    .returns-form-head {
        flex-direction: column;
        align-items: stretch;
    }

    .returns-form-options {
        grid-template-columns: 1fr;
    }

    .return-items-cards {
        grid-template-columns: 1fr;
    }

    .returns-form {
        padding: 0.85rem;
    }

    .return-qty-input {
        max-width: none;
        font-size: 16px;
    }

    .returns-form .form-select,
    .returns-form .form-control {
        font-size: 16px;
        min-height: 44px;
    }
}

@media (max-width: 575.98px) {
    .returns-page-title {
        font-size: 1.15rem;
    }

    .returns-state-card {
        min-height: 220px;
    }
}

/* Expenses page */
.expenses-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.expenses-page-head,
.expenses-hero {
    --expenses-hero-ink: #0f172a;
    --expenses-hero-muted: #64748b;
    --expenses-hero-line: #e2e8f0;
    --expenses-hero-soft: #f8fafc;
    --expenses-hero-accent: #0f766e;
    --expenses-hero-accent-soft: rgba(15, 118, 110, 0.12);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
    padding: 1rem 1.15rem;
    margin-bottom: 0.85rem;
    border: 1px solid var(--expenses-hero-line);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.06), transparent 42%),
        var(--expenses-hero-soft);
}

.expenses-hero-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.expenses-hero-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--expenses-hero-accent-soft);
    color: var(--expenses-hero-accent);
    font-size: 1.25rem;
}

.expenses-hero-copy {
    min-width: 0;
}

.expenses-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--expenses-hero-ink);
}

.expenses-page-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.86rem;
    line-height: 1.4;
    color: var(--expenses-hero-muted);
    max-width: 32rem;
}

.expenses-hero-metrics {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    margin-inline-start: auto;
}

.expenses-hero-metric {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.15rem 1.1rem;
    border: 0;
    border-inline-start: 1px solid var(--expenses-hero-line);
    background: transparent;
}

.expenses-hero-metric:first-child {
    border-inline-start: 0;
    padding-inline-start: 0.25rem;
}

.expenses-hero-metric.is-total {
    background: transparent;
}

.expenses-hero-metric-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.expenses-hero-metric-value {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--expenses-hero-ink);
    line-height: 1.2;
    direction: ltr;
    white-space: nowrap;
}

.expenses-hero-metric.is-total .expenses-hero-metric-value {
    color: var(--expenses-hero-accent);
}

.expenses-hero-metric-value .money-wrap {
    gap: 0.25rem;
    font-size: 1rem;
}

.expenses-layout {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    min-width: 0;
}

.expenses-tools {
    min-width: 0;
}

.expenses-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(140px, 0.7fr);
    gap: 0.85rem;
}

.expenses-report {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.expenses-report-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}

.expenses-report-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.expenses-report-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.84rem;
    color: #64748b;
}

.expenses-form-section {
    overflow: hidden;
    padding: 0;
    position: static;
    top: auto;
    height: 100%;
}

.expenses-form-section-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.expenses-form-section-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fef2f2;
    color: #dc2626;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.expenses-form-section-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.expenses-form-section-head p {
    margin: 0.15rem 0 0;
    font-size: 0.76rem;
    color: #64748b;
}

.expenses-form-section-body {
    padding: 1rem 1.15rem 1.15rem;
}

.expenses-form-field {
    margin-bottom: 0.85rem;
}

.expenses-form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

.expenses-amount-field {
    display: flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.expenses-amount-field:focus-within {
    border-color: #fca5a5;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.expenses-amount-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding-inline: 0.5rem;
    background: #fef2f2;
    border-inline-end: 1px solid #e2e8f0;
    color: #b91c1c;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.expenses-amount-field .form-control {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    direction: ltr;
    text-align: left;
}

.expenses-amount-field .form-control:focus {
    box-shadow: none;
}

.expenses-form-actions {
    display: flex;
    margin-top: 0.25rem;
    padding-top: 0.85rem;
    border-top: 1px solid #f1f5f9;
}

.expenses-form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 46px;
    font-weight: 700;
    border-radius: 12px;
}

.expenses-filters-card {
    padding: 0;
    margin-bottom: 1rem;
}

.expenses-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    align-items: end;
}

.expenses-filter-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.expenses-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.expenses-filter-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    min-height: 42px;
}

.expenses-list-card {
    overflow: hidden;
}

.expenses-table-wrap {
    -webkit-overflow-scrolling: touch;
}

.expenses-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.expenses-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.expenses-table tbody tr:hover {
    background: #fffbfb;
}

.expenses-table tbody tr:last-child td {
    border-bottom: 0;
}

.expense-amount-cell {
    font-weight: 700;
    color: #dc2626;
    white-space: nowrap;
}

.expense-notes-cell {
    max-width: 220px;
    color: #64748b;
    font-size: 0.88rem;
}

.expenses-categories-section {
    overflow: hidden;
    padding: 0;
}

.expenses-page .expense-category-chooser {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.expenses-page .expense-category-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 0;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #dbe3ee;
    background: #ffffff;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.expenses-page .expense-category-choice:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.expenses-page .expense-category-choice:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.expenses-page .expense-category-choice.is-active {
    border-color: #0f766e;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.expense-category-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
}

.expense-category-rent {
    background: #eff6ff;
    color: #1d4ed8;
}

.expense-category-salary {
    background: #f0fdf4;
    color: #15803d;
}

.expense-category-electricity {
    background: #fefce8;
    color: #a16207;
}

.expense-category-transport {
    background: #faf5ff;
    color: #7e22ce;
}

.expense-category-other {
    background: #f8fafc;
    color: #64748b;
}

.expense-category-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.expense-category-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.expenses-action-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fff;
    color: #dc2626;
    transition: background 0.15s, border-color 0.15s;
}

.expenses-action-btn:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #b91c1c;
}

.expenses-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #64748b;
}

.expenses-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fef2f2;
    color: #dc2626;
    font-size: 1.4rem;
}

.expenses-empty p {
    margin: 0;
}

.expenses-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem;
}

.expense-card {
    border: 1px solid #eef2f7;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.expense-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    background: #fafbfd;
    border-bottom: 1px solid #f1f5f9;
}

.expense-card-date {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
}

.expense-card-amount {
    font-weight: 800;
    color: #dc2626;
    font-size: 0.92rem;
    white-space: nowrap;
}

.expense-card-body {
    padding: 0.85rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.expense-card-notes {
    margin: 0;
    font-size: 0.84rem;
    color: #64748b;
    line-height: 1.5;
}

.expense-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-size: 0.78rem;
    color: #94a3b8;
}

.expense-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.expense-card-actions {
    padding: 0.65rem 0.95rem 0.85rem;
    border-top: 1px solid #f1f5f9;
}

.expense-card-delete-form {
    margin: 0;
}

.expense-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 44px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff;
    color: #dc2626;
    font-weight: 700;
    font-size: 0.84rem;
}

.expense-card-action:hover {
    background: #fef2f2;
    color: #b91c1c;
}

@media (max-width: 991.98px) {
    .expenses-form-section {
        position: static;
    }

    .expenses-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .expenses-filters {
        grid-template-columns: 1fr;
    }

    .expenses-filter-actions {
        width: 100%;
    }

    .expenses-filter-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
    }

    .expenses-form-section-body .form-control,
    .expenses-form-section-body .form-select,
    .expenses-form-section-body textarea,
    .expenses-filters .form-control {
        font-size: 16px;
        min-height: 46px;
    }

    .expenses-form-actions {
        position: sticky;
        bottom: 0;
        z-index: 20;
        margin: 0 -0.15rem;
        padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 0.92) 24%, #f8fafc 100%);
    }
}

@media (max-width: 575.98px) {
    .expenses-page-title {
        font-size: 1.2rem;
    }

    .expenses-hero,
    .expenses-page-head {
        align-items: stretch;
        padding: 0.9rem;
    }

    .expenses-hero-metrics {
        width: 100%;
        margin-inline-start: 0;
        padding-top: 0.75rem;
        border-top: 1px solid var(--expenses-hero-line, #e2e8f0);
    }

    .expenses-hero-metric {
        flex: 1;
        min-width: 0;
        padding: 0.15rem 0.75rem;
    }

    .expenses-hero-metric:first-child {
        padding-inline-start: 0;
    }

    .expenses-hero-metric-value {
        white-space: normal;
        font-size: 1rem;
    }

    .expenses-filter-actions .btn,
    .expenses-form-submit {
        flex: 1 1 100%;
    }
}

/* Reports page */
.reports-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.reports-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.reports-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.reports-page-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.reports-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    border-radius: 12px;
    min-height: 42px;
}

.reports-print-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    border-radius: 12px;
    min-height: 42px;
    flex-shrink: 0;
    min-width: 44px;
}

.reports-nav-bar {
    overflow: hidden;
    padding: 0;
}

.reports-nav-bar-head {
    padding: 0.65rem 1rem 0;
}

.reports-nav-bar-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}

.reports-nav-mobile {
    padding: 0.45rem 0.75rem 0.75rem;
}

.reports-mobile-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.reports-mobile-item {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
    min-height: 0;
    padding: 0.4rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    text-decoration: none;
    text-align: start;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.reports-mobile-item:active {
    transform: none;
}

.reports-mobile-item.active {
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: none;
}

.reports-mobile-item-icon {
    width: auto;
    height: auto;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #64748b;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.reports-mobile-item.active .reports-mobile-item-icon {
    background: transparent;
    color: #2563eb;
}

.reports-mobile-item-label {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    color: #475569;
    white-space: nowrap;
}

.reports-mobile-item.active .reports-mobile-item-label {
    color: #1d4ed8;
}

.reports-nav-scroll {
    padding: 0.5rem 1rem 0.75rem;
}

.reports-nav-pills {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    min-width: 0;
}

.reports-nav-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 0;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.reports-nav-pill > i {
    width: auto;
    height: auto;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    color: #64748b;
    font-size: 0.9rem;
}

.reports-nav-pill > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-nav-pill:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
    color: #1e40af;
    box-shadow: none;
}

.reports-nav-pill:hover > i {
    background: transparent;
    color: #2563eb;
}

.reports-nav-pill.active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    box-shadow: none;
}

.reports-nav-pill.active > i {
    background: transparent;
    color: #2563eb;
}

@media (max-width: 1199.98px) {
    .reports-nav-pills {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .reports-nav-pills {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.reports-filters-card {
    padding: 0;
}

.reports-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    align-items: end;
}

.reports-filters:has(.reports-filter-field:only-of-type) {
    grid-template-columns: minmax(0, 1fr) auto;
}

.reports-filter-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.reports-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reports-filter-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-weight: 700;
    min-height: 44px;
    font-size: 0.9rem;
}

.reports-filter-submit {
    color: #fff !important;
}

.reports-filter-submit span,
.reports-filter-reset span {
    line-height: 1.2;
}

.reports-date-input {
    direction: ltr;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
}

.reports-date-input::-webkit-date-and-time-value {
    text-align: left;
}

.reports-result-card {
    overflow: hidden;
    padding: 0;
}

.reports-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.reports-result-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.reports-result-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #2563eb;
    flex-shrink: 0;
}

.reports-result-head h3 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
}

.reports-result-head p {
    margin: 0.15rem 0 0;
    font-size: 0.76rem;
    color: #64748b;
}

.reports-result-body {
    padding: 0;
}

.reports-pagination {
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid #e2e8f0;
}

.reports-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.reports-pager-meta {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    direction: ltr;
    unicode-bidi: plaintext;
}

.reports-pager-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.reports-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
}

a.reports-pager-btn:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.reports-pager-btn.is-active {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.reports-pager-btn.is-disabled,
.reports-pager-btn.is-ellipsis {
    opacity: 0.45;
    pointer-events: none;
}

[data-theme="dark"] .reports-pagination,
[data-bs-theme="dark"] .reports-pagination {
    border-top-color: #1e293b;
}

[data-theme="dark"] .reports-pager-btn,
[data-bs-theme="dark"] .reports-pager-btn {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] a.reports-pager-btn:hover,
[data-bs-theme="dark"] a.reports-pager-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #93c5fd;
}

[data-theme="dark"] .reports-pager-btn.is-active,
[data-bs-theme="dark"] .reports-pager-btn.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.reports-table-wrap {
    -webkit-overflow-scrolling: touch;
}

.reports-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.reports-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.reports-table tbody tr:hover {
    background: #f8fbff;
}

.reports-table tbody tr:last-child td {
    border-bottom: 0;
}

.reports-amount-positive {
    font-weight: 700;
    color: #15803d;
}

.reports-amount-negative {
    font-weight: 700;
    color: #dc2626;
}

.reports-stock-low {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #fef2f2;
    color: #dc2626;
    font-weight: 700;
    font-size: 0.82rem;
}

.reports-badge-clear {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #f0fdf4;
    color: #15803d;
    font-size: 0.74rem;
    font-weight: 700;
}

.reports-link {
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
}

.reports-link:hover {
    color: #2563eb;
}

.reports-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #15803d;
    font-weight: 600;
    text-decoration: none;
}

.reports-phone-link:hover {
    color: #166534;
}

.reports-pl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
    padding: 1rem 1.15rem;
}

.reports-pl-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1rem;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    background: #fff;
}

.reports-pl-positive {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.reports-pl-negative {
    border-color: #fecaca;
    background: #fef2f2;
}

.reports-pl-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
}

.reports-pl-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.reports-pl-positive .reports-pl-value {
    color: #15803d;
}

.reports-pl-negative .reports-pl-value {
    color: #dc2626;
}

.reports-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #64748b;
}

.reports-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.4rem;
}

.reports-empty p {
    margin: 0;
}

.reports-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem;
}

.report-card {
    border: 1px solid #eef2f7;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.report-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    background: #fafbfd;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.86rem;
}

.report-card-top strong,
.report-card-top a {
    min-width: 0;
}

.report-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.65rem 0.95rem 0;
    font-size: 0.78rem;
    color: #64748b;
}

.report-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.report-card-rows {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.75rem 0.95rem 0.95rem;
}

.report-card-rows strong {
    color: #0f172a;
    text-align: end;
    font-weight: 700;
}

.report-card-value {
    color: #0f172a;
    text-align: end;
    font-weight: 700;
    min-width: 0;
    flex: 1 1 auto;
}

.report-card-value .money-wrap,
.report-card-top .money-wrap,
.report-card-top .reports-amount-positive,
.report-card-top .reports-amount-negative {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    white-space: normal;
}

.report-card-value .money-iqd,
.report-card-top .money-iqd {
    display: block;
    font-size: 0.72rem;
    line-height: 1.2;
}

.report-card-rows > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.82rem;
}

.report-card-rows span {
    color: #94a3b8;
    flex-shrink: 0;
}


@media (max-width: 767.98px) {
    .reports-page {
        gap: 0.75rem;
    }

    .reports-page-head {
        gap: 0.5rem;
    }

    .reports-nav-bar-head {
        padding: 0.65rem 0.85rem 0;
    }

    .reports-filters {
        grid-template-columns: 1fr 1fr;
        padding: 0.85rem;
        gap: 0.65rem;
    }

    .reports-filters-month {
        grid-template-columns: 1fr;
    }

    .reports-filter-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
        width: 100%;
    }

    .reports-filter-actions .btn {
        width: 100%;
        min-height: 46px;
        font-size: 1rem;
    }

    .reports-filters .form-control {
        font-size: 16px;
        min-height: 46px;
    }

    .reports-result-head {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        padding: 0.85rem;
        gap: 0.65rem;
    }

    .reports-result-title-wrap {
        flex: 1 1 auto;
        min-width: 0;
    }

    .reports-print-btn-sm {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
    }

    .reports-result-head h3 {
        font-size: 0.92rem;
    }

    .reports-result-head p {
        font-size: 0.72rem;
        word-break: break-word;
    }

    .reports-result-icon {
        width: 38px;
        height: 38px;
    }

    .reports-pl-grid {
        padding: 0.85rem;
        gap: 0.65rem;
    }

    .reports-cards {
        padding: 0.65rem;
    }
}

@media (max-width: 575.98px) {
    .reports-page-title {
        font-size: 1.15rem;
    }

    .reports-filter-actions:has(.reports-filter-reset) {
        grid-template-columns: 1fr 1fr;
    }

    .reports-pl-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .reports-nav-bar,
    .reports-filters-card,
    .reports-print-btn,
    .reports-print-btn-sm,
    .reports-page-head .d-flex {
        display: none !important;
    }

    .reports-result-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .reports-cards {
        display: none !important;
    }

    .reports-table-wrap.d-none,
    .reports-table-wrap {
        display: block !important;
    }

    .reports-table {
        width: 100% !important;
    }

    .reports-table thead {
        display: table-header-group !important;
    }

    .reports-table tr {
        display: table-row !important;
        page-break-inside: avoid;
    }

    .reports-table th,
    .reports-table td {
        display: table-cell !important;
    }
}

/* Users page */
.users-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.users-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.users-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.users-page-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.users-page-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    border-radius: 12px;
    white-space: nowrap;
}

.users-roles-card {
    overflow: hidden;
    padding: 0;
}

.users-roles-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.users-roles-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    flex-shrink: 0;
}

.users-roles-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.users-roles-head p {
    margin: 0.15rem 0 0;
    font-size: 0.76rem;
    color: #64748b;
}

.users-roles-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.15rem;
}

.users-role-item {
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.users-role-admin {
    border-color: #bfdbfe;
    background: #f8fbff;
}

.users-role-cashier {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.users-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.users-role-admin .users-role-badge {
    color: #1d4ed8;
}

.users-role-cashier .users-role-badge {
    color: #475569;
}

.users-role-item p {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.45;
}

.users-filters-card {
    padding: 0;
}

.users-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    align-items: end;
}

.users-filter-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.users-search-wrap {
    position: relative;
}

.users-search-wrap i {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.users-search-wrap .form-control {
    padding-right: 2.25rem;
}

.users-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.users-filter-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    min-height: 42px;
}

.users-list-card {
    overflow: hidden;
}

.users-table-wrap {
    -webkit-overflow-scrolling: touch;
}

.users-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.users-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.users-table tbody tr:hover {
    background: #f8fbff;
}

.users-table tbody tr:last-child td {
    border-bottom: 0;
}

.user-name {
    font-weight: 700;
    color: #0f172a;
}

.user-username {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.82rem;
}

.user-role-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.user-role-pill-admin {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.user-role-pill-cashier {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.users-row-actions {
    display: inline-flex;
    gap: 0.35rem;
}

.users-action-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    background: #fff;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.users-action-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.users-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #64748b;
}

.users-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.4rem;
}

.users-empty p {
    margin: 0;
}

.users-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem;
}

.user-card {
    border: 1px solid #eef2f7;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.user-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    background: #fafbfd;
    border-bottom: 1px solid #f1f5f9;
}

.user-card-identity {
    min-width: 0;
}

.user-card-name {
    display: block;
    font-size: 0.92rem;
    color: #0f172a;
}

.user-card-username {
    display: block;
    margin-top: 0.2rem;
    padding: 0;
    background: none;
    font-size: 0.78rem;
    color: #64748b;
}

.user-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.65rem 0.95rem 0;
    font-size: 0.78rem;
    color: #94a3b8;
}

.user-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.user-card-actions {
    padding: 0.65rem 0.95rem 0.85rem;
}

.user-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #2563eb;
    font-weight: 700;
    font-size: 0.84rem;
    text-decoration: none;
}

.user-card-action:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

@media (max-width: 767.98px) {
    .users-page-cta {
        width: 100%;
        justify-content: center;
        min-height: 46px;
    }

    .users-roles-grid {
        grid-template-columns: 1fr;
    }

    .users-filters {
        grid-template-columns: 1fr;
    }

    .users-filter-actions {
        width: 100%;
    }

    .users-filter-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
    }

    .users-search-wrap .form-control {
        font-size: 16px;
        min-height: 46px;
    }
}

@media (max-width: 575.98px) {
    .users-page-title {
        font-size: 1.15rem;
    }

    .users-page-cta,
    .users-filter-actions .btn {
        flex: 1 1 100%;
    }
}

/* User form page */
.user-form-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    max-width: 640px;
    margin: 0 auto;
}

.user-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.user-form-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.user-form-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.user-form-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    border-radius: 12px;
}

.user-form-section {
    overflow: hidden;
    padding: 0;
}

.user-form-section-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.user-form-section-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.user-form-section-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.user-form-section-head p {
    margin: 0.15rem 0 0;
    font-size: 0.76rem;
    color: #64748b;
}

.user-form-section-body {
    padding: 1rem 1.15rem 1.15rem;
}

.user-form-field {
    margin-bottom: 0.85rem;
}

.user-form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

.user-input-field {
    display: flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.user-input-field:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.user-input-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    background: #f8fafc;
    border-inline-end: 1px solid #e2e8f0;
    color: #64748b;
    flex-shrink: 0;
    font-weight: 700;
}

.user-input-field .form-control {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.user-input-field .form-control:focus {
    box-shadow: none;
}

.user-input-field .form-control[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

.user-form-hint {
    margin-top: 0.35rem;
    font-size: 0.74rem;
    color: #94a3b8;
}

.user-permissions {
    margin: 0.35rem 0 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}
.user-permissions-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.user-permissions-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}
.user-permissions-help {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: #64748b;
}
.user-permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.45rem;
}
.user-permission-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.55rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 650;
    color: #334155;
}
.user-permission-item input {
    margin: 0;
    flex-shrink: 0;
}
.user-permissions-admin-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.35rem 0 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 0.86rem;
    font-weight: 650;
}
[data-theme="dark"] .user-permissions,
[data-bs-theme="dark"] .user-permissions {
    background: #0f172a;
    border-color: #1e293b;
}
[data-theme="dark"] .user-permissions-title,
[data-bs-theme="dark"] .user-permissions-title {
    color: #f1f5f9;
}
[data-theme="dark"] .user-permission-item,
[data-bs-theme="dark"] .user-permission-item {
    background: #111827;
    border-color: #334155;
    color: #e2e8f0;
}

.user-role-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
}

.user-role-option {
    margin: 0;
    cursor: pointer;
}

.user-role-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.user-role-option-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.user-role-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    flex-shrink: 0;
}

.user-role-option-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.user-role-option-text strong {
    font-size: 0.88rem;
    color: #0f172a;
}

.user-role-option-text small {
    font-size: 0.74rem;
    color: #64748b;
    line-height: 1.35;
}

.user-role-option input:checked + .user-role-option-cashier {
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.08);
}

.user-role-option input:checked + .user-role-option-cashier .user-role-option-icon {
    background: #e2e8f0;
    color: #334155;
}

.user-role-option input:checked + .user-role-option-admin {
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.user-role-option input:checked + .user-role-option-admin .user-role-option-icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.user-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.25rem;
    padding-top: 0.85rem;
    border-top: 1px solid #f1f5f9;
}

.user-form-submit,
.user-form-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 46px;
    padding-inline: 1.15rem;
    font-weight: 700;
    border-radius: 12px;
}

.user-form-submit {
    flex: 1 1 220px;
}

@media (max-width: 767.98px) {
    .user-form-section-body .form-control {
        font-size: 16px;
        min-height: 46px;
    }

    .user-form-actions {
        position: sticky;
        bottom: 0;
        z-index: 20;
        margin: 0 -0.15rem;
        padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 0.92) 24%, #f8fafc 100%);
    }

    .user-form-submit,
    .user-form-cancel {
        flex: 1 1 calc(50% - 0.35rem);
    }
}

@media (max-width: 575.98px) {
    .user-form-title {
        font-size: 1.15rem;
    }

    .user-form-submit,
    .user-form-cancel {
        flex: 1 1 100%;
    }
}

/* Currency settings page */
.settings-subnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0.35rem;
    border-radius: 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.settings-subnav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.settings-subnav-link i {
    font-size: 1rem;
}

.settings-subnav-link:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.75);
}

.settings-subnav-link.active {
    color: #0f172a;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.settings-subnav-link-telegram.active {
    color: #0088cc;
}

.settings-subnav-link-telegram.active i {
    color: #0088cc;
}

.settings-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    max-width: 720px;
    margin: 0 auto;
}
.settings-page-invoice-design {
    max-width: 1180px;
}
.invoice-design-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 1rem;
    align-items: start;
}
.invoice-design-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1rem;
}
.invoice-design-span { grid-column: 1 / -1; }
.invoice-design-color-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.invoice-design-color-row input[type="color"] {
    width: 3rem;
    height: 2.55rem;
    padding: 0.2rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}
.invoice-design-preview-card {
    position: sticky;
    top: 1rem;
    align-self: start;
    overflow: visible !important;
}
.invoice-design-preview-wrap {
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #eef2f7;
    max-height: min(78vh, 920px);
    overflow: auto;
}
[data-theme="dark"] .invoice-design-preview-wrap,
[data-bs-theme="dark"] .invoice-design-preview-wrap {
    background: #0f172a;
    border-color: #1e293b;
}
.invoice-design-preview {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
    padding: 1.25rem 1.15rem 1rem !important;
}
[data-theme="dark"] .invoice-design-preview,
[data-bs-theme="dark"] .invoice-design-preview {
    background: #fff !important;
    color: var(--inv-ink, #111827) !important;
    border-color: #e5e7eb !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
}
.invoice-design-color-row .form-control {
    font-family: "Plus Jakarta Sans", "Segoe UI", ui-monospace, monospace;
    letter-spacing: 0.02em;
}
.invoice-design-preview .inv-head {
    align-items: stretch;
}
.invoice-design-preview .inv-brand-board {
    margin-bottom: 0.35rem;
}
.invoice-design-preview .inv-brand-meta.is-placeholder,
.invoice-design-preview .inv-brand-tagline.is-placeholder,
.invoice-design-preview .inv-thanks.is-placeholder,
.invoice-design-preview .inv-design-terms.is-placeholder {
    opacity: 0.45;
    font-style: italic;
}
.invoice-phone-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.invoice-phone-row {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) auto;
    gap: 0.45rem;
    align-items: center;
}
@media (max-width: 640px) {
    .invoice-phone-row {
        grid-template-columns: 1fr;
    }
    .invoice-phone-remove {
        width: 100%;
    }
}
.inv-brand-phone-name {
    font-weight: 750;
}
.inv-brand-phone-sep {
    margin-inline: 0.2rem;
}
.invoice-design-group-title {
    margin: 1.15rem 0 0.65rem;
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
}
.invoice-design-group-title:first-child { margin-top: 0; }
.invoice-design-toggles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 0.85rem;
    margin-bottom: 1rem;
}
@media (max-width: 991.98px) {
    .invoice-design-layout { grid-template-columns: 1fr; }
    .invoice-design-grid { grid-template-columns: 1fr; }
    .invoice-design-toggles { grid-template-columns: 1fr; }
}

.settings-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.settings-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.settings-page-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.settings-form-section,
.settings-info-section {
    overflow: hidden;
    padding: 0;
}

.settings-form-section-head,
.settings-info-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.settings-info-head {
    border-bottom: 0;
}

.settings-form-section-icon,
.settings-info-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.settings-form-section-icon {
    background: #fef3c7;
    color: #d97706;
}

.settings-info-icon {
    background: #eff6ff;
    color: #2563eb;
}

.settings-form-section-head h3,
.settings-info-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.settings-form-section-head p {
    margin: 0.15rem 0 0;
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.45;
}

.settings-info-head p {
    margin: 0.35rem 0 0;
    font-size: 0.84rem;
    color: #64748b;
    line-height: 1.55;
}

.settings-form-section-body {
    padding: 1rem 1.15rem 1.15rem;
}

.settings-form-field {
    margin-bottom: 1rem;
}

.settings-form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

.settings-rate-field {
    display: flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.settings-rate-field:focus-within {
    border-color: #fcd34d;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.settings-rate-prefix,
.settings-rate-suffix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding-inline: 0.85rem;
    background: #fffbeb;
    color: #b45309;
    font-weight: 700;
    font-size: 0.88rem;
    flex-shrink: 0;
}

.settings-rate-suffix {
    background: #ecfdf5;
    color: #047857;
}

.settings-rate-prefix {
    border-inline-end: 1px solid #e2e8f0;
}

.settings-rate-suffix {
    border-inline-start: 1px solid #e2e8f0;
}

.settings-rate-field .form-control {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    direction: ltr;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 700;
}

.settings-rate-field .form-control:focus {
    box-shadow: none;
}

.settings-form-hint {
    margin-top: 0.35rem;
    font-size: 0.74rem;
    color: #94a3b8;
}

.settings-examples {
    margin-bottom: 0.25rem;
}

.settings-examples-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.settings-examples-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.settings-example-card {
    padding: 0.75rem 0.65rem;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: #f8fafc;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.settings-example-card .money-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.settings-example-card .money-iqd,
.settings-example-iqd {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
}

.settings-form-actions {
    display: flex;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid #f1f5f9;
}

.settings-form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 46px;
    font-weight: 700;
    border-radius: 12px;
}

@media (max-width: 767.98px) {
    .settings-form-section-body .form-control {
        font-size: 16px;
        min-height: 46px;
    }

    .settings-examples-grid {
        grid-template-columns: 1fr;
    }

    .settings-form-actions {
        position: sticky;
        bottom: 0;
        z-index: 20;
        margin: 0 -0.15rem;
        padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 0.92) 24%, #f8fafc 100%);
    }
}

@media (max-width: 575.98px) {
    .settings-page-title {
        font-size: 1.15rem;
    }

    .settings-subnav {
        gap: 0.3rem;
        padding: 0.3rem;
    }

    .settings-subnav-link {
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.5rem 0.25rem;
        font-size: 0.68rem;
        min-height: 62px;
    }

    .settings-subnav-link span {
        line-height: 1.25;
        text-align: center;
    }
}

.settings-page-currency {
    max-width: 920px;
}

.currency-hero {
    padding: 1.25rem 1.35rem;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    background:
        radial-gradient(1200px 200px at 10% -20%, rgba(251, 191, 36, 0.18), transparent 55%),
        radial-gradient(900px 180px at 90% 0%, rgba(16, 185, 129, 0.14), transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.currency-hero-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.currency-hero-side {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 160px;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e8edf4;
}

.currency-hero-code {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #64748b;
    text-transform: uppercase;
}

.currency-hero-side strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.currency-hero-eq {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: #f8fafc;
    font-size: 1rem;
}

.currency-hero-note {
    margin: 0.9rem 0 0;
    text-align: center;
    font-size: 0.84rem;
    color: #64748b;
    font-weight: 600;
}

.currency-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
    gap: 0.9rem;
    margin-bottom: 0.35rem;
}

.settings-credit-field {
    display: flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.settings-credit-field .form-control {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-weight: 700;
}

.settings-credit-suffix {
    display: inline-flex;
    align-items: center;
    padding: 0 0.9rem;
    background: #f1f5f9;
    border-inline-start: 1px solid #e2e8f0;
    color: #475569;
    font-weight: 700;
    font-size: 0.82rem;
    white-space: nowrap;
}

.settings-example-kicker {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.settings-example-card {
    padding: 0.85rem 0.75rem;
}

.settings-currency-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}

.settings-currency-item {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(150px, 0.85fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 1rem 1.05rem;
    border: 1px solid #e8edf4;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.03);
}

.settings-currency-item.is-display {
    border-color: #93c5fd;
    background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 100%);
}

.settings-currency-item.is-base {
    background: #fafbfc;
}

.settings-currency-main {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.settings-currency-flag {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    flex-shrink: 0;
}

.settings-currency-meta {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.settings-currency-meta strong {
    color: #0f172a;
    font-size: 0.98rem;
}

.settings-currency-symbol {
    color: #64748b;
    font-weight: 700;
}

.settings-currency-meta > span {
    color: #64748b;
    font-size: 0.8rem;
}

.settings-currency-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.3rem;
}

.settings-currency-tag {
    display: inline-flex;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 700;
}

.settings-currency-tag.is-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.settings-currency-mid {
    min-width: 0;
}

.settings-currency-rate-form .settings-form-label {
    margin-bottom: 0.25rem;
}

.settings-currency-rate-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.settings-currency-rate-row .form-control {
    max-width: 150px;
    direction: ltr;
    font-weight: 700;
}

.settings-currency-base-rate {
    font-weight: 800;
    color: #0f172a;
    font-size: 1.1rem;
}

.settings-currency-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
    align-items: center;
}

.settings-currency-active-note {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #2563eb;
}

.settings-currency-add {
    padding: 1rem;
    border: 1.5px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
}

.settings-currency-add-head {
    margin-bottom: 0.85rem;
}

.settings-currency-add-head h4 {
    margin: 0 0 0.25rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
}

.settings-currency-add-head p {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.45;
}

.settings-currency-add-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.settings-currency-flag-upload {
    margin-top: 0.85rem;
}

.settings-currency-flag-dropzone {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    max-width: 420px;
    padding: 0.75rem 0.9rem;
    border: 1.5px dashed #cbd5e1;
    border-radius: 14px;
    background: #fff;
    text-align: start;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.settings-currency-flag-dropzone:hover,
.settings-currency-flag-dropzone:focus-visible {
    border-color: #93c5fd;
    background: #f0f7ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
    outline: none;
}

.settings-currency-flag-preview {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-currency-flag-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.settings-currency-flag-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.settings-currency-flag-copy strong {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}

.settings-currency-flag-copy small {
    font-size: 0.74rem;
    color: #94a3b8;
    line-height: 1.35;
}

.settings-currency-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.85rem;
    font-weight: 700;
    border-radius: 12px;
    min-height: 44px;
    padding-inline: 1.1rem;
}

.settings-currency-footnote {
    margin: 1rem 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.5;
}

.currency-flag-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.55em;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
    min-width: 1em;
    min-height: 1em;
    padding: 0.15em;
}

@media (max-width: 991.98px) {
    .currency-settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-currency-item {
        grid-template-columns: 1fr;
    }

    .settings-currency-actions {
        justify-content: flex-start;
    }

    .settings-currency-add-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .settings-currency-add-grid {
        grid-template-columns: 1fr;
    }

    .currency-hero-side {
        width: 100%;
        min-width: 0;
    }
}

.settings-form-actions-inline {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.settings-backup-section {
    overflow: hidden;
    padding: 0;
}

.settings-backup-icon {
    background: #ecfdf5;
    color: #059669;
}

.settings-backup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.settings-backup-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1rem;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    background: #fafbfd;
    min-height: 100%;
}

.settings-backup-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.1rem;
}

.settings-backup-import-icon {
    background: #fef2f2;
    color: #dc2626;
}

.settings-backup-card h4 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
}

.settings-backup-card p {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.45;
    flex: 1 1 auto;
}

.settings-backup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 46px;
    font-weight: 700;
    border-radius: 12px;
    margin-top: auto;
}

.settings-import-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.15rem;
}

.settings-import-field {
    margin: 0;
}

.settings-import-confirm {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.45;
    cursor: pointer;
}

.settings-import-confirm input {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

@media (max-width: 767.98px) {
    .settings-backup-grid {
        grid-template-columns: 1fr;
    }

    .settings-import-field .form-control {
        font-size: 16px;
        min-height: 46px;
    }
}

.settings-telegram-section {
    overflow: hidden;
    padding: 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.settings-telegram-section .settings-form-section-body {
    padding: 1rem;
}

.tg-settings-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.tg-enable-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.05rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
}

.tg-enable-card-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.tg-enable-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0088cc;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.28);
}

.tg-enable-card-text {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.tg-enable-card-text strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.tg-status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #cbd5e1;
}

.tg-status-badge.is-active {
    color: #0369a1;
    background: #fff;
    border-color: #7dd3fc;
}

.tg-enable-switch {
    flex-shrink: 0;
}

.settings-telegram-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.settings-telegram-switch-ui {
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: #94a3b8;
    position: relative;
    display: block;
    transition: background 0.2s ease;
}

.settings-telegram-switch-ui::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease;
}

.settings-telegram-switch input:checked + .settings-telegram-switch-ui {
    background: #0088cc;
}

.settings-telegram-switch input:checked + .settings-telegram-switch-ui::after {
    transform: translateX(-20px);
}

.tg-panel {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid #eef2f7;
    background: #fafbfd;
}

.tg-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.tg-panel-head-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1rem;
    flex-shrink: 0;
}

.tg-panel-head-icon-schedule {
    background: #fef3c7;
    color: #d97706;
}

.tg-panel-head h4 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}

.tg-panel-head p {
    margin: 0.15rem 0 0;
    font-size: 0.74rem;
    color: #64748b;
    line-height: 1.45;
}

.tg-field-stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.tg-input-wrap {
    position: relative;
}

.tg-input-icon {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
}

.tg-input {
    min-height: 46px;
    padding-right: 2.5rem;
    border-radius: 12px;
    border-color: #e2e8f0;
    background: #fff;
    font-size: 0.84rem;
}

.tg-input:focus {
    border-color: #0088cc;
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.12);
}

.settings-telegram-token-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
}

.tg-field-hint {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.45;
    padding-inline: 0.15rem;
}

.tg-schedule-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tg-schedule-input {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.tg-schedule-input .form-control {
    width: 96px;
    min-height: 46px;
    border-radius: 12px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    border-color: #e2e8f0;
    background: #fff;
}

.tg-schedule-input span {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
}

.tg-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.tg-preset-chip {
    min-width: 44px;
    min-height: 38px;
    padding: 0.35rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tg-preset-chip:hover {
    border-color: #0088cc;
    color: #0088cc;
}

.tg-preset-chip.active {
    background: #0088cc;
    border-color: #0088cc;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.22);
}

.tg-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.tg-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    border: 1px solid #eef2f7;
    background: #fff;
}

.tg-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ecfdf5;
    color: #059669;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.tg-stat-icon-next {
    background: #eff6ff;
    color: #2563eb;
}

.tg-stat-label {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.tg-stat-card strong {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
}

.tg-actions-bar {
    display: flex;
    gap: 0.55rem;
    padding-top: 0.15rem;
}

.tg-btn-save {
    flex: 1 1 auto;
    min-height: 48px;
    border-radius: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.tg-test-form {
    margin: 0;
}

.tg-actions-bar-secondary {
    margin-top: -0.35rem;
}

.tg-btn-test {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: #0088cc;
    border: 1px dashed #7dd3fc;
    background: #f0f9ff;
}

.tg-btn-test:hover:not(:disabled) {
    color: #fff;
    background: #0088cc;
    border-color: #0088cc;
}

.tg-btn-test:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 767.98px) {
    .settings-telegram-section .settings-form-section-body {
        padding: 0.85rem;
    }

    .tg-enable-card {
        padding: 0.9rem;
    }

    .tg-stats-grid {
        grid-template-columns: 1fr;
    }

    .tg-input,
    .tg-schedule-input .form-control {
        font-size: 16px;
    }
}

/* Debt collection — modern workspace */
.collect-page {
    --collect-ink: #0f172a;
    --collect-muted: #64748b;
    --collect-line: #e2e8f0;
    --collect-surface: #ffffff;
    --collect-soft: #f8fafc;
    --collect-accent: #0f766e;
    --collect-accent-soft: rgba(15, 118, 110, 0.12);
    --collect-debt: #c2410c;
    --collect-debt-soft: rgba(194, 65, 12, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    max-width: 1180px;
    margin: 0 auto;
}

.collect-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: stretch;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--collect-line);
    border-radius: 20px;
    background:
        radial-gradient(900px 180px at 100% 0%, rgba(15, 118, 110, 0.1), transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.collect-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: var(--collect-accent-soft);
    color: var(--collect-accent);
    font-size: 0.72rem;
    font-weight: 700;
}

.collect-hero-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--collect-ink);
    letter-spacing: -0.02em;
}

.collect-hero-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--collect-muted);
    max-width: 38rem;
}

.collect-hero-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: min(260px, 100%);
}

.collect-hero-metric {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    background: rgba(255, 255, 255, 0.85);
}

.collect-hero-metric-label,
.collect-hero-metric-note {
    display: block;
    font-size: 0.74rem;
    color: var(--collect-muted);
}

.collect-hero-metric-value {
    display: block;
    margin: 0.25rem 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--collect-accent);
    direction: ltr;
}

.collect-hero-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.55rem 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--collect-line);
    background: #fff;
    color: #334155;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 700;
}

.collect-hero-link:hover {
    border-color: #94a3b8;
    color: var(--collect-ink);
}

.collect-workspace {
    display: grid;
    grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.15fr);
    gap: 1rem;
    align-items: stretch;
}

.collect-panel {
    background: var(--collect-surface);
    border: 1px solid var(--collect-line);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    min-width: 0;
}

.collect-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--collect-line);
    background: var(--collect-soft);
}

.collect-panel-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--collect-ink);
}

.collect-panel-head p {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--collect-muted);
}

.collect-search {
    display: flex;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--collect-line);
    background: #fff;
}

.collect-search-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.collect-search-wrap i {
    position: absolute;
    top: 50%;
    inset-inline-start: 0.9rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.collect-search-wrap input {
    width: 100%;
    min-height: 46px;
    padding-block: 0.65rem;
    padding-inline: 2.45rem 1rem;
    border: 1px solid var(--collect-line);
    border-radius: 14px;
    background: var(--collect-soft);
    color: var(--collect-ink);
    font: inherit;
}

.collect-search-wrap input:focus {
    outline: none;
    border-color: #14b8a6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16);
}

.collect-search-btn {
    min-height: 46px;
    padding: 0 1rem;
    border: 0;
    border-radius: 14px;
    background: var(--collect-ink);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.collect-search-btn:hover {
    background: #1e293b;
}

.collect-debtor-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.85rem;
    max-height: min(64vh, 620px);
    overflow-y: auto;
}

.collect-debtor-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 16px;
    background: var(--collect-soft);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.collect-debtor-item:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    background: #fff;
    color: inherit;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.collect-debtor-item.is-active {
    border-color: rgba(15, 118, 110, 0.35);
    background: #fff;
    box-shadow: 0 0 0 3px var(--collect-accent-soft);
}

.collect-debtor-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ecfeff;
    color: #0f766e;
    font-weight: 800;
    flex-shrink: 0;
}

.collect-debtor-avatar-lg {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 1.15rem;
}

.collect-debtor-main,
.collect-selected-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.collect-debtor-main strong,
.collect-selected-copy h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--collect-ink);
}

.collect-debtor-meta,
.collect-selected-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.74rem;
    color: var(--collect-muted);
}

.collect-debtor-meta i,
.collect-selected-meta i {
    margin-inline-end: 0.2rem;
}

.collect-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.7rem;
}

.collect-debtor-amount {
    font-weight: 800;
    color: var(--collect-debt);
    direction: ltr;
    text-align: end;
    white-space: nowrap;
}

.collect-panel-pay {
    display: flex;
    flex-direction: column;
    min-height: 420px;
}

.collect-selected {
    padding: 1.1rem 1.15rem 0;
}

.collect-selected-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
}

.collect-history-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--collect-line);
    background: #fff;
    color: #475569;
    text-decoration: none;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.collect-history-link:hover {
    color: var(--collect-ink);
    border-color: #94a3b8;
}

.collect-debt-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: var(--collect-debt-soft);
    border: 1px solid rgba(194, 65, 12, 0.16);
}

.collect-debt-banner span {
    font-size: 0.82rem;
    font-weight: 700;
    color: #9a3412;
}

.collect-debt-banner strong {
    font-size: 1.1rem;
    color: var(--collect-debt);
    direction: ltr;
}

.collect-pay-form {
    padding: 1.1rem 1.15rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1 1 auto;
}

.collect-pay-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.collect-pay-label,
.collect-pay-label-row label,
.collect-pay-field > label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--collect-muted);
}

.collect-pay-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.collect-full-btn {
    border: 0;
    background: transparent;
    color: var(--collect-accent);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0;
}

.collect-full-btn:hover {
    text-decoration: underline;
}

.collect-amount-field {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--collect-line);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.collect-amount-field:focus-within {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16);
}

.collect-amount-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 0 0.75rem;
    background: var(--collect-soft);
    border-inline-end: 1px solid var(--collect-line);
    color: var(--collect-muted);
    font-weight: 800;
}

.collect-amount-field input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 54px;
    border: 0;
    padding: 0.75rem 1rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--collect-ink);
    background: transparent;
}

.collect-amount-field input:focus {
    outline: none;
}

.collect-method-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.collect-method {
    margin: 0;
    cursor: pointer;
}

.collect-method input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.collect-method span {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 74px;
    padding: 0.65rem 0.5rem;
    border-radius: 16px;
    border: 1px solid var(--collect-line);
    background: var(--collect-soft);
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.collect-method span i {
    font-size: 1.15rem;
}

.collect-method input:checked + span {
    background: #fff;
    border-color: rgba(15, 118, 110, 0.45);
    color: var(--collect-accent);
    box-shadow: 0 0 0 3px var(--collect-accent-soft);
}

.collect-pay-form textarea {
    width: 100%;
    min-height: 78px;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--collect-line);
    border-radius: 14px;
    background: var(--collect-soft);
    color: var(--collect-ink);
    resize: vertical;
    font: inherit;
}

.collect-pay-form textarea:focus {
    outline: none;
    border-color: #14b8a6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16);
}

.collect-pay-submit {
    margin-top: auto;
    min-height: 52px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(180deg, #0f766e 0%, #0d9488 100%);
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    box-shadow: 0 12px 24px rgba(13, 148, 136, 0.28);
}

.collect-pay-submit:hover {
    filter: brightness(1.05);
    color: #fff;
}

.collect-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: var(--collect-muted);
}

.collect-empty-panel {
    flex: 1 1 auto;
    min-height: 420px;
}

.collect-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--collect-accent-soft);
    color: var(--collect-accent);
    font-size: 1.55rem;
}

.collect-empty strong {
    color: var(--collect-ink);
    font-size: 1rem;
}

.collect-empty p {
    margin: 0;
    max-width: 280px;
    font-size: 0.88rem;
}

.collect-recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem 1rem 1rem;
}

.collect-recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: var(--collect-soft);
    border: 1px solid transparent;
}

.collect-recent-item:hover {
    border-color: var(--collect-line);
    background: #fff;
}

.collect-recent-main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.collect-recent-main strong {
    color: var(--collect-ink);
    font-size: 0.9rem;
}

.collect-recent-main span {
    color: var(--collect-muted);
    font-size: 0.74rem;
}

.collect-recent-side {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.collect-recent-amount {
    color: #047857;
    direction: ltr;
    font-size: 0.95rem;
}

.collect-receipt-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--collect-line);
    background: #fff;
    color: #475569;
    text-decoration: none;
}

.collect-receipt-btn:hover {
    color: var(--collect-ink);
    border-color: #94a3b8;
}

@media (max-width: 991.98px) {
    .collect-hero,
    .collect-workspace,
    .collect-selected-top {
        grid-template-columns: 1fr;
    }

    .collect-hero-side {
        min-width: 0;
    }

    .collect-method-grid {
        grid-template-columns: 1fr;
    }

    .collect-method span {
        flex-direction: row;
        justify-content: flex-start;
        min-height: 48px;
        padding-inline: 0.9rem;
    }

    .collect-history-link {
        justify-self: start;
    }
}

@media (max-width: 575.98px) {
    .collect-search {
        flex-direction: column;
    }

    .collect-debtor-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .collect-debtor-amount {
        grid-column: 2;
        text-align: start;
    }

    .collect-recent-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Wasted products */
.waste-form-card {
    margin-bottom: 1rem;
}

.waste-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(110px, 0.5fr) minmax(0, 1.2fr);
    gap: 0.85rem;
    align-items: end;
}

.waste-form-field-wide {
    min-width: 0;
}

.waste-form-actions {
    margin-top: 1rem;
}

.waste-form-actions .btn {
    min-height: 44px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

@media (max-width: 767.98px) {
    .waste-form-grid {
        grid-template-columns: 1fr;
    }

    .waste-form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}


/* ===== Modern Shop POS (ported from Pharmacy-pos) ===== */
:root {
    --posx-accent: #2563eb;
    --posx-accent-dark: #1d4ed8;
    --posx-green: #16a34a;
    --posx-ink: #0f172a;
    --posx-muted: #64748b;
    --posx-line: #e2e8f0;
    --posx-soft: #f8fafc;
    --posx-cart-w: 520px;
}

body.pos-screen {
    overflow: hidden;
    background: #f1f5f9;
}

.app-wrapper.is-pos-screen {
    height: 100vh;
    height: 100dvh;
}

.app-wrapper.is-pos-screen .app-content {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #f1f5f9;
}

.app-wrapper.is-pos-screen .app-main-pos {
    flex: 1;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}

.posx {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--posx-cart-w);
    height: 100%;
    min-height: 0;
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 40%, #f1f5f9 100%);
}

.posx-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 1rem 1.15rem 1rem;
    gap: 0.85rem;
    container-type: inline-size;
    container-name: posx-main;
}

.posx-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "start meta actions";
    align-items: start;
    column-gap: 0.65rem;
    row-gap: 0.55rem;
}

.posx-topbar-start {
    grid-area: start;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
}

.posx-topbar-heading {
    min-width: 0;
}

.posx-topbar-meta {
    grid-area: meta;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.posx-menu-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--posx-line);
    border-radius: 12px;
    background: #fff;
    color: var(--posx-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    text-decoration: none;
}

.posx-menu-btn:hover {
    color: var(--posx-accent);
    border-color: #bfdbfe;
    background: #eff6ff;
}

.posx-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--posx-muted);
    margin-bottom: 0.15rem;
}

.posx-breadcrumb a {
    color: var(--posx-muted);
    text-decoration: none;
}

.posx-breadcrumb a:hover { color: var(--posx-accent); }

.posx-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--posx-ink);
}

.posx-topbar-actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    min-width: 0;
}

.posx-topbar-actions .header-theme-btn,
.posx-topbar-actions .header-lang-btn,
.posx-topbar-meta .header-theme-btn,
.posx-topbar-meta .header-lang-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.posx-topbar-meta .header-lang,
.posx-topbar-actions .header-lang {
    display: inline-flex;
}

.posx-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    border-radius: 12px;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
    flex: 0 0 auto;
}

.posx-btn-label-short {
    display: none;
}

.posx-btn-accent {
    background: var(--posx-accent);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.posx-btn-accent:hover { background: var(--posx-accent-dark); color: #fff; }

.posx-btn-ghost {
    background: #fff;
    color: var(--posx-ink);
    border-color: var(--posx-line);
}

.posx-btn-ghost:hover {
    border-color: #93c5fd;
    color: var(--posx-accent-dark);
}

.posx-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(140px, 0.7fr) minmax(120px, 0.55fr);
    gap: 0.65rem;
}

.posx-search {
    position: relative;
    display: flex;
    align-items: center;
}

.posx-search i {
    position: absolute;
    right: 0.9rem;
    color: #94a3b8;
    pointer-events: none;
}

.posx-search input,
.posx-select {
    width: 100%;
    height: 46px;
    border: 1px solid var(--posx-line);
    border-radius: 14px;
    background: #fff;
    padding: 0 2.4rem 0 0.95rem;
    font-size: 0.92rem;
    color: var(--posx-ink);
    outline: none;
}

.posx-select {
    padding-right: 0.95rem;
    padding-left: 2rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.9rem center;
}

.posx-search input:focus,
.posx-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.posx-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-width: 100%;
    padding-bottom: 0.1rem;
}

.posx-cat {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    background: #fff;
    color: var(--posx-muted);
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: 0.15s ease;
}

.posx-cat:hover { color: var(--posx-ink); }
.posx-cat.active {
    background: var(--posx-accent);
    color: #fff;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
}

.posx-results {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.15rem 0.15rem 1rem;
}

.posx-results.is-loading { opacity: 0.55; pointer-events: none; }

.posx-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
}

.posx-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: #fff;
    padding: 0;
    text-align: start;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    display: flex;
    flex-direction: column;
}

.posx-card:hover {
    transform: translateY(-1px);
    border-color: #93c5fd;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.1);
}

.posx-card-media {
    position: relative;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.posx-card-media.has-image {
    height: 72px;
    background: #f8fafc !important;
    color: inherit;
}

.posx-card-media.tone-mint { background: linear-gradient(145deg, #34d399 0%, #059669 100%); color: #fff; }
.posx-card-media.tone-sky { background: linear-gradient(145deg, #60a5fa 0%, #2563eb 100%); color: #fff; }
.posx-card-media.tone-amber { background: linear-gradient(145deg, #fbbf24 0%, #d97706 100%); color: #fff; }
.posx-card-media.tone-rose { background: linear-gradient(145deg, #fb7185 0%, #e11d48 100%); color: #fff; }
.posx-card-media.tone-violet { background: linear-gradient(145deg, #a78bfa 0%, #7c3aed 100%); color: #fff; }
.posx-card-media.tone-teal { background: linear-gradient(145deg, #2dd4bf 0%, #0f766e 100%); color: #fff; }

.posx-card-add {
    position: absolute;
    left: 0.25rem;
    bottom: 0.25rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--posx-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.28);
}

.posx-card-rx {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    background: rgba(255, 255, 255, 0.95);
    color: #b45309;
    border-radius: 999px;
    padding: 0.18rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.posx-card-flag {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    border-radius: 999px;
    padding: 0.18rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}
.posx-card-flag.danger { color: #dc2626; }
.posx-card-flag.warn { color: #b45309; }

.posx-card-body {
    padding: 0.28rem 0.32rem 0.32rem;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-height: 0;
}

.posx-card-name {
    font-size: 0.64rem;
    color: var(--posx-ink);
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.posx-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.54rem;
    color: var(--posx-muted);
}

.posx-card-stock {
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.28rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
}
.posx-card-stock.is-low {
    background: #fef3c7;
    color: #b45309;
}

.posx-card-sku {
    display: inline-block;
    max-width: 100%;
    padding: 0.05rem 0.25rem;
    border-radius: 5px;
    background: #f1f5f9;
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.56rem;
    font-weight: 600;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.posx-card-price {
    margin-top: auto;
    padding-top: 0.2rem;
}

.posx-card-money {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.05rem;
    width: 100%;
    padding: 0.2rem 0.28rem;
    border-radius: 6px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}

.posx-card-money-usd,
.posx-card-money-iqd {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
    min-width: 0;
}

.posx-card-money .posx-card-flag-img,
.posx-card-money .currency-input-flag {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.posx-card-money-usd strong {
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.posx-card-money-iqd {
    padding-top: 0.08rem;
    border-top: 1px dashed #cbd5e1;
}

.posx-card-money-iqd small {
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 600;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.posx-line-thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #eef2ff;
    color: #fff;
    font-size: 1.15rem;
    border: 0;
    line-height: 1;
    position: relative;
}

.posx-line-thumb > i {
    display: block;
    line-height: 1;
    color: inherit;
    opacity: 0.95;
}

.posx-line-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.posx-line-thumb.has-image {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0;
}


.posx-line-thumb.tone-mint { background: linear-gradient(145deg, #34d399 0%, #059669 100%); color: #fff; }
.posx-line-thumb.tone-sky { background: linear-gradient(145deg, #60a5fa 0%, #2563eb 100%); color: #fff; }
.posx-line-thumb.tone-amber { background: linear-gradient(145deg, #fbbf24 0%, #d97706 100%); color: #fff; }
.posx-line-thumb.tone-rose { background: linear-gradient(145deg, #fb7185 0%, #e11d48 100%); color: #fff; }
.posx-line-thumb.tone-violet { background: linear-gradient(145deg, #a78bfa 0%, #7c3aed 100%); color: #fff; }
.posx-line-thumb.tone-teal { background: linear-gradient(145deg, #2dd4bf 0%, #0f766e 100%); color: #fff; }

.posx-line-thumb-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.posx-line-price {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.posx-cart {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
    border-right: 1px solid var(--posx-line);
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.04);
}

.posx-cart-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--posx-line);
}

.posx-user-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.posx-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
}

.posx-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.posx-user-meta strong {
    font-size: 0.88rem;
    color: var(--posx-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.posx-user-meta small {
    color: var(--posx-muted);
    font-size: 0.72rem;
}

.posx-logout {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--posx-muted);
    background: var(--posx-soft);
    text-decoration: none;
}

.posx-logout:hover { color: #dc2626; background: #fef2f2; }

.posx-cart-controls {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--posx-line);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: none;
    overflow: visible;
}

.posx-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--posx-muted);
    margin-bottom: 0.22rem;
}

.posx-field .form-select,
.posx-field .form-control {
    border-radius: 10px;
    border-color: var(--posx-line);
    font-size: 0.84rem;
    min-height: 36px;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.posx-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.posx-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem;
    background: var(--posx-soft);
    border-radius: 10px;
    padding: 0.18rem;
}

.posx-seg label {
    margin: 0;
    cursor: pointer;
}

.posx-seg input { display: none; }

.posx-seg span {
    display: block;
    text-align: center;
    padding: 0.35rem 0.15rem;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--posx-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.posx-seg input:checked + span {
    background: #fff;
    color: var(--posx-ink);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.posx-seg .is-cash input:checked + span { color: #15803d; }
.posx-seg .is-credit input:checked + span { color: #b45309; }

.posx-credit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    margin-top: 0.4rem;
    font-size: 0.72rem;
    color: var(--posx-muted);
}

.posx-credit-meta strong {
    color: var(--posx-ink);
    font-weight: 700;
}

#creditPaymentField .pos-credit-inputs {
    margin-top: 0.15rem;
}

.posx-order-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.posx-order-head strong {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    color: var(--posx-ink);
}

.posx-order-head i { color: var(--posx-accent); }

.posx-icon-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: var(--posx-soft);
    color: var(--posx-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.posx-icon-btn.danger:hover,
.posx-icon-btn:hover { background: #fef2f2; color: #dc2626; }

.posx-cart-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.35rem 0.85rem 0.5rem;
}

.posx-line {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 0;
    border-bottom: 1px solid var(--posx-line);
    border-radius: 0;
    padding: 0.6rem 0.1rem;
    margin-bottom: 0;
    background: transparent;
}

.posx-line:last-child {
    border-bottom: 0;
}

.posx-line-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    min-width: 0;
    flex: 1 1 auto;
}

.posx-line-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1 1 auto;
    text-align: start;
}

.posx-line-info strong {
    font-size: 0.84rem;
    color: var(--posx-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    unicode-bidi: plaintext;
}

.posx-line-info span,
.posx-line-price {
    font-size: 0.72rem;
    color: var(--posx-muted);
    direction: ltr;
    unicode-bidi: plaintext;
}
.posx-line-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
}
.posx-line-unit,
.posx-line-total {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.posx-line-unit-sep {
    color: #94a3b8;
    margin: 0 0.1rem;
}
.posx-line-flag,
.posx-line-price .currency-flag {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.posx-line-price .money-wrap {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    white-space: normal;
}
.posx-line-price .money-usd,
.posx-line-price .money-iqd {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.posx-line-price .money-sep {
    color: #94a3b8;
}
.posx-line-total .money-usd {
    color: var(--posx-ink);
    font-weight: 700;
}
.posx-price-currency {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
.posx-price-currency:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}
.posx-price-currency .currency-flag,
.posx-price-currency .posx-line-flag {
    width: 14px;
    height: 14px;
    pointer-events: none;
}
.posx-price-input {
    width: 4.6rem;
    min-width: 4.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    text-align: center;
    font-weight: 800;
    font-size: 0.78rem;
    color: var(--posx-ink);
    padding: 0.18rem 0.25rem;
    appearance: textfield;
    -moz-appearance: textfield;
}
.posx-price-input::-webkit-outer-spin-button,
.posx-price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.posx-price-input:focus {
    outline: 0;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.posx-line.is-loss {
    background: rgba(220, 38, 38, 0.06);
}
.posx-line.is-loss .posx-price-input {
    border-color: #f87171;
    color: #b91c1c;
    background: #fff7f7;
}
.posx-line-loss {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.18rem;
    padding: 0.16rem 0.5rem;
    border-radius: 8px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.18);
    color: #b91c1c;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    max-width: 100%;
}
.posx-line-loss i {
    font-size: 0.72rem;
    flex-shrink: 0;
}
.posx-line-loss em {
    font-style: normal;
}
.posx-line-loss strong {
    font-weight: 800;
    letter-spacing: -0.01em;
}

.posx-buy-item {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.7rem 0.15rem 0.75rem;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--posx-line);
    background: transparent;
    box-shadow: none;
}

.posx-buy-item:last-child {
    border-bottom: 0;
}

.posx-buy-head {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 28px;
    gap: 0.55rem;
    align-items: center;
}

.posx-buy-item .posx-line-thumb {
    width: 40px;
    height: 40px;
    border-radius: 11px;
}

.posx-buy-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.posx-buy-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--posx-ink);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    unicode-bidi: plaintext;
}

.posx-buy-total {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--posx-muted);
    direction: ltr;
    unicode-bidi: plaintext;
}

.posx-buy-remove {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: var(--posx-soft);
    color: var(--posx-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.posx-buy-remove:hover {
    background: rgba(225, 29, 72, 0.12);
    color: #e11d48;
}

.posx-buy-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.posx-buy-prices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    min-width: 0;
}

.posx-buy-money {
    width: 100%;
    min-width: 0;
}

.posx-buy-qty {
    background: var(--posx-soft);
}

.posx-line-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.posx-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: var(--posx-soft);
    border-radius: 999px;
    padding: 0.12rem;
}

.posx-qty button {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--posx-ink);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.posx-qty span {
    min-width: 1.1rem;
    text-align: center;
    font-weight: 800;
    font-size: 0.8rem;
}

.posx-qty-input {
    width: 3.4rem;
    min-width: 3.4rem;
    border: 0;
    background: transparent;
    text-align: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--posx-ink);
    padding: 0.1rem 0.15rem;
    appearance: textfield;
    -moz-appearance: textfield;
}

.posx-qty-input::-webkit-outer-spin-button,
.posx-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.posx-line .posx-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.posx-line-note {
    font-size: 0.72rem;
    color: var(--posx-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.posx-cart-foot {
    border-top: 1px solid var(--posx-line);
    padding: 0.7rem 0.85rem 0.85rem;
    background: #fff;
}

.posx-summary {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.65rem;
}

.posx-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.84rem;
    color: var(--posx-muted);
}

.posx-summary-row strong { color: var(--posx-ink); }

.posx-summary-discount label {
    margin: 0;
    font-size: 0.84rem;
    color: var(--posx-muted);
    flex-shrink: 0;
}

.posx-discount-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
    max-width: 240px;
}

.posx-summary-discount .pos-money-input {
    max-width: none;
    width: 100%;
    min-width: 0;
}

.posx-summary-sub {
    font-size: 0.78rem;
}

.posx-summary-total {
    padding-top: 0.4rem;
    border-top: 1px solid var(--posx-line);
    font-size: 1rem;
}

.posx-summary-total span,
.posx-summary-total strong {
    color: var(--posx-ink);
    font-weight: 800;
}

.posx-summary-total small {
    font-weight: 600;
    color: var(--posx-muted);
}

.posx-summary-total em {
    font-style: normal;
}

.posx-actions {
    display: grid;
    grid-template-columns: 1fr 48px;
    gap: 0.45rem;
}

.posx-actions-single {
    grid-template-columns: 1fr;
}

.posx-actions-single .posx-pay-btn {
    width: 100%;
    justify-content: center;
}

.posx-pay-btn,
.posx-print-btn {
    border: 0;
    border-radius: 12px;
    min-height: 44px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.7rem;
}

.posx-pay-btn {
    background: var(--posx-accent);
    color: #fff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.28);
}

.posx-pay-btn:disabled,
.posx-print-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.posx-pay-btn em {
    font-style: normal;
    background: rgba(255,255,255,0.22);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
    font-size: 0.75rem;
}

.posx-print-btn {
    background: var(--posx-green);
    color: #fff;
}

.posx .pos-alert {
    margin-bottom: 0.55rem;
}

.posx .pos-field-required label::after {
    content: " *";
    color: #dc2626;
}

.posx .pos-cart-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--posx-muted);
}

.posx .pos-cart-empty-icon {
    display: inline-flex;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: var(--posx-soft);
    color: #94a3b8;
    font-size: 1.4rem;
    margin-bottom: 0.55rem;
}

@media (max-width: 1399.98px) {
    .posx-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    :root { --posx-cart-w: 440px; }
}

@media (max-width: 1199.98px) {
    .posx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .posx-toolbar { grid-template-columns: 1fr 1fr; }
    .posx-search { grid-column: 1 / -1; }
}

@media (max-width: 991.98px) {
    body.pos-screen { overflow: auto; }
    .app-wrapper.is-pos-screen .app-main-pos { overflow: auto; }
    .posx {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100%;
    }
    .posx-main { min-height: 70vh; }
    .posx-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "start meta"
            "actions actions";
        row-gap: 0.55rem;
        column-gap: 0.5rem;
    }
    .posx-topbar-meta {
        display: inline-flex;
        justify-self: end;
    }
    .posx-topbar-actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.35rem;
        width: 100%;
        justify-content: stretch;
    }
    .posx-btn {
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 56px;
        padding: 0.4rem 0.2rem;
        flex-direction: column;
        gap: 0.18rem;
        white-space: normal;
        text-align: center;
        font-size: 0.68rem;
        line-height: 1.15;
    }
    .posx-btn i {
        font-size: 1.05rem;
        line-height: 1;
        flex: 0 0 auto;
    }
    .posx-btn-label {
        display: none;
    }
    .posx-btn-label-short {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        white-space: nowrap;
    }
    .posx-btn .posx-held-badge {
        position: absolute;
        top: 0.25rem;
        inset-inline-end: 0.25rem;
        min-width: 1.05rem;
        height: 1.05rem;
        font-size: 0.62rem;
        pointer-events: none;
    }
    .posx-cart {
        border-right: 0;
        border-top: 1px solid var(--posx-line);
        max-height: none;
    }
    .posx-cart-controls { max-height: none; }
    .posx-cart-body { max-height: 320px; }
    .posx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .posx-main { padding: 0.75rem; }
    .posx-title { font-size: 1.1rem; }
    .posx-breadcrumb { font-size: 0.72rem; }
    .posx-topbar-actions { gap: 0.3rem; }
    .posx-btn {
        min-height: 52px;
        padding: 0.35rem 0.15rem;
        font-size: 0.62rem;
        border-radius: 10px;
    }
    .posx-topbar-meta .header-theme-btn,
    .posx-topbar-meta .header-lang-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 10px;
    }
    .posx-grid { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
    .posx-card-media { height: 44px; font-size: 1rem; }
    .posx-card-media.has-image { height: 64px; }
    .posx-actions { grid-template-columns: 1fr; }
    .posx-field-row { grid-template-columns: 1fr; }
    .posx-cats {
        gap: 0.35rem;
    }
    .posx-cat {
        padding: 0.32rem 0.65rem;
        font-size: 0.72rem;
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }
    .posx-toolbar .posx-select {
        display: none;
    }
}

/* Hold order panel */
.posx-order-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.posx-hold-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 0;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
}

.posx-hold-btn:hover:not(:disabled) {
    background: #2563eb;
    color: #fff;
}

.posx-hold-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.posx-held-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 800;
}

.posx-held-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1080;
}

.posx-held-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: min(420px, 100%);
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 1085;
    display: flex;
    flex-direction: column;
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.18);
}

.posx-held-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
}

.posx-held-panel-head h2 {
    margin: 0;
    font-size: 1.05rem;
    color: #0f172a;
}

.posx-held-panel-head p {
    margin: 0.2rem 0 0;
    color: #64748b;
    font-size: 0.8rem;
}

.posx-held-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.85rem 1rem 1.25rem;
}

.posx-held-item {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.85rem;
    margin-bottom: 0.7rem;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.posx-held-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.posx-held-item-top strong {
    color: #0f172a;
    font-size: 0.92rem;
}

.posx-held-item-top span {
    color: #2563eb;
    font-weight: 800;
}

.posx-held-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    color: #64748b;
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
}

.posx-held-item-meta i { margin-left: 0.2rem; }

.posx-held-item-names {
    color: #475569;
    font-size: 0.8rem;
    margin-bottom: 0.7rem;
    line-height: 1.4;
}

.posx-held-item-actions {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr;
    gap: 0.45rem;
}

.posx-held-item-actions .posx-btn {
    justify-content: center;
    width: 100%;
}

.pos-alert-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.pos-alert-warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

html[dir="rtl"] .posx-held-panel {
    left: auto;
    right: 0;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
}

.posx-card-media.has-image {
    padding: 0.2rem;
    overflow: hidden;
}

.posx-card-media.has-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.posx-card-media.has-image > i {
    display: none;
}



/* Shop POS tweaks: no Rx filter, credit/wholesale in cart */

/* Product grid: 5 tidy cards, no stretch */
.posx-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.4rem;
}

.posx-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    text-align: start;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.posx-card:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.posx-card:active {
    transform: translateY(0);
}

.posx-card-media {
    position: relative;
    width: 100%;
    flex: 0 0 auto;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 16 / 10; max-height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 100%);
}

.posx-card-media.has-image {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0.2rem !important;
    background: #f8fafc !important;
    color: inherit;
}

.posx-card-media.has-image img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    object-position: center;
    display: block;
}

.posx-card-add {
    position: absolute;
    left: 0.3rem;
    bottom: 0.3rem;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

html[dir="rtl"] .posx-card-add {
    left: auto;
    right: 0.4rem;
}

.posx-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 0;
    padding: 0.42rem 0.5rem 0.48rem;
    justify-content: flex-start;
    background: transparent;
}

.posx-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.28rem;
    min-width: 0;
}

.posx-card-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: #0f172a;
}

.posx-card-head .posx-card-stock {
    flex: 0 0 auto;
    max-width: 48%;
    margin-top: 0.02rem;
    padding: 0.08rem 0.3rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.posx-card-head .posx-card-stock.is-low {
    background: #fef3c7;
    color: #b45309;
}





.posx-card-price {
    margin-top: auto;
    padding-top: 0.35rem;
    border-top: 1px solid #f1f5f9;
}

.posx-card-money {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.posx-card-money-usd,
.posx-card-money-iqd {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-width: 0;
}

.posx-card-money-iqd {
    padding-top: 0;
    border-top: 0 !important;
    margin-inline-start: auto;
    flex-shrink: 1;
}

.posx-card-money-usd strong {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.posx-card-money-iqd .posx-card-iqd,
.posx-card-money-iqd small {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: normal;
}

.posx-card-money .posx-card-flag-img,
.posx-card-money .currency-input-flag {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
    object-fit: cover;
}


html[dir="rtl"] .posx-card,
html[dir="rtl"] .posx-card-body {
    text-align: right;
}

.posx-toolbar {
    grid-template-columns: minmax(0, 1.8fr) minmax(160px, 0.7fr);
}
:root {
    --posx-cart-w: 520px;
}
.posx-cart-controls .pos-customer-debt {
    margin-top: 0.3rem;
}
.posx .pos-field-error .form-select {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

@media (max-width: 1399.98px) {
    .posx-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1199.98px) {
    .posx-toolbar { grid-template-columns: 1fr 1fr; }
    .posx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .posx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ===== Modern analytics dashboard (dashx) ===== */
.dashx {
    --dashx-ink: #0f172a;
    --dashx-muted: #64748b;
    --dashx-line: #e2e8f0;
    --dashx-card: #ffffff;
    --dashx-soft: #f8fafc;
    --dashx-accent: #0ea5e9;
    --dashx-accent-2: #14b8a6;
    --dashx-good: #10b981;
    --dashx-bad: #ef4444;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.dashx-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashx-eyebrow {
    margin: 0 0 0.25rem;
    color: var(--dashx-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dashx-title {
    margin: 0;
    color: var(--dashx-ink);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.dashx-date {
    margin: 0.35rem 0 0;
    color: var(--dashx-muted);
    font-size: 0.86rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.dashx-hero-actions,
.dashx-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.dashx-chip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0.45rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--dashx-line);
    background: #fff;
    color: var(--dashx-ink);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.dashx-chip-btn:hover {
    border-color: #bae6fd;
    color: #0369a1;
    background: #f0f9ff;
}

.dashx-chip-btn-accent {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px rgba(14, 165, 233, 0.25);
}

.dashx-chip-btn-accent:hover {
    color: #fff;
    background: linear-gradient(135deg, #0284c7, #0369a1);
}

.dashx-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--dashx-line);
    border-radius: 16px;
    background: var(--dashx-card);
}

.dashx-filter-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.dashx-field {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    font-size: 0.75rem;
    color: var(--dashx-muted);
    font-weight: 700;
}

.dashx-field input {
    min-width: 150px;
    height: 40px;
    border: 1px solid var(--dashx-line);
    border-radius: 10px;
    padding: 0 0.75rem;
    color: var(--dashx-ink);
    background: #fff;
}

.dashx-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.dashx-kpi,
.dashx-card,
.dashx-mini,
.dashx-notice {
    background: var(--dashx-card);
    border: 1px solid var(--dashx-line);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.dashx-kpi {
    padding: 1rem 1.05rem 1.05rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 132px;
}

.dashx-kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--dashx-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.dashx-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.dashx-trend.is-up {
    background: #ecfdf5;
    color: #059669;
}

.dashx-trend.is-down {
    background: #fef2f2;
    color: #dc2626;
}

.dashx-kpi-value {
    color: var(--dashx-ink);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.dashx-kpi-value .money-usd,
.dashx-kpi-value .money-iqd {
    display: block;
}

.dashx-kpi-value .money-iqd {
    margin-top: 0.15rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--dashx-muted);
}

.dashx-kpi-compare {
    margin: auto 0 0;
    color: var(--dashx-muted);
    font-size: 0.74rem;
}

.dashx-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.dashx-mini {
    padding: 0.85rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dashx-mini span {
    color: var(--dashx-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.dashx-mini strong {
    color: var(--dashx-ink);
    font-size: 1rem;
}

.dashx-mini strong .money-iqd {
    display: block;
    margin-top: 0.12rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--dashx-muted);
}

.dashx-viz-grid,
.dashx-rank-grid,
.dashx-panels {
    display: grid;
    grid-template-columns: 1.05fr 1.2fr;
    gap: 0.85rem;
}

.dashx-panels {
    grid-template-columns: 1.35fr 0.9fr;
}

.dashx-card {
    padding: 1rem 1.05rem 1.1rem;
    min-width: 0;
}

.dashx-card-wide { grid-column: auto; }

.dashx-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.dashx-card-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--dashx-ink);
}

.dashx-card-head p {
    margin: 0.2rem 0 0;
    color: var(--dashx-muted);
    font-size: 0.78rem;
}

.dashx-link {
    color: #0284c7;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.dashx-link:hover { color: #0369a1; }

.dashx-gauge-wrap {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1rem;
    align-items: center;
}

.dashx-gauge {
    --gauge: 0;
    width: 180px;
    height: 100px;
    margin: 0 auto;
    position: relative;
    border-radius: 180px 180px 0 0;
    background:
        radial-gradient(circle at 50% 100%, #fff 58%, transparent 59%),
        conic-gradient(from 180deg,
            #0ea5e9 0deg,
            #14b8a6 calc(var(--gauge) * 1.8deg),
            #e2e8f0 calc(var(--gauge) * 1.8deg) 180deg,
            transparent 180deg 360deg);
}

.dashx-gauge-center {
    position: absolute;
    left: 50%;
    bottom: 0.15rem;
    transform: translateX(-50%);
    text-align: center;
}

.dashx-gauge-center strong {
    display: block;
    font-size: 1.35rem;
    color: var(--dashx-ink);
    font-weight: 800;
}

.dashx-gauge-center span {
    color: var(--dashx-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.dashx-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.dashx-legend li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--dashx-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.dashx-legend i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.dashx-legend .tone-cash { background: #0ea5e9; }
.dashx-legend .tone-credit { background: #14b8a6; }
.dashx-legend .tone-margin { background: #94a3b8; }

.dashx-funnel-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.dashx-funnel-metrics div {
    text-align: center;
    min-width: 0;
}

.dashx-funnel-metrics strong {
    display: block;
    color: var(--dashx-ink);
    font-size: 1.05rem;
    font-weight: 800;
}

.dashx-funnel-metrics span {
    display: block;
    margin-top: 0.15rem;
    color: var(--dashx-muted);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
}

.dashx-funnel {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.35rem;
    min-height: 88px;
    padding: 0.35rem 0.2rem 0;
}

.dashx-funnel-seg {
    flex: 1;
    height: calc(28px + (var(--w) * 0.55));
    max-height: 92px;
    border-radius: 10px 10px 6px 6px;
    background: linear-gradient(180deg, #38bdf8, #0ea5e9);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.35rem;
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.18);
    opacity: calc(1 - (var(--i) * 0.12));
}

.dashx-funnel-seg em {
    font-style: normal;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
}

.dashx-rank {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashx-rank li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 36px;
    gap: 0.55rem;
    align-items: center;
}

.dashx-rank-no {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
}

.dashx-rank-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.28rem;
}

.dashx-rank-label strong {
    color: var(--dashx-ink);
    font-size: 0.84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashx-rank-label small {
    color: var(--dashx-muted);
    font-size: 0.7rem;
    white-space: nowrap;
}

.dashx-rank-bar {
    position: relative;
    height: 28px;
    border-radius: 999px;
    background:
        repeating-linear-gradient(
            -45deg,
            #e0f2fe,
            #e0f2fe 6px,
            #f0f9ff 6px,
            #f0f9ff 12px
        );
    overflow: hidden;
}

.dashx-rank-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #0ea5e9 55%, #14b8a6);
    opacity: 0.95;
}

.dashx-rank-bar em {
    position: absolute;
    inset-inline-start: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 800;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 999px;
    padding: 0.08rem 0.45rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.dashx-rank-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 800;
    font-size: 0.85rem;
}

.dashx-rank-avatar.tone-0 { background: #e0f2fe; color: #0369a1; }
.dashx-rank-avatar.tone-1 { background: #ccfbf1; color: #0f766e; }
.dashx-rank-avatar.tone-2 { background: #e2e8f0; color: #334155; }
.dashx-rank-avatar.tone-3 { background: #dbeafe; color: #1d4ed8; }
.dashx-rank-avatar.tone-4 { background: #cffafe; color: #0e7490; }

.dashx-sales {
    display: flex;
    flex-direction: column;
}

.dashx-sale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.15rem;
    border-bottom: 1px solid var(--dashx-line);
    text-decoration: none;
    color: inherit;
}

.dashx-sale:last-child { border-bottom: 0; }

.dashx-sale:hover {
    background: #f8fafc;
}

.dashx-sale strong {
    display: block;
    color: var(--dashx-ink);
    font-size: 0.88rem;
}

.dashx-sale span,
.dashx-sale small {
    color: var(--dashx-muted);
    font-size: 0.74rem;
}

.dashx-sale-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    text-align: end;
}

.dashx-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
}

.dashx-pill.is-cash { background: #ecfdf5; color: #047857; }
.dashx-pill.is-credit { background: #fff7ed; color: #c2410c; }

.dashx-stock {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dashx-stock li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--dashx-line);
}

.dashx-stock li:last-child { border-bottom: 0; }

.dashx-stock strong {
    display: block;
    color: var(--dashx-ink);
    font-size: 0.86rem;
}

.dashx-stock small {
    color: var(--dashx-muted);
    font-size: 0.72rem;
}

.dashx-stock-badge {
    min-width: 2rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.dashx-stock-badge.is-low { background: #fffbeb; color: #b45309; }
.dashx-stock-badge.is-out { background: #fef2f2; color: #dc2626; }

.dashx-empty {
    padding: 1.6rem 0.75rem;
    text-align: center;
    color: var(--dashx-muted);
}

.dashx-empty i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.4rem;
}

.dashx-empty p { margin: 0; font-size: 0.88rem; }
.dashx-empty.is-ok { color: #059669; }

.dashx-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
}

.dashx-notice i {
    font-size: 1.2rem;
    color: #0f766e;
}

.dashx-notice div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-inline-end: auto;
}

.dashx-table-wrap { overflow: auto; }

.dashx-table {
    width: 100%;
    border-collapse: collapse;
}

.dashx-table th,
.dashx-table td {
    padding: 0.7rem 0.35rem;
    border-bottom: 1px solid var(--dashx-line);
    text-align: start;
    font-size: 0.86rem;
}

.dashx-table th {
    color: var(--dashx-muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.dashx-table td { color: var(--dashx-ink); }

@media (max-width: 1199.98px) {
    .dashx-kpi-grid,
    .dashx-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashx-viz-grid,
    .dashx-rank-grid,
    .dashx-panels { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
    .dashx-title { font-size: 1.3rem; }
    .dashx-kpi-grid,
    .dashx-mini-grid { grid-template-columns: 1fr; }
    .dashx-gauge-wrap { grid-template-columns: 1fr; }
    .dashx-funnel-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashx-sale {
        flex-direction: column;
        align-items: flex-start;
    }
    .dashx-sale-meta { align-items: flex-start; text-align: start; }
}
/* ===== Modern returns page (retx) ===== */
.retx {
    --retx-ink: #0f172a;
    --retx-muted: #64748b;
    --retx-line: #e2e8f0;
    --retx-card: #fff;
    --retx-soft: #f8fafc;
    --retx-accent: #0ea5e9;
    --retx-warn: #f59e0b;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.retx-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.retx-eyebrow {
    margin: 0 0 0.2rem;
    color: var(--retx-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.retx-title {
    margin: 0;
    color: var(--retx-ink);
    font-size: 1.45rem;
    font-weight: 800;
}

.retx-subtitle {
    margin: 0.3rem 0 0;
    color: var(--retx-muted);
    font-size: 0.9rem;
}

.retx-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0.4rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--retx-line);
    background: #fff;
    color: var(--retx-ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.82rem;
}

.retx-chip.is-project {
    border-color: #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
}

.retx-tag.is-project {
    background: #eef2ff;
    color: #3730a3;
}

.retx-tag.is-project i {
    font-size: 0.7rem;
}

.retx-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.retx-mode {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--retx-line);
    background: var(--retx-card);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.retx-mode:hover {
    border-color: #bae6fd;
    transform: translateY(-1px);
}

.retx-mode.is-active {
    border-color: #38bdf8;
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.14);
    background: linear-gradient(180deg, #f0f9ff, #fff);
}

.retx-mode-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 1.2rem;
    flex: 0 0 auto;
}

.retx-mode.is-active .retx-mode-icon {
    background: #0ea5e9;
    color: #fff;
}

.retx-mode-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.retx-mode-copy strong {
    color: var(--retx-ink);
    font-size: 0.95rem;
}

.retx-mode-copy small {
    color: var(--retx-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.retx-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.retx-steps span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--retx-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.retx-steps em {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #64748b;
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 800;
}

.retx-steps .is-on {
    background: #e0f2fe;
    color: #0369a1;
}

.retx-steps .is-on em {
    background: #0ea5e9;
    color: #fff;
}

.retx-direct {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
    gap: 0.9rem;
    align-items: start;
}

.retx-card {
    background: var(--retx-card);
    border: 1px solid var(--retx-line);
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
    padding: 1rem;
    min-width: 0;
}

.retx-pick {
    overflow: visible;
}

.retx-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.retx-card-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--retx-ink);
}

.retx-card-head p {
    margin: 0.2rem 0 0;
    color: var(--retx-muted);
    font-size: 0.8rem;
}

.retx-field,
.retx-search {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.retx-field > span,
.retx-field-label,
.retx-item label,
.retx-line-info label span {
    color: var(--retx-muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.retx-field select,
.retx-field input,
.retx-item input,
.retx-line-info input,
.retx-form-foot select,
.retx-form-foot input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--retx-line);
    border-radius: 11px;
    padding: 0.45rem 0.75rem;
    background: #fff;
    color: var(--retx-ink);
}

.retx-search {
    position: relative;
}

.retx-search i {
    position: absolute;
    top: 50%;
    inset-inline-start: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.retx-search input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--retx-line);
    border-radius: 12px;
    padding: 0.55rem 0.9rem;
    padding-inline-start: 2.4rem;
    background: #fff;
    color: var(--retx-ink);
}

.retx-debt-hint {
    margin: -0.35rem 0 0.75rem;
    color: #b45309;
    font-size: 0.78rem;
    font-weight: 700;
}

.retx-results,
.retx-cart-body,
.retx-invoice-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 420px;
    overflow: auto;
}

.retx-result {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    width: 100%;
    text-align: start;
    border: 1px solid var(--retx-line);
    border-radius: 12px;
    background: #fff;
    padding: 0.65rem 0.75rem;
    cursor: pointer;
}

.retx-result-split {
    cursor: default;
}

.retx-result:hover,
.retx-result-split:hover {
    border-color: #7dd3fc;
    background: #f0f9ff;
}

.retx-result-prices {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 7.5rem;
}

.retx-price-pick {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 1px solid var(--retx-line);
    border-radius: 10px;
    background: #fff;
    padding: 0.35rem 0.55rem;
    cursor: pointer;
    text-align: start;
}

.retx-price-pick em {
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--retx-muted);
}

.retx-price-pick strong {
    font-size: 0.8rem;
    color: #0284c7;
}

.retx-price-pick.is-wholesale strong { color: #1d4ed8; }

.retx-price-pick:hover {
    border-color: #38bdf8;
    background: #e0f2fe;
}

.retx-line-type {
    display: inline-flex;
    gap: 0.25rem;
    margin: 0.2rem 0 0.35rem;
}

.retx-type-btn {
    border: 1px solid var(--retx-line);
    border-radius: 999px;
    background: #fff;
    color: var(--retx-muted);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    cursor: pointer;
}

.retx-type-btn.is-on {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
}

.retx-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    color: #0284c7;
}

.retx-result-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.retx-result-copy strong {
    color: var(--retx-ink);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.retx-result-copy small,
.retx-result-meta em {
    color: var(--retx-muted);
    font-size: 0.72rem;
    font-style: normal;
}

.retx-result-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}

.retx-result-meta strong {
    color: #0284c7;
    font-size: 0.84rem;
}

.retx-side {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: sticky;
    top: 0.75rem;
}

.retx-cart {
    display: flex;
    flex-direction: column;
    min-height: 420px;
}

.retx-cart-body { flex: 1; }

.retx-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 0.45rem;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--retx-line);
}

.retx-line:last-child { border-bottom: 0; }

.retx-line-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.retx-line-info strong {
    color: var(--retx-ink);
    font-size: 0.84rem;
}

.retx-line-info label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.retx-line-info input {
    min-height: 34px;
    max-width: 110px;
    padding: 0.25rem 0.45rem;
}

.retx-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 0.15rem;
}

.retx-qty button {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--retx-ink);
}

.retx-qty span {
    min-width: 1.1rem;
    text-align: center;
    font-weight: 800;
    font-size: 0.8rem;
}

.retx-line-total {
    color: var(--retx-ink);
    font-size: 0.82rem;
    white-space: nowrap;
}

.retx-icon-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: #f1f5f9;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.retx-icon-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

.retx-refund {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--retx-line);
}

.retx-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin: 0.4rem 0 0.75rem;
}

.retx-seg label {
    cursor: pointer;
}

.retx-seg input { display: none; }

.retx-seg span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 40px;
    border-radius: 11px;
    border: 1px solid var(--retx-line);
    background: #fff;
    color: var(--retx-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.retx-seg input:checked + span {
    border-color: #38bdf8;
    background: #e0f2fe;
    color: #0369a1;
}

.retx-checkout {
    background: var(--retx-card);
    border: 1px solid var(--retx-line);
    border-radius: 16px;
    padding: 0.9rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.retx-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.retx-total span {
    color: var(--retx-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.retx-total strong {
    color: var(--retx-ink);
    font-size: 1.15rem;
}

.retx-submit {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.25);
}

.retx-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.retx-empty {
    padding: 1.6rem 0.75rem;
    text-align: center;
    color: var(--retx-muted);
}

.retx-empty i {
    display: block;
    font-size: 1.45rem;
    margin-bottom: 0.4rem;
}

.retx-empty p { margin: 0; font-size: 0.88rem; }
.retx-empty.is-info { color: #0369a1; }


.retx-item-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}

.retx-item {
    border: 1px solid var(--retx-line);
    border-radius: 12px;
    padding: 0.75rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.retx-item strong { color: var(--retx-ink); font-size: 0.88rem; }
.retx-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    color: var(--retx-muted);
    font-size: 0.74rem;
}

.retx-bought-price {
    color: #0369a1;
    font-weight: 800;
    font-size: 0.82rem;
}

.retx-form-foot {
    display: grid;
    grid-template-columns: minmax(140px, 0.7fr) minmax(0, 1.3fr);
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.retx-field-grow { min-width: 0; }

.retx-alert,
.retx-toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.88rem;
}

.retx-alert.is-ok,
.retx-toast.is-ok { background: #ecfdf5; color: #047857; }
.retx-alert.is-bad,
.retx-toast.is-bad { background: #fef2f2; color: #b91c1c; }

@media (max-width: 991.98px) {
    .retx-modes,
    .retx-direct,
    .retx-invoice,
    .retx-item-grid,
    .retx-form-foot { grid-template-columns: 1fr; }
    .retx-side { position: static; }
    .retx-cart { min-height: 0; }
    .retx-line {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "info remove"
            "qty total";
    }
    .retx-line-info { grid-area: info; }
    .retx-qty { grid-area: qty; justify-self: start; }
    .retx-line-total { grid-area: total; justify-self: end; }
    .retx-icon-btn { grid-area: remove; justify-self: end; }
}
/* Invoice / customer return workspace */
.retx-invoice {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    align-items: start;
    min-height: calc(100vh - 220px);
    gap: 1rem;
}

.retx-invoices {
    display: flex;
    flex-direction: column;
    padding: 0;
    max-height: calc(100vh - 220px);
    overflow: hidden;
    background:
        linear-gradient(180deg, #f8fafc 0%, #fff 28%);
}

.retx-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
}

.retx-side-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--retx-ink);
    letter-spacing: -0.02em;
}

.retx-side-head p {
    margin: 0.2rem 0 0;
    color: var(--retx-muted);
    font-size: 0.78rem;
}

.retx-side-badge {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #e0f2fe, #bae6fd);
    color: #0369a1;
    font-size: 1.1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.retx-invoice-search {
    margin: 0 1rem 0.75rem;
}

.retx-invoice-search.retx-search {
    flex-direction: row;
    align-items: center;
}

.retx-invoice-search input {
    padding-inline-start: 2.4rem;
}

.retx-invoice-list {
    flex: 1;
    max-height: none;
    gap: 0.45rem;
    padding: 0 0.75rem 0.85rem;
}

.retx-invoice-item {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 14px;
    gap: 0.7rem;
    align-items: center;
    padding: 0.85rem 0.8rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
}

.retx-invoice-item:hover {
    border-color: #bae6fd;
    background: #f0f9ff;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(14, 165, 233, 0.1);
}

.retx-invoice-item.is-active {
    border-color: #7dd3fc;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 55%, #fff 100%);
    box-shadow: 0 12px 28px rgba(14, 165, 233, 0.14);
}

.retx-invoice-item.is-active::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 16%;
    bottom: 16%;
    width: 3px;
    border-radius: 999px;
    background: #0ea5e9;
}

.retx-invoice-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
    color: #334155;
    font-weight: 800;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.retx-invoice-item.is-credit-sale .retx-invoice-avatar {
    background: linear-gradient(145deg, #ffedd5, #fed7aa);
    color: #c2410c;
}

.retx-invoice-item.is-overdue {
    border-color: #fdba74;
}

.retx-invoice-item.is-overdue .retx-invoice-avatar {
    background: linear-gradient(145deg, #fecaca, #f87171);
    color: #991b1b;
}

.retx-invoice-item.is-active .retx-invoice-avatar {
    background: linear-gradient(145deg, #0ea5e9, #0284c7);
    color: #fff;
}

.retx-invoice-body {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 0;
}

.retx-invoice-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.retx-invoice-top strong {
    font-size: 0.9rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--retx-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.retx-invoice-top em {
    font-style: normal;
    color: #0284c7;
    font-weight: 800;
    font-size: 0.86rem;
    flex: 0 0 auto;
}

.retx-debt-amt {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.05rem;
    color: #c2410c !important;
    line-height: 1.15;
}

.retx-debt-amt small {
    font-size: 0.62rem;
    font-weight: 800;
    color: #ea580c;
    text-transform: none;
}

.retx-invoice-code {
    display: inline-flex;
    align-self: flex-start;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 0.12rem 0.4rem;
}

.retx-invoice-item.is-active .retx-invoice-code {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.retx-invoice-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.7rem;
    color: var(--retx-muted);
    font-size: 0.72rem;
    line-height: 1.35;
}

.retx-invoice-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.retx-invoice-meta i {
    font-size: 0.7rem;
    opacity: 0.85;
}

.retx-invoice-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.05rem;
}

.retx-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.14rem 0.48rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1.2;
    background: #f1f5f9;
    color: #475569;
}

.retx-tag.is-cash { background: #ecfdf5; color: #047857; }
.retx-tag.is-credit { background: #fff7ed; color: #c2410c; }
.retx-tag.is-type { background: #eff6ff; color: #1d4ed8; }
.retx-tag.is-best { background: #fef9c3; color: #a16207; }
.retx-tag.is-high-debt { background: #fee2e2; color: #b91c1c; }

.retx-invoice-item.is-best-buyer .retx-invoice-avatar {
    background: linear-gradient(145deg, #fef08a, #facc15);
    color: #854d0e;
}

.retx-invoice-item.is-high-debt .retx-invoice-avatar {
    background: linear-gradient(145deg, #fecaca, #f87171);
    color: #991b1b;
}

.retx-invoice-item.is-best-buyer.is-high-debt .retx-invoice-avatar {
    background: linear-gradient(145deg, #fde68a, #fb923c);
    color: #9a3412;
}

.retx-invoice-chevron {
    color: #94a3b8;
    font-size: 0.85rem;
    transition: color 0.18s, transform 0.18s;
}

.retx-invoice-item:hover .retx-invoice-chevron,
.retx-invoice-item.is-active .retx-invoice-chevron {
    color: #0ea5e9;
}

html[dir="ltr"] .retx-invoice-chevron {
    transform: scaleX(-1);
}

html[dir="ltr"] .retx-invoice-item:hover .retx-invoice-chevron {
    transform: scaleX(-1) translateX(2px);
}

html[dir="rtl"] .retx-invoice-item:hover .retx-invoice-chevron {
    transform: translateX(-2px);
}

.retx-invoice-main {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.06), transparent 36%),
        #fff;
}

.retx-sale-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.25rem;
    border-bottom: 1px solid var(--retx-line);
    background:
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 40%),
        linear-gradient(135deg, #f8fafc 0%, #fff 48%, #f0f9ff 100%);
}

.retx-sale-banner-main {
    min-width: 0;
}

.retx-sale-banner h2 {
    margin: 0.2rem 0 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--retx-ink);
}

.retx-sale-banner-meta {
    margin: 0.55rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    color: var(--retx-muted);
    font-size: 0.8rem;
}

.retx-sale-banner-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.retx-sale-banner-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    text-align: end;
}

.retx-sale-amount {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--retx-ink);
}

.retx-sale-banner-side > strong {
    font-size: 1.05rem;
    color: var(--retx-ink);
}

.retx-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.retx-item-search {
    margin: 0.85rem 1.05rem 0;
}

.retx-item-search.retx-search {
    flex-direction: row;
    align-items: center;
}

.retx-item-search input {
    padding-inline-start: 2.4rem;
}

.retx-item-search-empty {
    margin: 0.65rem 1.05rem 0;
    color: var(--retx-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.retx-item-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.95rem 1.05rem;
    overflow: auto;
    flex: 1;
}

.retx-item-list.is-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
    align-content: start;
}

.retx-item-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--retx-line);
    border-radius: 16px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.retx-item-row:hover {
    border-color: #bae6fd;
    box-shadow: 0 8px 18px rgba(14, 165, 233, 0.08);
    transform: translateY(-1px);
}

.retx-item-row.is-card {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 0.55rem;
    padding: 0.75rem;
    min-width: 0;
}

.retx-item-row.is-card .retx-item-thumb {
    width: 100%;
    height: 88px;
    border-radius: 12px;
}

.retx-item-row.is-card .retx-item-main strong {
    font-size: 0.8rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.retx-item-row.is-card .retx-item-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.retx-item-row.is-card .retx-item-qty {
    justify-self: center;
    width: 100%;
    justify-content: space-between;
}

.retx-item-row.is-card .retx-item-line {
    min-width: 0;
    text-align: center;
    font-size: 0.84rem;
}

.retx-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.35rem 1.05rem 0.95rem;
}

.retx-pager-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
}

.retx-pager-btn,
.retx-pager-num {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--retx-line);
    border-radius: 10px;
    background: #fff;
    color: var(--retx-ink);
    font-weight: 800;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.retx-pager-num.is-on {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #fff;
}

.retx-pager-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.retx-item-thumb {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    color: #0284c7;
    overflow: hidden;
    flex-shrink: 0;
}

.retx-item-thumb.has-image {
    background: #f1f5f9;
}

.retx-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.retx-item-thumb i {
    font-size: 1.25rem;
}

.retx-item-main {
    min-width: 0;
}

.retx-item-main strong {
    display: block;
    color: var(--retx-ink);
    font-size: 0.92rem;
    margin-bottom: 0.25rem;
}

.retx-item-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 0.2rem;
}

.retx-qty-btn {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--retx-ink);
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.retx-qty-input {
    width: 48px;
    min-height: 30px;
    border: 0;
    background: transparent;
    text-align: center;
    font-weight: 800;
    color: var(--retx-ink);
}

.retx-item-line {
    min-width: 72px;
    text-align: end;
    color: #0284c7;
    font-size: 0.9rem;
}

.retx-form-bar {
    margin-top: auto;
    border-top: 1px solid var(--retx-line);
    padding: 0.9rem 1.05rem 1.05rem;
    background: #f8fafc;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
    gap: 0.85rem;
    align-items: end;
}

.retx-form-bar-fields {
    display: grid;
    grid-template-columns: minmax(140px, 0.7fr) minmax(0, 1.3fr);
    gap: 0.65rem;
}

.retx-form-bar-fields .retx-field { margin-bottom: 0; }

.retx-form-bar-action {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.retx-form-bar-action .retx-total { margin-bottom: 0; }

.retx-empty-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    padding: 2.5rem 1.25rem;
    text-align: center;
    background:
        radial-gradient(circle at center, rgba(14, 165, 233, 0.08), transparent 55%);
}

.retx-empty-panel h3 {
    margin: 0.85rem 0 0.35rem;
    color: var(--retx-ink);
    font-size: 1.12rem;
    letter-spacing: -0.02em;
}

.retx-empty-panel p {
    max-width: 28ch;
    color: var(--retx-muted);
}

.retx-empty-glow {
    width: 78px;
    height: 78px;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #e0f2fe, #bae6fd);
    color: #0284c7;
    font-size: 1.75rem;
    box-shadow: 0 14px 32px rgba(14, 165, 233, 0.2);
    animation: retxPulse 2.4s ease-in-out infinite;
}

@keyframes retxPulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@media (max-width: 1400px) {
    .retx-item-list.is-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .retx-item-list.is-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .retx-empty-glow {
        animation: none !important;
    }
}

@media (max-width: 991.98px) {
    .retx {
        gap: 0.75rem;
        padding-bottom: 1rem;
    }

    .retx-modes {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .retx-mode {
        padding: 0.8rem 0.85rem;
    }

    .retx-mode-copy small {
        display: none;
    }

    .retx-direct,
    .retx-invoice {
        display: grid;
        grid-template-columns: 1fr;
        min-height: 0;
        gap: 0.75rem;
    }

    .retx-invoices {
        max-height: min(42vh, 320px);
        order: -1;
    }

    .retx-invoice-main {
        min-height: 0;
    }

    .retx-sale-banner {
        flex-direction: column;
        padding: 1rem;
    }

    .retx-sale-banner h2 {
        font-size: 1.1rem;
    }

    .retx-sale-banner-side {
        align-items: flex-start;
        text-align: start;
        width: 100%;
    }

    .retx-form-bar,
    .retx-form-bar-fields {
        grid-template-columns: 1fr;
    }

    .retx-form-bar-action .retx-submit {
        width: 100%;
    }

    .retx-item-list.is-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        padding: 0.75rem;
    }

    .retx-item-search {
        margin: 0.75rem 0.75rem 0;
    }

    .retx-item-row:not(.is-card) {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .retx-item-row:not(.is-card) .retx-item-qty,
    .retx-item-row:not(.is-card) .retx-item-line {
        grid-column: 2;
        justify-self: start;
    }

    .retx-item-line { text-align: start; }

    .retx-pager {
        padding-bottom: 0.75rem;
        position: sticky;
        bottom: 0;
        background: linear-gradient(180deg, transparent, #fff 35%);
        z-index: 2;
    }

    .retx-empty-panel {
        min-height: 220px;
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 575.98px) {
    .retx-modes {
        gap: 0.45rem;
    }

    .retx-mode-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 1rem;
    }

    .retx-mode-copy strong {
        font-size: 0.86rem;
    }

    .retx-invoices {
        max-height: min(38vh, 280px);
    }

    .retx-item-list.is-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .retx-item-row.is-card .retx-item-thumb {
        height: 72px;
    }

    .retx-side-head {
        padding: 0.85rem 0.85rem 0.55rem;
    }

    .retx-invoice-search {
        margin: 0 0.85rem 0.65rem;
    }

    .retx-invoice-list {
        padding: 0 0.65rem 0.75rem;
    }
}
.retx-customer-picker {
    position: relative;
    margin-bottom: 0.9rem;
}
.retx-customer-picker .retx-field-label {
    display: block;
    margin-bottom: 0.35rem;
}
.retx-customer-search-wrap {
    position: relative;
    display: block;
}
.retx-customer-search-wrap > i {
    position: absolute;
    top: 50%;
    inset-inline-start: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.retx-customer-input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--retx-line);
    border-radius: 12px;
    padding: 0.55rem 0.9rem;
    padding-inline-start: 2.4rem;
    background: var(--retx-card);
    color: var(--retx-ink);
}
.retx-customer-chosen {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #bae6fd;
    background: #f0f9ff;
}
.retx-customer-chosen-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0ea5e9;
    color: #fff;
    font-weight: 800;
    flex: 0 0 auto;
}
.retx-customer-chosen-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}
.retx-customer-chosen-copy strong {
    color: var(--retx-ink);
    font-size: 0.9rem;
}
.retx-customer-chosen-copy small {
    color: var(--retx-muted);
    font-size: 0.74rem;
}
.retx-customer-clear {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: #e0f2fe;
    color: #0369a1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.retx-customer-fallback {
    margin: 0.4rem 0 0;
    color: var(--retx-muted);
    font-size: 0.76rem;
    font-weight: 700;
}
.retx-customer-menu {
    position: static;
    margin-top: 0.45rem;
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--retx-line);
    border-radius: 12px;
    background: var(--retx-card);
    box-shadow: none;
    padding: 0.35rem;
}
.retx-customer-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    text-align: start;
    border: 0;
    border-radius: 10px;
    background: transparent;
    padding: 0.6rem 0.65rem;
    cursor: pointer;
    color: inherit;
}
.retx-customer-option:hover { background: #f0f9ff; }
.retx-customer-option-main {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.retx-customer-option-main strong {
    color: var(--retx-ink);
    font-size: 0.86rem;
}
.retx-customer-option-main small {
    color: var(--retx-muted);
    font-size: 0.72rem;
}
.retx-customer-option em {
    font-style: normal;
    color: #b45309;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}
.retx-customer-empty {
    padding: 0.65rem;
    color: var(--retx-muted);
    font-size: 0.8rem;
    text-align: center;
}
.retx-search-box {
    position: relative;
    display: block;
}
.retx-search-box > i {
    position: absolute;
    top: 50%;
    inset-inline-start: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.retx-search-box input,
.retx-search input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--retx-line);
    border-radius: 12px;
    padding: 0.55rem 0.9rem;
    padding-inline-start: 2.4rem;
    background: var(--retx-card);
    color: var(--retx-ink);
}
html[data-theme="dark"] .retx-customer-chosen {
    background: #0c4a6e;
    border-color: #0284c7;
}
html[data-theme="dark"] .retx-customer-clear {
    background: #075985;
    color: #e0f2fe;
}
html[data-theme="dark"] .retx-customer-option:hover { background: #0c4a6e; }
html[data-theme="dark"] .retx-customer-input,
html[data-theme="dark"] .retx-customer-menu,
html[data-theme="dark"] .retx-search-box input,
html[data-theme="dark"] .retx-search input {
    background: #111827;
    border-color: #334155;
    color: #e2e8f0;
}

/* Warehouse stock inventory */
.warehouse-page { display: flex; flex-direction: column; gap: 0.85rem; }
.warehouse-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.warehouse-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary, #0f172a);
}
.warehouse-subtitle {
    margin: 0.2rem 0 0;
    color: var(--text-muted, #64748b);
    font-size: 0.86rem;
}
.warehouse-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}
.warehouse-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    background: var(--card-bg, #fff);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.warehouse-stat span {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    font-weight: 600;
}
.warehouse-stat strong {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary, #0f172a);
}
.warehouse-stat.is-warn strong { color: #d97706; }
.warehouse-stat.is-danger strong { color: #dc2626; }
.warehouse-stat.is-active,
.warehouse-stat:hover {
    border-color: #93c5fd;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}
.warehouse-search {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    padding: 0.85rem;
    align-items: center;
}
.warehouse-search-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
}
.warehouse-search-wrap i {
    position: absolute;
    inset-inline-start: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
.warehouse-search-wrap input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 0.45rem 0.85rem;
    padding-inline-start: 2.2rem;
    background: var(--card-bg, #fff);
    color: var(--text-primary, #0f172a);
}
.warehouse-stock-badge {
    display: inline-flex;
    min-width: 2rem;
    justify-content: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.8rem;
}
.warehouse-stock-badge.is-ok {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}
.warehouse-stock-badge.is-low {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}
.warehouse-stock-badge.is-out {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}
.warehouse-cards {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem;
}
.warehouse-card {
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 0.85rem;
    background: var(--card-bg, #fff);
}
.warehouse-card-top {
    display: flex;
    justify-content: space-between;
    gap: 0.65rem;
    align-items: center;
}
.warehouse-card-top .product-thumb {
    width: 42px;
    height: 42px;
}
.warehouse-card-top strong {
    flex: 1;
    min-width: 0;
}
.warehouse-card-meta,
.warehouse-card-foot {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.45rem;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
}
@media (max-width: 767.98px) {
    .warehouse-stats { grid-template-columns: 1fr; }
}

/* App confirm dialog */
body.app-confirm-open { overflow: hidden; }
.app-confirm {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.app-confirm[hidden] { display: none !important; }
.app-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}
.app-confirm-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 400px);
    padding: 1.25rem;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    animation: appConfirmIn 0.16s ease-out;
}
@keyframes appConfirmIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
.app-confirm-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
    font-size: 1.2rem;
}
.app-confirm.is-danger .app-confirm-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}
.app-confirm-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}
.app-confirm-message {
    margin: 0.35rem 0 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #64748b;
}
.app-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
}
.app-confirm-actions .btn {
    min-width: 96px;
    font-weight: 700;
}

/* ===== Construction module ===== */
.construction-page { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.construction-nav {
    display: flex; flex-wrap: nowrap; gap: 0.4rem; overflow-x: auto;
    padding: 0.35rem 0.15rem 0.55rem; -webkit-overflow-scrolling: touch;
}
.construction-nav-link {
    display: inline-flex; align-items: center; gap: 0.35rem; flex: 0 0 auto;
    min-height: 38px; padding: 0.35rem 0.8rem; border-radius: 999px;
    border: 1px solid #dbe3ee; background: #fff; color: #334155;
    font-size: 0.8rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.construction-nav-link:hover { background: #f8fafc; color: #0f172a; }
.construction-nav-link.is-active {
    background: rgba(15, 118, 110, 0.12); border-color: #0f766e; color: #0f766e;
}
.construction-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: 1rem 1.1rem; border: 1px solid #e2e8f0; border-radius: 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef6f5 100%);
}
.construction-hero-main { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.construction-hero-mark {
    width: 46px; height: 46px; border-radius: 14px; display: inline-flex;
    align-items: center; justify-content: center; background: #0f766e; color: #fff; font-size: 1.2rem;
}
.construction-page-title { margin: 0; font-size: 1.25rem; font-weight: 800; color: #0f172a; }
.construction-page-subtitle { margin: 0.2rem 0 0; font-size: 0.88rem; color: #64748b; }
.construction-owner-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    margin-top: 0.45rem;
    font-size: 0.9rem;
}
.construction-owner-label {
    color: #64748b;
    font-weight: 700;
}
.construction-owner-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #0f766e;
    font-weight: 700;
    text-decoration: none;
}
.construction-owner-link:hover { text-decoration: underline; }
.construction-project-hero-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-top: 0.45rem;
    font-size: 0.82rem;
    color: #64748b;
}
.construction-project-hero-dates span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.construction-project-hero-dates i { color: #0f766e; }
.construction-project-hero-dates strong {
    color: #0f172a;
    font-weight: 700;
}
.construction-metrics {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem;
}
.construction-metric {
    padding: 0.9rem 1rem; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff;
}
.construction-metric.is-profit { border-color: #86efac; background: #f0fdf4; }
.construction-metric.is-loss { border-color: #fecaca; background: #fef2f2; }
.construction-metric-label { display: block; font-size: 0.78rem; color: #64748b; font-weight: 600; }
.construction-metric-value { display: block; margin-top: 0.25rem; font-size: 1rem; color: #0f172a; }
.construction-card { padding: 1rem 1.1rem; }
.construction-card-title { margin: 0 0 0.85rem; font-size: 1rem; font-weight: 800; color: #0f172a; }
.construction-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}
.construction-filters .form-control,
.construction-filters .form-select {
    flex: 1 1 160px;
    min-width: 140px;
    min-height: 42px;
    height: 42px;
    max-height: 42px;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}
.construction-material-filter-card {
    padding: 0.85rem 1rem;
}
.construction-material-filter {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
    width: 100%;
}
.construction-material-filter-label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
}
.construction-material-filter-row {
    display: block;
    width: 100%;
}
.construction-material-filter-select {
    display: block;
    width: 100% !important;
    max-width: 100%;
    min-width: 0 !important;
    min-height: 44px;
    flex: none !important;
    font-size: 16px;
}
.construction-table th { font-size: 0.78rem; color: #64748b; white-space: nowrap; }
.construction-table td { vertical-align: middle; }
.construction-money-cell .money-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    white-space: normal;
}
.construction-money-cell .money-sep { display: none; }
.construction-money-cell .money-usd { font-weight: 800; font-size: 0.86rem; }
.construction-money-cell .money-iqd { font-size: 0.68rem; color: #94a3b8; font-weight: 650; }
.construction-money-cell.is-in .money-usd { color: #15803d; }
.construction-money-cell.is-out .money-usd { color: #b91c1c; }
.construction-money-cell.is-balance .money-usd { color: #0f766e; }
.construction-project-mobile-money {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: 0.65rem;
}
.construction-project-mobile-money > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.4rem 0.45rem;
    border-radius: 12px;
    background: #f8fafc;
}
.construction-project-mobile-money em {
    font-style: normal;
    font-size: 0.64rem;
    font-weight: 700;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.construction-project-mobile-money strong {
    display: block;
    direction: ltr;
    unicode-bidi: isolate;
}
.construction-project-mobile-money .money-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    white-space: normal;
}
.construction-project-mobile-money .money-sep { display: none; }
.construction-project-mobile-money .money-usd { font-size: 0.8rem; font-weight: 800; }
.construction-project-mobile-money .money-iqd { font-size: 0.64rem; color: #94a3b8; font-weight: 650; }
.construction-project-mobile-money .is-in .money-usd { color: #15803d; }
.construction-project-mobile-money .is-out .money-usd { color: #b91c1c; }
.construction-project-mobile-money .is-balance .money-usd { color: #0f766e; }
.construction-table-compact {
    table-layout: fixed;
    width: 100%;
}
.construction-table-compact th,
.construction-table-compact td {
    padding: 0.45rem 0.55rem;
}
.construction-table-compact .construction-col-name { width: 22%; }
.construction-table-compact .construction-col-phone { width: 16%; }
.construction-table-compact .construction-col-address { width: 20%; }
.construction-table-compact .construction-col-balance { width: 22%; }
.construction-table-compact .construction-col-count { width: 8%; text-align: center; }
.construction-table-compact .construction-col-actions { width: 12%; }
.construction-table-compact .construction-col-address {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0;
}
.construction-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.28rem;
    flex-wrap: nowrap;
}
.construction-row-actions form { display: inline-flex; margin: 0; }
.construction-row-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.construction-table .construction-col-phone,
.construction-table .construction-phone-cell {
    text-align: start;
    white-space: nowrap;
}
.construction-client-card .construction-phone-line {
    white-space: nowrap;
}
.construction-table .construction-phone-cell .customer-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    direction: ltr;
    unicode-bidi: isolate;
    max-width: 100%;
}
.construction-table-compact .construction-balance-pill {
    max-width: 100%;
}
.construction-table-compact .construction-balance-pill .money-wrap {
    gap: 0.2rem;
}
.construction-table-compact .construction-balance-pill .money-iqd {
    font-size: 0.78em;
}
.construction-status {
    display: inline-flex; align-items: center; min-height: 26px; padding: 0.15rem 0.55rem;
    border-radius: 999px; font-size: 0.74rem; font-weight: 700; background: #e2e8f0; color: #334155;
}
.construction-status-planning { background: #e0e7ff; color: #3730a3; }
.construction-status-active { background: #ccfbf1; color: #0f766e; }
.construction-status-on_hold { background: #fef3c7; color: #92400e; }
.construction-status-completed { background: #dcfce7; color: #166534; }
.construction-status-cancelled { background: #fee2e2; color: #991b1b; }
.construction-month-list, .construction-mini-list { list-style: none; margin: 0; padding: 0; }
.construction-month-row, .construction-mini-list li {
    display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0;
    border-bottom: 1px solid #f1f5f9; font-size: 0.88rem;
}
.construction-month-row:last-child, .construction-mini-list li:last-child { border-bottom: 0; }
.construction-dl { margin: 0; display: grid; gap: 0.65rem; }
.construction-dl > div { display: grid; gap: 0.15rem; }
.construction-dl dt { margin: 0; font-size: 0.75rem; color: #64748b; font-weight: 700; }
.construction-dl dd { margin: 0; color: #0f172a; font-weight: 600; }
.construction-breakdown-item {
    padding: 0.7rem 0.8rem; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc;
    display: flex; flex-direction: column; gap: 0.25rem; min-height: 72px;
}
.construction-breakdown-item span { font-size: 0.75rem; color: #64748b; font-weight: 600; }
.construction-mobile-cards { display: grid; gap: 0.65rem; }
.construction-mobile-card {
    display: block; padding: 0.85rem 0.95rem; border: 1px solid #e2e8f0; border-radius: 14px;
    background: #fff; color: inherit; text-decoration: none;
}
.construction-material-mobile-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.construction-material-mobile-top {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: start;
}
.construction-material-mobile-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}
.construction-material-mobile-copy strong {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}
.construction-material-mobile-copy a {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f766e;
    text-decoration: none;
}
.construction-material-mobile-copy small {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
}
.construction-material-mobile-money {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.55rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.78rem;
    color: #64748b;
}
.construction-material-mobile-money strong {
    font-size: 0.9rem;
    color: #0f172a;
}
@media (max-width: 767.98px) {
    .construction-hero {
        padding: 0.85rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .construction-hero > .btn {
        width: 100%;
        justify-content: center;
    }
    .construction-page-title { font-size: 1.05rem; }
    .construction-page-subtitle { font-size: 0.8rem; }
    .construction-card { padding: 0.85rem; }
    .construction-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .construction-filters .form-control,
    .construction-filters .form-select {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        min-height: 44px;
        height: 44px;
        max-height: 44px;
        font-size: 16px;
    }
    .construction-filters .btn {
        width: 100%;
        min-height: 44px;
        flex: 0 0 auto;
    }
    .construction-material-pos-form .form-select {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
    }
    .construction-material-pos,
    .construction-material-kpis {
        margin-bottom: 0.85rem;
    }
    .construction-material-checkout {
        position: sticky;
        bottom: 0.5rem;
        z-index: 5;
    }
}

.construction-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 220px;
}
.construction-search-wrap > i {
    position: absolute;
    inset-inline-start: 0.85rem;
    color: #94a3b8;
    pointer-events: none;
}
.construction-search-wrap .form-control {
    padding-inline-start: 2.35rem;
}
.construction-balance-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    font-size: 0.82rem;
}
.construction-balance-pill.is-positive {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}
.construction-balance-pill.is-negative {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}
.construction-client-cards {
    display: grid;
    gap: 0.7rem;
}
.construction-client-card {
    display: block;
    padding: 0.9rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}
.construction-empty {
    text-align: center;
    padding: 2rem 1rem;
}
.construction-empty-icon {
    display: inline-flex;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}
.construction-tx-type {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}
.construction-tx-credit { background: #dcfce7; color: #166534; }
.construction-tx-debit { background: #fee2e2; color: #991b1b; }

/* Construction project form */
.construction-form-card {
    max-width: 920px;
    margin-inline: auto;
    width: 100%;
}
.construction-form-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.construction-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 0.9rem;
}
.construction-form-field-wide {
    grid-column: 1 / -1;
}
.construction-form-field .form-label {
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
}
.construction-form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}
.construction-form-field-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.construction-form-field-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}
.construction-form-field-actions .btn.is-muted {
    opacity: 0.72;
}
.construction-money-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}
.construction-money-pair .input-group-text {
    min-width: 44px;
    padding: 0.35rem 0.5rem;
    background: #f8fafc;
}
.construction-money-pair .form-control {
    min-height: 38px;
}
.construction-form-date {
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
}
@media (max-width: 575.98px) {
    .construction-money-pair {
        grid-template-columns: 1fr;
    }
}
.construction-form-date::-webkit-date-and-time-value {
    text-align: left;
}
.construction-form-actions-inline {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid #eef2f7;
}
.construction-form-danger-inline {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #fecaca;
}
@media (max-width: 767.98px) {
    .construction-form-grid {
        grid-template-columns: 1fr;
    }
    .construction-form-actions-inline {
        justify-content: stretch;
    }
    .construction-form-actions-inline .btn {
        flex: 1 1 auto;
    }
}

/* Construction expenses — modern workspace */
.construction-expense-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1rem;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 42%),
        linear-gradient(135deg, #f8fafc 0%, #eef6f5 55%, #f8fafc 100%);
}
.construction-expense-hero-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.55rem;
    margin-inline-start: auto;
}
.construction-expense-stat {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1 1 140px;
    max-width: 220px;
    padding: 0.55rem 0.7rem;
    border-radius: 14px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}
.construction-expense-stat.is-paid .construction-expense-stat-icon {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}
.construction-expense-stat.is-spent .construction-expense-stat-icon {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}
.construction-expense-stat.is-balance {
    border-color: rgba(15, 118, 110, 0.22);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(240, 253, 250, 0.95));
}
.construction-expense-stat.is-balance .construction-expense-stat-icon {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}
.construction-expense-stat.is-over {
    border-color: rgba(220, 38, 38, 0.28);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(254, 242, 242, 0.95));
}
.construction-expense-stat.is-over .construction-expense-stat-icon {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}
.construction-expense-stat-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
    font-size: 0.95rem;
}
.construction-expense-stat-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.construction-expense-stat-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #64748b;
    line-height: 1.2;
}
.construction-expense-stat-value {
    display: block;
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    direction: ltr;
    unicode-bidi: isolate;
}
.construction-expense-stat.is-paid .construction-expense-stat-value { color: #15803d; }
.construction-expense-stat.is-spent .construction-expense-stat-value { color: #b45309; }
.construction-expense-stat.is-balance .construction-expense-stat-value { color: #0f766e; }
.construction-expense-stat.is-over .construction-expense-stat-value { color: #b91c1c; }
.construction-expense-stat-value .money-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    white-space: normal;
}
.construction-expense-stat-value .money-sep {
    display: none;
}
.construction-expense-stat-value .money-usd {
    font-size: 0.9rem;
    font-weight: 800;
    color: inherit;
}
.construction-expense-stat-value .money-iqd {
    font-size: 0.66rem;
    font-weight: 600;
    color: #64748b;
}
.construction-money-stack .money-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.08rem;
}
.construction-money-stack .money-sep { display: none; }
.construction-money-stack .money-usd {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: inherit;
}
.construction-money-stack .money-iqd {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-size: 0.76rem;
    font-weight: 650;
    color: #64748b;
}
.construction-spend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.45rem;
    max-width: 100%;
    padding: 0.35rem 0.55rem 0.35rem 0.35rem;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 100%);
    color: #1e3a8a;
}
.construction-spend-chip-icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    font-size: 0.72rem;
}
.construction-spend-chip-copy {
    display: flex;
    flex-direction: column;
    gap: 0.02rem;
    min-width: 0;
    line-height: 1.15;
}
.construction-spend-chip-copy em {
    font-style: normal;
    font-size: 0.62rem;
    font-weight: 700;
    color: #64748b;
}
.construction-spend-chip-copy strong {
    font-size: 0.78rem;
    font-weight: 800;
    color: #1e40af;
}
.construction-spend-chip-copy .money-wrap {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.2rem;
    flex-wrap: wrap;
}
.construction-spend-chip-copy .money-sep {
    display: inline;
    color: #94a3b8;
    font-weight: 600;
}
.construction-spend-chip-copy .money-usd,
.construction-spend-chip-copy .money-iqd {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: #1e40af;
}
.construction-spend-chip-copy .money-iqd { color: #64748b; font-weight: 700; }
.construction-spend-chip-share {
    flex: 0 0 auto;
    margin-inline-start: 0.15rem;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-size: 0.66rem;
    font-weight: 800;
}
.construction-spend-chip.is-count {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #334155;
}
.construction-spend-chip.is-count .construction-spend-chip-icon {
    background: #64748b;
}
.construction-spend-chip.is-count .construction-spend-chip-copy strong {
    color: #0f172a;
}
.construction-expense-cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.65rem;
}
.construction-expense-cat {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 0.85rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.construction-expense-cat:hover {
    border-color: #99f6e4;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.construction-expense-cat.is-active {
    border-color: #0f766e;
    background: rgba(15, 118, 110, 0.06);
}
.construction-expense-cat-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ecfdf5;
    color: #0f766e;
    flex: 0 0 auto;
}
.construction-expense-cat-copy {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}
.construction-expense-cat-copy strong {
    font-size: 0.84rem;
    color: #0f172a;
}
.construction-expense-cat-copy em {
    font-style: normal;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f766e;
}
.construction-expense-form-card,
.construction-expense-list-card {
    height: 100%;
}
.construction-expense-form-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.construction-expense-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding: 0.3rem;
    border-radius: 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.construction-expense-mode button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0.45rem 0.65rem;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 750;
}
.construction-expense-mode button.is-active {
    background: #fff;
    color: #0f766e;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.construction-expense-mode-panel { display: none; }
.construction-expense-mode-panel.is-open { display: block; }
.construction-expense-pos-picker {
    margin-bottom: 0.35rem;
}
.construction-expense-form-head,
.construction-expense-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.construction-expense-list-balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}
.construction-expense-list-balance > span {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}
.construction-expense-list-owner {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #334155 !important;
}
.construction-expense-list-balance .construction-balance-pill {
    font-size: 0.92rem;
}
.construction-expense-owner {
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}
.construction-expense-form-badge {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}
.construction-expense-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 0.85rem;
    margin-bottom: 1rem;
}
.construction-expense-submit {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 700;
}
.construction-expense-list-sub {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: #64748b;
}
.construction-expense-filters {
    margin-bottom: 1rem;
}
.construction-expense-table tbody tr {
    transition: background-color 0.15s ease;
}
.construction-expense-table tbody tr:hover {
    background: #f8fafc;
}
.construction-expense-date {
    font-variant-numeric: tabular-nums;
    color: #475569;
    font-weight: 600;
}
.construction-expense-project {
    color: #0f766e;
    font-weight: 700;
    text-decoration: none;
}
.construction-expense-project:hover { text-decoration: underline; }
.construction-expense-amount {
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
}
.construction-expense-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}
.construction-expense-thumb {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.construction-expense-thumb.has-image {
    background: #fff;
}
.construction-expense-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.construction-expense-desc {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #64748b;
}
.construction-expense-card-desc-row {
    margin-top: 0.45rem;
}
.construction-expense-card-desc-row .construction-expense-card-desc {
    margin: 0;
}
.construction-expense-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 28px;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #334155;
    white-space: nowrap;
}
.construction-expense-pill-products { background: #eff6ff; color: #1d4ed8; }
.construction-expense-pill-materials { background: #ecfeff; color: #0e7490; }
.construction-expense-pill-labor { background: #eef2ff; color: #4338ca; }
.construction-expense-pill-equipment { background: #fff7ed; color: #c2410c; }
.construction-expense-pill-transportation { background: #f0fdf4; color: #15803d; }
.construction-expense-pill-subcontractors { background: #fdf4ff; color: #a21caf; }
.construction-expense-pill-other { background: #f8fafc; color: #475569; }
.construction-expense-delete {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.construction-expense-cards {
    display: grid;
    gap: 0.75rem;
}
.construction-expense-card {
    padding: 0.95rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
.construction-expense-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}
.construction-expense-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    margin-top: 0.45rem;
    font-size: 0.8rem;
    color: #64748b;
}
.construction-expense-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.construction-expense-card-desc {
    margin: 0.55rem 0 0;
    font-size: 0.86rem;
    color: #475569;
}
.construction-expense-card-actions {
    margin-top: 0.75rem;
    padding-top: 0.7rem;
    border-top: 1px solid #eef2f7;
}
@media (max-width: 1199.98px) {
    .construction-expense-form-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 767.98px) {
    .construction-expense-hero-stats {
        width: 100%;
        margin-inline-start: 0;
    }
    .construction-expense-stat {
        flex: 1 1 calc(50% - 0.55rem);
        max-width: none;
    }
    .construction-expense-stat.is-balance {
        flex: 1 1 100%;
    }
}

.construction-expense-form-grid .construction-form-field-wide {
    grid-column: 1 / -1;
}

/* Construction dashboard */
.construction-dash-hero {
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 46%),
        linear-gradient(135deg, #f8fafc 0%, #eef6f5 52%, #f8fafc 100%);
}
.construction-dash-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.construction-dash-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.55rem;
}
.construction-dash-kpi {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.65rem 0.7rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
    min-width: 0;
}
.construction-dash-kpi.is-accent {
    border-color: rgba(15, 118, 110, 0.22);
    background: linear-gradient(145deg, #ffffff, #f0fdfa);
}
.construction-dash-kpi.is-accent.is-over {
    border-color: rgba(185, 28, 28, 0.28);
    background: linear-gradient(145deg, #ffffff, #fef2f2);
}
.construction-dash-kpi.is-accent.is-over .construction-dash-kpi-value {
    color: #b91c1c;
}
.construction-dash-kpi-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
}
.construction-dash-kpi-icon.is-teal { background: rgba(15, 118, 110, 0.12); color: #0f766e; }
.construction-dash-kpi-icon.is-blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.construction-dash-kpi-icon.is-amber { background: rgba(217, 119, 6, 0.12); color: #d97706; }
.construction-dash-kpi-icon.is-green { background: rgba(22, 163, 74, 0.12); color: #16a34a; }
.construction-dash-kpi-label {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1.2;
}
.construction-dash-kpi-value {
    display: block;
    margin-top: 0.12rem;
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    direction: ltr;
}
.construction-dash-kpi-value .money-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.02rem;
}
.construction-dash-kpi-value .money-sep { display: none; }
.construction-dash-kpi-value .money-iqd {
    font-size: 0.64rem;
    font-weight: 600;
    color: #64748b;
}
.construction-dash-kpi-hint {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.62rem;
    font-style: normal;
    color: #94a3b8;
    font-weight: 600;
    line-height: 1.2;
}
.construction-dash-kpi-hint .money-wrap {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.construction-dash-kpi-hint .money-sep { display: inline; }
.construction-dash-kpi-hint .money-usd,
.construction-dash-kpi-hint .money-iqd {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}
.construction-dash-quick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}
.construction-dash-quick-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.construction-dash-quick-link i { color: #0f766e; }
.construction-dash-quick-link:hover {
    border-color: #0f766e;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.08);
    color: #0f172a;
}
.construction-dash-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.construction-dash-months {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.construction-dash-month-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.86rem;
}
.construction-dash-month-top span { color: #64748b; font-weight: 700; }
.construction-dash-month-top strong { color: #0f172a; font-weight: 800; direction: ltr; }
.construction-dash-month-track {
    height: 8px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
}
.construction-dash-month-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #0f766e);
    min-width: 0;
    transition: width 0.35s ease;
}
.construction-dash-simple th {
    border-bottom-width: 1px;
}
.construction-dash-simple td {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    vertical-align: middle;
}
.construction-dash-simple-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}
.construction-dash-simple-money {
    font-size: 0.98rem;
    font-weight: 800;
    direction: ltr;
}
.construction-dash-simple-money .money-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.05rem;
}
.construction-dash-simple-money .money-sep { display: none; }
.construction-dash-simple-money .money-iqd {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
}
.construction-dash-simple .text-muted .money-wrap {
    justify-content: flex-end;
}
.construction-dash-link {
    color: #0f766e;
    font-weight: 700;
    text-decoration: none;
}
.construction-dash-link:hover { text-decoration: underline; }
.construction-dash-table tbody tr:hover { background: #f8fafc; }
.construction-dash-recent-cards {
    display: grid;
    gap: 0.65rem;
}
.construction-dash-recent-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 0.95rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    text-decoration: none;
    color: inherit;
}
.construction-dash-recent-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.construction-dash-recent-bal {
    font-weight: 800;
    direction: ltr;
}
@media (max-width: 1399.98px) {
    .construction-dash-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 991.98px) {
    .construction-dash-quick {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 767.98px) {
    .construction-dash-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .construction-dash-hero-actions {
        width: 100%;
    }
    .construction-dash-hero-actions .btn {
        flex: 1 1 auto;
    }
}

/* Construction project show */
.construction-project-hero {
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 44%),
        linear-gradient(135deg, #f8fafc 0%, #eef6f5 55%, #f8fafc 100%);
}
.construction-project-hero-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
}
.construction-project-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.construction-project-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.construction-profit-value-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.construction-profit-value-row .form-control {
    flex: 1 1 auto;
    min-width: 0;
}
.construction-profit-suffix {
    flex: 0 0 auto;
    min-width: 1.6rem;
    text-align: center;
    font-weight: 800;
    color: #64748b;
}
.construction-profit-setup {
    border: 1px solid #c7d2fe;
    background: linear-gradient(180deg, #eef2ff 0%, #fff 70%);
}
.construction-profit-setup-list {
    display: grid;
    gap: 0.65rem;
}
.construction-profit-setup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}
.construction-profit-setup-item strong {
    display: block;
    font-size: 0.95rem;
    color: #0f172a;
}
[data-theme="dark"] .construction-profit-setup,
[data-bs-theme="dark"] .construction-profit-setup {
    border-color: #3730a3;
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 72%);
}
[data-theme="dark"] .construction-profit-setup .construction-card-title,
[data-bs-theme="dark"] .construction-profit-setup .construction-card-title {
    color: #e0e7ff;
}
[data-theme="dark"] .construction-profit-setup .construction-page-subtitle,
[data-bs-theme="dark"] .construction-profit-setup .construction-page-subtitle {
    color: #a5b4fc;
}
[data-theme="dark"] .construction-profit-setup-item,
[data-bs-theme="dark"] .construction-profit-setup-item {
    background: #111827;
    border-color: #312e81;
}
[data-theme="dark"] .construction-profit-setup-item strong,
[data-bs-theme="dark"] .construction-profit-setup-item strong {
    color: #f1f5f9;
}
[data-theme="dark"] .construction-profit-setup-item .text-muted,
[data-bs-theme="dark"] .construction-profit-setup-item .text-muted {
    color: #94a3b8 !important;
}
.construction-dash-recent-bal {
    display: grid;
    gap: 0.2rem;
}
.construction-project-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.construction-project-facts {
    margin: 0;
    display: grid;
    gap: 0.85rem;
}
.construction-project-facts > div {
    display: grid;
    gap: 0.2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eef2f7;
}
.construction-project-facts > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.construction-project-facts dt {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
}
.construction-project-facts dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}
.construction-project-facts dd a {
    color: #0f766e;
    text-decoration: none;
}
.construction-project-facts dd a:hover { text-decoration: underline; }
.construction-project-fact-sub {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
}
.construction-project-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.construction-project-breakdown-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}
.construction-project-breakdown-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: #334155;
}
.construction-project-breakdown-label i { color: #0f766e; }
.construction-project-breakdown-top strong {
    font-size: 0.9rem;
    color: #0f172a;
    direction: ltr;
}
.construction-project-breakdown-track {
    height: 7px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
}
.construction-project-breakdown-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #0f766e);
}
.construction-project-feed {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.construction-project-feed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    min-height: 0;
    padding: 0.65rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}
.construction-project-feed-main {
    min-width: 0;
    flex: 1 1 auto;
}
.construction-project-feed-main strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}
.construction-project-feed-main strong a {
    color: #0f766e;
    text-decoration: none;
}
.construction-project-feed-main strong a:hover { text-decoration: underline; }
.construction-project-feed-main span {
    display: block;
    margin-top: 0.12rem;
    font-size: 0.76rem;
    color: #64748b;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.construction-project-feed-amt {
    flex: 0 0 auto;
    max-width: 46%;
    direction: ltr;
    text-align: end;
}
.construction-project-feed-amt .money-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.12rem;
    white-space: normal;
}
.construction-project-feed-amt .money-sep {
    display: none;
}
.construction-project-feed-amt .money-usd,
.construction-project-feed-amt .money-iqd {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.construction-project-feed-amt .currency-flag {
    display: inline-block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.construction-project-feed-amt .money-usd {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
}
.construction-project-feed-amt .money-iqd {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
}
.construction-project-feed-wide .construction-project-feed-row {
    max-width: 520px;
}
.construction-empty-sm {
    padding: 0.75rem 0;
}
.construction-empty-sm p { margin: 0; }
@media (max-width: 767.98px) {
    .construction-project-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .construction-project-hero-actions {
        width: 100%;
    }
    .construction-project-hero-actions .btn {
        flex: 1 1 auto;
    }
}

/* Quick add forms on project show */
.construction-project-add {
    margin-bottom: 0.85rem;
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}
.construction-quick-form { margin: 0; }
.construction-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    align-items: end;
}
.construction-quick-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    min-width: 0;
}
.construction-quick-field > span {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}
.construction-quick-field-wide { grid-column: 1 / -1; }
.construction-quick-submit {
    grid-column: 1 / -1;
    min-height: 36px;
}
.construction-quick-field .form-control,
.construction-quick-field .form-select {
    width: 100%;
}
@media (max-width: 575.98px) {
    .construction-quick-grid {
        grid-template-columns: 1fr;
    }
}

/* Project expense quick-add: type chips + custom type */
.construction-expense-quick {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.construction-expense-type-block {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.construction-expense-type-head span {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}
.construction-expense-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.construction-expense-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.38rem 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.construction-expense-chip i {
    font-size: 0.85rem;
    opacity: 0.85;
}
.construction-expense-chip:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}
.construction-expense-chip.is-active {
    border-color: #0f766e;
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}
.construction-expense-chip-add {
    border-style: dashed;
    color: #0f766e;
}
.construction-expense-chip-add.is-active,
.construction-expense-chip-custom.is-active {
    border-style: solid;
}
.construction-expense-custom-wrap {
    display: none;
}
.construction-expense-custom-wrap.is-open {
    display: block;
}
.construction-expense-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.construction-expense-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
    min-width: 0;
}
.construction-expense-field > span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}
.construction-expense-field > span i {
    font-size: 0.8rem;
    color: #0f766e;
}
.construction-expense-field .form-control,
.construction-expense-field .form-select {
    min-height: 42px;
    border-radius: 12px;
    border-color: #cbd5e1;
    background: #fff;
}
.construction-expense-field .form-control:focus,
.construction-expense-field .form-select:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.construction-expense-composer {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.construction-expense-amount-panel {
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
    border: 1px solid #dbe7e5;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.1), transparent 48%),
        linear-gradient(180deg, #f8fffe 0%, #f1f5f9 100%);
}
.construction-expense-amount-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}
.construction-expense-amount-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}
.construction-expense-amount-input {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    border: 1px solid #dbe4ee;
    background: #fff;
    min-height: 48px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.construction-expense-amount-input:focus-within {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.construction-expense-amount-flag {
    display: inline-flex;
    align-items: center;
}
.construction-expense-amount-input .form-control {
    border: 0;
    box-shadow: none;
    padding: 0;
    min-height: 0;
    background: transparent;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}
.construction-expense-amount-input .form-control:focus {
    box-shadow: none;
}
.construction-expense-amount-input em {
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #94a3b8;
}
.construction-expense-meta-row {
    display: grid;
    grid-template-columns: minmax(140px, 0.85fr) minmax(0, 1.15fr);
    gap: 0.55rem;
    align-items: end;
}
.construction-expense-meta-stack {
    grid-template-columns: 1fr;
}
.construction-expense-field-grow {
    min-width: 0;
}
.construction-expense-composer-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    font-weight: 800;
}
.construction-expense-feed-row {
    align-items: center;
}
.construction-expense-feed-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
    font-size: 0.95rem;
}
.construction-empty-sm i {
    display: block;
    margin: 0 auto 0.35rem;
    font-size: 1.35rem;
    color: #94a3b8;
}
@media (max-width: 575.98px) {
    .construction-expense-amount-row,
    .construction-expense-meta-row {
        grid-template-columns: 1fr;
    }
}

/* Searchable product picker with images */
.construction-product-picker {
    position: relative;
}
.construction-product-picker-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0.35rem 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    text-align: start;
}
.construction-product-picker.is-open .construction-product-picker-trigger {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.construction-product-picker-preview {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}
.construction-product-picker-thumb {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}
.construction-product-picker-label {
    font-size: 0.86rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.construction-product-picker-panel {
    position: absolute;
    z-index: 40;
    inset-inline: 0;
    top: calc(100% + 0.35rem);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}
.construction-product-picker-search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid #eef2f7;
}
.construction-product-picker-search i { color: #94a3b8; }
.construction-product-picker-search .form-control {
    border: 0;
    box-shadow: none;
    padding-inline: 0;
    background: transparent;
}
.construction-product-picker-list {
    max-height: 240px;
    overflow: auto;
    padding: 0.35rem;
}
.construction-product-picker-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.55rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    text-align: start;
    color: inherit;
}
.construction-product-picker-item:hover,
.construction-product-picker-item.is-active {
    background: rgba(15, 118, 110, 0.08);
}
.construction-product-picker-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}
.construction-product-picker-copy strong {
    font-size: 0.86rem;
    font-weight: 700;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.construction-product-picker-copy em {
    font-style: normal;
    font-size: 0.74rem;
    font-weight: 600;
    color: #64748b;
}
.construction-product-picker-empty {
    padding: 0.85rem;
    text-align: center;
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 600;
}

.construction-material-kpis {
    margin-bottom: 1.15rem;
}
.construction-material-thumb-cell {
    width: 52px;
    vertical-align: middle;
}
.construction-material-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    overflow: hidden;
}
.construction-material-thumb.has-image {
    background: #fff;
    border: 1px solid #e2e8f0;
}
.construction-material-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Materials POS checkout strip */
.construction-material-pos-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.construction-material-pos-field { margin: 0; }
.construction-material-pos-picker { min-width: 0; }
.construction-material-checkout {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.85rem;
    border-radius: 16px;
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
}
.construction-material-selected {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}
.construction-material-selected.is-empty {
    opacity: 0.72;
}
.construction-material-selected-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: #1d4ed8;
    flex: 0 0 auto;
}
.construction-material-selected-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.construction-material-selected-copy strong {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.construction-material-selected-copy small {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
}
.construction-material-checkout-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}
.construction-material-checkout-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    min-width: 0;
}
.construction-material-checkout-field > span {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}
.construction-material-checkout-price {
    grid-column: 1 / -1;
}
.construction-material-checkout-submit {
    font-weight: 800;
    min-height: 42px;
}
/* Construction product picker — same POS cards, compact panel layout */
.construction-pos-picker {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.construction-pos-picker-search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
}
.construction-pos-picker-search i { color: #94a3b8; flex: 0 0 auto; }
.construction-pos-picker-search .form-control {
    border: 0;
    box-shadow: none;
    padding: 0.25rem 0;
    background: transparent;
}
.construction-pos-picker-results {
    max-height: 420px;
    overflow: auto;
    padding: 0.1rem 0.1rem 0.35rem;
}
.construction-product-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.construction-product-menu-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    text-align: start;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.construction-product-menu-item:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}
.construction-product-menu-item.is-selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}
.construction-product-menu-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    overflow: hidden;
    flex-shrink: 0;
}
.construction-product-menu-thumb.has-image {
    background: #fff;
    border: 1px solid #e2e8f0;
}
.construction-product-menu-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.construction-product-menu-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.construction-product-menu-copy strong {
    font-size: 0.84rem;
    font-weight: 750;
    color: #0f172a;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.construction-product-menu-copy small {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
}
.construction-product-menu-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.12rem;
    min-width: 0;
}
.construction-product-menu-price strong,
.construction-product-menu-price small {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    white-space: nowrap;
}
.construction-product-menu-price strong {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
}
.construction-product-menu-price small {
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
}
.construction-product-menu-price .currency-input-flag {
    width: 14px;
    height: 14px;
}
.construction-material-price-mode {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
}
.construction-material-price-mode label {
    margin: 0;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    padding: 0.45rem 0.35rem;
    text-align: center;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
}
.construction-material-price-mode label input { display: none; }
.construction-material-price-mode label.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
.construction-material-qty {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 0.3rem;
    align-items: center;
}
.construction-material-qty button {
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}
.construction-material-qty input {
    text-align: center;
    font-weight: 700;
}
.construction-material-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.construction-material-cart-head strong {
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
}
.construction-material-cart {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 260px;
    overflow: auto;
}
.construction-material-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1rem 0.75rem;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
}
.construction-material-cart-empty[hidden] { display: none !important; }
.construction-material-cart-line {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto 32px;
    gap: 0.55rem;
    align-items: center;
    padding: 0.55rem 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
}
.construction-material-cart-thumb {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    overflow: hidden;
}
.construction-material-cart-thumb.has-image {
    background: #fff;
    border: 1px solid #e2e8f0;
}
.construction-material-cart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.construction-material-cart-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}
.construction-material-cart-copy strong {
    font-size: 0.86rem;
    font-weight: 750;
    color: #0f172a;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.construction-material-cart-money {
    display: block;
}
.construction-material-cart-money .money-wrap {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.28rem;
}
.construction-material-cart-money .money-usd,
.construction-material-cart-money .money-iqd {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
}
.construction-material-cart-money .money-usd {
    font-weight: 800;
    color: #0f172a;
}
.construction-material-cart-money .money-iqd {
    font-size: 0.78em;
    color: #64748b;
}
.construction-material-cart-money .currency-flag {
    width: 14px;
    height: 14px;
}
.construction-material-cart-qty {
    display: inline-grid;
    grid-template-columns: 32px 52px 32px;
    gap: 0.25rem;
    align-items: center;
    padding: 0.2rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
}
.construction-material-cart-qty button,
.construction-material-cart-qty input {
    height: 30px;
}
.construction-material-cart-qty button {
    width: 32px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 1px #e2e8f0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}
.construction-material-cart-qty input {
    width: 52px;
    min-width: 52px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.86rem;
    font-weight: 750;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}
.construction-material-cart-qty input:focus {
    outline: none;
    box-shadow: none;
}
.construction-material-cart-qty input::-webkit-outer-spin-button,
.construction-material-cart-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.construction-material-cart-remove {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 575.98px) {
    .construction-material-cart-line {
        grid-template-columns: 40px minmax(0, 1fr) 32px;
        grid-template-areas:
            "thumb copy remove"
            "qty qty qty";
    }
    .construction-material-cart-thumb { grid-area: thumb; }
    .construction-material-cart-copy { grid-area: copy; }
    .construction-material-cart-qty {
        grid-area: qty;
        width: 100%;
        grid-template-columns: 40px minmax(0, 1fr) 40px;
    }
    .construction-material-cart-qty input { width: 100%; min-width: 0; }
    .construction-material-cart-remove { grid-area: remove; }
}
.construction-material-line-total .money-wrap {
    justify-content: flex-end;
}
.construction-material-line-total .currency-flag {
    width: 14px;
    height: 14px;
}
.construction-material-line-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: #0f172a;
    color: #fff;
}
.construction-material-line-total span {
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
}
.construction-material-line-total strong {
    font-size: 0.95rem;
    font-weight: 800;
    direction: ltr;
}
.construction-material-line-total .money-wrap {
    justify-content: flex-end;
}
.construction-material-line-total .money-usd { color: #fff; }
.construction-material-line-total .money-iqd { color: #cbd5e1; }
.construction-material-line-total .money-sep { color: #64748b; }
.construction-pos-picker-empty {
    padding: 0.85rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 600;
}
.construction-product-menu-hint {
    margin-top: 0.35rem;
    padding: 0.35rem 0.45rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
}
.construction-project-add .construction-pos-picker-results {
    max-height: 190px;
}
.construction-project-add .construction-pos-picker {
    gap: 0.4rem;
}
.construction-project-add .construction-pos-picker-search {
    padding: 0.28rem 0.5rem;
    border-radius: 10px;
}
.construction-project-add .construction-product-menu-list {
    gap: 0.25rem;
}
.construction-project-add .construction-product-menu-item {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 0.45rem;
    padding: 0.28rem 0.4rem;
    border-radius: 10px;
}
.construction-project-add .construction-product-menu-thumb {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.85rem;
}
.construction-project-add .construction-product-menu-copy strong {
    font-size: 0.76rem;
}
.construction-project-add .construction-product-menu-copy small {
    font-size: 0.64rem;
}
.construction-project-add .construction-product-menu-price strong {
    font-size: 0.74rem;
}
.construction-project-add .construction-product-menu-price small {
    font-size: 0.62rem;
}
.construction-project-add .construction-product-menu-hint {
    margin-top: 0.2rem;
    padding: 0.2rem;
    font-size: 0.66rem;
}
.construction-project-add .construction-material-checkout {
    margin-top: 0.55rem;
    gap: 0.45rem;
}
.construction-project-add .construction-material-cart {
    max-height: 140px;
}
.construction-project-add .construction-material-cart-empty {
    padding: 0.55rem 0.5rem;
    font-size: 0.72rem;
}
.construction-project-add .construction-material-cart-line {
    grid-template-columns: 32px minmax(0, 1fr) auto 28px;
    gap: 0.4rem;
    padding: 0.3rem 0.4rem;
}
.construction-project-add .construction-material-cart-thumb {
    width: 32px;
    height: 32px;
}
.construction-project-add .construction-material-price-mode label {
    padding: 0.28rem 0.45rem;
    font-size: 0.72rem;
}
.construction-project-add .construction-material-line-total {
    padding: 0.4rem 0.55rem;
}
.construction-project-add .construction-material-line-total strong {
    font-size: 0.86rem;
}
.construction-project-add .construction-material-checkout-submit {
    min-height: 34px;
}

/* Cashbox owner summaries + ledger history */
.construction-owner-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}
.construction-owner-summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.85rem 0.95rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.construction-owner-summary-card:hover {
    border-color: #99f6e4;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.08);
    transform: translateY(-1px);
}
.construction-owner-summary-head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.construction-owner-summary-head strong {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}
.construction-owner-summary-head span {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}
.construction-owner-summary-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}
.construction-owner-summary-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
    overflow: hidden;
}
.construction-owner-summary-metrics em {
    display: block;
    width: 100%;
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    line-height: 1.25;
    text-align: start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.construction-owner-summary-metrics strong {
    display: block;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 800;
    direction: ltr;
    unicode-bidi: isolate;
    text-align: start;
}
.construction-owner-summary-metrics .money-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
    width: auto;
    max-width: 100%;
    white-space: normal;
}
.construction-owner-summary-metrics .money-sep { display: none; }
.construction-owner-summary-metrics .money-usd,
.construction-owner-summary-metrics .money-iqd {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
}
.construction-owner-summary-metrics .money-usd { font-size: 0.9rem; font-weight: 800; letter-spacing: -0.02em; }
.construction-owner-summary-metrics .money-iqd { font-size: 0.72rem; color: #94a3b8; font-weight: 650; }
.construction-owner-summary-metrics .money-amount {
    overflow: hidden;
    text-overflow: ellipsis;
}
.construction-owner-summary-metrics .is-in { color: #15803d; }
.construction-owner-summary-metrics .is-out { color: #b91c1c; }
.construction-owner-summary-metrics .is-balance { color: #0f766e; }
.construction-owner-summary-metrics .is-in .money-usd { color: inherit; }
.construction-owner-summary-metrics .is-out .money-usd { color: inherit; }
.construction-owner-summary-metrics .is-balance .money-usd { color: inherit; }
.construction-cashbox-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.construction-cashbox-history-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
}
@media (max-width: 575.98px) {
    .construction-owner-summary-metrics {
        grid-template-columns: 1fr;
    }
}

/* Cashbox page — modern layout */
.construction-cashbox-hero {
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 42%),
        linear-gradient(135deg, #f8fafc 0%, #eef6f5 55%, #f8fafc 100%);
}
.construction-cashbox-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    width: min(720px, 100%);
}
.construction-cashbox-stat {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(6px);
}
.construction-cashbox-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 1rem;
}
.construction-cashbox-stat.is-balance .construction-cashbox-stat-icon {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}
.construction-cashbox-stat.is-in .construction-cashbox-stat-icon {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}
.construction-cashbox-stat.is-out .construction-cashbox-stat-icon {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}
.construction-cashbox-stat-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
}
.construction-cashbox-stat-value {
    display: block;
    margin-top: 0.15rem;
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}
.construction-cashbox-stat.is-balance .construction-cashbox-stat-value { color: #0f766e; }
.construction-cashbox-stat.is-in .construction-cashbox-stat-value { color: #15803d; }
.construction-cashbox-stat.is-out .construction-cashbox-stat-value { color: #b91c1c; }
.construction-cashbox-form-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.construction-cashbox-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.construction-cashbox-form-badge {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}
.construction-cashbox-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding: 0.3rem;
    border-radius: 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.construction-cashbox-mode button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0;
    min-height: 40px;
    padding: 0.45rem 0.6rem;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 750;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.construction-cashbox-mode button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.construction-cashbox-mode button.is-active {
    background: #fff;
    color: #0f766e;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.construction-cashbox-form.is-out .construction-cashbox-mode button[data-cashbox-mode="out"].is-active {
    color: #b91c1c;
}
.construction-cashbox-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.construction-owner-summary-head {
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
}
.construction-owner-summary-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    flex: 0 0 auto;
}
.construction-cashbox-table tbody tr:hover {
    background: #f8fafc;
}
.construction-tx-type {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Modern cashbox ledger feed */
.construction-ledger-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.construction-ledger-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.construction-ledger-panel-title {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.construction-ledger-panel-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    flex: 0 0 auto;
}
.construction-ledger-panel-sub {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: #64748b;
}
.construction-ledger-panel-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.construction-ledger-stat {
    min-width: 110px;
    padding: 0.55rem 0.75rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}
.construction-ledger-stat em {
    display: block;
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.15rem;
}
.construction-ledger-stat strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
}
.construction-ledger-stat.is-in {
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.construction-ledger-stat.is-in strong { color: #15803d; }
.construction-ledger-stat.is-out {
    background: #fef2f2;
    border-color: #fecaca;
}
.construction-ledger-stat.is-out strong { color: #b91c1c; }
.construction-ledger-filters {
    display: grid;
    grid-template-columns: minmax(160px, 1.2fr) minmax(160px, 1.2fr) auto auto;
    gap: 0.75rem;
    align-items: end;
    padding: 0.85rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}
.construction-ledger-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
}
.construction-ledger-filter-field > span {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}
.construction-ledger-type-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: #eef2f7;
    border: 1px solid #e2e8f0;
}
.construction-ledger-type-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.construction-ledger-type-btn:hover { color: #0f172a; background: rgba(255,255,255,0.7); }
.construction-ledger-type-btn.is-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.construction-ledger-type-btn.is-in.is-active { color: #15803d; }
.construction-ledger-type-btn.is-out.is-active { color: #b91c1c; }
.construction-ledger-reset {
    white-space: nowrap;
}
.construction-ledger-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.construction-ledger-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
}
.construction-ledger-chip a {
    color: inherit;
    text-decoration: none;
    opacity: 0.7;
    font-size: 1rem;
    line-height: 1;
}
.construction-ledger-chip a:hover { opacity: 1; }
.construction-ledger-chip.is-in {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #166534;
}
.construction-ledger-chip.is-out {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.construction-ledger-feed {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.construction-ledger-row {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
    padding: 0.45rem 0.65rem 0.45rem 0.55rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    position: relative;
    overflow: hidden;
}
.construction-ledger-row::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}
.construction-ledger-row.is-in {
    background: linear-gradient(90deg, rgba(220, 252, 231, 0.4) 0%, #fff 22%);
}
.construction-ledger-row.is-in::before { background: #22c55e; }
.construction-ledger-row.is-out {
    background: linear-gradient(90deg, rgba(254, 226, 226, 0.4) 0%, #fff 22%);
}
.construction-ledger-row.is-out::before { background: #ef4444; }
.construction-ledger-row-dot {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex: 0 0 auto;
}
.construction-ledger-row.is-in .construction-ledger-row-dot {
    background: #dcfce7;
    color: #15803d;
}
.construction-ledger-row.is-out .construction-ledger-row-dot {
    background: #fee2e2;
    color: #b91c1c;
}
.construction-ledger-row-main {
    min-width: 0;
}
.construction-ledger-row-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem 0.45rem;
}
.construction-ledger-row .construction-tx-type {
    font-size: 0.65rem;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    line-height: 1.2;
}
.construction-ledger-row-date {
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
    margin-inline-start: auto;
}
.construction-ledger-row-purpose {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 750;
    color: #0f172a;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(420px, 55vw);
}
.construction-ledger-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.2rem;
}
.construction-ledger-meta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.2;
}
.construction-ledger-meta-link.is-plain {
    color: #64748b;
}
.construction-ledger-meta-link:hover {
    border-color: #99f6e4;
    color: #0f766e;
    background: #f0fdfa;
}
.construction-ledger-row-money {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.construction-ledger-amount-block {
    display: inline-flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.28rem;
    min-width: 6.5rem;
}
.construction-ledger-amount-sign {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.15;
    margin-top: 0.05rem;
}
.construction-ledger-amount-value .money-wrap {
    align-items: flex-end;
}
.construction-ledger-amount-value .money-usd {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.construction-ledger-amount-value .money-iqd {
    font-size: 0.68rem;
    font-weight: 650;
}
.construction-ledger-amount-block.is-in,
.construction-ledger-amount-block.is-in .money-usd {
    color: #15803d;
}
.construction-ledger-amount-block.is-out,
.construction-ledger-amount-block.is-out .money-usd {
    color: #b91c1c;
}
.construction-ledger-balances {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.18rem;
    min-width: 7.25rem;
}
.construction-ledger-balance-pill {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.35rem;
    padding: 0.14rem 0.42rem;
    border-radius: 8px;
    font-size: 0.66rem;
    font-weight: 700;
    border: 1px solid transparent;
    line-height: 1.2;
}
.construction-ledger-balance-pill em {
    font-style: normal;
    opacity: 0.8;
    font-weight: 700;
    white-space: nowrap;
}
.construction-ledger-balance-pill b {
    font-weight: 800;
    text-align: end;
    justify-self: end;
}
.construction-ledger-balance-pill.is-ok {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #166534;
}
.construction-ledger-balance-pill.is-broke {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.construction-ledger-balance-pill.is-owner {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}
.construction-ledger-print {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    color: #334155;
    background: #fff;
    text-decoration: none;
    flex: 0 0 auto;
}
.construction-ledger-print:hover {
    border-color: #0f766e;
    color: #0f766e;
    background: #f0fdfa;
}
.construction-ledger-empty {
    padding: 1.25rem 0.75rem;
}
@media (max-width: 991.98px) {
    .construction-ledger-filters {
        grid-template-columns: 1fr;
    }
    .construction-ledger-type-toggle,
    .construction-ledger-reset {
        width: 100%;
        justify-content: center;
    }
    .construction-ledger-row {
        grid-template-columns: 24px minmax(0, 1fr);
        align-items: start;
    }
    .construction-ledger-row-money {
        grid-column: 2;
        justify-content: flex-start;
        width: 100%;
    }
    .construction-ledger-amount-block {
        justify-content: flex-start;
    }
    .construction-ledger-amount-value .money-wrap {
        align-items: flex-start;
    }
    .construction-ledger-row-date {
        margin-inline-start: 0;
        width: 100%;
    }
    .construction-ledger-row-purpose {
        max-width: 100%;
        white-space: normal;
    }
}
.construction-cashbox-cards {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.construction-cashbox-card {
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.construction-cashbox-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
}
.construction-cashbox-card-purpose {
    display: block;
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
}
.construction-cashbox-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-top: 0.55rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: #64748b;
}
.construction-cashbox-card-meta a {
    color: #0f766e;
    text-decoration: none;
    font-weight: 700;
}
.construction-cashbox-card-meta a:hover { text-decoration: underline; }
@media (max-width: 991.98px) {
    .construction-cashbox-hero-stats {
        width: 100%;
        grid-template-columns: 1fr;
    }
}

.construction-cashbox-see-more {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px dashed #e2e8f0;
}
.construction-cashbox-see-more .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 42px;
    padding-inline: 1.1rem;
    border-radius: 12px;
    font-weight: 800;
}
.construction-cashbox-see-more-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.75rem;
}
.construction-owner-summary-card.is-active {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.construction-owner-summary-identity {
    min-width: 0;
    flex: 1 1 auto;
}
.construction-owner-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-top: 0.2rem;
}
.construction-owner-summary-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.74rem;
    font-weight: 650;
    color: #64748b;
}
.construction-owner-summary-meta i {
    color: #0f766e;
    font-size: 0.78rem;
}
.construction-owner-summary-projects-count {
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e !important;
    font-weight: 800 !important;
}
.construction-owner-summary-chevron {
    color: #94a3b8;
    font-size: 0.95rem;
}
.construction-owner-summary-project-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.construction-owner-summary-project-chip,
.construction-owner-summary-project-more {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 100%;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.72rem;
    font-weight: 700;
    font-style: normal;
    line-height: 1.2;
}
.construction-owner-summary-project-chip strong {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.construction-owner-summary-project-chip em {
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
    padding-inline-start: 0.45rem;
    border-inline-start: 1px solid currentColor;
    opacity: 0.95;
}
.construction-owner-summary-project-chip.is-ok {
    color: #166534;
    background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #86efac;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.construction-owner-summary-project-chip.is-ok em {
    color: #14532d;
    border-inline-start-color: rgba(22, 101, 52, 0.28);
}
.construction-owner-summary-project-chip.is-broke {
    color: #991b1b;
    background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
    border-color: #fca5a5;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.construction-owner-summary-project-chip.is-broke em {
    color: #7f1d1d;
    border-inline-start-color: rgba(153, 27, 27, 0.28);
}
.construction-owner-summary-project-chip.is-flat,
.construction-owner-summary-project-more {
    color: #475569;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border-color: #cbd5e1;
}
.construction-owner-summary-project-phone {
    opacity: 0.85;
    font-weight: 700;
    font-size: 0.68rem;
}
.construction-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #0f766e;
    text-decoration: none;
    font-weight: 700;
}
.construction-phone-link:hover {
    color: #115e59;
    text-decoration: underline;
}
.construction-phone-link.is-plain {
    color: #64748b;
}
.construction-project-phone-line {
    margin-top: 0.25rem !important;
}
.construction-invoice-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.construction-invoice-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    text-decoration: none;
}
.construction-invoice-mode-btn:hover {
    border-color: #94a3b8;
    color: #0f172a;
}
.construction-invoice-mode-btn.is-active {
    border-color: #0f766e;
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
}
.construction-invoice-hero .construction-expense-hero-stats {
    margin: 0;
}
.construction-invoice-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #eef2f7;
}
.construction-invoice-print-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 1rem;
    margin-bottom: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fdba74;
    color: #9a3412;
    box-shadow: 0 10px 28px rgba(154, 52, 18, 0.08);
    animation: constructionPrintAlertIn 0.28s ease;
}
.construction-invoice-print-alert.d-none,
.construction-invoice-print-alert[hidden] {
    display: none !important;
}
.construction-invoice-print-alert-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(234, 88, 12, 0.14);
    color: #c2410c;
    font-size: 1.05rem;
}
.construction-invoice-print-alert-text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.45;
    padding-top: 0.2rem;
}
.construction-invoice-print-alert-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: #c2410c;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    cursor: pointer;
    opacity: 0.75;
}
.construction-invoice-print-alert-close:hover {
    opacity: 1;
    background: rgba(234, 88, 12, 0.12);
}
@keyframes constructionPrintAlertIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.construction-invoice-printall {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}
.construction-invoice-printall-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.1rem;
}
.construction-invoice-printall-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 650;
    cursor: pointer;
}
.construction-invoice-printall-check input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #0f766e;
}
.construction-invoice-printall-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.construction-invoice-printall-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 12px;
    white-space: nowrap;
}
.construction-invoice-bar-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
    min-width: 0;
}
.construction-invoice-bar-field > span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}
.construction-invoice-bar-field .form-select {
    border-radius: 12px;
    border-color: #e2e8f0;
    min-height: 2.65rem;
}
@media (max-width: 767.98px) {
    .construction-invoice-bar {
        grid-template-columns: 1fr;
    }
}
.construction-invoice-source {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
    font-size: 0.75rem;
    font-weight: 700;
}
.construction-invoice-source.is-pos {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}
.construction-invoice-empty {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.construction-invoice-desk-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}
.construction-invoice-desk-who {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.construction-invoice-desk-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    flex: 0 0 auto;
}
.construction-invoice-desk-sub {
    color: #64748b;
    font-size: 0.9rem;
}
.construction-invoice-desk-sub a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}
.construction-invoice-desk-sub a:hover {
    color: #0f766e;
}
.construction-invoice-desk-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}
@media (max-width: 1199.98px) {
    .construction-invoice-desk-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 767.98px) {
    .construction-invoice-desk-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.construction-invoice-desk-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
}
.construction-invoice-desk-tab em {
    font-style: normal;
    font-weight: 800;
    opacity: 0.7;
}
.construction-invoice-desk-tab:hover {
    border-color: #94a3b8;
    color: #0f172a;
}
.construction-invoice-desk-tab.is-active {
    border-color: #0f766e;
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
}
.construction-invoice-desk-body {
    max-height: min(62vh, 720px);
    overflow: auto;
}
.construction-invoice-buys {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.construction-invoice-buy-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: 1px solid #eef2f7;
    background: #fff;
}
.construction-invoice-buy-thumb {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    overflow: hidden;
    font-size: 0.75rem;
}
.construction-invoice-buy-thumb.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.construction-invoice-buy-copy {
    min-width: 0;
    display: flex;
    flex-flow: row wrap;
    align-items: baseline;
    gap: 0.35rem 0.55rem;
}
.construction-invoice-buy-copy strong {
    font-size: 0.84rem;
    font-weight: 700;
    color: #0f172a;
}
.construction-invoice-buy-copy span {
    font-size: 0.74rem;
    color: #64748b;
}
.construction-invoice-buy-side {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
}
.construction-invoice-buy-amount {
    font-size: 0.8rem;
    text-align: end;
}
.construction-invoice-buy-amount .money-wrap {
    gap: 0.15rem;
}
.construction-invoice-buy-amount .money-usd {
    font-size: 0.8rem;
}
.construction-invoice-buy-amount .money-iqd {
    font-size: 0.68rem;
}
.construction-invoice-buy-side .btn-sm {
    padding: 0.15rem 0.35rem;
    font-size: 0.72rem;
    line-height: 1;
}
@media (max-width: 575.98px) {
    .construction-invoice-desk-tabs {
        grid-template-columns: 1fr;
    }
}
.construction-owner-summary-metrics {
    padding-top: 0.55rem;
    margin-top: 0.15rem;
    border-top: 1px solid #eef2f7;
}
.construction-owner-summary-metric {
    padding: 0.55rem 0.6rem;
    border-radius: 12px;
    background: #f8fafc;
}

.construction-cashbox-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1.25rem;
}
@media (max-width: 767.98px) {
    .construction-cashbox-kpis {
        grid-template-columns: 1fr;
    }
}
