﻿html {
    font-size: 15px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 0;
    background-color: #f6f8fb;
    color: #212529;
}

.app-container {
    max-width: 1180px;
}

.app-navbar {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.brand-wrap {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
    min-width: 0;
}

.brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: #1f2937;
    white-space: nowrap;
}

.app-user-text {
    font-weight: 500;
}

.page-header-wrap {
    margin-top: 1rem;
    margin-bottom: 1.25rem;
}

.page-title {
    margin-bottom: 0.35rem;
    font-size: 1.9rem;
    font-weight: 700;
}

.login-page-wrap {
    min-height: calc(100vh - 150px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0 2rem;
}

.login-card {
    width: 100%;
    max-width: 460px;
    border: 0;
    border-radius: 18px;
}

.login-logo {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
}

.login-title {
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.action-buttons-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.action-btn {
    min-width: 170px;
}

.scanner-frame {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    background: #fff;
}

.invoice-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.invoice-detail-box {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
    background: #fafafa;
}

.invoice-detail-label {
    font-size: 0.88rem;
    color: #6b7280;
    margin-bottom: 6px;
    font-weight: 600;
}

.invoice-detail-value {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    word-break: break-word;
}

.dashboard-page-header {
    margin-bottom: 1.35rem;
}

.dashboard-grid {
    align-items: stretch;
}

.dashboard-card {
    --dashboard-accent: #0d6efd;
    --dashboard-accent-soft: rgba(13, 110, 253, 0.10);
    --dashboard-accent-border: rgba(13, 110, 253, 0.16);
    border: 1px solid #e7ebf0;
    border-radius: 20px;
    min-height: 205px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.055);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    border-color: var(--dashboard-accent-border);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
}

.dashboard-card-danger {
    --dashboard-accent: #dc3545;
    --dashboard-accent-soft: rgba(220, 53, 69, 0.10);
    --dashboard-accent-border: rgba(220, 53, 69, 0.20);
}

.dashboard-card-secondary {
    --dashboard-accent: #6c757d;
    --dashboard-accent-soft: rgba(108, 117, 125, 0.11);
    --dashboard-accent-border: rgba(108, 117, 125, 0.20);
}

.dashboard-card-primary {
    --dashboard-accent: #0d6efd;
    --dashboard-accent-soft: rgba(13, 110, 253, 0.10);
    --dashboard-accent-border: rgba(13, 110, 253, 0.18);
}

.dashboard-card-dark {
    --dashboard-accent: #212529;
    --dashboard-accent-soft: rgba(33, 37, 41, 0.09);
    --dashboard-accent-border: rgba(33, 37, 41, 0.18);
}

.dashboard-card-body {
    gap: 1.35rem;
}

.dashboard-card-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
    text-align: center;
    padding-top: 0.1rem;
}

.dashboard-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 64px;
    color: var(--dashboard-accent);
    background: var(--dashboard-accent-soft);
    border: 1px solid var(--dashboard-accent-border);
    box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.55);
}

.dashboard-card-icon svg {
    width: 30px;
    height: 30px;
}

.dashboard-card-title {
    font-size: 1.22rem;
    line-height: 1.35;
    font-weight: 700;
    margin: 0;
    color: #1f2937;
    text-align: center;
}

.dashboard-card-action {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dashboard-action-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.18s ease;
}

[dir="rtl"] .dashboard-action-arrow {
    transform: scaleX(-1);
}

.dashboard-card-action:hover .dashboard-action-arrow {
    transform: translateX(3px);
}

[dir="rtl"] .dashboard-card-action:hover .dashboard-action-arrow {
    transform: scaleX(-1) translateX(3px);
}

.reports-action-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.reports-action-btn {
    min-width: 180px;
}

.reports-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.reports-chart-type-wrap {
    width: 220px;
}

.report-table-wrap {
    border-radius: 12px;
}

.report-meta-strip,
.report-meta-inline {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: #4b5563;
    font-size: 0.94rem;
}

.report-meta-strip {
    margin-bottom: 1rem;
}

.report-meta-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.sales-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 1rem;
}

.sales-summary-item {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #e3e8ef;
    border-radius: 12px;
    background: #f8fafc;
}

.sales-summary-item-total {
    background: #eef6ff;
    border-color: #d4e7ff;
}

.sales-summary-label {
    display: block;
    color: #667085;
    font-size: 0.78rem;
    line-height: 1.35;
    font-weight: 700;
}

.sales-summary-value {
    display: block;
    margin-top: 5px;
    color: #111827;
    font-size: 1.08rem;
    line-height: 1.2;
    font-weight: 800;
    white-space: nowrap;
}

.division-filter-wrap {
    margin-top: 1.25rem;
    padding: 1rem 1rem 0.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fafafa;
}

.division-filter-title {
    font-weight: 700;
    margin-bottom: 0.85rem;
    color: #1f2937;
}

.division-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.division-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-weight: 500;
    color: #374151;
}

    .division-check-item input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin: 0;
    }

.division-filter-note {
    margin-top: 0.85rem;
    color: #6b7280;
    font-size: 0.92rem;
}

.card {
    border: 0;
    border-radius: 18px;
}

    .card .card-body {
        padding: 1.25rem;
    }

.form-control,
.form-select {
    border-radius: 12px;
}

.btn {
    border-radius: 12px;
    font-weight: 600;
}

.table {
    margin-bottom: 0;
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 320px;
    margin: 0 auto;
}

@media (max-width: 991.98px) {
    .brand-text {
        font-size: 0.98rem;
    }

    .action-btn,
    .reports-action-btn {
        min-width: 150px;
    }

    .division-checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .app-container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .brand-logo {
        width: 34px;
        height: 34px;
    }

    .brand-text {
        font-size: 0.95rem;
        white-space: normal;
        line-height: 1.15;
    }

    .page-title {
        font-size: 1.55rem;
    }

    .login-page-wrap {
        min-height: auto;
        padding-top: 1.2rem;
    }

    .login-card {
        max-width: 100%;
        border-radius: 16px;
    }

    .login-logo {
        max-width: 90px;
        max-height: 90px;
    }

    .card .card-body {
        padding: 1rem;
    }

    .action-buttons-wrap,
    .reports-action-wrap {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .action-btn,
    .reports-action-btn {
        width: 100%;
        min-width: 0;
    }

    .scanner-frame {
        max-width: 100%;
        padding: 8px;
        border-radius: 14px;
    }

    .invoice-details-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .invoice-detail-box {
        padding: 12px 14px;
    }

    .invoice-detail-label {
        font-size: 0.82rem;
    }

    .invoice-detail-value {
        font-size: 0.98rem;
    }

    .dashboard-card {
        min-height: 175px;
        border-radius: 18px;
    }

    .dashboard-card:hover {
        transform: none;
    }

    .dashboard-card-body {
        gap: 1rem;
    }

    .dashboard-card-heading {
        gap: 10px;
    }

    .dashboard-card-icon {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
    }

    .dashboard-card-icon svg {
        width: 27px;
        height: 27px;
    }

    .dashboard-card-title {
        font-size: 1.12rem;
    }

    .dashboard-card-action {
        min-height: 46px;
    }

    .reports-chart-header,
    .report-meta-header {
        flex-direction: column;
        align-items: stretch;
    }

    .reports-chart-type-wrap {
        width: 100%;
    }

    .division-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        max-width: 100%;
        height: 260px;
    }

    .table-responsive {
        border-radius: 12px;
    }


    /* Mobile reports: one continuous report list, not separate cards. */
    .mobile-report-list {
        width: 100%;
        overflow: hidden;
        border: 1px solid #e3e8ef;
        border-radius: 14px;
        background: #fff;
    }

    .mobile-report-row {
        position: relative;
        padding: 14px 15px;
        background: #fff;
        border-bottom: 1px solid #e8edf3;
    }

    .mobile-report-row:last-of-type {
        border-bottom: 0;
    }

    .mobile-report-row-compact {
        padding-top: 13px;
        padding-bottom: 13px;
    }

    .mobile-report-primary {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        min-width: 0;
    }

    .mobile-report-text {
        min-width: 0;
        flex: 1 1 auto;
    }

    .mobile-report-title {
        color: #172033;
        font-size: 0.96rem;
        line-height: 1.45;
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    .mobile-report-reason {
        font-weight: 650;
    }

    .mobile-report-subtitle {
        margin-top: 3px;
        color: #7a8496;
        font-size: 0.79rem;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

    .mobile-report-amount {
        flex: 0 0 auto;
        color: #0f172a;
        font-size: 1rem;
        line-height: 1.35;
        font-weight: 800;
        white-space: nowrap;
    }

    .mobile-report-meta,
    .mobile-report-secondary {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 14px;
        margin-top: 9px;
        color: #667085;
        font-size: 0.79rem;
        line-height: 1.45;
    }

    .mobile-report-meta strong,
    .mobile-report-secondary strong {
        color: #344054;
        font-weight: 700;
    }

    .mobile-report-meta > span,
    .mobile-report-secondary > span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .mobile-report-meta > span + span::before,
    .mobile-report-secondary > span + span::before {
        content: "•";
        margin-inline-end: 7px;
        color: #c0c7d2;
    }

    .mobile-report-total {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 13px 15px;
        border-top: 0;
        background: #f7f9fc;
        color: #344054;
        font-size: 0.9rem;
        font-weight: 700;
    }

    .mobile-report-total strong {
        color: #111827;
        font-size: 0.98rem;
        white-space: nowrap;
    }

    .mobile-report-total-split {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .mobile-report-total-split > span {
        display: inline-flex;
        align-items: baseline;
        gap: 5px;
    }

    /* Deleted invoices: details expand inside the selected invoice row. */
    .mobile-deleted-row {
        scroll-margin-top: 78px;
        padding-bottom: 0;
    }

    .mobile-deleted-row.is-expanded {
        background: #fbfdff;
    }

    .mobile-inline-action-form {
        margin: 12px -15px 0;
        border-top: 1px solid #edf1f5;
    }

    .mobile-inline-action {
        display: flex;
        width: 100%;
        min-height: 43px;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 15px;
        border: 0;
        background: transparent;
        color: #1769d2;
        font: inherit;
        font-size: 0.86rem;
        font-weight: 700;
        text-align: start;
    }

    .mobile-inline-action:active {
        background: #f2f6fb;
    }

    .mobile-inline-action-arrow {
        color: #7c8798;
        font-size: 1rem;
        line-height: 1;
    }

    .mobile-deleted-row.is-expanded .mobile-inline-action-arrow {
        transform: rotate(180deg);
    }

    .mobile-deleted-row.details-collapsed .mobile-inline-action-arrow {
        transform: none;
    }

    .mobile-deleted-row.details-collapsed .mobile-inline-details {
        display: none;
    }

    .mobile-inline-details {
        margin: 0 -15px;
        border-top: 1px solid #bdd7f4;
        border-bottom: 1px solid #bdd7f4;
        background: #eef6ff;
        box-shadow: inset 4px 0 0 #6ea8e6;
    }

    [dir="rtl"] .mobile-inline-details {
        box-shadow: inset -4px 0 0 #6ea8e6;
    }

    .mobile-inline-details-heading {
        padding: 11px 15px;
        color: #174f87;
        font-size: 0.82rem;
        font-weight: 800;
        border-bottom: 1px solid #cfe1f5;
        background: #e4f1ff;
    }

    .mobile-inline-detail-list {
        background: transparent;
    }

    .mobile-inline-detail-item {
        padding: 12px 15px;
        border-bottom: 1px solid #d5e5f5;
        background: transparent;
    }

    .mobile-inline-detail-item:last-child {
        border-bottom: 0;
    }

    .mobile-inline-detail-main {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .mobile-inline-detail-title {
        color: #1f2937;
        font-size: 0.9rem;
        line-height: 1.4;
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    .mobile-inline-detail-code {
        margin-top: 4px;
        color: #98a2b3;
        font-size: 0.73rem;
    }

    .mobile-inline-detail-total {
        flex: 0 0 auto;
        color: #111827;
        font-size: 0.91rem;
        white-space: nowrap;
    }

    .mobile-inline-detail-metrics {
        display: flex;
        flex-wrap: wrap;
        gap: 5px 14px;
        margin-top: 8px;
        color: #667085;
        font-size: 0.77rem;
    }

    .mobile-inline-detail-metrics strong {
        color: #344054;
    }

    .mobile-inline-details-total {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 7px 14px;
        padding: 11px 15px;
        border-top: 1px solid #c8dcf1;
        background: #deedfc;
        color: #294d72;
        font-size: 0.8rem;
        font-weight: 700;
    }

    .mobile-inline-details-total strong {
        color: #111827;
    }

    .btn-lg,
    .form-control-lg,
    .form-select-lg {
        font-size: 1rem;
    }
}

@media (max-width: 575.98px) {
    .app-navbar {
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }

    .brand-wrap {
        gap: 8px;
        max-width: calc(100% - 56px);
    }

    .brand-text {
        font-size: 0.9rem;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .chart-container {
        height: 230px;
    }
}

.app-rtl {
    direction: rtl;
    text-align: right;
}

.app-rtl .brand-wrap,
.app-rtl .reports-chart-header,
.app-rtl .report-meta-header,
.app-rtl .report-meta-strip,
.app-rtl .report-meta-inline,
.app-rtl .division-check-item,
.app-rtl .action-buttons-wrap,
.app-rtl .reports-action-wrap {
    direction: rtl;
}

.app-rtl .navbar-nav {
    padding-right: 0;
}

.chart-container canvas {
    max-width: 100% !important;
}

@media (max-width: 575.98px) {
    .sales-summary-grid {
        gap: 6px;
    }

    .sales-summary-item {
        padding: 9px 8px;
        border-radius: 10px;
        text-align: center;
    }

    .sales-summary-label {
        min-height: 2.7em;
        font-size: 0.69rem;
    }

    .sales-summary-value {
        margin-top: 4px;
        font-size: 0.94rem;
    }

    .chart-container {
        min-height: 300px;
        overflow: visible;
    }

    .report-meta-strip,
    .report-meta-inline {
        gap: 8px;
        font-size: 0.88rem;
    }
}

/* PWA / phone notification controls */
.push-notification-nav {
    margin-inline-end: 0.55rem;
}

.push-notification-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 10px;
    white-space: nowrap;
}

.push-notification-bell {
    line-height: 1;
}

.push-notification-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #adb5bd;
    box-shadow: 0 0 0 2px rgba(173, 181, 189, 0.14);
}

.push-notification-indicator.is-enabled {
    background: #198754;
    box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.14);
}

.push-notification-menu {
    width: min(330px, calc(100vw - 28px));
    border: 0;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
}

.push-notification-title {
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.push-notification-status {
    color: #6c757d;
    font-size: 0.88rem;
    line-height: 1.45;
}

.pwa-standalone body {
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
}

@media (max-width: 991.98px) {
    .push-notification-nav {
        margin: 0.45rem 0 0.25rem;
    }

    .push-notification-menu-button {
        width: 100%;
        justify-content: flex-start;
    }

    .push-notification-menu {
        width: 100%;
        max-width: 100%;
    }
}

/* ============================================================
   Professional application shell - desktop + mobile
   ============================================================ */
:root {
    --app-border: #e7ebf0;
    --app-text: #172033;
    --app-muted: #6b7280;
    --app-surface: #ffffff;
    --app-surface-soft: #f8fafc;
    --app-primary-soft: #edf4ff;
    --app-primary: #0d6efd;
    --app-danger-soft: #fff1f2;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.035);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.app-navbar {
    padding: 0;
    min-height: 70px;
    background: transparent;
}

.app-header-shell {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand-wrap {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    text-decoration: none;
}

.brand-wrap:hover,
.brand-wrap:focus {
    text-decoration: none;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-text {
    color: var(--app-text);
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.app-header-user {
    align-items: center;
    gap: 9px;
    min-width: 0;
    max-width: 270px;
    padding: 6px 10px 6px 7px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: #fff;
}

.app-rtl .app-header-user {
    padding: 6px 7px 6px 10px;
}

.app-user-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
}

.app-user-avatar svg {
    width: 17px;
    height: 17px;
}

.app-user-summary {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.app-user-summary strong,
.app-user-summary small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user-summary strong {
    color: var(--app-text);
    font-size: 0.82rem;
    font-weight: 700;
}

.app-user-summary small {
    margin-top: 3px;
    color: var(--app-muted);
    font-size: 0.72rem;
}

.app-menu-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dfe5ec;
    border-radius: 13px;
    background: #fff;
    color: #253044;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.04);
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.app-menu-toggle:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.07);
}

.app-menu-toggle:active {
    transform: scale(0.96);
}

.app-menu-toggle:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.18);
    outline-offset: 2px;
}

.app-menu-toggle svg {
    width: 22px;
    height: 22px;
}

.app-main-container {
    padding-top: 10px;
}

.app-navigation-drawer {
    width: min(330px, 92vw) !important;
    border: 0 !important;
    background: #fff;
    box-shadow: 0 0 42px rgba(15, 23, 42, 0.18);
}

.app-drawer-header {
    min-height: 78px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--app-border);
}

.drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.drawer-brand-logo {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    object-fit: contain;
}

.drawer-brand-title {
    color: var(--app-text);
    font-size: 0.96rem;
    font-weight: 750;
    line-height: 1.2;
}

.drawer-brand-subtitle {
    margin-top: 3px;
    color: #8a94a4;
    font-size: 0.73rem;
    line-height: 1.2;
}

.app-drawer-header .btn-close {
    flex: 0 0 auto;
    margin: 0;
    opacity: 0.55;
}

.app-drawer-body {
    display: flex;
    flex-direction: column;
    padding: 16px 16px 18px;
    overflow-x: hidden;
}

.drawer-user-card {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #e8edf3;
    border-radius: 15px;
    background: linear-gradient(135deg, #fbfcfe 0%, #f5f8fc 100%);
}

.drawer-user-icon {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #325d99;
    background: #eaf2ff;
}

.drawer-user-icon svg {
    width: 20px;
    height: 20px;
}

.drawer-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.drawer-user-label {
    color: #8b95a5;
    font-size: 0.7rem;
    font-weight: 600;
}

.drawer-user-info strong {
    margin-top: 2px;
    color: var(--app-text);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-user-info small {
    margin-top: 3px;
    color: var(--app-muted);
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-section-label {
    margin: 0 8px 8px;
    color: #9aa3b1;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.app-menu-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 13px;
    color: #3b4658;
    font-size: 0.91rem;
    font-weight: 650;
    text-decoration: none;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.app-menu-link:hover {
    color: #1e293b;
    background: #f5f7fa;
    text-decoration: none;
}

.app-menu-link.active {
    color: #0b5ed7;
    background: var(--app-primary-soft);
}

.app-menu-link.active::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 5px;
    background: var(--app-primary);
}

.app-ltr .app-menu-link.active::before {
    left: 0;
}

.app-rtl .app-menu-link.active::before {
    right: 0;
}

.app-menu-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #667085;
}

.app-menu-icon svg {
    width: 19px;
    height: 19px;
}

.app-menu-link.active .app-menu-icon {
    color: #0b5ed7;
    background: rgba(13, 110, 253, 0.07);
}

.drawer-spacer {
    flex: 1 1 auto;
    min-height: 24px;
}

.app-menu-logout {
    margin-top: 18px;
    border-top: 1px solid var(--app-border);
    border-radius: 0;
    padding-top: 17px;
    color: #c73545;
}

.app-menu-logout:hover {
    color: #a91f30;
    background: transparent;
}

.app-menu-logout .app-menu-icon {
    color: #c73545;
    background: var(--app-danger-soft);
}

/* ============================================================
   Invoice deletion notification control
   ============================================================ */
.delete-notification-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 15px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #fbfcfe 100%);
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.045);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.delete-notification-card.push-enabled {
    border-color: #cce7d8;
    box-shadow: 0 5px 18px rgba(25, 135, 84, 0.055);
}

.delete-notification-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #fff7df;
    color: #9a6b00;
}

.delete-notification-card.push-enabled .delete-notification-icon {
    color: #16744a;
    background: #eaf8f0;
}

.delete-notification-icon svg {
    width: 23px;
    height: 23px;
}

.delete-notification-content {
    min-width: 0;
}

.delete-notification-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    justify-content: space-between;
}

.delete-notification-title {
    color: var(--app-text);
    font-size: 0.97rem;
    font-weight: 750;
    line-height: 1.25;
}

.delete-notification-subtitle {
    margin-top: 3px;
    color: #7b8493;
    font-size: 0.78rem;
    line-height: 1.4;
}

.push-notification-state {
    flex: 0 0 auto;
    padding-top: 3px;
}

.push-notification-indicator {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #adb5bd;
    box-shadow: 0 0 0 3px rgba(173, 181, 189, 0.14);
}

.push-notification-indicator.is-enabled {
    background: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.13);
}

.push-notification-status {
    margin-top: 7px;
    color: #667085;
    font-size: 0.8rem;
    line-height: 1.45;
}

.delete-notification-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.delete-notification-actions .btn {
    min-width: 120px;
    padding: 0.58rem 0.85rem;
    font-size: 0.82rem;
    border-radius: 11px;
}

/* Old header notification dropdown is intentionally no longer used. */
.push-notification-nav,
.push-notification-menu {
    display: none !important;
}

@media (max-width: 767.98px) {
    .app-navbar,
    .app-header-shell {
        min-height: 62px;
    }

    .app-header-shell {
        gap: 10px;
    }

    .brand-logo {
        width: 36px;
        height: 36px;
    }

    .brand-text {
        max-width: calc(100vw - 112px);
        font-size: 0.92rem;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-menu-toggle {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 12px;
    }

    .app-main-container {
        padding-top: 5px;
    }

    .app-drawer-header {
        min-height: 70px;
        padding: 14px 15px;
    }

    .app-drawer-body {
        padding: 14px;
    }

    .delete-notification-card {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 11px 12px;
        padding: 13px;
        border-radius: 16px;
    }

    .delete-notification-icon {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .delete-notification-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
        padding-top: 2px;
    }

    .delete-notification-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .brand-text {
        font-size: 0.87rem;
    }

    .delete-notification-card {
        grid-template-columns: 1fr;
    }

    .delete-notification-icon {
        display: none;
    }

    .delete-notification-actions {
        grid-column: auto;
        grid-template-columns: 1fr;
    }
}
/* ===== Mobile app-only PWA install gate ===== */
.pwa-install-gate {
    display: none;
}

html.pwa-install-required,
html.pwa-install-required body {
    min-height: 100%;
    overflow: hidden;
}

html.pwa-install-required .pwa-install-gate {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 12% 0%, rgba(214, 165, 63, 0.16), transparent 28%),
        linear-gradient(160deg, #f8fafc 0%, #eef3f8 100%);
    overflow: auto;
}

.pwa-install-card {
    width: min(460px, 100%);
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(218, 225, 234, 0.95);
    border-radius: 26px;
    padding: 20px;
    box-shadow: 0 24px 70px rgba(20, 61, 105, 0.14);
}

.pwa-install-card-top {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 3px;
}

.pwa-install-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
}

.pwa-app-label {
    margin-top: 8px;
    color: #c6922e;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    direction: ltr;
}

.pwa-gate-language {
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid #e1e7ee;
    border-radius: 11px;
    background: #fff;
}

.pwa-gate-language button {
    min-width: 31px;
    height: 28px;
    padding: 0 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #7c8798;
    font-size: 0.64rem;
    font-weight: 900;
}

.pwa-gate-language button.active {
    background: #173f70;
    color: #fff;
}

.pwa-install-copy {
    max-width: 360px;
    margin: 17px auto 15px;
    text-align: center;
}

.pwa-install-copy h1 {
    margin: 0;
    color: #14243a;
    font-size: 1.45rem;
    line-height: 1.3;
    font-weight: 900;
}

.pwa-install-copy p {
    margin: 7px 0 0;
    color: #77859a;
    font-size: 0.78rem;
    line-height: 1.7;
}

.pwa-platform-panel {
    padding: 14px;
    border: 1px solid #e4eaf1;
    border-radius: 19px;
    background: #fbfcfe;
}

.pwa-platform-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    text-align: start;
}

.pwa-platform-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-weight: 900;
}

.pwa-platform-mark.android {
    background: #eaf7ef;
    color: #1c8a50;
}

.pwa-platform-mark.apple {
    background: #edf1f6;
    color: #182236;
    font-size: 0.85rem;
}

.pwa-platform-heading strong {
    display: block;
    color: #1c293c;
    font-size: 0.9rem;
    direction: ltr;
}

.pwa-platform-heading small {
    display: block;
    margin-top: 2px;
    color: #8a95a5;
    font-size: 0.67rem;
}

.pwa-install-button {
    width: 100%;
    min-height: 49px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 14px;
    background: #173f70;
    color: #fff;
    font-size: 0.86rem;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(23, 63, 112, 0.18);
}

.pwa-install-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pwa-install-button:disabled {
    opacity: 0.78;
    box-shadow: none;
}

.pwa-install-button.installed {
    background: #198754;
}

.pwa-mini-guide {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e6ebf1;
}

.pwa-guide-title {
    margin-bottom: 8px;
    color: #778499;
    font-size: 0.68rem;
    font-weight: 700;
    text-align: start;
}

.pwa-guide-steps {
    display: grid;
    gap: 8px;
}

.pwa-guide-steps.compact {
    grid-template-columns: 1fr 1fr;
}

.pwa-guide-step {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e7ebf1;
    border-radius: 14px;
    background: #fff;
    text-align: start;
}

.pwa-step-visual {
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #edf3f9;
    color: #173f70;
    font-size: 1.35rem;
    font-weight: 500;
    direction: ltr;
}

.pwa-step-visual.dots {
    font-size: 1.5rem;
    line-height: 1;
}

.pwa-step-visual.home {
    background: #f7f0df;
    color: #9d7629;
}

.pwa-step-visual svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pwa-guide-step > div:last-child {
    min-width: 0;
}

.pwa-guide-step b {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    margin-inline-end: 5px;
    border-radius: 6px;
    background: #f0f3f7;
    color: #68768a;
    font-size: 0.58rem;
    vertical-align: middle;
}

.pwa-guide-step strong {
    color: #273449;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.4;
}

.pwa-guide-step span {
    display: block;
    margin-top: 2px;
    color: #8793a4;
    font-size: 0.63rem;
    line-height: 1.45;
}

.ios-steps .pwa-guide-step {
    min-height: 64px;
}

.pwa-open-installed {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 12px;
    color: #7f8b9c;
    font-size: 0.66rem;
    line-height: 1.5;
    text-align: center;
}

.pwa-open-installed svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 420px) {
    .pwa-install-card {
        padding: 17px 14px;
        border-radius: 22px;
    }

    .pwa-install-logo {
        width: 68px;
        height: 68px;
    }

    .pwa-install-copy {
        margin: 14px auto 12px;
    }

    .pwa-install-copy h1 {
        font-size: 1.28rem;
    }

    .pwa-install-copy p {
        font-size: 0.72rem;
    }

    .pwa-platform-panel {
        padding: 12px;
        border-radius: 17px;
    }

    .pwa-guide-steps.compact {
        grid-template-columns: 1fr;
    }

    .pwa-guide-step {
        padding: 9px;
    }

    .pwa-gate-language {
        transform: scale(0.92);
        transform-origin: top right;
    }
}

/* ============================================================
   UI polish v2 - unified desktop + mobile experience
   ============================================================ */
:root {
    --ui-border: #e4e9f0;
    --ui-border-strong: #d6dee8;
    --ui-surface: #ffffff;
    --ui-surface-soft: #f8fafc;
    --ui-text: #172033;
    --ui-muted: #687386;
    --ui-primary: #0d6efd;
    --ui-primary-soft: #eef5ff;
    --ui-shadow: 0 10px 30px rgba(15, 23, 42, 0.055);
}

body {
    background: #f5f7fa;
}

.app-container {
    max-width: 1320px;
}

.page-header-wrap {
    margin-top: 1.15rem;
    margin-bottom: 1.15rem;
}

.page-title {
    color: var(--ui-text);
    letter-spacing: -0.02em;
}

.card:not(.dashboard-card):not(.login-card) {
    border: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow);
}

.form-label {
    margin-bottom: 0.42rem;
    color: #4a5568;
    font-size: 0.82rem;
    font-weight: 700;
}

.form-control,
.form-select {
    border-color: #dce3eb;
    background-color: #fff;
    box-shadow: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #9fc5fb;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.10);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.dashboard-card {
    position: relative;
    min-height: 168px;
    border: 1px solid var(--ui-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.045);
    overflow: hidden;
}

.dashboard-card::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--dashboard-accent);
    opacity: 0.9;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    border-color: var(--dashboard-accent-border);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.075);
}

.dashboard-card-body {
    min-height: 168px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    padding: 22px 22px 22px 24px;
}

.app-rtl .dashboard-card-body {
    padding: 22px 24px 22px 22px;
}

.dashboard-card-icon {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 16px;
    box-shadow: none;
}

.dashboard-card-icon svg {
    width: 27px;
    height: 27px;
}

.dashboard-card-copy {
    min-width: 0;
}

.dashboard-card-title {
    margin: 0;
    color: var(--ui-text);
    font-size: 1.08rem;
    line-height: 1.35;
    text-align: start;
}

.dashboard-card-action {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 10px;
    color: var(--dashboard-accent);
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
    background: var(--dashboard-accent-soft);
}

.dashboard-card-action:hover,
.dashboard-card-action:focus {
    color: var(--dashboard-accent);
    text-decoration: none;
}

.dashboard-action-arrow {
    width: 16px;
    height: 16px;
}

/* Report filters */
.report-filter-card {
    overflow: hidden;
    border-radius: 20px;
}

.report-filter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px 17px;
    border-bottom: 1px solid #eef1f5;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.report-filter-heading {
    min-width: 0;
}

.report-filter-kicker {
    margin-bottom: 4px;
    color: #7b8797;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.report-filter-title {
    margin: 0;
    color: var(--ui-text);
    font-size: 1.06rem;
    font-weight: 800;
}

.report-filter-hint {
    margin: 4px 0 0;
    color: #7a8494;
    font-size: 0.82rem;
}

.report-filter-body {
    padding: 20px 22px 22px !important;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.report-filter-grid-deleted {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-filter-field {
    min-width: 0;
}

.report-filter-field .form-control-lg,
.report-filter-field .form-select-lg {
    min-height: 47px;
    font-size: 0.95rem;
}

.reports-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    background: #fff;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
}

.reports-filter-toggle svg {
    width: 17px;
    height: 17px;
    transition: transform 0.18s ease;
}

.reports-filter-toggle:not(.collapsed) svg {
    transform: rotate(180deg);
}

.division-filter-wrap {
    margin-top: 18px;
    padding: 15px 16px 13px;
    border: 1px solid #e5eaf0;
    border-radius: 15px;
    background: #fafbfd;
}

.division-filter-title {
    margin-bottom: 10px;
    font-size: 0.84rem;
}

.division-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.division-check-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid #dfe5ec;
    border-radius: 999px;
    background: #fff;
    color: #435066;
    font-size: 0.82rem;
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.division-check-item:has(input:checked) {
    border-color: #b9d5fb;
    background: #eef5ff;
    color: #0b5ed7;
}

.division-check-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--ui-primary);
}

.division-filter-note {
    margin-top: 9px;
    font-size: 0.76rem;
}

.report-filter-actions {
    justify-content: flex-end;
    margin-top: 17px;
}

.report-filter-actions .reports-action-btn {
    min-width: 150px;
    min-height: 45px;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
}

/* Report content */
.report-result-card {
    border-radius: 20px;
    overflow: hidden;
}

.report-result-card > .card-body {
    padding: 21px 22px;
}

.report-meta-header {
    padding-bottom: 14px;
    border-bottom: 1px solid #eef1f5;
}

.report-meta-header h4,
.reports-chart-header h4 {
    color: var(--ui-text);
    font-size: 1.02rem;
    font-weight: 800;
}

.report-meta-strip,
.report-meta-inline {
    gap: 7px;
}

.report-meta-strip > span,
.report-meta-inline > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 9px;
    border: 1px solid #e7ebf0;
    border-radius: 999px;
    background: #fafbfd;
    color: #667085;
    font-size: 0.76rem;
}

.sales-summary-grid {
    gap: 10px;
    margin: 15px 0 17px;
}

.sales-summary-item {
    position: relative;
    min-height: 86px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 16px;
    border: 1px solid #e4e9f0;
    border-radius: 15px;
    background: #fbfcfe;
}

.sales-summary-item-total {
    border-color: #bfd9fb;
    background: linear-gradient(135deg, #eef6ff 0%, #f7fbff 100%);
}

.sales-summary-label {
    min-height: 0;
    color: #748094;
    font-size: 0.73rem;
    font-weight: 750;
}

.sales-summary-value {
    margin-top: 6px;
    color: #111827;
    font-size: 1.18rem;
    font-weight: 850;
    letter-spacing: -0.02em;
}

.sales-summary-item-total .sales-summary-value {
    color: #0b5ed7;
    font-size: 1.28rem;
}

.report-table-wrap {
    border: 1px solid #e5eaf0;
    border-radius: 14px;
    overflow: auto;
    background: #fff;
}

.report-desktop-table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: transparent;
    --bs-table-hover-bg: #f8fbff;
    font-size: 0.88rem;
}

.report-desktop-table > :not(caption) > * > * {
    padding: 0.78rem 0.85rem;
    border-width: 0 0 1px;
    border-color: #edf0f4;
    vertical-align: middle;
}

.report-desktop-table thead th {
    background: #f7f9fc;
    color: #566174;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.report-desktop-table tbody tr {
    transition: background-color 0.14s ease;
}

.report-desktop-table tbody tr:hover {
    background: #f8fbff;
}

.report-desktop-table tfoot th {
    border-bottom: 0;
    background: #f8fafc;
    color: #1f2937;
    font-weight: 800;
}

/* Login */
.login-page-wrap {
    min-height: calc(100vh - 110px);
    padding: 28px 0 42px;
}

.login-card {
    position: relative;
    max-width: 520px;
    border: 1px solid #e3e8ef;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 65px rgba(15, 23, 42, 0.10);
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline: 0;
    height: 4px;
    background: linear-gradient(90deg, #0d6efd, #3d8bfd);
}

.login-card-body {
    padding: 31px 32px 32px !important;
}

.login-brand-block {
    margin-bottom: 18px;
}

.login-logo-shell {
    width: 86px;
    height: 86px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e7ebf0;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.login-logo {
    max-width: 68px;
    max-height: 68px;
}

.login-brand-name {
    margin-top: 11px;
    color: #172033;
    font-size: 1.05rem;
    font-weight: 850;
}

.login-subtitle {
    margin-top: 3px;
    color: #7a8494;
    font-size: 0.79rem;
}

.login-title {
    margin: 21px 0 17px;
    color: #273244;
    font-size: 1.08rem;
    font-weight: 800;
}

.login-form .form-control-lg,
.login-form .form-select-lg {
    min-height: 49px;
    font-size: 0.96rem;
}

.login-submit-btn {
    min-height: 50px;
    margin-top: 20px;
    border-radius: 13px;
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.18);
}

.login-alert {
    border-radius: 13px;
    font-size: 0.86rem;
}

@media (max-width: 1199.98px) {
    .report-filter-grid,
    .report-filter-grid-deleted {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .app-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .page-header-wrap {
        margin-top: 0.85rem;
        margin-bottom: 0.9rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .dashboard-card {
        min-height: 104px;
        border-radius: 17px;
    }

    .dashboard-card-body {
        min-height: 104px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 12px;
        padding: 16px 15px 16px 18px;
    }

    .app-rtl .dashboard-card-body {
        padding: 16px 18px 16px 15px;
    }

    .dashboard-card-icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        border-radius: 14px;
    }

    .dashboard-card-icon svg {
        width: 24px;
        height: 24px;
    }

    .dashboard-card-title {
        font-size: 1rem;
    }

    .dashboard-card-action {
        width: 38px;
        height: 38px;
        justify-content: center;
        padding: 0;
        border-radius: 12px;
    }

    .dashboard-card-action > span {
        display: none;
    }

    .dashboard-action-arrow {
        width: 17px;
        height: 17px;
    }

    .report-filter-card {
        border-radius: 17px;
    }

    .report-filter-card-header {
        align-items: stretch;
        flex-direction: column;
        gap: 13px;
        padding: 16px 16px 14px;
    }

    .report-filter-hint {
        max-width: 92%;
    }

    .reports-filter-toggle {
        width: 100%;
    }

    .report-filter-body {
        padding: 15px 16px 17px !important;
        border-top: 1px solid #eef1f5;
    }

    .report-filter-grid,
    .report-filter-grid-deleted {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .division-filter-wrap {
        margin-top: 14px;
        padding: 12px;
        border-radius: 13px;
    }

    .division-checkbox-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 7px;
        padding-bottom: 3px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .division-checkbox-grid::-webkit-scrollbar {
        display: none;
    }

    .division-check-item {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .report-filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 9px;
        margin-top: 14px;
    }

    .report-filter-actions .reports-action-btn {
        width: 100%;
        min-width: 0;
        min-height: 45px;
        padding-inline: 0.55rem;
        font-size: 0.82rem;
    }

    .report-result-card {
        border-radius: 17px;
    }

    .report-result-card > .card-body {
        padding: 15px 14px;
    }

    .report-meta-header {
        gap: 9px;
        padding-bottom: 11px;
    }

    .report-meta-inline,
    .report-meta-strip {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .report-meta-inline::-webkit-scrollbar,
    .report-meta-strip::-webkit-scrollbar {
        display: none;
    }

    .report-meta-inline > span,
    .report-meta-strip > span {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .sales-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin: 13px 0 14px;
    }

    .sales-summary-item {
        min-height: 74px;
        padding: 10px 8px;
        border-radius: 12px;
        text-align: center;
    }

    .sales-summary-label {
        font-size: 0.64rem;
        line-height: 1.28;
    }

    .sales-summary-value,
    .sales-summary-item-total .sales-summary-value {
        margin-top: 5px;
        font-size: 0.94rem;
    }

    .login-page-wrap {
        min-height: calc(100vh - 82px);
        padding: 15px 0 24px;
    }

    .login-card {
        max-width: 100%;
        border-radius: 20px;
    }

    .login-card-body {
        padding: 24px 18px 22px !important;
    }

    .login-logo-shell {
        width: 76px;
        height: 76px;
        border-radius: 20px;
    }

    .login-logo {
        max-width: 60px;
        max-height: 60px;
    }

    .login-title {
        margin-top: 18px;
    }
}

@media (max-width: 420px) {
    .report-filter-actions {
        grid-template-columns: 1fr;
    }

    .sales-summary-label {
        font-size: 0.61rem;
    }

    .sales-summary-value,
    .sales-summary-item-total .sales-summary-value {
        font-size: 0.88rem;
    }
}

/* Hostess Performance Report */
.hostess-report-shell {
    overflow: hidden;
}

.hostess-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 16px;
}

.hostess-kpi-card {
    min-height: 92px;
    padding: 16px 17px;
    border: 1px solid #e6ebf2;
    border-radius: 16px;
    background: #fbfcfe;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hostess-kpi-card > span {
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 750;
}

.hostess-kpi-card > strong {
    margin-top: 5px;
    color: #1f2937;
    font-size: 1.35rem;
    font-weight: 850;
    line-height: 1.1;
}

.hostess-kpi-card-primary {
    border-color: #cfe0ff;
    background: linear-gradient(145deg, #f4f8ff, #eef5ff);
}

.hostess-kpi-card-primary > strong {
    color: #0d6efd;
}

.hostess-payment-overview {
    padding: 14px;
    border: 1px solid #e8edf4;
    border-radius: 15px;
    background: #fff;
}

.hostess-section-label {
    color: #374151;
    font-size: 0.8rem;
    font-weight: 850;
}

.hostess-payment-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.hostess-payment-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #e1e7ef;
    border-radius: 11px;
    background: #f8fafc;
    color: #586174;
    font-size: 0.75rem;
    font-weight: 700;
}

.hostess-payment-chip strong {
    color: #1f2937;
    font-size: 0.82rem;
    font-weight: 850;
}

.hostess-allocation-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 2px 16px;
    color: #768195;
    font-size: 0.72rem;
    line-height: 1.55;
}

.hostess-allocation-note svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 1px;
}

.hostess-report-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 10px;
    margin: 17px 0 12px;
}

.hostess-search-wrap {
    position: relative;
}

.hostess-search-wrap svg {
    position: absolute;
    top: 50%;
    inset-inline-start: 13px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: #8b95a5;
    pointer-events: none;
}

.hostess-search-wrap .form-control {
    min-height: 44px;
    padding-inline-start: 41px;
    border-radius: 12px;
}

.hostess-sort-select {
    min-height: 44px;
    border-radius: 12px;
    font-size: 0.82rem;
}

.hostess-cards-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hostess-performance-card {
    border: 1px solid #e3e8ef;
    border-radius: 17px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.hostess-performance-card:hover {
    border-color: #d4dce8;
    box-shadow: 0 7px 22px rgba(15, 23, 42, 0.055);
}

.hostess-performance-card[open] {
    border-color: #cfd9e7;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.065);
}

.hostess-performance-card-unassigned {
    border-color: #f0d8d8;
}

.hostess-card-summary {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto 32px;
    align-items: center;
    gap: 18px;
    padding: 15px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.hostess-card-summary::-webkit-details-marker {
    display: none;
}

.hostess-card-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hostess-avatar {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf4ff;
    color: #0d6efd;
    font-size: 1rem;
    font-weight: 900;
}

.hostess-performance-card-unassigned .hostess-avatar {
    background: #fff1f1;
    color: #b42318;
}

.hostess-card-name-wrap {
    min-width: 0;
}

.hostess-name-line {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.hostess-card-name {
    overflow: hidden;
    color: #202939;
    font-size: 0.96rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hostess-rank-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 27px;
    height: 23px;
    padding: 0 6px;
    border-radius: 8px;
    background: #edf4ff;
    color: #0d6efd;
    font-size: 0.67rem;
    font-weight: 900;
}

.hostess-rank-unassigned {
    background: #fff0f0;
    color: #b42318;
}

.hostess-card-mini-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 5px;
    color: #7a8494;
    font-size: 0.7rem;
}

.hostess-card-totals {
    display: flex;
    align-items: center;
    gap: 24px;
}

.hostess-card-totals > div {
    min-width: 96px;
    text-align: end;
}

.hostess-card-totals span {
    display: block;
    color: #7b8494;
    font-size: 0.68rem;
    font-weight: 700;
}

.hostess-card-totals strong {
    display: block;
    margin-top: 3px;
    color: #344054;
    font-size: 0.95rem;
    font-weight: 850;
}

.hostess-card-sales strong {
    color: #0d6efd;
    font-size: 1.05rem;
}

.hostess-expand-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #f5f7fa;
    color: #667085;
}

.hostess-expand-icon svg {
    width: 17px;
    height: 17px;
    transition: transform 0.18s ease;
}

.hostess-performance-card[open] .hostess-expand-icon svg {
    transform: rotate(180deg);
}

.hostess-card-details {
    padding: 0 16px 16px;
    border-top: 1px solid #eef1f5;
    background: #fbfcfe;
}

.hostess-detail-section {
    padding-top: 15px;
}

.hostess-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.hostess-section-heading > span {
    color: #8a94a4;
    font-size: 0.69rem;
}

.hostess-payment-chips-card {
    margin-top: 9px;
}

.hostess-items-table-wrap,
.hostess-reference-body {
    border: 1px solid #e5eaf1;
    border-radius: 13px;
    overflow: hidden;
    background: #fff;
}

.hostess-items-table th,
.hostess-items-table td,
.hostess-reference-table th,
.hostess-reference-table td {
    padding-top: 9px;
    padding-bottom: 9px;
    font-size: 0.77rem;
}

.hostess-invoice-reference-section {
    margin-top: 14px;
    border: 1px solid #e4e9f0;
    border-radius: 13px;
    background: #fff;
    overflow: hidden;
}

.hostess-invoice-reference-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 13px;
    cursor: pointer;
    list-style: none;
    color: #465266;
    font-size: 0.78rem;
    font-weight: 800;
}

.hostess-invoice-reference-section > summary::-webkit-details-marker {
    display: none;
}

.hostess-reference-count {
    min-width: 27px;
    height: 24px;
    padding: 0 7px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f4f8;
    color: #667085;
    font-size: 0.7rem;
}

.hostess-reference-body {
    border: 0;
    border-top: 1px solid #edf0f4;
    border-radius: 0;
}

.hostess-no-matches {
    margin-top: 12px;
    padding: 18px;
    border: 1px dashed #d7dee8;
    border-radius: 14px;
    background: #fafbfc;
    color: #788395;
    text-align: center;
    font-size: 0.82rem;
}

@media (max-width: 991.98px) {
    .hostess-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hostess-card-summary {
        grid-template-columns: minmax(210px, 1fr) auto 32px;
    }

    .hostess-card-totals {
        gap: 13px;
    }
}

@media (max-width: 767.98px) {
    .hostess-kpi-grid {
        gap: 7px;
        margin: 12px 0 13px;
    }

    .hostess-kpi-card {
        min-height: 76px;
        padding: 11px 12px;
        border-radius: 13px;
    }

    .hostess-kpi-card > span {
        font-size: 0.66rem;
    }

    .hostess-kpi-card > strong {
        margin-top: 4px;
        font-size: 1.05rem;
    }

    .hostess-payment-overview {
        padding: 12px;
        border-radius: 13px;
    }

    .hostess-payment-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .hostess-payment-chips::-webkit-scrollbar {
        display: none;
    }

    .hostess-payment-chip {
        flex: 0 0 auto;
        min-height: 34px;
        padding: 6px 10px;
    }

    .hostess-allocation-note {
        margin-bottom: 13px;
        font-size: 0.66rem;
    }

    .hostess-report-toolbar {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 14px;
    }

    .hostess-search-wrap .form-control,
    .hostess-sort-select {
        min-height: 42px;
        font-size: 0.79rem;
    }

    .hostess-cards-list {
        gap: 8px;
    }

    .hostess-performance-card {
        border-radius: 14px;
    }

    .hostess-card-summary {
        position: relative;
        grid-template-columns: minmax(0, 1fr) 27px;
        gap: 9px;
        padding: 12px;
    }

    .hostess-card-identity {
        gap: 9px;
    }

    .hostess-avatar {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 0.88rem;
    }

    .hostess-card-name {
        max-width: 46vw;
        font-size: 0.88rem;
    }

    .hostess-rank-badge {
        min-width: 24px;
        height: 21px;
        font-size: 0.62rem;
    }

    .hostess-card-mini-meta {
        gap: 5px 9px;
        font-size: 0.64rem;
    }

    .hostess-card-totals {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
        margin-top: 2px;
    }

    .hostess-card-totals > div {
        min-width: 0;
        padding: 8px 9px;
        border-radius: 10px;
        background: #f7f9fc;
        text-align: start;
    }

    .hostess-card-totals span {
        font-size: 0.61rem;
    }

    .hostess-card-totals strong,
    .hostess-card-sales strong {
        font-size: 0.88rem;
    }

    .hostess-expand-icon {
        grid-column: 2;
        grid-row: 1;
        width: 27px;
        height: 27px;
        border-radius: 8px;
    }

    .hostess-card-details {
        padding: 0 11px 11px;
    }

    .hostess-detail-section {
        padding-top: 12px;
    }

    .hostess-mobile-items,
    .hostess-mobile-references {
        border: 1px solid #e5eaf1;
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
    }

    .hostess-mobile-item,
    .hostess-reference-row {
        padding: 11px 12px;
        border-bottom: 1px solid #edf0f4;
    }

    .hostess-mobile-item:last-child,
    .hostess-reference-row:last-child {
        border-bottom: 0;
    }

    .hostess-mobile-item-main,
    .hostess-reference-top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
    }

    .hostess-mobile-item-main > div {
        min-width: 0;
    }

    .hostess-mobile-item-main strong,
    .hostess-reference-top strong {
        display: block;
        color: #263246;
        font-size: 0.78rem;
        font-weight: 850;
    }

    .hostess-mobile-item-main span {
        display: block;
        margin-top: 2px;
        overflow: hidden;
        color: #8a94a4;
        font-size: 0.66rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hostess-mobile-item-main b,
    .hostess-reference-top b {
        flex: 0 0 auto;
        color: #0d6efd;
        font-size: 0.79rem;
        font-weight: 850;
    }

    .hostess-mobile-item-meta,
    .hostess-reference-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 5px 10px;
        margin-top: 7px;
        color: #768195;
        font-size: 0.63rem;
    }

    .hostess-reference-item {
        margin-top: 4px;
        color: #4f5b6e;
        font-size: 0.72rem;
        font-weight: 700;
    }

    .hostess-invoice-reference-section {
        margin-top: 11px;
        border-radius: 12px;
    }

    .hostess-invoice-reference-section > summary {
        padding: 11px 12px;
        font-size: 0.73rem;
    }
}

/* Barcode stock lookup and Caliber open-order preparation */
.stock-invoice-page {max-width:1180px; margin:0 auto;}
.stock-invoice-page .stock-scan-input-wrap input {font-size:1.12rem; min-width:0;}
.stock-found-item {border:1px solid #dce8ed; border-radius:14px; background:linear-gradient(120deg,#f5fbfd,#fff); padding:18px;}
.stock-found-header {display:grid; grid-template-columns:minmax(200px,1fr) minmax(120px,180px) minmax(110px,160px);gap:14px;align-items:center;}
.stock-found-header h4 {font-size:1.12rem;margin:.3rem 0;overflow-wrap:anywhere;}
.stock-muted {font-size:.82rem;color:#64748b;}
.stock-stat {background:#fff;border:1px solid #e1eaf0;border-radius:12px;padding:12px;min-width:0;}
.stock-stat small {color:#6b7688;display:block;margin-bottom:4px;}
.stock-stat strong {font-size:1.45rem;font-variant-numeric:tabular-nums;color:#124c62;}
.stock-found-actions {display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.stock-found-actions .form-control {max-width:130px;}
.stock-cart-table {min-width:540px;}
.stock-cart-table td {vertical-align:middle;}
.stock-cart-table .stock-row-qty {width:95px;min-width:80px;}
.stock-cart-footer {display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;padding:12px 0;border-top:1px solid #edf0f4;}
.stock-grand-total strong {font-size:1.55rem; margin:0 .4rem;font-variant-numeric:tabular-nums;}
.stock-cart-empty {text-align:center;color:#8592a3;padding:20px!important;}
.stock-scanner {max-width:480px; margin:0 auto;}
.stock-scanner[hidden], .stock-found-item[hidden], #stockBalances[hidden] {display:none!important;}
@media(max-width:700px) {.stock-found-header {grid-template-columns:1fr 1fr;}.stock-found-header>div:first-child {grid-column:1/-1;}.stock-stat strong {font-size:1.2rem;}.stock-found-item {padding:12px;}}

.stock-customer-results {border:1px solid #dce4ec;border-radius:10px;max-height:205px;overflow-y:auto;background:#fff;}
.stock-customer-choice {width:100%;padding:10px 14px;text-align:start;background:#fff;border:0;border-bottom:1px solid #e9eff3;color:#193a50;display:block;}
.stock-customer-choice:last-child {border-bottom:0;}
.stock-customer-choice:hover,.stock-customer-choice:focus {background:#ebf8ff;}

/* Stock/Invoice V3: dedicated responsive cards, no horizontal scrolling on phones */
.stock-invoice-page {max-width:1120px;margin-inline:auto;padding:0 0 2.5rem;color:#172b44}
.stock-invoice-page *, .stock-invoice-page *::before,.stock-invoice-page *::after {box-sizing:border-box}
.stock-invoice-page [hidden] {display:none!important}
.si-hero {display:flex;align-items:center;gap:14px;padding:18px 20px;border-radius:20px;margin-bottom:14px;background:linear-gradient(115deg,#132941,#11637c);color:#fff;box-shadow:0 10px 25px #10283d1a}
.si-hero-symbol {width:55px;height:55px;border:1px solid #ffffff55;background:#ffffff1c;border-radius:17px;display:grid;place-items:center;font-size:2rem;flex:none}
.si-hero h1 {margin:0;font-size:1.38rem;font-weight:850;color:white}
.si-hero p {margin:.35rem 0 0;font-size:.8rem;color:#e1f5ff}
.si-panel {border:1px solid #e1e9f1;border-radius:19px;background:#fff;box-shadow:0 4px 17px #1029410b;padding:18px;margin-bottom:14px;min-width:0}
.si-section-title {display:flex;align-items:center;gap:10px;margin-bottom:15px;flex-wrap:wrap}
.si-section-title h2 {font-size:1.04rem;font-weight:850;margin:0;color:#162b45}
.si-step {background:#e6f5fa;color:#126b8a;width:29px;height:29px;border-radius:10px;display:grid;place-items:center;font-size:.85rem;font-weight:900}
.si-hint {margin-inline-start:auto;color:#8293a4;font-size:.72rem}
.si-field {min-width:0}
.si-field label {display:block;color:#496079;font-size:.8rem;font-weight:700;margin:0 0 6px}
.si-field .form-select,.si-field .form-control,.si-scan-bar .form-control {border-radius:11px;border-color:#d6e1ed;min-height:45px;background-color:#fff;min-width:0}
.si-settings-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}
.si-customer-bar {display:flex;align-items:end;flex-wrap:wrap;gap:8px}
.si-grow {flex:1;min-width:200px}
.si-customer-bar .btn {border-radius:11px;min-height:45px;white-space:nowrap}
.si-customer-selected {margin-bottom:9px;min-height:0}
.si-customer-pill {display:flex;align-items:center;gap:9px;flex-wrap:wrap;border:1px solid #aadaca;background:#e9f8f2;padding:11px 13px;border-radius:12px;color:#116d4e;font-weight:750;font-size:.88rem}
.si-customer-pill small {font-size:.72rem;font-weight:500;color:#527e70}
.si-customer-results {margin-top:8px;border:1px solid #dce7ef;border-radius:13px;max-height:230px;overflow-y:auto;background:white}
.si-customer-choice {display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 13px;border:0;border-bottom:1px solid #eaf0f5;background:#fff;width:100%;text-align:start;color:#1a344e}
.si-customer-choice:last-child {border-bottom:0}
.si-customer-choice:hover,.si-customer-choice:focus {background:#eaf7fc}
.si-customer-choice strong {font-size:.89rem}
.si-customer-choice small {color:#657d91;font-size:.78rem;direction:ltr;unicode-bidi:isolate}
.si-new-customer {margin-top:13px;background:#f4f9fc;border:1px solid #cfe4ef;padding:14px;border-radius:14px}
.si-new-customer h3 {font-size:.95rem;font-weight:800;margin-bottom:13px}
.si-new-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.si-inline-actions {display:flex;gap:9px;flex-wrap:wrap;margin-top:12px}
.si-inline-actions .btn {border-radius:11px;min-height:43px}
.si-scan-bar {display:flex;gap:8px;flex-wrap:wrap}
.si-scan-bar .form-control {font-size:1.04rem;flex:1;min-width:170px}
.si-scan-bar .btn {border-radius:11px;min-height:46px}
.si-found-item {margin-top:12px;border:1px solid #cce4ed;border-radius:16px;background:#f5fbfd;padding:15px}
.si-found-name h3 {font-size:1.1rem;font-weight:850;margin:3px 0 0;overflow-wrap:anywhere}
.si-muted {color:#7b8c9f;font-size:.78rem}
.si-stock-stats {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.si-stock-stats>div {background:white;border:1px solid #deedf4;padding:11px 13px;border-radius:12px}
.si-stock-stats small {display:block;font-size:.7rem;color:#648091;margin-bottom:4px}
.si-stock-stats strong {font-size:1.35rem;color:#0a6179;font-weight:850;font-variant-numeric:tabular-nums}
.si-add-area {display:flex;align-items:end;flex-wrap:wrap;gap:10px;margin-top:13px}
.si-add-area .si-field {min-width:110px;flex:0 1 135px}
.si-add-area .btn {min-height:45px;border-radius:11px}
.si-balance-list {background:#fff;border:1px solid #dbe9f0;border-radius:12px;padding:12px;margin-top:12px}
.si-balance-list h4 {font-size:.87rem;font-weight:850;margin:0 0 8px}
.si-balance-row {display:flex;align-items:center;justify-content:space-between;padding:9px 3px;border-bottom:1px solid #edf2f6;gap:12px;font-size:.82rem}
.si-balance-row:last-child {border-bottom:0}
.si-balance-row strong {color:#0b5879;white-space:nowrap}
.si-cart-cards {display:grid;gap:10px}
.si-cart-card {display:grid;grid-template-columns:minmax(0,2fr) minmax(115px,1fr) minmax(115px,1fr) minmax(102px,.8fr) auto;gap:10px;align-items:end;padding:13px;border:1px solid #e1e8f0;background:#fafdff;border-radius:14px;min-width:0}
.si-cart-card .si-card-info {min-width:0;align-self:center}
.si-cart-card .si-card-info strong {display:block;font-size:.88rem;overflow-wrap:anywhere}
.si-cart-card .si-card-info small {font-size:.72rem;color:#8292a4}
.si-card-field {min-width:0}
.si-card-field label {display:block;font-size:.7rem;color:#6e8194;margin:0 0 5px}
.si-card-field .form-control {height:42px;border-radius:10px;padding:8px;min-width:0;text-align:center}
.si-card-field .si-readonly-price {font-size:.9rem;font-weight:700;display:flex;align-items:center;height:42px}
.si-line-total {font-size:.91rem;font-weight:900;color:#146283;white-space:nowrap;margin-bottom:10px}
.si-line-remove {height:40px;min-width:40px;border-radius:11px;align-self:end}
.si-cart-empty {padding:18px;text-align:center;border:1px dashed #cee0e9;border-radius:13px;color:#8295a5;font-size:.86rem}
.si-cart-summary {display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;background:#edf7fa;border-radius:13px;margin-top:15px;padding:13px 15px;font-weight:800}
.si-cart-summary strong {font-size:1.52rem;color:#0d6685;white-space:nowrap;font-variant-numeric:tabular-nums}
.si-cart-summary small {font-size:.7rem}
.si-cart-controls {display:flex;justify-content:flex-end;margin-top:12px}
.si-cart-controls .btn,.si-save-btn {border-radius:12px}
.si-save-btn {width:100%;min-height:53px;font-weight:800}
.si-count {background:#e6f5fa;color:#116c86;border-radius:50px;padding:2px 12px;font-size:.83rem;font-weight:850}
.si-bottom-note {margin-top:9px;text-align:center}
@media(max-width:900px) {.si-settings-grid {grid-template-columns:repeat(2,minmax(0,1fr))}.si-cart-card {grid-template-columns:minmax(0,1fr) minmax(110px,1fr) minmax(110px,1fr)}.si-cart-card .si-card-info {grid-column:1/-1}.si-line-remove {justify-self:end}}
@media(max-width:600px) {
 .stock-invoice-page {max-width:100%;padding-bottom:100px}
 .si-hero {border-radius:0 0 19px 19px;padding:15px 13px;margin-bottom:11px}
 .si-hero-symbol {width:46px;height:46px;border-radius:13px}
 .si-hero h1 {font-size:1.13rem}
 .si-hero p {font-size:.71rem}
 .si-panel {border-radius:15px;padding:13px 12px;margin:0 0 11px;box-shadow:0 3px 14px #1029410b}
 .si-settings-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .si-field label {font-size:.71rem}
 .si-field .form-select,.si-field .form-control {min-height:42px;font-size:.85rem;padding-inline:9px}
 .si-hint {width:100%;margin:0 0 0 38px;font-size:.68rem}
 .si-customer-bar .si-grow {flex:1 1 100%;min-width:0}
 .si-customer-bar .btn {flex:1 1 auto;font-size:.83rem}
 .si-new-grid {grid-template-columns:1fr}
 .si-scan-bar .form-control {flex:1 1 100%;min-width:0}
 .si-scan-bar .btn {flex:1 1 0}
 .si-stock-stats strong {font-size:1.15rem}
 .si-add-area {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .si-add-area .si-field {width:100%;min-width:0}
 .si-add-area .btn {width:100%;font-size:.83rem}
 .si-cart-card {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:11px}
 .si-cart-card .si-card-info {grid-column:1/-1}
 .si-line-total {align-self:center;margin:0}
 .si-line-remove {justify-self:end}
 .si-cart-summary strong {font-size:1.25rem}
}
/* Caliber Tools V4 — focused desktop + mobile dashboard */
.dh-home { max-width:1100px; margin-inline:auto; padding:10px 0 32px; color:#182d43; }
.dh-heading { margin:7px 0 17px; }
.dh-heading h1 { margin:0; font-size:clamp(1.35rem,2vw,1.7rem); letter-spacing:-.025em; font-weight:800; color:#132b43; }
.dh-feature,.dh-tool { text-decoration:none; color:inherit; }
.dh-feature { position:relative; display:flex; align-items:center; gap:20px; padding:24px 26px; min-height:148px; background:linear-gradient(116deg,#12314d,#165771); color:white; border-radius:21px; box-shadow:0 13px 30px rgba(16,44,67,.10); border:1px solid rgba(255,255,255,.1); transition:transform .15s,box-shadow .15s; }
.dh-feature:hover,.dh-feature:focus-visible { color:#fff; transform:translateY(-2px); box-shadow:0 18px 36px rgba(16,44,67,.17); }
.dh-feature-icon { width:72px; height:72px; flex:0 0 72px; display:grid; place-items:center; border-radius:20px; background:rgba(255,255,255,.13); border:1px solid rgba(255,255,255,.17); }
.dh-feature-icon svg { width:38px; height:38px; }
.dh-feature-content { display:flex; flex:1; flex-direction:column; gap:14px; min-width:0; }
.dh-feature-content strong { font-size:clamp(1.16rem,2.2vw,1.56rem); font-weight:800; line-height:1.35; }
.dh-feature-tags { display:flex; flex-wrap:wrap; gap:7px; }
.dh-feature-tags span { color:#d9eff8; border:1px solid rgba(255,255,255,.24); border-radius:100px; padding:4px 12px; font-size:.78rem; font-weight:600; }
.dh-feature-arrow { width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; background:rgba(255,255,255,.15); border-radius:12px; }
.dh-feature-arrow svg { width:22px; height:22px; }
[dir="rtl"] .dh-feature-arrow svg { transform:rotate(180deg); }
.dh-secondary { margin-top:27px; }
.dh-secondary-heading { font-size:.88rem; font-weight:800; color:#60768b; margin-bottom:12px; }
.dh-tools { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.dh-tool { min-width:0; min-height:114px; border:1px solid #e0e8f0; background:#fff; border-radius:18px; display:flex; align-items:center; gap:13px; padding:17px; box-shadow:0 4px 16px rgba(17,49,76,.035); transition:border-color .15s,transform .15s,box-shadow .15s; }
.dh-tool:hover,.dh-tool:focus-visible { color:#17304d; border-color:#aac9de; box-shadow:0 8px 22px rgba(17,49,76,.08); transform:translateY(-2px); }
.dh-tool-icon { display:grid;place-items:center; width:49px;height:49px; flex:0 0 49px; border-radius:14px; background:#edf5ff; color:#2369ad; }
.dh-tool-icon svg { width:25px; height:25px; }
.dh-tool strong { font-size:.94rem;line-height:1.45;overflow-wrap:anywhere;flex:1;min-width:0;font-weight:750; }
.dh-tool-arrow { font-size:1.1rem; color:#6b8093; flex:none; }
[dir="rtl"] .dh-tool-arrow { transform:scaleX(-1); }
.dh-tool-dna .dh-tool-icon { background:#f1f1f6;color:#4c526b; }
.dh-tool-delete .dh-tool-icon { background:#fff0f2;color:#bd4359; }
.dh-tool-assign .dh-tool-icon { background:#eaf7f2;color:#218464; }
@media(max-width:990px) { .dh-tools {grid-template-columns:repeat(2,minmax(0,1fr));} }
@media(max-width:650px) {
 .dh-home {padding:0 0 20px;}
 .dh-heading {margin:7px 0 14px;}
 .dh-heading h1 {font-size:1.35rem;}
 .dh-feature {gap:12px;min-height:125px;padding:17px 15px;border-radius:17px;}
 .dh-feature-icon {width:55px;height:55px;flex-basis:55px;border-radius:15px;}
 .dh-feature-icon svg {width:31px;height:31px;}
 .dh-feature-content {gap:9px;}
 .dh-feature-content strong {font-size:1.07rem;}
 .dh-feature-tags {gap:5px;}
 .dh-feature-tags span {font-size:.69rem;padding:3px 8px;}
 .dh-feature-arrow {width:32px;height:32px;flex-basis:32px;border-radius:9px;}
 .dh-feature-arrow svg {width:18px;height:18px;}
 .dh-secondary {margin-top:22px;}
 .dh-tools {grid-template-columns:1fr;gap:9px;}
 .dh-tool {min-height:76px;padding:12px;border-radius:14px;}
 .dh-tool-icon {width:44px;height:44px;flex-basis:44px;}
}
/* Caliber Tools V4 — one clear stock-and-invoice workspace. No changes to business logic. */
.stock-invoice-page {max-width:1180px;padding:0 0 36px;}
.stock-invoice-page .si-hero {background:transparent;box-shadow:none;color:#182f46;padding:5px 1px 14px;border-radius:0;margin-bottom:0;gap:11px;}
.stock-invoice-page .si-hero-symbol {width:40px;height:40px;flex-basis:40px;border:1px solid #d5e6f1;background:#e8f3fa;border-radius:12px;color:#126987;}
.si-hero-symbol svg {width:25px;height:25px;}
.stock-invoice-page .si-hero h1 {color:#162e46;font-size:1.4rem;font-weight:850;}
.si-content-grid {display:grid;grid-template-columns:minmax(0,1.55fr) minmax(315px,.9fr);grid-template-areas:'scan customer' 'cart settings';column-gap:14px;row-gap:14px;align-items:start;}
.si-content-grid > .si-panel {margin:0;min-width:0;}
.si-content-grid > .si-scan-panel {grid-area:scan;}
.si-content-grid > .si-customer-panel {grid-area:customer;}
.si-content-grid > .si-cart-panel {grid-area:cart;}
.si-content-grid > .si-settings-panel {grid-area:settings;}
.stock-invoice-page .si-panel {padding:18px;border:1px solid #e0e8ef;border-radius:17px;box-shadow:0 4px 17px rgba(16,41,65,.035);}
.stock-invoice-page .si-section-title {margin-bottom:13px;min-height:27px;gap:9px;}
.stock-invoice-page .si-section-title h2 {font-size:1.03rem;letter-spacing:0;font-weight:800;}
.si-context-shortcut {margin-inline-start:auto;border:1px solid #d8e9f0;border-radius:100px;background:#f4fafc;color:#316a80;max-width:55%;display:inline-flex;align-items:center;gap:5px;padding:6px 10px;font-weight:650;font-size:.74rem;cursor:pointer;}
.si-context-shortcut span {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.si-context-shortcut svg {flex:0 0 16px;width:16px;height:16px;}
.si-context-shortcut:hover,.si-context-shortcut:focus-visible {background:#e8f5f9;border-color:#b0d9e6;}
.stock-invoice-page .si-field label {font-size:.74rem;margin-bottom:4px;color:#536b81;}
.stock-invoice-page .si-field .form-select,.stock-invoice-page .si-field .form-control {min-height:43px;}
.stock-invoice-page .si-scan-bar {display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;}
.stock-invoice-page .si-scan-bar .form-control {min-width:0;min-height:48px;font-size:1.06rem;}
.stock-invoice-page .si-scan-bar .btn {min-height:48px;white-space:nowrap;font-weight:700;}
.stock-invoice-page #stockLookupMessage:empty,.stock-invoice-page #stockSaveMessage:empty,.stock-invoice-page #stockCustomerCreateMessage:empty {display:none;}
.stock-invoice-page #stockLookupMessage:not(:empty),.stock-invoice-page #stockSaveMessage:not(:empty) {margin-top:9px!important;}
.stock-invoice-page #stockLookupMessage .alert,.stock-invoice-page #stockSaveMessage .alert {font-size:.83rem;padding:9px 12px;border-radius:10px;}
.stock-invoice-page .si-found-item {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,215px);gap:12px;padding:13px;border-radius:13px;background:#f5fafc;margin-top:12px;}
.stock-invoice-page .si-found-name {align-self:center;min-width:0;}
.stock-invoice-page .si-found-name h3 {font-size:1.06rem;margin:3px 0;}
.stock-invoice-page .si-stock-stats {margin:0;gap:7px;}
.stock-invoice-page .si-stock-stats > div {border-radius:10px;padding:8px 10px;}
.stock-invoice-page .si-stock-stats small {font-size:.67rem;}
.stock-invoice-page .si-stock-stats strong {font-size:1.07rem;}
.stock-invoice-page .si-add-area {grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:end;gap:8px;margin-top:0;padding-top:9px;border-top:1px solid #dceaf1;}
.stock-invoice-page .si-add-area .si-field {flex:1 1 108px;max-width:135px;}
.stock-invoice-page .si-add-area .si-add-action {min-height:43px;white-space:nowrap;}
.stock-invoice-page #stockBalances {grid-column:1/-1;}
.stock-invoice-page .si-customer-selected {margin-bottom:10px;}
.stock-invoice-page .si-customer-pill {padding:9px 11px;border-radius:11px;font-size:.83rem;}
.stock-invoice-page .si-customer-bar {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;}
.stock-invoice-page .si-customer-bar .si-grow {grid-column:1/-1;min-width:0;}
.stock-invoice-page .si-customer-bar .btn {width:100%;min-height:42px;font-size:.81rem;white-space:normal;}
.stock-invoice-page .si-customer-bar .si-customer-find:only-of-type {grid-column:1/-1;}
.stock-invoice-page .si-new-customer {padding:11px;}
.stock-invoice-page .si-new-grid {grid-template-columns:1fr;gap:9px;}
.si-settings-panel {padding-bottom:14px!important;}
.si-settings-panel > .si-settings-toggle {list-style:none;cursor:pointer;display:flex;align-items:center;margin-bottom:0;}
.si-settings-panel > .si-settings-toggle::-webkit-details-marker {display:none;}
.si-settings-panel > .si-settings-toggle::marker {content:'';}
.si-settings-brief {font-size:.7rem;font-weight:600;color:#7690a2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;max-width:52%;margin-inline-start:auto;}
.si-chevron {width:17px;height:17px;flex:none;color:#627c8e;transition:transform .17s;}
.si-settings-panel[open] .si-chevron {transform:rotate(180deg);}
.si-settings-panel[open] > .si-settings-toggle {margin-bottom:15px;}
.stock-invoice-page .si-settings-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.stock-invoice-page .si-settings-grid .form-select {font-size:.82rem;padding-inline:9px;}
.stock-invoice-page .si-cart-cards {gap:8px;}
.stock-invoice-page .si-cart-card {grid-template-columns:minmax(0,1.7fr) minmax(76px,.65fr) minmax(83px,.7fr) minmax(88px,.75fr) 36px;gap:8px;padding:11px;align-items:center;border-radius:12px;}
.stock-invoice-page .si-cart-card .si-card-info strong {font-size:.86rem;}
.stock-invoice-page .si-card-field label {font-size:.67rem;}
.stock-invoice-page .si-card-field .form-control {height:40px;}
.stock-invoice-page .si-line-total {margin:0;font-size:.84rem;}
.stock-invoice-page .si-line-remove {min-width:36px;width:36px;height:38px;align-self:center;}
.stock-invoice-page .si-cart-empty {padding:15px;font-size:.81rem;}
.stock-invoice-page .si-cart-summary {margin-top:12px;padding:11px 13px;}
.stock-invoice-page .si-cart-summary strong {font-size:1.3rem;}
.stock-invoice-page .si-cart-controls {margin-top:8px;}
.stock-invoice-page .si-cart-controls .btn {font-size:.78rem;padding:6px 10px;}
.stock-invoice-page #stockSaveForm {margin-top:11px!important;}
.stock-invoice-page .si-save-btn {min-height:49px;font-size:.94rem;}
.stock-invoice-page .si-top-alert {font-size:.84rem;padding:9px 12px;margin-bottom:12px;}
@media(max-width:1020px) {
 .si-content-grid {grid-template-columns:minmax(0,1.25fr) minmax(265px,.9fr);gap:11px;}
 .stock-invoice-page .si-cart-card {grid-template-columns:minmax(0,1fr) repeat(2,minmax(75px,.6fr));}
 .stock-invoice-page .si-cart-card .si-card-info {grid-column:1/-1;}
 .stock-invoice-page .si-line-remove {justify-self:end;}
}
@media(max-width:740px) {
 .stock-invoice-page {padding:0 0 35px;max-width:100%;}
 .stock-invoice-page .si-hero {padding:2px 0 11px;gap:9px;margin:0;}
 .stock-invoice-page .si-hero h1 {font-size:1.18rem;}
 .stock-invoice-page .si-hero-symbol {width:36px;height:36px;flex-basis:36px;border-radius:10px;}
 .si-hero-symbol svg {width:22px;height:22px;}
 .si-content-grid {grid-template-columns:minmax(0,1fr);grid-template-areas:'scan' 'customer' 'cart' 'settings';gap:10px;}
 .stock-invoice-page .si-panel {padding:12px;border-radius:14px;}
 .stock-invoice-page .si-section-title {min-height:23px;margin-bottom:10px;}
 .stock-invoice-page .si-section-title h2 {font-size:.99rem;}
 .stock-invoice-page .si-scan-bar {grid-template-columns:minmax(0,1fr) 74px 86px;gap:6px;}
 .stock-invoice-page .si-scan-bar .form-control {grid-column:1/-1;min-height:47px;font-size:1rem;}
 .stock-invoice-page .si-scan-bar .btn {min-height:42px;}
 .stock-invoice-page #stockFindBtn {grid-column:1/3;}
 .stock-invoice-page #stockCameraBtn {grid-column:3/4;}
 .stock-invoice-page .si-found-item {grid-template-columns:minmax(0,1fr);gap:10px;padding:11px;margin-top:10px;}
 .stock-invoice-page .si-stock-stats {grid-template-columns:repeat(2,minmax(0,1fr));}
 .stock-invoice-page .si-add-area {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
 .stock-invoice-page .si-add-area .si-field {max-width:none;}
 .stock-invoice-page .si-add-area .si-add-action {width:100%;white-space:normal;}
 .stock-invoice-page .si-new-grid {grid-template-columns:1fr;}
 .stock-invoice-page .si-cart-card {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px;}
 .stock-invoice-page .si-cart-card .si-card-info {grid-column:1/-1;}
 .stock-invoice-page .si-line-total {align-self:center;}
 .stock-invoice-page .si-line-remove {justify-self:end;}
 .stock-invoice-page .si-cart-summary strong {font-size:1.17rem;}
 .stock-invoice-page .si-settings-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
 .si-settings-brief {max-width:40%;}
}
@media(max-width:390px) {
 .stock-invoice-page .si-scan-bar {grid-template-columns:minmax(0,1fr) 80px;}
 .stock-invoice-page #stockFindBtn {grid-column:1/2;}
 .stock-invoice-page #stockCameraBtn {grid-column:2/3;}
 .si-settings-brief {display:none;}
}

/* Caliber Tools V5 — one POS workspace with independent, content-sized side column */
.stock-invoice-page .si-content-grid {
    display:grid;
    grid-template-columns:minmax(0,1.65fr) minmax(300px,.9fr);
    grid-template-areas:none;
    gap:14px;
    align-items:start;
}
.stock-invoice-page .si-main-col,
.stock-invoice-page .si-side-col {
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:12px;
}
.stock-invoice-page .si-main-col {
    padding:16px;
    border:1px solid #dfebf1;
    background:white;
    border-radius:18px;
    box-shadow:0 5px 19px rgba(16,41,65,.04);
    gap:0;
}
.stock-invoice-page .si-main-col > .si-panel {
    margin:0;
    padding:0;
    box-shadow:none;
    border:0;
    border-radius:0;
    background:transparent;
    min-width:0;
}
.stock-invoice-page .si-main-col > .si-cart-panel {
    border-top:1px solid #e8eef3;
    margin-top:16px;
    padding-top:15px;
}
.stock-invoice-page .si-side-col > .si-panel {margin:0;min-width:0;}
.stock-invoice-page .si-customer-panel .si-section-title,
.stock-invoice-page .si-scan-panel .si-section-title {margin-bottom:10px;}
.stock-invoice-page .si-cart-panel .si-section-title {margin-bottom:11px;}
.stock-invoice-page .si-cart-empty {padding:12px;}
.stock-invoice-page .si-scan-panel .si-scan-bar input {width:100%;}
.stock-invoice-page .si-item-results {
    display:flex;
    flex-direction:column;
    margin-top:7px;
    background:#fff;
    border:1px solid #cee0ec;
    border-radius:13px;
    max-height:320px;
    overflow-y:auto;
    box-shadow:0 5px 13px rgba(17,49,76,.05);
}
.stock-invoice-page .si-item-choice {
    text-align:start;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:2px 12px;
    width:100%;
    padding:10px 12px;
    background:#fff;
    border:0;
    border-bottom:1px solid #e8eef3;
    color:#19364b;
    cursor:pointer;
}
.stock-invoice-page .si-item-choice:last-child {border-bottom:0;}
.stock-invoice-page .si-item-choice:hover,
.stock-invoice-page .si-item-choice:focus-visible {background:#eef8ff;outline:2px solid #a6d5f4;outline-offset:-2px;}
.stock-invoice-page .si-item-choice strong {font-size:.88rem;font-weight:750;overflow-wrap:anywhere;grid-column:1;}
.stock-invoice-page .si-item-choice .si-item-alt {font-size:.77rem;color:#637a8f;overflow-wrap:anywhere;grid-column:1;}
.stock-invoice-page .si-item-choice .si-item-code {font-size:.74rem;color:#216581;white-space:nowrap;grid-column:2;grid-row:1 / span 2;align-self:center;direction:ltr;unicode-bidi:isolate;}
@media(max-width:1020px) {
    .stock-invoice-page .si-content-grid {grid-template-columns:minmax(0,1.3fr) minmax(275px,.95fr);gap:10px;}
    .stock-invoice-page .si-main-col {padding:13px;}
}
@media(max-width:740px) {
    .stock-invoice-page .si-content-grid {display:flex;flex-direction:column;gap:10px;}
    .stock-invoice-page .si-main-col,
    .stock-invoice-page .si-side-col {width:100%;gap:10px;}
    .stock-invoice-page .si-main-col {padding:12px;border-radius:14px;}
    .stock-invoice-page .si-main-col > .si-cart-panel {margin-top:12px;padding-top:12px;}
    .stock-invoice-page .si-scan-panel .si-section-title {margin-bottom:8px;}
}

/* Caliber Tools V9 — unified barcode + invoice workspace (desktop/tablet/mobile).
   Restricted to .stock-invoice-page so existing tools and dashboard stay unchanged. */
.stock-invoice-page {
    --si-ink: #17324c;
    --si-muted: #657b90;
    --si-line: #e3ebf3;
    --si-blue: #1569e8;
    max-width: 1390px;
    margin-inline: auto;
    padding-bottom: 105px;
    color: var(--si-ink);
}
.stock-invoice-page .si-hero {padding:2px 0 13px;margin:0;}
.stock-invoice-page .si-hero h1 {font-size:clamp(1.15rem,1.5vw,1.36rem);}
.stock-invoice-page .si-hero-symbol {width:36px;height:36px;flex-basis:36px;border-radius:10px;}
.stock-invoice-page .si-hero-symbol svg {width:21px;height:21px;}
.stock-invoice-page .si-active-context {
    display:grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap:10px;
    margin:0 0 14px;
}
.stock-invoice-page .si-context-tile {
    min-width:0;
    border:1px solid #dce8f1;
    border-radius:15px;
    padding:12px 13px;
    display:flex;
    align-items:center;
    gap:10px;
    background:#fff;
    color:var(--si-ink);
    text-align:start;
    cursor:pointer;
    box-shadow:0 3px 10px rgba(25,61,91,.025);
}
.stock-invoice-page .si-context-tile:hover,
.stock-invoice-page .si-context-tile:focus-visible {border-color:#87b5e7;background:#f9fcff;outline:2px solid transparent;box-shadow:0 0 0 3px rgba(22,104,224,.10);}
.stock-invoice-page .si-context-icon {width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#edf6fc;color:#186a97;flex:none;}
.stock-invoice-page .si-context-icon svg {width:19px;height:19px;}
.stock-invoice-page .si-context-text {min-width:0;display:flex;flex-direction:column;flex:1;gap:3px;}
.stock-invoice-page .si-context-text small {font-size:.68rem;line-height:1.2;color:var(--si-muted);font-weight:600;}
.stock-invoice-page .si-context-text strong {font-size:.87rem;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:800;}
.stock-invoice-page .si-context-edit {font-size:.72rem;color:#186ac8;white-space:nowrap;font-weight:750;flex:none;}
.stock-invoice-page .si-context-dot {color:#a7b9c9;font-weight:400;margin-inline:2px;}
.stock-invoice-page .si-workspace {
    display:grid;
    grid-template-columns:minmax(0,1.15fr) minmax(0,.9fr);
    gap:14px;
    align-items:start;
}
.stock-invoice-page .si-scan-column,
.stock-invoice-page .si-order-column {min-width:0;}
.stock-invoice-page .si-workspace .si-panel {margin:0;padding:17px;background:#fff;border:1px solid var(--si-line);border-radius:18px;box-shadow:0 6px 21px rgba(23,49,77,.035);}
.stock-invoice-page .si-workspace .si-section-title {margin-bottom:12px;gap:8px;}
.stock-invoice-page .si-scan-hint {margin-inline-start:auto;font-size:.72rem;color:#7b92a7;white-space:nowrap;}
.stock-invoice-page .si-scan-bar {display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;}
.stock-invoice-page .si-scan-bar .form-control {grid-column:auto!important;height:49px;min-height:49px;font-size:1rem;border-radius:12px;}
.stock-invoice-page .si-scan-bar .btn {grid-column:auto!important;height:49px;min-height:49px;border-radius:12px;font-size:.85rem;padding-inline:14px;}
.stock-invoice-page #stockCameraBtn {display:inline-flex;align-items:center;justify-content:center;gap:6px;}
.stock-invoice-page #stockCameraBtn svg {width:19px;height:19px;flex:none;}
.stock-invoice-page .si-found-item {grid-template-columns:minmax(0,1fr) minmax(0,190px);padding:12px;margin-top:13px;background:#f5fafc;}
.stock-invoice-page .si-found-name h3 {font-size:1.02rem;margin-block:3px;}
.stock-invoice-page .si-stock-stats {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
.stock-invoice-page .si-stock-stats > div {padding:8px 9px;border-radius:10px;}
.stock-invoice-page .si-stock-stats strong {font-size:1.06rem;}
.stock-invoice-page .si-add-area {display:grid;grid-template-columns:minmax(80px,.7fr) minmax(94px,.8fr) minmax(125px,1.2fr) auto;align-items:end;gap:8px;padding-top:10px;}
.stock-invoice-page .si-add-area .si-field {width:auto;min-width:0;max-width:none;}
.stock-invoice-page .si-add-area .si-add-action {width:auto;min-height:43px;font-size:.82rem;white-space:nowrap;padding-inline:12px;}
.stock-invoice-page .si-add-area #stockAddPriceWrap[hidden] {display:none!important;}
.stock-invoice-page .si-add-area #stockAddPriceWrap[hidden] ~ #stockAddBtn {grid-column:span 2;}
.stock-invoice-page .si-cart-panel {min-height:245px;}
.stock-invoice-page .si-cart-panel .si-section-title {justify-content:space-between;}
.stock-invoice-page .si-cart-empty {padding:34px 12px;background:#fbfdff;}
.stock-invoice-page .si-cart-card {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:11px;
    padding:13px;
    background:#fbfdff;
    border-color:#e0eaf4;
    border-radius:13px;
}
.stock-invoice-page .si-cart-card .si-card-info {grid-column:1/-1;min-width:0;}
.stock-invoice-page .si-cart-card .si-card-info strong {font-size:.9rem;}
.stock-invoice-page .si-cart-card .si-card-info small {font-size:.7rem;}
.stock-invoice-page .si-cart-card .si-card-operations {display:flex;align-items:end;flex-wrap:wrap;gap:8px;grid-column:1/-1;}
.stock-invoice-page .si-cart-card .si-card-field {flex:0 0 115px;}
.stock-invoice-page .si-cart-card .si-card-field .form-control {height:40px;min-height:40px;}
.stock-invoice-page .si-cart-card .si-line-total {align-self:end;margin:0 0 8px auto;font-size:.93rem;}
.stock-invoice-page .si-cart-card .si-line-remove {align-self:end;height:40px;min-width:40px;width:40px;}
.stock-invoice-page .si-cart-card .si-stepper {display:flex;align-items:center;gap:0;border:1px solid #d4e1ed;border-radius:10px;overflow:hidden;background:#fff;}
.stock-invoice-page .si-cart-card .si-stepper button {border:0;background:#f1f6fa;color:#1c5c7a;font-weight:900;width:35px;height:40px;flex:none;}
.stock-invoice-page .si-cart-card .si-stepper button:hover {background:#dfeef8;}
.stock-invoice-page .si-cart-card .si-stepper .form-control {width:60px;height:40px;min-height:40px;text-align:center;border:0;border-radius:0;padding:4px;font-weight:800;}
.stock-invoice-page .si-cart-controls {margin-top:9px;}
.stock-invoice-page .si-cart-controls .btn {font-size:.73rem;min-height:32px;}
.stock-invoice-page .si-checkout {
    position:sticky;
    bottom:0;
    z-index:30;
    margin:14px 0 0;
    padding:12px 14px;
    background:rgba(255,255,255,.97);
    border:1px solid #dbe7f1;
    border-radius:16px;
    box-shadow:0 -6px 26px rgba(18,48,77,.10);
    backdrop-filter:blur(12px);
}
.stock-invoice-page .si-checkout-row {display:flex;align-items:center;justify-content:space-between;gap:15px;}
.stock-invoice-page .si-checkout-totals {display:flex;flex-direction:column;gap:3px;}
.stock-invoice-page .si-checkout-totals small {font-size:.73rem;font-weight:750;color:#637a91;}
.stock-invoice-page .si-checkout-totals strong {font-size:1.52rem;line-height:1.1;color:#0e6283;font-variant-numeric:tabular-nums;white-space:nowrap;}
.stock-invoice-page .si-checkout-totals .si-currency {font-size:.77rem;}
.stock-invoice-page .si-checkout-count {display:inline-flex;padding:2px 7px;border-radius:100px;background:#e9f4f8;color:#145b79;margin-inline-start:5px;}
.stock-invoice-page #stockSaveForm {margin:0!important;flex:0 1 320px;min-width:210px;}
.stock-invoice-page .si-save-btn {width:100%;min-height:51px;font-size:.94rem;border-radius:12px;margin:0;}
.stock-invoice-page #stockSaveMessage:not(:empty) {margin:0 0 9px!important;}
.stock-invoice-page .si-scan-toast {margin-top:8px;background:#edf9f1;color:#137246;border-radius:10px;padding:7px 11px;font-size:.79rem;font-weight:750;}
.stock-invoice-page .si-drawer {--bs-offcanvas-width:435px;width:min(435px,100%);max-width:100vw;direction:inherit;background:#fff;}
.stock-invoice-page .si-drawer-header {border-bottom:1px solid #e4edf5;padding:17px 20px;}
.stock-invoice-page .si-drawer-header .offcanvas-title {font-size:1.07rem;font-weight:850;color:#1a344b;}
.stock-invoice-page .si-drawer-body {padding:17px 18px;}
.stock-invoice-page .si-drawer .si-panel {margin:0;padding:0;border:0;box-shadow:none;background:transparent;}
.stock-invoice-page .si-drawer .si-customer-panel .si-section-title {display:none;}
.stock-invoice-page .si-drawer .si-settings-panel > .si-settings-toggle {display:none;}
.stock-invoice-page .si-drawer .si-settings-panel[open] > .si-settings-toggle {margin-bottom:0;}
.stock-invoice-page .si-drawer .si-settings-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.stock-invoice-page .si-drawer .si-customer-bar {grid-template-columns:repeat(2,minmax(0,1fr));}
.stock-invoice-page .si-drawer .si-new-grid {grid-template-columns:1fr;}
.stock-invoice-page .si-drawer .si-customer-pill {margin-top:0;}
.stock-invoice-page .si-drawer #siSettingsBrief {display:none;}
.stock-invoice-page .si-drawer .si-field .form-control,
.stock-invoice-page .si-drawer .si-field .form-select {min-height:46px;font-size:.94rem;}
.stock-invoice-page .si-drawer .si-customer-results {max-height:32vh;}
.stock-invoice-page .si-drawer .si-new-customer {margin-top:12px;}
@media (max-width:1030px) {
    .stock-invoice-page .si-workspace {grid-template-columns:minmax(0,1fr) minmax(0,.95fr);gap:11px;}
    .stock-invoice-page .si-add-area {grid-template-columns:minmax(80px,.8fr) minmax(85px,.9fr);}
    .stock-invoice-page .si-add-area #stockAddBtn {grid-column:1/-1;}
    .stock-invoice-page .si-add-area #stockShowBalancesBtn {grid-column:1/-1;}
    .stock-invoice-page .si-add-area #stockAddPriceWrap[hidden] ~ #stockAddBtn {grid-column:1/-1;}
    .stock-invoice-page .si-found-item {grid-template-columns:1fr;}
}
@media (max-width:820px) {
    .stock-invoice-page .si-workspace {grid-template-columns:minmax(0,1fr);gap:12px;}
    .stock-invoice-page .si-cart-panel {min-height:0;}
    .stock-invoice-page .si-add-area {grid-template-columns:minmax(0,.6fr) minmax(0,.8fr) minmax(0,1.3fr) auto;}
    .stock-invoice-page .si-add-area #stockAddBtn,
    .stock-invoice-page .si-add-area #stockShowBalancesBtn {grid-column:auto;}
    .stock-invoice-page .si-add-area #stockAddPriceWrap[hidden] ~ #stockAddBtn {grid-column:span 2;}
    .stock-invoice-page .si-checkout {margin-top:12px;}
}
@media (max-width:600px) {
    .stock-invoice-page {padding-bottom:105px;}
    .stock-invoice-page .si-hero {padding:2px 0 9px;}
    .stock-invoice-page .si-active-context {gap:7px;margin-bottom:10px;}
    .stock-invoice-page .si-context-tile {padding:9px;gap:7px;min-height:60px;border-radius:12px;}
    .stock-invoice-page .si-context-icon {width:30px;height:30px;flex-basis:30px;border-radius:9px;}
    .stock-invoice-page .si-context-icon svg {width:16px;height:16px;}
    .stock-invoice-page .si-context-text strong {font-size:.76rem;}
    .stock-invoice-page .si-context-edit {display:none;}
    .stock-invoice-page .si-context-text small {font-size:.62rem;}
    .stock-invoice-page .si-context-dot {margin:0 1px;}
    .stock-invoice-page .si-workspace .si-panel {padding:12px;border-radius:14px;}
    .stock-invoice-page .si-section-title h2 {font-size:1rem;}
    .stock-invoice-page .si-scan-hint {font-size:.65rem;}
    .stock-invoice-page .si-scan-bar {grid-template-columns:minmax(0,1fr) 48px;gap:7px;}
    .stock-invoice-page .si-scan-bar .form-control {grid-column:1/-1!important;height:49px;font-size:16px;padding-inline:11px;}
    .stock-invoice-page .si-scan-bar #stockFindBtn {grid-column:1!important;min-height:44px;height:44px;}
    .stock-invoice-page .si-scan-bar #stockCameraBtn {grid-column:2!important;min-height:44px;height:44px;padding:7px;}
    .stock-invoice-page .si-scan-bar #stockCameraBtn span {display:none;}
    .stock-invoice-page .si-found-item {grid-template-columns:minmax(0,1fr);padding:11px;}
    .stock-invoice-page .si-stock-stats {grid-template-columns:repeat(2,minmax(0,1fr));}
    .stock-invoice-page .si-add-area {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
    .stock-invoice-page .si-add-area #stockAddBtn {grid-column:1/-1;order:3;min-height:47px;}
    .stock-invoice-page .si-add-area #stockShowBalancesBtn {grid-column:1/-1;order:4;min-height:39px;}
    .stock-invoice-page .si-add-area #stockAddPriceWrap[hidden] ~ #stockAddBtn {grid-column:1/-1;}
    .stock-invoice-page .si-cart-card {padding:11px;}
    .stock-invoice-page .si-cart-card .si-card-operations {gap:7px;}
    .stock-invoice-page .si-cart-card .si-card-field {flex:0 1 100px;}
    .stock-invoice-page .si-cart-card .si-line-total {font-size:.89rem;margin-inline-start:auto;}
    .stock-invoice-page .si-checkout {
        position:fixed;
        inset-inline:0;
        bottom:0;
        margin:0;
        padding:10px max(12px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
        border-radius:15px 15px 0 0;
        border-inline:0;
        border-bottom:0;
        box-shadow:0 -5px 28px rgba(16,43,72,.16);
    }
    .stock-invoice-page .si-checkout-totals strong {font-size:1.18rem;}
    .stock-invoice-page #stockSaveForm {min-width:0;flex:0 1 55%;}
    .stock-invoice-page .si-save-btn {font-size:.86rem;min-height:49px;}
    .stock-invoice-page .si-drawer.offcanvas-end {
        --bs-offcanvas-width:100%;
        width:100%;height:auto;max-height:min(85dvh,770px);
        top:auto;right:0;left:0;bottom:0;
        border:0;border-radius:22px 22px 0 0;
        transform:translateY(100%);
    }
    .stock-invoice-page .si-drawer.offcanvas-end.show,
    .stock-invoice-page .si-drawer.offcanvas-end.showing {transform:none;}
    .stock-invoice-page .si-drawer-header {padding:16px;}
    .stock-invoice-page .si-drawer-body {padding:14px 16px calc(22px + env(safe-area-inset-bottom));}
    .stock-invoice-page .si-drawer .si-settings-grid {gap:9px;}
}
@media (max-width:365px) {
    .stock-invoice-page .si-context-icon {display:none;}
    .stock-invoice-page .si-context-tile {padding:9px 7px;}
    .stock-invoice-page .si-cart-card .si-card-operations {gap:6px;}
    .stock-invoice-page .si-cart-card .si-card-field {flex-basis:88px;}
    .stock-invoice-page .si-cart-card .si-stepper button {width:30px;}
    .stock-invoice-page .si-cart-card .si-stepper .form-control {width:49px;}
    .stock-invoice-page .si-checkout-totals strong {font-size:1.06rem;}
}
