/* THSH LOCAL FONT - VAZIRMATN */
@font-face {
    font-family: "Vazirmatn";
    src: url("/static/fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 600;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("/static/fonts/Vazirmatn-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700 900;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --sidebar: #0f172a;
    --sidebar-soft: #1e293b;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Tahoma,
        sans-serif;
}

button,
input,
select {
    font: inherit;
}

a {
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 280px;
    background: var(--sidebar);
    color: white;
    min-height: 100vh;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 24px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(
        135deg,
        #3b82f6,
        #2563eb
    );
    font-size: 22px;
    font-weight: 800;
}

.brand strong {
    display: block;
    font-size: 18px;
}

.brand span {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    margin-top: 2px;
}

.nav {
    flex: 1;
    overflow-y: auto;
}

.nav-title {
    color: #64748b;
    font-size: 11px;
    margin: 22px 10px 8px;
}

.nav-item {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 5px;
    transition: .2s;
}

.nav-item:hover,
.nav-item.active {
    background: var(--sidebar-soft);
    color: white;
}

.nav-item small {
    margin-right: auto;
    color: #64748b;
    font-size: 10px;
}

.nav-item.disabled {
    opacity: .55;
    cursor: default;
}

.sidebar-footer {
    border-top: 1px solid #1e293b;
    padding: 16px 10px 0;
}

.environment {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
}

.dot,
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background: #22c55e;
}

.logout {
    color: #fca5a5;
    font-size: 13px;
}

.main-content {
    width: calc(100% - 280px);
    margin-right: 280px;
    min-height: 100vh;
}

.topbar {
    min-height: 92px;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 18px 30px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
}

.topbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.topbar-status {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #ecfdf5;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
}

.menu-button {
    display: none;
    width: auto;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
}

.page-content {
    padding: 26px 30px 40px;
    max-width: 1500px;
    margin: auto;
}

.summary-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow:
        0 4px 18px
        rgba(15, 23, 42, .04);
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    font-size: 22px;
}

.summary-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.summary-card strong {
    font-size: 17px;
}

.section-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    box-shadow:
        0 5px 22px
        rgba(15, 23, 42, .04);
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.section-header h2 {
    margin: 0;
    font-size: 18px;
}

.section-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.section-icon {
    margin-right: auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--surface-soft);
    display: grid;
    place-items: center;
    font-size: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.audit-stats {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.audit-stat {
    background: var(--surface-soft);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.audit-number {
    display: block;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 5px;
}

label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 7px;
}

input,
select {
    width: 100%;
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: white;
    margin-bottom: 14px;
    outline: none;
}

input:focus,
select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px #dbeafe;
}

.primary-button,
.dark-button,
.danger-button,
.link-button {
    border: none;
    border-radius: 12px;
    padding: 12px 15px;
    cursor: pointer;
    font-weight: 700;
}

.primary-button {
    width: 100%;
    background: var(--primary);
    color: white;
}

.primary-button:hover {
    background: var(--primary-dark);
}

.dark-button {
    width: 100%;
    background: #111827;
    color: white;
}

.danger-button {
    width: 100%;
    background: var(--danger);
    color: white;
}

.link-button {
    margin-right: auto;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
}

.success {
    color: var(--success);
}

.warning {
    color: var(--warning);
}

.error {
    color: var(--danger);
}

.flash {
    margin: 18px 30px 0;
    border-radius: 14px;
    padding: 13px 16px;
    background: white;
    border: 1px solid var(--border);
}

.flash-success {
    border-right: 4px solid #22c55e;
}

.flash-error {
    border-right: 4px solid #ef4444;
}

.sidebar-overlay {
    display: none;
}

.report-link {
    display: block;
    padding: 13px 14px;
    border-radius: 12px;
    color: var(--primary);
    background: var(--surface-soft);
    margin-bottom: 8px;
}

@media (max-width: 1100px) {

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

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

@media (max-width: 800px) {

    .sidebar {
        transform: translateX(110%);
        transition: .25s ease;
        width: 270px;
        box-shadow:
            -10px 0 30px
            rgba(15,23,42,.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15,23,42,.45);
        z-index: 900;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        width: 100%;
        margin-right: 0;
    }

    .menu-button {
        display: inline-block;
    }

    .topbar {
        padding: 14px 16px;
    }

    .page-content {
        padding: 18px 14px 30px;
    }

    .flash {
        margin: 14px 14px 0;
    }

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

@media (max-width: 520px) {

    .summary-grid,
    .audit-stats {
        grid-template-columns: 1fr;
    }

    .topbar-status {
        display: none;
    }
}


/* =========================================================
   PRODUCTS
   ========================================================= */

.product-search {
    display: grid;
    grid-template-columns:
        minmax(180px, .7fr)
        minmax(240px, 1.5fr)
        auto
        130px;
    gap: 14px;
    align-items: end;
}

.product-search input,
.product-search select {
    margin-bottom: 0;
}

.stock-filter {
    padding-bottom: 11px;
}

.stock-filter label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text);
}

.stock-filter input {
    width: auto;
    margin: 0;
}

.products-result {
    margin-top: 18px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table th {
    text-align: right;
    padding: 12px 13px;
    color: var(--muted);
    font-size: 12px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.data-table td {
    padding: 13px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.data-table tbody tr:hover {
    background: #fafcff;
}

.quality-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 8px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 11px;
    font-weight: 700;
}

.stock-ok {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #dcfce7;
    color: #166534;
    font-weight: 800;
}

.stock-zero {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 800;
}

.table-action {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 7px 11px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
}

.empty-table {
    text-align: center;
    color: var(--muted);
    padding: 35px !important;
}

.ltr {
    direction: ltr;
    text-align: left;
}

.detail-header {
    margin-bottom: 14px;
}

.back-link {
    color: var(--primary);
    font-size: 13px;
}

.product-detail-card {
    max-width: 850px;
}

.product-code {
    background: #f8fafc;
    border-radius: 13px;
    padding: 14px;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 12px;
}

.product-code strong {
    display: block;
    color: var(--text);
    margin-top: 5px;
    font-size: 17px;
}

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

.full-field {
    grid-column: 1 / -1;
}

.warning-box {
    padding: 12px 14px;
    border-radius: 11px;
    background: #fffbeb;
    color: #92400e;
    font-size: 12px;
    line-height: 1.8;
    margin-bottom: 15px;
}

@media (max-width: 800px) {

    .product-search {
        grid-template-columns: 1fr;
    }

    .stock-filter {
        padding-bottom: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .full-field {
        grid-column: auto;
    }
}


/* =========================================================
   SYNC PANEL
   ========================================================= */

.sync-upload-card {
    max-width: 760px;
}

.info-box {
    background: #eff6ff;
    color: #1e40af;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 15px;
    font-size: 12px;
    line-height: 1.9;
}

.info-box strong {
    display: block;
    margin-top: 4px;
}

.sync-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    color: #92400e;
}

.sync-warning strong,
.sync-warning span {
    display: block;
}

.sync-warning span {
    margin-top: 4px;
    font-size: 12px;
}

.preview-section {
    margin-top: 28px;
}

.preview-section h3 {
    font-size: 15px;
    margin-bottom: 12px;
}

.sync-actions {
    margin-top: 26px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.sync-actions form {
    min-width: 160px;
}

.light-button {
    width: 100%;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    padding: 12px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
}

@media (max-width: 600px) {

    .sync-actions {
        flex-direction: column;
    }

    .sync-actions form {
        width: 100%;
    }
}


/* =========================================================
   SYSTEM / HISTORY
   ========================================================= */

.history-card {
    margin-top: 18px;
}

.rollback-button {
    border: none;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 9px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 700;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 14px;
    border-radius: 12px;
    background: #f8fafc;
}

.activity-item strong,
.activity-item span,
.activity-item small {
    display: block;
}

.activity-item span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.activity-item small {
    color: #94a3b8;
    margin-top: 3px;
    font-size: 10px;
}

.activity-meta {
    text-align: left;
}

@media (max-width: 600px) {

    .activity-item {
        flex-direction: column;
    }

    .activity-meta {
        text-align: right;
    }
}


/* =========================================================
   PRODUCT HISTORY
   ========================================================= */

.detail-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.database-pill {
    margin-right: auto;
    background: #eef2ff;
    color: #4338ca;
    padding: 7px 11px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.product-overview {
    background:
        linear-gradient(
            135deg,
            #111827,
            #1e293b
        );

    color: white;

    border-radius: 22px;

    padding: 24px;

    margin-bottom: 18px;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
}

.product-title {
    font-size: 23px;
    font-weight: 800;
}

.product-subtitle {
    color: #cbd5e1;
    margin-top: 6px;
}

.product-code-big {
    display: inline-block;
    margin-top: 13px;
    padding: 7px 10px;
    border-radius: 9px;
    background: rgba(255,255,255,.08);
    direction: ltr;
}

.product-metrics {
    display: flex;
    gap: 12px;
}

.product-metric {
    min-width: 130px;
    background: rgba(255,255,255,.08);
    border-radius: 15px;
    padding: 15px;
}

.product-metric span {
    display: block;
    color: #94a3b8;
    font-size: 11px;
}

.product-metric strong {
    display: block;
    margin-top: 5px;
    font-size: 19px;
}

.product-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(350px, .85fr);
    gap: 18px;
    align-items: start;
}

.product-history {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.history-entry {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: #fafcff;
}

.history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-head span {
    font-size: 10px;
    color: var(--muted);
    direction: ltr;
}

.changed-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
}

.changed-fields span {
    background: #eef2ff;
    color: #4338ca;
    padding: 4px 7px;
    border-radius: 7px;
    font-size: 9px;
}

.history-diff {
    display: grid;
    grid-template-columns:
        80px 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid #eef2f7;
    margin-top: 8px;
    font-size: 11px;
}

.history-diff del {
    color: #dc2626;
}

.history-diff strong {
    color: #16a34a;
}

.history-text-diff {
    border-top: 1px solid #eef2f7;
    margin-top: 8px;
    padding-top: 8px;
}

.history-text-diff small {
    color: var(--muted);
    display: block;
    margin-top: 5px;
}

.history-footer {
    margin-top: 10px;
}

.undo-button {
    border: none;
    background: #fff7ed;
    color: #c2410c;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
}

.undone-badge {
    display: inline-block;
    background: #f1f5f9;
    color: #64748b;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 10px;
}

.empty-history {
    padding: 25px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1050px) {

    .product-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {

    .product-overview {
        flex-direction: column;
        align-items: stretch;
    }

    .product-metrics {
        width: 100%;
    }

    .product-metric {
        flex: 1;
        min-width: 0;
    }
}


/* =========================================================
   ORDERS
   ========================================================= */

.order-filters {
    display: grid;
    grid-template-columns:
        minmax(240px, 2fr)
        1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.order-filters .primary-button {
    margin: 0;
    white-space: nowrap;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-card {
    display: grid;
    grid-template-columns:
        95px minmax(150px, 1.5fr)
        150px 160px 150px 25px;
    align-items: center;
    gap: 12px;

    text-decoration: none;
    color: inherit;

    border: 1px solid var(--border);
    background: white;
    border-radius: 14px;
    padding: 13px 15px;

    transition: .15s ease;
}

.order-card:hover {
    transform: translateY(-1px);
    border-color: #c7d2fe;
    box-shadow:
        0 8px 25px rgba(15,23,42,.05);
}

.order-number small,
.order-customer span,
.order-price small {
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.order-number strong {
    font-size: 17px;
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--muted);
    font-size: 11px;
}

.order-price {
    direction: ltr;
    text-align: right;
}

.order-price strong {
    font-size: 14px;
}

.order-status {
    text-align: center;
    padding: 7px 9px;
    border-radius: 9px;
    background: #f1f5f9;
    font-size: 10px;
    font-weight: 700;
}

.status-completed,
.status-delivered {
    background: #ecfdf5;
    color: #047857;
}

.status-invoice_registered {
    background: #eff6ff;
    color: #1d4ed8;
}

.status-new,
.status-taken {
    background: #fff7ed;
    color: #c2410c;
}

.status-cancelled {
    background: #fef2f2;
    color: #b91c1c;
}

.order-arrow {
    color: #94a3b8;
    font-size: 17px;
}


/* ORDER DETAIL */

.order-hero {
    background:
        linear-gradient(
            135deg,
            #111827,
            #1e293b
        );

    border-radius: 20px;
    padding: 22px 24px;
    color: white;

    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 16px;
}

.order-hero small {
    color: #94a3b8;
    display: block;
}

.order-hero strong {
    display: block;
    font-size: 25px;
    margin-top: 4px;
}

.order-hero strong span {
    font-size: 11px;
    color: #94a3b8;
}

.order-hero-status {
    background: rgba(255,255,255,.1);
    padding: 10px 14px;
    border-radius: 11px;
    font-size: 12px;
}

.order-stage-grid {
    display: grid;
    grid-template-columns:
        repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.stage-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 15px;
}

.stage-card span,
.stage-card strong,
.stage-card small {
    display: block;
}

.stage-card span {
    color: var(--muted);
    font-size: 11px;
}

.stage-card strong {
    margin-top: 6px;
    font-size: 13px;
}

.stage-card small {
    margin-top: 5px;
    color: #94a3b8;
    font-size: 9px;
}

.order-detail-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(320px, .7fr);
    gap: 18px;
    align-items: start;
}

.customer-card {
    margin-top: 18px;
}

.customer-info-grid {
    display: grid;
    grid-template-columns:
        repeat(2, 1fr);
    gap: 12px;
}

.customer-info-grid div {
    background: #f8fafc;
    border-radius: 11px;
    padding: 11px;
}

.customer-info-grid span {
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.customer-info-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

.customer-address {
    margin-top: 12px;
    background: #f8fafc;
    padding: 12px;
    border-radius: 11px;
}

.customer-address span {
    color: var(--muted);
    font-size: 10px;
}

.customer-address p {
    margin: 5px 0 0;
    line-height: 1.8;
    font-size: 11px;
}


/* TIMELINE */

.order-timeline {
    position: relative;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 10px;
    padding-bottom: 18px;
}

.timeline-item:not(:last-child)::before {
    content: "";
    position: absolute;
    right: 6px;
    top: 13px;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.timeline-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #4f46e5;
    margin-top: 3px;
    z-index: 1;
}

.timeline-content {
    background: #f8fafc;
    border-radius: 11px;
    padding: 11px;
}

.timeline-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.timeline-top strong {
    font-size: 11px;
}

.timeline-top span {
    color: #6366f1;
    font-size: 9px;
}

.timeline-content p {
    font-size: 10px;
    line-height: 1.8;
    color: #475569;
    margin: 6px 0;
}

.timeline-content small {
    direction: ltr;
    display: block;
    color: #94a3b8;
    font-size: 9px;
}


@media (max-width: 1050px) {

    .order-card {
        grid-template-columns:
            90px 1fr 130px 130px;
    }

    .order-status {
        grid-column: 3 / 5;
    }

    .order-arrow {
        display: none;
    }

    .order-detail-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 700px) {

    .order-filters {
        grid-template-columns: 1fr;
    }

    .order-card {
        grid-template-columns:
            90px 1fr;
    }

    .order-info,
    .order-price,
    .order-status {
        grid-column: auto;
    }

    .order-stage-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }
}

/* =========================================================
   ORDER ACTIONS
   ========================================================= */

.order-actions-card {
    margin-bottom: 18px;
}

.order-actions-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.order-actions-grid form {
    margin: 0;
}

.action-card-button,
.action-status-box {
    width: 100%;
    min-height: 118px;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: right;
}

.action-card-button {
    border: none;
    cursor: pointer;
    transition: .15s ease;
}

.action-card-button:hover {
    transform: translateY(-2px);
}

.action-card-button strong,
.action-status-box strong {
    font-size: 14px;
    margin-top: 8px;
}

.action-card-button small,
.action-status-box small {
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.8;
    opacity: .85;
}

.action-icon {
    font-size: 24px;
}

.action-blue {
    background: linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );
    color: white;
}

.action-green {
    background: linear-gradient(
        135deg,
        #16a34a,
        #15803d
    );
    color: white;
}

.action-status-box {
    background: #f8fafc;
    border: 1px solid var(--border);
}

.action-ready {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.action-transit {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.action-completed {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}


/* =========================================================
   FINAL RESPONSIVE LAYOUT
   ========================================================= */

html,
body {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.sidebar-overlay {
    display: none;
}


/* ---------------- DESKTOP ---------------- */

@media (min-width: 801px) {

    .app-shell {
        display: block;
        width: 100%;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;

        width: 280px;
        height: 100vh;

        transform: none;
        overflow-y: auto;

        z-index: 1000;
    }

    .main-content {
        width: calc(100% - 280px);
        min-width: 0;
        margin-right: 280px;
        margin-left: 0;
    }

    .menu-button {
        display: none;
    }

    .sidebar-overlay,
    .sidebar-overlay.show {
        display: none;
    }

    .page-content {
        width: 100%;
        min-width: 0;
    }
}


/* ---------------- MOBILE ---------------- */

@media (max-width: 800px) {

    html,
    body {
        overflow-x: hidden;
    }

    .app-shell {
        display: block;
        width: 100%;
        min-height: 100vh;
    }

    .main-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        min-width: 0;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;

        width: min(82vw, 300px);
        height: 100dvh;

        transform: translateX(105%);
        transition: transform .22s ease;

        overflow-y: auto;

        z-index: 1200;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;

        position: fixed;
        inset: 0;

        width: 100vw;
        height: 100dvh;

        background: rgba(15, 23, 42, .55);

        z-index: 1100;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }

    .topbar {
        width: 100%;
        min-width: 0;
        padding: 14px 16px;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .page-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        padding: 16px 12px 28px;
    }

    .section-card {
        width: 100%;
        max-width: 100%;
    }

    .order-hero {
        width: 100%;
    }

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

    .order-detail-grid {
        grid-template-columns: 1fr;
    }

    .customer-info-grid {
        grid-template-columns: 1fr;
    }

    .order-actions-grid {
        grid-template-columns: 1fr;
    }

    .table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}


/* ---------------- SMALL MOBILE ---------------- */

@media (max-width: 520px) {

    .order-hero {
        padding: 18px;
        border-radius: 18px;
    }

    .order-hero strong {
        font-size: 22px;
    }

    .order-stage-grid {
        gap: 9px;
    }

    .stage-card {
        padding: 12px;
    }

    .product-overview {
        padding: 18px;
    }
}



/* =========================================================
   ORDER DETAIL - LAYOUT FIX
   Scoped only to order detail page
   ========================================================= */

.order-detail-grid {
    min-width: 0;
}

.order-detail-grid > * {
    min-width: 0;
}

.order-detail-grid .section-card {
    min-width: 0;
    max-width: 100%;
}

.order-detail-grid .table-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

/*
   Override global .data-table min-width:760px
   only inside order detail.
*/
.order-detail-grid .data-table {
    width: 100%;
    min-width: 600px;
    max-width: none;
}


/* Desktop */
@media (min-width: 1051px) {

    .order-detail-grid {
        grid-template-columns:
            minmax(0, 1.5fr)
            minmax(280px, .7fr);
    }
}


/* Tablet */
@media (max-width: 1050px) {

    .order-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .order-detail-grid .timeline-card {
        width: 100%;
    }
}


/* Mobile */
@media (max-width: 700px) {

    .order-detail-grid {
        display: block;
        width: 100%;
    }

    .order-detail-grid > div,
    .order-detail-grid > .section-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .order-detail-grid .timeline-card {
        margin-top: 18px;
    }

    .order-detail-grid .data-table {
        min-width: 620px;
    }

    .order-hero {
        min-width: 0;
        gap: 12px;
    }

    .order-stage-grid {
        min-width: 0;
    }

    .stage-card {
        min-width: 0;
    }

    .order-actions-card {
        min-width: 0;
        max-width: 100%;
    }
}


/* =========================================================
   COURIER CONTROL CENTER
   ========================================================= */

.courier-team-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.courier-person-card {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 14px;

    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.courier-avatar {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    background: #eff6ff;
    border-radius: 14px;

    font-size: 22px;
}

.courier-person-card strong,
.courier-person-card span,
.courier-person-card small {
    display: block;
}

.courier-person-card span {
    color: var(--muted);
    font-size: 11px;
    margin-top: 3px;
}

.courier-person-card small {
    color: #2563eb;
    margin-top: 5px;
    font-size: 10px;
}


.courier-columns {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 18px 0;
}

.courier-order-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.courier-order-card {
    display: grid;
    grid-template-columns:
        minmax(130px, 1fr)
        minmax(150px, 1fr)
        auto;

    align-items: center;
    gap: 12px;

    padding: 13px;

    border: 1px solid var(--border);
    border-radius: 13px;

    color: inherit;
    text-decoration: none;

    transition: .15s ease;
}

.courier-order-card:hover {
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.courier-order-card strong,
.courier-order-card span,
.courier-order-card small {
    display: block;
}

.courier-order-card span {
    color: var(--muted);
    margin-top: 3px;
    font-size: 11px;
}

.courier-order-card small {
    color: #94a3b8;
    margin-top: 3px;
    font-size: 9px;
}

.courier-state {
    padding: 7px 10px;
    border-radius: 9px;

    font-size: 10px;
    font-weight: 700;

    white-space: nowrap;
}

.courier-state.ready {
    background: #eff6ff;
    color: #1d4ed8;
}

.courier-state.transit {
    background: #fff7ed;
    color: #c2410c;
}

.courier-state.delivered {
    background: #ecfdf5;
    color: #047857;
}


@media (max-width: 950px) {

    .courier-columns {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 600px) {

    .courier-order-card {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .courier-order-card > div:nth-child(2) {
        grid-column: 1 / 2;
    }

    .courier-state {
        grid-column: 2;
        grid-row: 1 / 3;
    }
}


/* =========================================================
   COURIER DESKTOP SAFE LAYOUT
   ========================================================= */

.courier-columns,
.courier-team-grid,
.courier-order-list {
    min-width: 0;
}

.courier-columns > *,
.courier-team-grid > *,
.courier-order-card > * {
    min-width: 0;
}


/*
   Viewport may still be desktop-sized, but after the
   280px sidebar the actual content area can be narrow.
*/
@media (min-width: 801px) and (max-width: 1250px) {

    .courier-columns {
        grid-template-columns: minmax(0, 1fr);
    }

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

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


/* Keep a safe visual gap from the fixed sidebar */
@media (min-width: 801px) {

    .page-content {
        padding-right: 30px;
        padding-left: 30px;
    }

    .courier-order-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .courier-columns .section-card {
        min-width: 0;
        max-width: 100%;
    }
}


/* =========================================================
   WAREHOUSE CONTROL CENTER
   ========================================================= */

.warehouse-columns {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 18px 0;
}

.warehouse-columns > * {
    min-width: 0;
}

.warehouse-state {
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.warehouse-state.new {
    background: #eff6ff;
    color: #1d4ed8;
}

.warehouse-state.picking {
    background: #fff7ed;
    color: #c2410c;
}

.warehouse-state.pickup {
    background: #f0fdf4;
    color: #15803d;
}

.warehouse-state.courier {
    background: #eef2ff;
    color: #4338ca;
}


@media (max-width: 1250px) {

    .warehouse-columns {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 600px) {

    .warehouse-state {
        grid-column: 2;
        grid-row: 1 / 3;
    }
}

/* =========================================================
   WAREHOUSE CONTROL CENTER
   ========================================================= */

.warehouse-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 18px 0;
}

.warehouse-columns > * {
    min-width: 0;
}

.warehouse-state {
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.warehouse-state.new {
    background: #eff6ff;
    color: #1d4ed8;
}

.warehouse-state.picking {
    background: #fff7ed;
    color: #c2410c;
}

.warehouse-state.pickup {
    background: #f5f3ff;
    color: #6d28d9;
}

.warehouse-state.courier {
    background: #ecfdf5;
    color: #047857;
}

@media (max-width: 1050px) {
    .warehouse-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .warehouse-columns {
        display: block;
        margin: 14px 0;
    }

    .warehouse-columns > .section-card {
        margin-bottom: 14px;
    }

    .warehouse-columns .courier-order-card {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .warehouse-columns
    .courier-order-card > div:nth-child(2) {
        grid-column: 1 / 2;
    }

    .warehouse-columns .warehouse-state {
        grid-column: 2;
        grid-row: 1 / 3;
    }
}



/* =========================================================
   WAREHOUSE DIRECT ACTIONS
   ========================================================= */

.warehouse-inline-action {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.warehouse-inline-action select {
    flex: 1;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
}

.warehouse-action-button {
    border: none;
    border-radius: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

.warehouse-action-button.start {
    background: #2563eb;
    color: white;
}

.warehouse-action-button.complete {
    width: 100%;
    background: #16a34a;
    color: white;
}

@media (max-width: 600px) {

    .warehouse-inline-action {
        flex-direction: column;
    }

    .warehouse-inline-action select,
    .warehouse-action-button {
        width: 100%;
    }
}


/* ==========================================================
   NEW SALE
   ========================================================== */

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

.sale-type-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,.02);
}

.sale-type-card:hover {
    transform: translateY(-1px);
}

.sale-type-card.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.sale-type-card strong {
    font-size: 16px;
}

.sale-type-card span {
    opacity: .72;
    font-size: 13px;
}

.selected-customer-card {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid var(--border-color, #e5e7eb);
}

.selected-customer-card > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.selected-customer-card span,
.selected-customer-card small {
    opacity: .72;
}

.selected-customer-card strong {
    font-size: 16px;
}

.selected-customer-balance {
    text-align: left;
    min-width: 170px;
}

.sale-customer-results {
    margin-top: 18px;
}

.sale-empty-message {
    margin-top: 16px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(127,127,127,.08);
    opacity: .82;
}

.sale-add-disabled {
    opacity: .5;
    cursor: not-allowed;
}

.sale-cart-placeholder {
    opacity: .92;
}


@media (max-width: 700px) {

    .sale-customer-types {
        grid-template-columns: 1fr;
    }

    .selected-customer-card {
        grid-template-columns: 1fr;
    }

    .selected-customer-balance {
        text-align: right;
        min-width: 0;
    }
}

.sale-qty-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sale-qty-form input {
    width: 72px;
    min-width: 72px;
}

.sale-remove-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #dc2626;
    font: inherit;
}

.sale-total-card {
    margin-top: 18px;
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 14px;
    background: rgba(59,130,246,.07);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.sale-total-card strong {
    font-size: 20px;
}

@media (max-width: 700px) {
    .sale-total-card {
        align-items: flex-start;
        flex-direction: column;
    }
}
/* THSH ERP UI V1 */
:root{--bg:#f3f6fb;--surface:#fff;--surface-soft:#f8fafc;--border:#e7ecf3;--text:#172033;--muted:#748095;--primary:#2563eb;--primary-dark:#1d4ed8;--sidebar:#101b34;--sidebar-soft:#1b2a4a;--success:#16a34a;--warning:#d97706;--danger:#dc2626}
body{background:linear-gradient(180deg,#f7f9fc 0,#f2f5fa 100%);letter-spacing:-.15px}
.sidebar{width:260px;padding:18px 14px;background:linear-gradient(180deg,#111d38 0%,#0b1428 100%);box-shadow:-8px 0 30px rgba(15,23,42,.08)}
.brand{padding:4px 8px 20px;margin-bottom:4px;border-bottom:1px solid rgba(255,255,255,.06)}
.brand-logo{width:42px;height:42px;border-radius:13px;background:linear-gradient(135deg,#3b82f6,#1d4ed8);box-shadow:0 8px 22px rgba(37,99,235,.28)}
.brand strong{font-size:17px;letter-spacing:.3px}.brand span{color:#7f91ae}
.nav{padding:4px 2px 10px;scrollbar-width:thin;scrollbar-color:#31415f transparent}
.nav-title{margin:19px 11px 7px;color:#647694;font-size:10px;font-weight:800;letter-spacing:.2px}
.nav-item{min-height:42px;padding:9px 11px;border-radius:11px;margin-bottom:3px;color:#b8c5d9;font-size:13px;font-weight:600}
.nav-item>span:first-child{width:23px;text-align:center;font-size:16px}
.nav-item:hover{background:rgba(255,255,255,.055);color:#fff;transform:translateX(-2px)}
.nav-item.active{background:linear-gradient(90deg,rgba(37,99,235,.30),rgba(59,130,246,.15));color:#fff;box-shadow:inset -3px 0 #3b82f6}
.sidebar-footer{border-top:1px solid rgba(255,255,255,.07);padding:14px 9px 2px}.environment{margin-bottom:10px}.logout{display:inline-flex;padding:6px 0}
.main-content{width:calc(100% - 260px);margin-right:260px}
.topbar{min-height:78px;padding:14px 28px;background:rgba(255,255,255,.94);backdrop-filter:blur(12px);border-bottom:1px solid #e8edf4;box-shadow:0 2px 12px rgba(15,23,42,.025)}
.topbar h1{font-size:20px;font-weight:900;color:#182238}.topbar p{font-size:12px;color:#8490a3;margin-top:3px}
.topbar-status{padding:7px 11px;border:1px solid #d9f4e3;background:#f0fdf4;color:#15803d;border-radius:999px}
.page-content{padding:22px 28px 42px;max-width:1600px;margin:0 auto;width:100%}
.cc-dashboard{max-width:1600px!important}
.cc-hero{background:linear-gradient(135deg,#fff 0%,#f5f9ff 70%,#eef5ff 100%)!important;border:1px solid #e2eaf5!important;border-radius:18px!important;box-shadow:0 7px 24px rgba(15,23,42,.045)!important}
.cc-metric,.cc-panel{background:#fff!important;border:1px solid #e5ebf3!important;box-shadow:0 5px 20px rgba(15,23,42,.04);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.cc-metric:hover,.cc-panel:hover{border-color:#d7e2f1!important;box-shadow:0 9px 28px rgba(15,23,42,.065)}
.cc-metric:hover{transform:translateY(-2px)}
.cc-metric-icon{background:#eef5ff!important;color:#2563eb;border:1px solid #e0ebfb}
.cc-metric-value{color:#16213a;letter-spacing:-.5px}.cc-rial{color:#8a96a8}
.cc-work-item,.cc-action{background:#fbfcfe;border-color:#e8edf4!important;transition:.18s ease}
.cc-work-item:hover,.cc-action:hover{background:#f4f8ff!important;border-color:#d8e5f8!important;transform:translateY(-1px)}
.cc-count{background:#fff7df!important;color:#a16207;border:1px solid #fde9a8}
.cc-health-item{background:#f8fafc;border:1px solid #edf1f5;border-radius:12px;padding:11px 12px}
.cc-audit-stat{background:#f8fafc;border:1px solid #edf1f5;border-radius:12px}
.flash{margin:14px 28px 0;border-radius:12px;box-shadow:0 5px 18px rgba(15,23,42,.04)}
@media(max-width:800px){.sidebar{width:270px}.main-content{width:100%;margin-right:0}.topbar{min-height:70px;padding:12px 16px}.page-content{padding:16px 14px 32px}.cc-hero{border-radius:15px!important}.flash{margin:10px 14px 0}}
@media(max-width:520px){.topbar h1{font-size:17px}.topbar p{font-size:11px}.cc-metric,.cc-panel{border-radius:14px!important}}

/* ==========================================================
   THSH SALES POS FINAL - DESKTOP WORKSPACE
   ========================================================== */

body:has(.sales-pos) .page-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 18px 24px 32px;
}

.sales-pos {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.sales-pos-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sales-pos .section-card {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 16px;
}

.sales-panel-title, .sales-cart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.sales-panel-title h2, .sales-cart-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
}

.sales-panel-title p, .sales-cart-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.sales-status-pill, .sales-result-count {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.sales-status-pill.cash {
    background: #ecfdf5;
    color: #15803d;
}

.sales-status-pill.registered {
    background: #eff6ff;
    color: #1d4ed8;
}

.sales-result-count {
    background: #f1f5f9;
    color: #475569;
}

.sales-customer-panel {
    padding: 17px 18px;
}

.sales-customer-panel .sale-customer-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}

.sales-customer-panel .sale-type-card {
    min-height: 62px;
    padding: 11px 14px;
}

.sales-customer-search, .sales-product-search {
    margin-top: 13px;
}

.sales-product-panel {
    padding: 18px;
}

.sales-product-search {
    display: grid;
    grid-template-columns: minmax(0,1fr) 150px;
    gap: 10px;
}

.sales-product-search input[type="text"] {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
}

.sales-product-search .primary-button {
    width: 150px;
    min-height: 46px;
    font-size: 12px;
}

.sales-products-results {
    width: 100%;
    max-height: 600px;
    margin-top: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 14px;
}

.sales-products-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.sales-products-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.sales-products-table th {
    padding: 11px 13px;
    font-size: 11px;
}

.sales-products-table td {
    padding: 13px;
    font-size: 12px;
}

.sales-product-name {
    font-size: 13px;
    line-height: 1.65;
    font-weight: 900;
}

.sales-product-db {
    display: block;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 9px;
}

.sales-product-price strong {
    font-size: 13px;
    font-weight: 900;
}

.sales-product-code-cell {
    min-width: 155px;
}

.sales-sku-wrap {
    --sku-hue: 210;
    display: inline-flex;
    direction: ltr;
    align-items: center;
    gap: 7px;
    padding: 5px 8px 5px 5px;
    white-space: nowrap;
    border: 1px solid hsl(var(--sku-hue) 70% 76%);
    border-radius: 10px;
    background: hsl(var(--sku-hue) 85% 96%);
    color: hsl(var(--sku-hue) 70% 32%);
}

.sales-prefix-badge {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 28px;
    padding: 0 6px;
    border-radius: 7px;
    background: hsl(var(--sku-hue) 82% 88%);
    color: hsl(var(--sku-hue) 72% 29%);
    font-size: 11px;
    font-weight: 950;
}

.sales-sku-code {
    color: hsl(var(--sku-hue) 68% 30%);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .4px;
}

.sales-products-table .quality-badge {
    padding: 6px 9px;
    font-size: 10px;
    font-weight: 900;
}

.sales-products-table .stock-ok {
    min-width: 38px;
    min-height: 31px;
    padding: 5px 9px;
    font-size: 12px;
}

.sales-add-button {
    min-width: 82px;
    min-height: 35px;
    padding: 7px 12px;
    border: 0;
    border-radius: 9px;
    background: #eff6ff;
    color: #1d4ed8;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
}

.sales-add-button:hover {
    background: #dbeafe;
}

.sales-cart-panel {
    min-width: 0;
    position: sticky;
    top: 94px;
    max-height: calc(100vh - 112px);
    overflow: auto;
}

.sales-search-placeholder, .sales-cart-empty {
    display: grid;
    place-items: center;
    text-align: center;
}

@media (min-width:1600px) {
    .sales-pos {
        grid-template-columns: minmax(0,1fr) 380px;
    }
}

@media (max-width:1099px) {
    .sales-pos {
        grid-template-columns: 1fr;
    }
    .sales-cart-panel {
        position: static;
        max-height: none;
    }
}

@media (max-width:700px) {
    body:has(.sales-pos) .page-content {
        padding: 12px;
    }
    .sales-product-search {
        grid-template-columns: 1fr;
    }
    .sales-product-search .primary-button {
        width: 100%;
    }
    .sales-products-results {
        overflow-x: auto;
    }
    .sales-products-table {
        min-width: 780px;
    }
}


/* THSH TYPOGRAPHY FINAL */
html,
body,
button,
input,
select,
textarea {
    font-family: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif !important;
}

.sales-product-name {
    font-family: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
}

.sales-panel-title h2,
.sales-cart-header h2 {
    font-weight: 800 !important;
}

.sales-sku-code {
    font-family: "Segoe UI", Arial, sans-serif !important;
    font-weight: 700 !important;
}

.sales-prefix-badge {
    font-family: "Segoe UI", Arial, sans-serif !important;
    font-weight: 700 !important;
}

/* ==========================================================
   THSH SALES POS - FINAL POLISH
   ========================================================== */

@media (min-width:1100px) {
    .sales-pos {
        grid-template-columns: minmax(0,1fr) 320px;
        gap: 16px;
    }
}

@media (min-width:1600px) {
    .sales-pos {
        grid-template-columns: minmax(0,1fr) 335px;
    }
}

.sales-customer-panel {
    padding: 15px 17px;
}

.sales-customer-panel .sales-panel-title {
    margin-bottom: 11px;
}

.sales-customer-panel .sale-customer-types {
    gap: 8px;
}

.sales-customer-panel .sale-type-card {
    min-height: 56px;
    padding: 9px 13px;
}

.sales-product-panel {
    padding: 17px;
}

.sales-product-panel .sales-panel-title {
    margin-bottom: 11px;
}

.sales-products-table th {
    padding: 10px 13px;
}

.sales-products-table td {
    padding: 10px 13px;
    vertical-align: middle;
}

.sales-product-name {
    font-size: 13.5px !important;
    line-height: 1.5 !important;
    font-weight: 700 !important;
}

.sales-product-db {
    margin-top: 2px;
    font-size: 8.5px;
}

.sales-product-price strong {
    font-size: 14px !important;
    font-weight: 800 !important;
}

.sales-products-table .quality-badge {
    font-weight: 800;
}

.sales-products-table .stock-ok {
    min-width: 38px;
    min-height: 30px;
    font-weight: 800;
}

.sales-add-button {
    min-width: 82px;
    min-height: 34px;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 800;
    transition: background .15s ease, transform .15s ease;
}

.sales-add-button:hover {
    transform: translateY(-1px);
}

.sales-sku-wrap {
    padding-top: 4px;
    padding-bottom: 4px;
}

.sales-prefix-badge {
    height: 27px;
}

.sales-cart-panel {
    padding: 17px;
}

.sales-cart-empty {
    min-height: 125px;
}

.sales-products-results {
    max-height: calc(100vh - 430px);
    min-height: 280px;
}

@media (min-height:850px) {
    .sales-products-results {
        max-height: calc(100vh - 390px);
    }
}

/* Hide accidental standalone checkmark in cash-customer status area */
.sales-customer-panel > .check,
.sales-customer-panel > .checkmark,
.sales-customer-panel > .success-check {
    display: none !important;
}


/* ==========================================================
   THSH SALES POS - CART / CUSTOMER / FLASH FINISH
   ========================================================== */

/* Cash customer status */
.sales-cash-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 9px 12px;
    border: 1px solid #bbf7d0;
    border-radius: 11px;
    background: #f0fdf4;
    color: #166534;
}

.sales-cash-note > span {
    display: grid !important;
    place-items: center;
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    font-size: 14px;
    font-weight: 900;
}

.sales-cash-note strong {
    display: block;
    font-size: 11px;
    font-weight: 800;
}

.sales-cash-note small {
    display: block;
    margin-top: 1px;
    color: #4d7c5a;
    font-size: 9px;
}

/* Customer search */
.sales-customer-search {
    display: grid;
    grid-template-columns: minmax(0,1fr) 120px;
    gap: 10px;
    align-items: end;
}

.sales-customer-search > div {
    min-width: 0;
}

.sales-customer-search input {
    width: 100%;
    min-height: 44px;
}

.sales-customer-search > .primary-button {
    width: 120px !important;
    min-height: 44px;
    padding: 8px 12px !important;
}

/* Cart */
.sales-cart-panel {
    padding: 17px !important;
    overflow-x: hidden;
}

.sales-cart-header {
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 0 !important;
    border-bottom: 1px solid #edf2f7;
}

.sales-cart-header h2 {
    font-size: 16px !important;
}

.sales-cart-header p {
    font-size: 9px !important;
}

.sales-clear-cart {
    appearance: none;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff7f7;
    color: #dc2626;
    padding: 6px 9px;
    cursor: pointer;
    font-family: inherit;
    font-size: 9px;
    font-weight: 800;
}

.sales-clear-cart:hover {
    background: #fee2e2;
}

.sales-cart-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sales-cart-item {
    padding: 14px 0;
    border-bottom: 1px solid #edf2f7;
}

.sales-cart-item:last-child {
    border-bottom: 0;
}

.sales-cart-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.sales-cart-item-name {
    min-width: 0;
    flex: 1;
}

.sales-cart-item-name strong {
    display: block;
    color: #172033;
    font-size: 11.5px;
    line-height: 1.55;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.sales-cart-item-name small {
    display: block;
    direction: ltr;
    text-align: right;
    margin-top: 4px;
    color: #718096;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 9px;
    font-weight: 600;
}

.sale-remove-button {
    appearance: none;
    display: grid;
    place-items: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: #fff1f2;
    color: #e11d48;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 18px;
    line-height: 1;
}

.sale-remove-button:hover {
    background: #ffe4e6;
}

.sales-cart-item-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: 11px;
}

.sale-qty-form {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.sale-qty-form > span {
    color: #64748b;
    font-size: 9px;
    font-weight: 700;
}

.sale-qty-form input[type="number"] {
    width: 52px;
    height: 34px;
    padding: 4px 5px;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    background: #fff;
    text-align: center;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.sales-qty-save {
    appearance: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
}

.sales-qty-save:hover {
    background: #dbeafe;
}

.sales-cart-item-price {
    min-width: 0;
    text-align: left;
}

.sales-cart-item-price small {
    display: block;
    direction: ltr;
    color: #64748b;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 9px;
    white-space: nowrap;
}

.sales-cart-item-price strong {
    display: block;
    margin-top: 3px;
    color: #111827;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.sales-cart-summary {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
    padding: 14px 0 12px;
    border-top: 1px solid #dbe4ee;
}

.sales-cart-total-label span {
    display: block;
    color: #334155;
    font-size: 10px;
    font-weight: 800;
}

.sales-cart-total-label small {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 9px;
}

.sales-cart-total-value {
    direction: ltr;
    text-align: left;
    color: #0f172a;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 18px;
    font-weight: 900;
    white-space: nowrap;
}

.sales-cart-total-value small {
    margin-right: 3px;
    color: #64748b;
    font-family: "Vazirmatn", "Segoe UI", sans-serif;
    font-size: 9px;
    font-weight: 700;
}

.sales-checkout-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100% !important;
    min-height: 43px;
    margin-top: 2px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
}

/* Compact flash message */
.main-content > .flash {
    position: fixed;
    top: 84px;
    left: 28px;
    z-index: 1000;
    width: auto;
    max-width: 360px;
    margin: 0 !important;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15,23,42,.12);
    font-size: 10px;
    font-weight: 700;
}

.main-content > .flash-success {
    border: 1px solid #bbf7d0;
    border-right: 4px solid #22c55e;
    color: #166534;
}

.main-content > .flash-error {
    border: 1px solid #fecaca;
    border-right: 4px solid #ef4444;
    color: #b91c1c;
}

@media (max-width:700px) {
    .sales-customer-search {
        grid-template-columns: 1fr;
    }

    .sales-customer-search > .primary-button {
        width: 100% !important;
    }

    .sales-cart-item-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .sales-cart-item-price {
        width: 100%;
        text-align: right;
    }

    .main-content > .flash {
        top: 78px;
        left: 14px;
        right: 14px;
        max-width: none;
    }
}

/* ==========================================================
   THSH SALES POS - FINAL DESKTOP CART + TOAST
   ========================================================== */

@media (min-width:1100px) {
    .sales-pos {
        grid-template-columns: minmax(0,1fr) 370px;
    }
}

@media (min-width:1600px) {
    .sales-pos {
        grid-template-columns: minmax(0,1fr) 390px;
    }
}

.sales-cart-item-name strong {
    font-size: 11.5px;
    line-height: 1.6;
    font-weight: 750;
    word-break: normal;
    overflow-wrap: break-word;
}

.sales-cart-item-name small {
    margin-top: 3px;
    line-height: 1.45;
}

.sales-cart-item-bottom {
    margin-top: 10px;
}

.main-content > .flash {
    top: 92px;
    left: 24px;
    right: auto;
    z-index: 2000;
    min-width: 190px;
    max-width: 340px;
    padding: 10px 14px;
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity .28s ease,
        transform .28s ease;
}

.main-content > .flash.flash-hiding {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

@media (max-width:700px) {
    .main-content > .flash {
        top: 78px;
        left: 14px;
        right: 14px;
        min-width: 0;
        max-width: none;
    }
}

/* THSH SALES - Persian inline validation */
.sales-customer-search,
.sales-product-search {
    position: relative;
}

.sales-inline-validation {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    z-index: 20;
    padding: 6px 9px;
    border: 1px solid #fecaca;
    border-radius: 7px;
    background: #fff7f7;
    color: #b91c1c;
    box-shadow: 0 5px 14px rgba(15,23,42,.08);
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

/* ==========================================================
   THSH SALES POS - EDITABLE QTY STEPPER
   ========================================================== */

.sale-qty-form {
    gap: 7px;
}

.sales-qty-stepper {
    display: inline-flex;
    direction: ltr;
    align-items: center;
    height: 36px;
    overflow: hidden;
    border: 1px solid #d7e0ea;
    border-radius: 9px;
    background: #fff;
}

.sales-qty-stepper input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
    width: 48px !important;
    min-width: 48px !important;
    height: 34px !important;
    padding: 0 4px !important;
    border: 0 !important;
    border-right: 1px solid #edf2f7 !important;
    border-left: 1px solid #edf2f7 !important;
    border-radius: 0 !important;
    outline: 0;
    background: #fff;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
}

.sales-qty-stepper input[type="number"]::-webkit-inner-spin-button,
.sales-qty-stepper input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sales-qty-step {
    appearance: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.sales-qty-step:hover {
    background: #eef4ff;
    color: #2563eb;
}

.sales-qty-step:active {
    background: #dbeafe;
}

.sales-qty-save {
    width: auto !important;
    min-width: 42px;
    height: 36px;
    padding: 0 9px !important;
    border-radius: 9px;
    font-family: "Vazirmatn", "Segoe UI", sans-serif;
    font-size: 9px;
    font-weight: 800;
}

/* =========================================================
   THSH ERP SHELL V1
   Visual shell only — no page/business logic.
   ========================================================= */

:root{
    --erp-sidebar-width:258px;
    --erp-sidebar-bg:#0d1729;
    --erp-sidebar-bg-2:#111f37;
    --erp-blue:#2563eb;
    --erp-blue-soft:#eff6ff;
    --erp-shell-bg:#f5f7fb;
    --erp-line:#e7ebf1;
}

body{
    background:var(--erp-shell-bg);
}

.sidebar{
    width:var(--erp-sidebar-width);
    padding:16px 13px 14px;
    background:
        linear-gradient(
            180deg,
            var(--erp-sidebar-bg-2) 0%,
            var(--erp-sidebar-bg) 100%
        );
    border-left:1px solid rgba(255,255,255,.04);
    box-shadow:-10px 0 35px rgba(15,23,42,.07);
}

.brand{
    min-height:64px;
    padding:5px 8px 16px;
    gap:11px;
    border-bottom:1px solid rgba(255,255,255,.065);
    margin-bottom:8px;
}

.brand-logo{
    width:42px;
    height:42px;
    flex:0 0 42px;
    border-radius:13px;
    background:
        linear-gradient(
            145deg,
            #3b82f6,
            #1d4ed8
        );
    box-shadow:0 8px 22px rgba(37,99,235,.24);
    font-size:20px;
}

.brand strong{
    color:#fff;
    font-size:16px;
    font-weight:900;
    letter-spacing:.2px;
}

.brand span{
    margin-top:3px;
    color:#8292ab;
    font-size:10px;
    font-weight:500;
}

.nav{
    padding:3px 1px 8px;
}

.nav-title{
    margin:18px 10px 6px;
    color:#60718d;
    font-size:9px;
    font-weight:900;
}

.nav-item{
    position:relative;
    min-height:40px;
    margin-bottom:2px;
    padding:8px 10px;
    gap:9px;
    border-radius:10px;
    color:#b9c5d6;
    font-size:12px;
    font-weight:650;
    transition:
        background .16s ease,
        color .16s ease,
        transform .16s ease;
}

.nav-item > span:first-child{
    width:22px;
    flex:0 0 22px;
    text-align:center;
    font-size:15px;
    opacity:.92;
}

.nav-item:hover{
    background:rgba(255,255,255,.055);
    color:#fff;
    transform:none;
}

.nav-item.active{
    background:
        linear-gradient(
            90deg,
            rgba(37,99,235,.27),
            rgba(59,130,246,.10)
        );
    color:#fff;
    box-shadow:
        inset -3px 0 #3b82f6;
}

.sidebar-footer{
    padding:12px 8px 2px;
    border-top:1px solid rgba(255,255,255,.065);
}

.environment{
    margin-bottom:8px;
    color:#7f90aa;
    font-size:10px;
}

.logout{
    display:flex;
    align-items:center;
    min-height:34px;
    color:#fca5a5;
    font-size:11px;
}

.main-content{
    width:calc(100% - var(--erp-sidebar-width));
    margin-right:var(--erp-sidebar-width);
    background:var(--erp-shell-bg);
}

.topbar{
    min-height:74px;
    padding:12px 26px;
    gap:14px;
    background:rgba(255,255,255,.95);
    border-bottom:1px solid var(--erp-line);
    box-shadow:0 3px 15px rgba(15,23,42,.025);
    backdrop-filter:blur(14px);
}

.topbar h1{
    font-size:19px;
    line-height:1.4;
    font-weight:900;
    color:#172033;
}

.topbar p{
    margin-top:2px;
    color:#8994a6;
    font-size:11px;
}

.topbar-status{
    margin-right:auto;
    min-height:31px;
    padding:6px 11px;
    gap:6px;
    border:1px solid #d8f1df;
    border-radius:999px;
    background:#f3fcf6;
    color:#16803d;
    font-size:10px;
    font-weight:800;
}

.status-dot,
.environment .dot{
    width:7px;
    height:7px;
    box-shadow:0 0 0 3px rgba(34,197,94,.09);
}

.page-content{
    width:100%;
    max-width:1640px;
    margin:0 auto;
    padding:21px 26px 42px;
}

@media(max-width:800px){
    .sidebar{
        width:276px;
        padding-top:13px;
    }

    .main-content{
        width:100%;
        margin-right:0;
    }

    .topbar{
        min-height:66px;
        padding:10px 13px;
    }

    .topbar h1{
        font-size:16px;
    }

    .topbar p{
        display:none;
    }

    .topbar-status{
        padding:5px 9px;
    }

    .page-content{
        padding:14px 12px 30px;
    }

    .brand{
        min-height:60px;
    }
}

@media(max-width:480px){
    .topbar-status span:not(.status-dot){
        display:none;
    }

    .topbar-status{
        width:30px;
        height:30px;
        padding:0;
        justify-content:center;
    }
}


/* =========================================================
   THSH ERP DESKTOP READABILITY V1
   Global desktop sizing — excludes mobile and sales POS.
   ========================================================= */

@media (min-width:1200px){

    :root{
        --erp-sidebar-width:282px;
    }

    .sidebar{
        width:var(--erp-sidebar-width);
        padding:18px 15px 16px;
    }

    .main-content{
        width:calc(100% - var(--erp-sidebar-width));
        margin-right:var(--erp-sidebar-width);
    }

    .brand{
        min-height:72px;
        padding:6px 9px 17px;
        gap:12px;
    }

    .brand-logo{
        width:47px;
        height:47px;
        flex-basis:47px;
        border-radius:14px;
        font-size:22px;
    }

    .brand strong{
        font-size:18px;
    }

    .brand span{
        font-size:11px;
    }

    .nav-title{
        margin:20px 11px 7px;
        font-size:10.5px;
    }

    .nav-item{
        min-height:45px;
        padding:9px 11px;
        gap:10px;
        margin-bottom:3px;
        border-radius:11px;
        font-size:13.5px;
    }

    .nav-item > span:first-child{
        width:25px;
        flex-basis:25px;
        font-size:17px;
    }

    .environment{
        font-size:11px;
    }

    .logout{
        min-height:38px;
        font-size:12.5px;
    }

    .topbar{
        min-height:84px;
        padding:14px 30px;
    }

    .topbar h1{
        font-size:22px;
    }

    .topbar p{
        margin-top:3px;
        font-size:12.5px;
    }

    .topbar-status{
        min-height:35px;
        padding:7px 13px;
        font-size:11.5px;
    }

    .status-dot,
    .environment .dot{
        width:8px;
        height:8px;
    }

    .page-content{
        max-width:1700px;
        padding:24px 30px 46px;
    }


    /* Dashboard */

    body:not(:has(.sales-pos)) .erp-kpis{
        gap:15px;
        margin-bottom:17px;
    }

    body:not(:has(.sales-pos)) .erp-kpi{
        min-height:142px;
        padding:22px 23px;
        border-radius:18px;
    }

    body:not(:has(.sales-pos)) .erp-kpi-head{
        margin-bottom:14px;
    }

    body:not(:has(.sales-pos)) .erp-kpi-label{
        font-size:14px;
    }

    body:not(:has(.sales-pos)) .erp-kpi-icon{
        width:44px;
        height:44px;
        flex-basis:44px;
        border-radius:12px;
        font-size:20px;
    }

    body:not(:has(.sales-pos)) .erp-kpi-value{
        font-size:30px;
    }

    body:not(:has(.sales-pos)) .erp-kpi-value small{
        font-size:12px;
    }

    body:not(:has(.sales-pos)) .erp-kpi-sub{
        margin-top:7px;
        font-size:11.5px;
    }

    body:not(:has(.sales-pos)) .erp-workspace{
        grid-template-columns:
            minmax(0,1.4fr)
            minmax(360px,.6fr);
        gap:17px;
        margin-bottom:17px;
    }

    body:not(:has(.sales-pos)) .erp-card{
        padding:22px;
        border-radius:18px;
    }

    body:not(:has(.sales-pos)) .erp-card-head{
        margin-bottom:18px;
    }

    body:not(:has(.sales-pos)) .erp-card-head h2{
        font-size:18px;
    }

    body:not(:has(.sales-pos)) .erp-card-head p{
        margin-top:5px;
        font-size:11.5px;
    }

    body:not(:has(.sales-pos)) .erp-tasks{
        gap:10px;
    }

    body:not(:has(.sales-pos)) .erp-task{
        min-height:82px;
        padding:13px 14px;
        gap:13px;
        border-radius:13px;
    }

    body:not(:has(.sales-pos)) .erp-task-icon{
        width:44px;
        height:44px;
        flex-basis:44px;
        border-radius:11px;
        font-size:19px;
    }

    body:not(:has(.sales-pos)) .erp-task strong{
        font-size:14px;
    }

    body:not(:has(.sales-pos)) .erp-task small{
        margin-top:4px;
        font-size:10.5px;
    }

    body:not(:has(.sales-pos)) .erp-task-count{
        min-width:37px;
        height:37px;
        font-size:13px;
    }

    body:not(:has(.sales-pos)) .erp-actions{
        gap:9px;
    }

    body:not(:has(.sales-pos)) .erp-action{
        min-height:61px;
        padding:11px 13px;
        gap:12px;
        border-radius:12px;
        font-size:13.5px;
    }

    body:not(:has(.sales-pos)) .erp-action-icon{
        width:39px;
        height:39px;
        flex-basis:39px;
        font-size:17px;
    }

    body:not(:has(.sales-pos)) .erp-bottom{
        gap:17px;
    }

    body:not(:has(.sales-pos)) .erp-status-grid{
        gap:10px;
    }

    body:not(:has(.sales-pos)) .erp-status{
        min-height:80px;
        padding:13px;
    }

    body:not(:has(.sales-pos)) .erp-status span{
        margin-bottom:7px;
        font-size:10.5px;
    }

    body:not(:has(.sales-pos)) .erp-status strong{
        font-size:13.5px;
    }

    body:not(:has(.sales-pos)) .erp-audit-item{
        padding:15px 9px;
    }

    body:not(:has(.sales-pos)) .erp-audit-item strong{
        font-size:22px;
    }

    body:not(:has(.sales-pos)) .erp-audit-item span,
    body:not(:has(.sales-pos)) .erp-card-link,
    body:not(:has(.sales-pos)) .erp-empty{
        font-size:11px;
    }
}


/* =========================================================
   THSH ERP VISUAL POLISH V1
   Brand depth + dashboard hierarchy.
   Scale remains unchanged.
   ========================================================= */

:root{
    --erp-brand:#2563eb;
    --erp-brand-dark:#1d4ed8;
    --erp-brand-soft:#eff6ff;
    --erp-card-shadow:
        0 1px 2px rgba(15,23,42,.025),
        0 8px 26px rgba(15,23,42,.035);
}


/* ---------- Shell / Brand ---------- */

.sidebar{
    background:
        radial-gradient(
            circle at 75% 0%,
            rgba(59,130,246,.12),
            transparent 26%
        ),
        linear-gradient(
            180deg,
            #111f39 0%,
            #0c172a 56%,
            #091323 100%
        );
}

.brand-logo{
    position:relative;
    isolation:isolate;
    background:
        linear-gradient(
            145deg,
            #4f8df7 0%,
            #2563eb 48%,
            #1d4ed8 100%
        );
    border:1px solid rgba(255,255,255,.16);
    box-shadow:
        0 8px 24px rgba(37,99,235,.30),
        inset 0 1px 0 rgba(255,255,255,.18);
}

.brand-logo::after{
    content:"";
    position:absolute;
    inset:5px;
    z-index:-1;
    border-radius:9px;
    border:1px solid rgba(255,255,255,.10);
}

.brand strong{
    text-shadow:0 1px 8px rgba(0,0,0,.10);
}

.nav-item{
    border:1px solid transparent;
}

.nav-item:hover{
    border-color:rgba(255,255,255,.045);
}

.nav-item.active{
    border-color:rgba(96,165,250,.14);
    box-shadow:
        inset -3px 0 #3b82f6,
        0 5px 18px rgba(0,0,0,.08);
}

.topbar{
    position:relative;
}

.topbar::after{
    content:"";
    position:absolute;
    right:0;
    bottom:-1px;
    width:180px;
    height:2px;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(37,99,235,.75)
        );
}

.topbar-status{
    box-shadow:0 4px 12px rgba(22,128,61,.05);
}


/* ---------- Dashboard cards ---------- */

.erp-kpi,
.erp-card{
    box-shadow:var(--erp-card-shadow);
}

.erp-kpi{
    position:relative;
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.erp-kpi::before{
    content:"";
    position:absolute;
    top:0;
    right:20px;
    left:20px;
    height:3px;
    border-radius:0 0 6px 6px;
    opacity:.85;
}

.erp-kpi:hover{
    transform:translateY(-2px);
    box-shadow:
        0 3px 7px rgba(15,23,42,.035),
        0 14px 32px rgba(15,23,42,.06);
}

.erp-kpi.sales::before{
    background:#22c55e;
}

.erp-kpi.orders::before{
    background:#3b82f6;
}

.erp-kpi.accounting::before{
    background:#f59e0b;
}

.erp-kpi.receivables::before{
    background:#ef4444;
}

.erp-kpi.sales .erp-kpi-icon{
    color:#15803d;
    background:#ecfdf5;
    box-shadow:inset 0 0 0 1px #dcfce7;
}

.erp-kpi.orders .erp-kpi-icon{
    color:#2563eb;
    background:#eff6ff;
    box-shadow:inset 0 0 0 1px #dbeafe;
}

.erp-kpi.accounting .erp-kpi-icon{
    color:#b45309;
    background:#fff7ed;
    box-shadow:inset 0 0 0 1px #ffedd5;
}

.erp-kpi.receivables .erp-kpi-icon{
    color:#dc2626;
    background:#fef2f2;
    box-shadow:inset 0 0 0 1px #fee2e2;
}


/* ---------- Pending operations ---------- */

.erp-workspace > .erp-card:first-child{
    position:relative;
    overflow:hidden;
}

.erp-workspace > .erp-card:first-child::before{
    content:"";
    position:absolute;
    right:0;
    top:0;
    width:4px;
    height:100%;
    background:
        linear-gradient(
            180deg,
            #3b82f6,
            #60a5fa 42%,
            rgba(96,165,250,.05)
        );
}

.erp-task{
    background:#fff;
    transition:
        transform .16s ease,
        background .16s ease,
        border-color .16s ease,
        box-shadow .16s ease;
}

.erp-task:hover{
    transform:translateY(-1px);
    background:#fbfdff;
    border-color:#dbe5f0;
    box-shadow:0 7px 18px rgba(15,23,42,.04);
}

.erp-task-icon{
    box-shadow:inset 0 0 0 1px rgba(148,163,184,.10);
}

.erp-task-count{
    box-shadow:inset 0 0 0 1px rgba(245,158,11,.08);
}


/* ---------- Quick actions ---------- */

.erp-action{
    position:relative;
    overflow:hidden;
    background:
        linear-gradient(
            90deg,
            #ffffff,
            #fbfdff
        );
    transition:
        transform .16s ease,
        border-color .16s ease,
        box-shadow .16s ease;
}

.erp-action::after{
    content:"‹";
    margin-right:auto;
    color:#b7c2d0;
    font-family:Arial,sans-serif;
    font-size:18px;
    font-weight:700;
    transition:
        color .16s ease,
        transform .16s ease;
}

.erp-action:hover{
    transform:translateX(-2px);
    border-color:#cfdced;
    box-shadow:0 6px 16px rgba(15,23,42,.035);
}

.erp-action:hover::after{
    color:#2563eb;
    transform:translateX(-2px);
}

.erp-action-icon{
    color:#2563eb;
    background:
        linear-gradient(
            145deg,
            #eff6ff,
            #e8f1ff
        );
    box-shadow:inset 0 0 0 1px #dbeafe;
}


/* ---------- Lower information cards ---------- */

.erp-bottom .erp-card{
    position:relative;
    overflow:hidden;
}

.erp-status{
    background:
        linear-gradient(
            180deg,
            #fff,
            #fbfcfe
        );
    transition:
        border-color .16s ease,
        background .16s ease;
}

.erp-status:hover{
    border-color:#d9e2ec;
    background:#fff;
}

.erp-audit-item{
    background:
        linear-gradient(
            180deg,
            #fff,
            #fbfcfe
        );
}


/* ---------- Focus / interaction ---------- */

.erp-task:focus-visible,
.erp-action:focus-visible,
.nav-item:focus-visible{
    outline:3px solid rgba(37,99,235,.18);
    outline-offset:2px;
}


/* ---------- Desktop only refinements ---------- */

@media (min-width:1200px){

    .erp-card-head h2{
        letter-spacing:-.15px;
    }

    .erp-kpi-value{
        letter-spacing:-.4px;
    }

    .page-content{
        background:
            radial-gradient(
                circle at 50% 0%,
                rgba(59,130,246,.025),
                transparent 30%
            );
    }
}


/* ---------- Mobile keeps interactions calm ---------- */

@media (max-width:800px){

    .erp-kpi:hover,
    .erp-task:hover,
    .erp-action:hover{
        transform:none;
    }

    .erp-action::after{
        display:none;
    }
}


/* =========================================================
   THSH ERP ICON SYSTEM V1
   Inline SVG line icons — no external dependency.
   ========================================================= */

.erp-icon{
    display:block;
    width:1em;
    height:1em;
    flex:none;
}

.nav-icon{
    width:25px;
    height:25px;
    flex:0 0 25px;
    display:grid;
    place-items:center;
    color:#8295b1;
}

.nav-icon .erp-icon{
    width:18px;
    height:18px;
}

.nav-item:hover .nav-icon{
    color:#dbeafe;
}

.nav-item.active .nav-icon{
    color:#7db2ff;
}

.brand-monogram{
    display:block;
    direction:ltr;
    color:#fff !important;
    font-family:Arial,sans-serif;
    font-size:14px !important;
    line-height:1;
    font-weight:900 !important;
    letter-spacing:-.8px;
}

.erp-kpi-icon .erp-icon{
    width:21px;
    height:21px;
}

.erp-task-icon .erp-icon{
    width:20px;
    height:20px;
}

.erp-action-icon .erp-icon{
    width:19px;
    height:19px;
}

@media(min-width:1200px){
    .nav-icon .erp-icon{
        width:19px;
        height:19px;
    }

    .erp-kpi-icon .erp-icon{
        width:23px;
        height:23px;
    }

    .erp-task-icon .erp-icon{
        width:21px;
        height:21px;
    }

    .erp-action-icon .erp-icon{
        width:20px;
        height:20px;
    }

    .brand-monogram{
        font-size:15px !important;
    }
}

/* =========================================================
   THSH ERP DASHBOARD REFERENCE V3
   ========================================================= */

.erp-dashboard-v3{
    width:100%;
    direction:rtl;
}

.erp3-kpis{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:16px;
    margin-bottom:18px;
}

.erp3-kpi{
    min-width:0;
    min-height:126px;
    display:flex;
    align-items:center;
    gap:16px;
    padding:20px;
    background:#fff;
    border:1px solid #e7edf5;
    border-radius:18px;
    box-shadow:0 6px 22px rgba(31,49,79,.045);
}

.erp3-kpi-icon{
    width:54px;
    height:54px;
    flex:0 0 54px;
    display:grid;
    place-items:center;
    border-radius:15px;
}

.erp3-kpi-icon .erp-icon{
    width:27px;
    height:27px;
}

.erp3-kpi-sales .erp3-kpi-icon{
    color:#ef476f;
    background:#fff0f4;
}

.erp3-kpi-orders .erp3-kpi-icon{
    color:#7c3aed;
    background:#f3e8ff;
}

.erp3-kpi-ready .erp3-kpi-icon{
    color:#f59e0b;
    background:#fff6df;
}

.erp3-kpi-accounting .erp3-kpi-icon{
    color:#16a34a;
    background:#eafaf0;
}

.erp3-kpi-debt .erp3-kpi-icon{
    color:#2563eb;
    background:#eaf3ff;
}

.erp3-kpi-body{
    min-width:0;
}

.erp3-kpi-body > strong{
    display:block;
    color:#13213a;
    font-size:24px;
    line-height:1.2;
    font-weight:950;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.erp3-kpi-body > span{
    display:block;
    margin-top:5px;
    color:#344258;
    font-size:13px;
    font-weight:850;
}

.erp3-kpi-body > span small{
    color:#8d99aa;
    font-size:10px;
}

.erp3-kpi-body > em{
    display:block;
    margin-top:5px;
    color:#9aa6b6;
    font-size:10px;
    font-style:normal;
}

.erp3-main-grid{
    display:grid;
    grid-template-columns:minmax(0,1.65fr) minmax(270px,.92fr) minmax(270px,.82fr);
    gap:16px;
    margin-bottom:16px;
}

.erp3-lower-grid{
    display:grid;
    grid-template-columns:minmax(0,1.35fr) minmax(0,1fr) minmax(280px,.8fr);
    gap:16px;
    margin-bottom:16px;
}

.erp3-panel{
    min-width:0;
    background:#fff;
    border:1px solid #e7edf5;
    border-radius:18px;
    padding:19px;
    box-shadow:0 6px 22px rgba(31,49,79,.04);
}

.erp3-main-grid > .erp3-panel{
    min-height:310px;
}

.erp3-lower-grid > .erp3-panel{
    min-height:260px;
}

.erp3-panel-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:18px;
}

.erp3-panel-head h2{
    margin:0;
    color:#15223a;
    font-size:17px;
    font-weight:950;
}

.erp3-panel-head p{
    margin:5px 0 0;
    color:#9aa6b6;
    font-size:10px;
}

.erp3-panel-head > a{
    color:#2563eb;
    font-size:10px;
    font-weight:850;
}

.erp3-soft-badge{
    display:inline-flex;
    align-items:center;
    height:28px;
    padding:0 10px;
    color:#64748b;
    background:#f4f7fb;
    border-radius:9px;
    font-size:9px;
    font-weight:800;
}

.erp3-chart-empty{
    height:220px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    border:1px dashed #dce5ef;
    border-radius:14px;
    background:
        linear-gradient(to bottom,rgba(248,250,252,.3),rgba(248,250,252,.8)),
        repeating-linear-gradient(
            to right,
            transparent 0,
            transparent 70px,
            rgba(226,232,240,.35) 71px
        );
}

.erp3-chart-empty .erp3-empty-icon{
    width:48px;
    height:48px;
    display:grid;
    place-items:center;
    margin-bottom:12px;
    color:#3b82f6;
    background:#eaf3ff;
    border-radius:14px;
}

.erp3-chart-empty .erp-icon{
    width:24px;
    height:24px;
}

.erp3-chart-empty strong,
.erp3-data-empty strong{
    color:#46556b;
    font-size:12px;
    font-weight:850;
}

.erp3-chart-empty small,
.erp3-data-empty small{
    margin-top:5px;
    color:#9aa6b6;
    font-size:9px;
}

.erp3-order-total{
    width:116px;
    height:116px;
    margin:5px auto 18px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    border:14px solid #eaf3ff;
    border-top-color:#3b82f6;
    border-right-color:#60a5fa;
    border-radius:50%;
}

.erp3-order-total strong{
    color:#15223a;
    font-size:24px;
    font-weight:950;
}

.erp3-order-total span{
    margin-top:2px;
    color:#8e9bad;
    font-size:9px;
}

.erp3-status-list{
    display:grid;
    gap:8px;
}

.erp3-status-list a{
    display:grid;
    grid-template-columns:10px 1fr auto;
    align-items:center;
    gap:8px;
    color:#4a586c;
    font-size:10px;
}

.erp3-status-list strong{
    color:#18263d;
    font-size:11px;
}

.erp3-dot{
    width:8px;
    height:8px;
    border-radius:50%;
}

.erp3-dot.blue{background:#3b82f6}
.erp3-dot.amber{background:#f59e0b}
.erp3-dot.green{background:#22c55e}

.erp3-live-dot{
    width:9px;
    height:9px;
    margin-top:5px;
    border-radius:50%;
    background:#22c55e;
    box-shadow:0 0 0 4px #dcfce7;
}

.erp3-system-list{
    display:grid;
    gap:9px;
}

.erp3-system-list > div{
    display:grid;
    grid-template-columns:36px 1fr auto;
    align-items:center;
    gap:10px;
    min-height:52px;
}

.erp3-system-icon{
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    color:#64748b;
    background:#f5f7fa;
    border-radius:10px;
}

.erp3-system-icon .erp-icon{
    width:18px;
    height:18px;
}

.erp3-system-list span strong{
    display:block;
    color:#26354b;
    font-size:11px;
    font-weight:850;
}

.erp3-system-list span small{
    display:block;
    margin-top:3px;
    color:#9aa6b6;
    font-size:8px;
}

.erp3-system-list em{
    padding:5px 8px;
    color:#64748b;
    background:#f1f5f9;
    border-radius:8px;
    font-size:9px;
    font-style:normal;
    font-weight:850;
}

.erp3-system-list em.active{
    color:#15803d;
    background:#e8f8ed;
}

.erp3-data-empty{
    min-height:175px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    color:#8da0b7;
    text-align:center;
    border:1px dashed #e1e7ef;
    border-radius:13px;
    background:#fbfcfe;
}

.erp3-data-empty > span{
    width:42px;
    height:42px;
    display:grid;
    place-items:center;
    margin-bottom:10px;
    color:#6b8ebd;
    background:#edf4fc;
    border-radius:12px;
}

.erp3-data-empty .erp-icon{
    width:21px;
    height:21px;
}

.erp3-alerts{
    display:grid;
    gap:9px;
}

.erp3-alerts a{
    min-height:57px;
    display:grid;
    grid-template-columns:38px 1fr auto;
    align-items:center;
    gap:10px;
    padding:8px 9px;
    border:1px solid #edf1f5;
    border-radius:12px;
    color:inherit;
}

.erp3-alerts a:hover{
    background:#fafcff;
}

.erp3-alert-icon{
    width:36px;
    height:36px;
    display:grid;
    place-items:center;
    color:#f59e0b;
    background:#fff7e8;
    border-radius:10px;
}

.erp3-alert-icon .erp-icon{
    width:18px;
    height:18px;
}

.erp3-alerts strong{
    display:block;
    color:#344258;
    font-size:10px;
    font-weight:850;
}

.erp3-alerts small{
    display:block;
    margin-top:3px;
    color:#9ba7b6;
    font-size:8px;
}

.erp3-alerts b{
    min-width:27px;
    height:27px;
    display:grid;
    place-items:center;
    color:#b77900;
    background:#fff5dc;
    border-radius:8px;
    font-size:10px;
}

.erp3-quickbar{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:12px;
}

.erp3-quickbar a{
    min-height:78px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:12px;
    color:#35445b;
    background:#fff;
    border:1px solid #e7edf5;
    border-radius:16px;
    box-shadow:0 5px 18px rgba(31,49,79,.035);
    transition:.15s ease;
}

.erp3-quickbar a:hover{
    transform:translateY(-2px);
    border-color:#cddbea;
    box-shadow:0 9px 24px rgba(31,49,79,.07);
}

.erp3-quickbar span{
    width:38px;
    height:38px;
    display:grid;
    place-items:center;
    color:#2563eb;
    background:#edf5ff;
    border-radius:11px;
}

.erp3-quickbar .erp-icon{
    width:20px;
    height:20px;
}

.erp3-quickbar strong{
    font-size:10px;
    font-weight:850;
}

@media(max-width:1450px){
    .erp3-kpis{
        gap:11px;
    }

    .erp3-kpi{
        padding:15px;
        gap:11px;
    }

    .erp3-kpi-icon{
        width:46px;
        height:46px;
        flex-basis:46px;
    }

    .erp3-kpi-body > strong{
        font-size:20px;
    }
}

@media(max-width:1180px){
    .erp3-kpis{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .erp3-main-grid,
    .erp3-lower-grid{
        grid-template-columns:1fr 1fr;
    }

    .erp3-sales-chart{
        grid-column:1 / -1;
    }

    .erp3-quickbar{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
}

@media(max-width:760px){
    .erp3-kpis,
    .erp3-main-grid,
    .erp3-lower-grid{
        grid-template-columns:1fr;
    }

    .erp3-sales-chart{
        grid-column:auto;
    }

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

    .erp3-kpi{
        min-height:105px;
    }
}

@media(max-width:430px){
    .erp3-quickbar{
        grid-template-columns:1fr;
    }
}

/* =========================================================
   THSH ERP DASHBOARD LIVE DATA V1
   ========================================================= */

.erp3-live-chart{
    height:220px;
    padding:18px 12px 4px;
    border:1px solid #edf2f7;
    border-radius:14px;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 43px,
            rgba(226,232,240,.55) 44px
        );
}

.erp3-bars{
    height:100%;
    display:flex;
    align-items:flex-end;
    gap:4px;
    direction:ltr;
}

.erp3-bar-slot{
    height:100%;
    flex:1 1 0;
    min-width:0;
    display:flex;
    flex-direction:column;
    justify-content:flex-end;
    align-items:center;
    gap:5px;
}

.erp3-bar{
    width:70%;
    min-height:2px;
    max-width:18px;
    border-radius:5px 5px 2px 2px;
    background:linear-gradient(180deg,#3b82f6,#60a5fa);
    transition:.2s ease;
}

.erp3-bar-slot:hover .erp3-bar{
    opacity:.75;
}

.erp3-bar-slot small{
    min-height:13px;
    color:#94a3b8;
    font-size:7px;
    white-space:nowrap;
}

.erp3-recent-orders{
    display:grid;
}

.erp3-recent-orders > a{
    min-height:45px;
    display:grid;
    grid-template-columns:58px 1fr auto;
    align-items:center;
    gap:10px;
    padding:7px 4px;
    border-bottom:1px solid #edf1f5;
    color:inherit;
}

.erp3-recent-orders > a:last-child{
    border-bottom:0;
}

.erp3-order-number{
    direction:ltr;
    color:#64748b;
    font-size:9px;
    font-weight:850;
}

.erp3-order-customer strong{
    display:block;
    color:#26354b;
    font-size:10px;
    font-weight:850;
}

.erp3-order-customer small{
    display:block;
    margin-top:2px;
    color:#9aa6b6;
    font-size:8px;
}

.erp3-order-amount{
    direction:ltr;
    color:#1e293b;
    font-size:10px;
    font-weight:900;
    white-space:nowrap;
}

.erp3-order-amount small{
    color:#94a3b8;
    font-size:7px;
}

.erp3-top-products{
    display:grid;
    gap:13px;
}

.erp3-product-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) 100px 48px;
    align-items:center;
    gap:10px;
}

.erp3-product-info{
    min-width:0;
}

.erp3-product-info strong{
    display:block;
    overflow:hidden;
    color:#26354b;
    font-size:10px;
    font-weight:850;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.erp3-product-info small{
    display:block;
    margin-top:3px;
    overflow:hidden;
    color:#9aa6b6;
    font-size:8px;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.erp3-product-meter{
    height:6px;
    overflow:hidden;
    direction:rtl;
    background:#e8eef6;
    border-radius:999px;
}

.erp3-product-meter span{
    display:block;
    height:100%;
    background:#3b82f6;
    border-radius:999px;
}

.erp3-product-row b{
    color:#64748b;
    font-size:9px;
    font-weight:850;
    white-space:nowrap;
}

/* =========================================================
   THSH ERP TOPBAR V1
   Independent from legacy .topbar rules
   ========================================================= */

.erp-topbar{
    position:sticky;
    top:0;
    z-index:90;
    min-height:76px;
    display:grid;
    grid-template-columns:minmax(230px,.85fr) minmax(320px,1.2fr) auto;
    align-items:center;
    gap:22px;
    padding:11px 26px;
    background:rgba(255,255,255,.96);
    border-bottom:1px solid #e7edf4;
    box-shadow:0 5px 22px rgba(15,23,42,.035);
    backdrop-filter:blur(14px);
}

.erp-topbar-page{
    min-width:0;
    display:flex;
    align-items:center;
    gap:12px;
}

.erp-topbar-page-icon{
    width:40px;
    height:40px;
    flex:0 0 40px;
    display:grid;
    place-items:center;
    color:#2563eb;
    background:#eff6ff;
    border:1px solid #dbeafe;
    border-radius:12px;
}

.erp-topbar-page-icon svg{
    width:19px;
    height:19px;
}

.erp-topbar-page-copy{
    min-width:0;
}

.erp-topbar-page-copy h1{
    margin:0;
    overflow:hidden;
    color:#172033;
    font-size:16px;
    line-height:1.45;
    font-weight:900;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.erp-topbar-page-copy p{
    margin:2px 0 0;
    overflow:hidden;
    color:#8a97a9;
    font-size:9px;
    line-height:1.5;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.erp-topbar-search{
    width:100%;
    max-width:560px;
    justify-self:center;
    height:42px;
    display:flex;
    align-items:center;
    gap:9px;
    padding:0 13px;
    direction:rtl;
    background:#f7f9fc;
    border:1px solid #e5eaf1;
    border-radius:12px;
    transition:border-color .18s ease,box-shadow .18s ease,background .18s ease;
}

.erp-topbar-search:focus-within{
    background:#fff;
    border-color:#b8d2ff;
    box-shadow:0 0 0 3px rgba(59,130,246,.09);
}

.erp-topbar-search-icon{
    display:grid;
    place-items:center;
    color:#94a3b8;
}

.erp-topbar-search-icon svg{
    width:17px;
    height:17px;
}

.erp-topbar-search input{
    min-width:0;
    flex:1;
    height:100%;
    padding:0;
    outline:0;
    border:0;
    background:transparent;
    color:#26354b;
    font:inherit;
    font-size:10px;
}

.erp-topbar-search input::placeholder{
    color:#9ca8b8;
}

.erp-topbar-search kbd{
    direction:ltr;
    padding:3px 6px;
    color:#8b98a9;
    background:#fff;
    border:1px solid #dde4ed;
    border-bottom-width:2px;
    border-radius:6px;
    font-family:inherit;
    font-size:7px;
    white-space:nowrap;
}

.erp-topbar-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:9px;
    direction:rtl;
}

.erp-topbar-date{
    min-width:112px;
    display:flex;
    align-items:center;
    gap:8px;
    padding:5px 8px;
}

.erp-topbar-action-icon{
    width:30px;
    height:30px;
    display:grid;
    place-items:center;
    color:#64748b;
    background:#f6f8fb;
    border-radius:9px;
}

.erp-topbar-action-icon svg{
    width:15px;
    height:15px;
}

.erp-topbar-date strong,
.erp-topbar-date small{
    display:block;
    white-space:nowrap;
}

.erp-topbar-date strong{
    color:#46556b;
    font-size:8px;
    font-weight:850;
}

.erp-topbar-date small{
    margin-top:1px;
    direction:ltr;
    color:#9aa6b6;
    font-size:7px;
}

.erp-topbar-icon-button{
    position:relative;
    width:38px;
    height:38px;
    display:grid;
    place-items:center;
    padding:0;
    cursor:pointer;
    color:#64748b;
    background:#fff;
    border:1px solid #e4eaf1;
    border-radius:11px;
    transition:.18s ease;
}

.erp-topbar-icon-button:hover{
    color:#2563eb;
    background:#f8fbff;
    border-color:#cfe0ff;
}

.erp-topbar-icon-button svg{
    width:17px;
    height:17px;
}

.erp-topbar-notification-dot{
    position:absolute;
    top:7px;
    right:7px;
    width:6px;
    height:6px;
    background:#ef4444;
    border:2px solid #fff;
    border-radius:50%;
}

.erp-topbar-user{
    min-width:150px;
    display:grid;
    grid-template-columns:34px minmax(70px,1fr) 28px;
    align-items:center;
    gap:8px;
    padding:5px 7px;
    background:#fff;
    border:1px solid #e4eaf1;
    border-radius:12px;
}

.erp-topbar-avatar{
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    color:#fff;
    background:linear-gradient(135deg,#2563eb,#60a5fa);
    border-radius:10px;
    font-size:12px;
    font-weight:900;
}

.erp-topbar-user-copy{
    min-width:0;
}

.erp-topbar-user-copy strong,
.erp-topbar-user-copy small{
    display:block;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.erp-topbar-user-copy strong{
    color:#26354b;
    font-size:9px;
    font-weight:900;
}

.erp-topbar-user-copy small{
    margin-top:2px;
    color:#94a3b8;
    font-size:7px;
}

.erp-topbar-logout{
    width:28px;
    height:28px;
    display:grid;
    place-items:center;
    color:#94a3b8;
    border-radius:8px;
}

.erp-topbar-logout:hover{
    color:#dc2626;
    background:#fef2f2;
}

.erp-topbar-logout svg{
    width:14px;
    height:14px;
}

@media(max-width:1180px){
    .erp-topbar{
        grid-template-columns:minmax(200px,.8fr) minmax(220px,1fr) auto;
        gap:12px;
        padding-inline:18px;
    }

    .erp-topbar-date{
        display:none;
    }

    .erp-topbar-user{
        min-width:130px;
    }
}

@media(max-width:850px){
    .erp-topbar{
        position:relative;
        min-height:auto;
        grid-template-columns:1fr auto;
        gap:10px;
        padding:11px 14px;
    }

    .erp-topbar-search{
        grid-column:1 / -1;
        grid-row:2;
        max-width:none;
        height:40px;
    }

    .erp-topbar-page-copy p{
        display:none;
    }

    .erp-topbar-user-copy{
        display:none;
    }

    .erp-topbar-user{
        min-width:0;
        grid-template-columns:34px 28px;
    }
}

@media(max-width:520px){
    .erp-topbar{
        padding:9px 11px;
    }

    .erp-topbar-page-icon{
        width:36px;
        height:36px;
        flex-basis:36px;
    }

    .erp-topbar-page-copy h1{
        font-size:14px;
    }

    .erp-topbar-search kbd{
        display:none;
    }

    .erp-topbar-icon-button{
        width:36px;
        height:36px;
    }
}

/* =========================================================
   THSH ERP DESKTOP SCALE V1
   Larger readable desktop workspace
   ========================================================= */

@media (min-width:1200px){

    /* ---------- TOPBAR ---------- */

    .erp-topbar{
        min-height:88px;
        grid-template-columns:minmax(260px,.9fr) minmax(360px,1.15fr) auto;
        gap:24px;
        padding:14px 30px;
    }

    .erp-topbar-page{
        gap:14px;
    }

    .erp-topbar-page-icon{
        width:46px;
        height:46px;
        flex-basis:46px;
        border-radius:13px;
    }

    .erp-topbar-page-icon svg{
        width:22px;
        height:22px;
    }

    .erp-topbar-page-copy h1{
        font-size:19px;
    }

    .erp-topbar-page-copy p{
        margin-top:3px;
        font-size:11px;
    }

    .erp-topbar-search{
        max-width:600px;
        height:48px;
        padding-inline:15px;
        border-radius:13px;
    }

    .erp-topbar-search input{
        font-size:12px;
    }

    .erp-topbar-search-icon svg{
        width:19px;
        height:19px;
    }

    .erp-topbar-search kbd{
        padding:4px 7px;
        font-size:8px;
    }

    .erp-topbar-date{
        min-width:128px;
        gap:10px;
    }

    .erp-topbar-date strong{
        font-size:10px;
    }

    .erp-topbar-date small{
        font-size:9px;
    }

    .erp-topbar-action-icon{
        width:36px;
        height:36px;
    }

    .erp-topbar-action-icon svg{
        width:17px;
        height:17px;
    }

    .erp-topbar-icon-button{
        width:44px;
        height:44px;
        border-radius:12px;
    }

    .erp-topbar-icon-button svg{
        width:19px;
        height:19px;
    }

    .erp-topbar-user{
        min-width:175px;
        grid-template-columns:40px minmax(82px,1fr) 30px;
        gap:9px;
        padding:6px 8px;
    }

    .erp-topbar-avatar{
        width:40px;
        height:40px;
        font-size:14px;
    }

    .erp-topbar-user-copy strong{
        font-size:11px;
    }

    .erp-topbar-user-copy small{
        font-size:9px;
    }


    /* ---------- SIDEBAR ---------- */

    .sidebar{
        width:285px;
    }

    .main-content{
        margin-right:285px;
        width:calc(100% - 285px);
    }

    .sidebar .brand,
    .sidebar-brand{
        font-size:18px;
    }

    .nav-title{
        margin-top:17px;
        margin-bottom:7px;
        font-size:10px;
    }

    .nav-item{
        min-height:45px;
        padding:10px 14px;
        font-size:12px;
        border-radius:11px;
    }

    .nav-icon{
        width:25px;
        min-width:25px;
    }

    .nav-icon svg{
        width:18px;
        height:18px;
    }


    /* ---------- PAGE ---------- */

    .page-content{
        padding:24px 26px 38px;
    }


    /* ---------- KPI CARDS ---------- */

    .erp3-kpis{
        gap:16px;
    }

    .erp3-kpi{
        min-height:128px;
        padding:20px 18px;
        border-radius:17px;
    }

    .erp3-kpi-icon{
        width:52px;
        height:52px;
        flex:0 0 52px;
        border-radius:14px;
    }

    .erp3-kpi-icon svg{
        width:25px;
        height:25px;
    }

    .erp3-kpi-value{
        font-size:23px;
        line-height:1.2;
    }

    .erp3-kpi-label{
        margin-top:6px;
        font-size:12px;
        line-height:1.55;
    }

    .erp3-kpi-meta{
        margin-top:4px;
        font-size:9px;
    }


    /* ---------- DASHBOARD PANELS ---------- */

    .erp3-main-grid,
    .erp3-lower-grid{
        gap:16px;
        margin-top:16px;
    }

    .erp3-panel{
        padding:20px;
        border-radius:17px;
    }

    .erp3-panel-head{
        margin-bottom:16px;
    }

    .erp3-panel-head h2{
        font-size:16px;
        line-height:1.45;
    }

    .erp3-panel-head p,
    .erp3-panel-head small{
        margin-top:4px;
        font-size:10px;
    }


    /* ---------- EMPTY STATES ---------- */

    .erp3-chart-empty,
    .erp3-data-empty{
        min-height:205px;
    }

    .erp3-chart-empty strong,
    .erp3-data-empty strong{
        font-size:12px;
    }

    .erp3-chart-empty small,
    .erp3-data-empty small{
        margin-top:5px;
        font-size:9px;
    }

    .erp3-empty-icon,
    .erp3-data-empty > span{
        width:48px;
        height:48px;
        margin-bottom:10px;
    }

    .erp3-empty-icon svg,
    .erp3-data-empty > span svg{
        width:22px;
        height:22px;
    }


    /* ---------- ORDER STATUS ---------- */

    .erp3-donut{
        width:118px;
        height:118px;
    }

    .erp3-donut::after{
        width:82px;
        height:82px;
    }

    .erp3-donut-center strong{
        font-size:22px;
    }

    .erp3-donut-center small{
        font-size:9px;
    }

    .erp3-status-row{
        min-height:30px;
        font-size:10px;
    }

    .erp3-status-row b{
        font-size:11px;
    }


    /* ---------- SYSTEM STATUS ---------- */

    .erp3-system-row{
        min-height:49px;
        gap:11px;
    }

    .erp3-system-icon{
        width:36px;
        height:36px;
        flex:0 0 36px;
        border-radius:10px;
    }

    .erp3-system-icon svg{
        width:17px;
        height:17px;
    }

    .erp3-system-copy strong{
        font-size:11px;
    }

    .erp3-system-copy small{
        margin-top:3px;
        font-size:9px;
    }

    .erp3-system-state{
        padding:4px 8px;
        font-size:8px;
    }


    /* ---------- NEEDS ACTION ---------- */

    .erp3-action-row{
        min-height:49px;
        padding:8px 10px;
    }

    .erp3-action-row strong{
        font-size:10px;
    }

    .erp3-action-row small{
        font-size:8px;
    }

    .erp3-action-count{
        min-width:28px;
        height:28px;
        font-size:10px;
    }


    /* ---------- LIVE DATA ---------- */

    .erp3-live-chart{
        height:245px;
    }

    .erp3-recent-orders > a{
        min-height:54px;
        grid-template-columns:68px 1fr auto;
        gap:12px;
    }

    .erp3-order-number{
        font-size:10px;
    }

    .erp3-order-customer strong{
        font-size:11px;
    }

    .erp3-order-customer small{
        font-size:9px;
    }

    .erp3-order-amount{
        font-size:11px;
    }

    .erp3-product-row{
        grid-template-columns:minmax(0,1fr) 115px 55px;
        gap:12px;
    }

    .erp3-product-info strong{
        font-size:11px;
    }

    .erp3-product-info small{
        font-size:9px;
    }

    .erp3-product-row b{
        font-size:10px;
    }


    /* ---------- QUICK ACTIONS ---------- */

    .erp3-quickbar{
        gap:12px;
        margin-top:16px;
    }

    .erp3-quickbar a{
        min-height:66px;
        padding:12px;
        font-size:11px;
        border-radius:14px;
    }

    .erp3-quickbar svg{
        width:20px;
        height:20px;
    }
}

/* =========================================================
   THSH ERP DESKTOP SCALE V1
   Larger readable desktop workspace
   ========================================================= */

@media (min-width:1200px){

    /* ---------- TOPBAR ---------- */

    .erp-topbar{
        min-height:88px;
        grid-template-columns:minmax(260px,.9fr) minmax(360px,1.15fr) auto;
        gap:24px;
        padding:14px 30px;
    }

    .erp-topbar-page{
        gap:14px;
    }

    .erp-topbar-page-icon{
        width:46px;
        height:46px;
        flex-basis:46px;
        border-radius:13px;
    }

    .erp-topbar-page-icon svg{
        width:22px;
        height:22px;
    }

    .erp-topbar-page-copy h1{
        font-size:19px;
    }

    .erp-topbar-page-copy p{
        margin-top:3px;
        font-size:11px;
    }

    .erp-topbar-search{
        max-width:600px;
        height:48px;
        padding-inline:15px;
        border-radius:13px;
    }

    .erp-topbar-search input{
        font-size:12px;
    }

    .erp-topbar-search-icon svg{
        width:19px;
        height:19px;
    }

    .erp-topbar-search kbd{
        padding:4px 7px;
        font-size:8px;
    }

    .erp-topbar-date{
        min-width:128px;
        gap:10px;
    }

    .erp-topbar-date strong{
        font-size:10px;
    }

    .erp-topbar-date small{
        font-size:9px;
    }

    .erp-topbar-action-icon{
        width:36px;
        height:36px;
    }

    .erp-topbar-action-icon svg{
        width:17px;
        height:17px;
    }

    .erp-topbar-icon-button{
        width:44px;
        height:44px;
        border-radius:12px;
    }

    .erp-topbar-icon-button svg{
        width:19px;
        height:19px;
    }

    .erp-topbar-user{
        min-width:175px;
        grid-template-columns:40px minmax(82px,1fr) 30px;
        gap:9px;
        padding:6px 8px;
    }

    .erp-topbar-avatar{
        width:40px;
        height:40px;
        font-size:14px;
    }

    .erp-topbar-user-copy strong{
        font-size:11px;
    }

    .erp-topbar-user-copy small{
        font-size:9px;
    }


    /* ---------- SIDEBAR ---------- */

    .sidebar{
        width:285px;
    }

    .main-content{
        margin-right:285px;
        width:calc(100% - 285px);
    }

    .sidebar .brand,
    .sidebar-brand{
        font-size:18px;
    }

    .nav-title{
        margin-top:17px;
        margin-bottom:7px;
        font-size:10px;
    }

    .nav-item{
        min-height:45px;
        padding:10px 14px;
        font-size:12px;
        border-radius:11px;
    }

    .nav-icon{
        width:25px;
        min-width:25px;
    }

    .nav-icon svg{
        width:18px;
        height:18px;
    }


    /* ---------- PAGE ---------- */

    .page-content{
        padding:24px 26px 38px;
    }


    /* ---------- KPI CARDS ---------- */

    .erp3-kpis{
        gap:16px;
    }

    .erp3-kpi{
        min-height:128px;
        padding:20px 18px;
        border-radius:17px;
    }

    .erp3-kpi-icon{
        width:52px;
        height:52px;
        flex:0 0 52px;
        border-radius:14px;
    }

    .erp3-kpi-icon svg{
        width:25px;
        height:25px;
    }

    .erp3-kpi-value{
        font-size:23px;
        line-height:1.2;
    }

    .erp3-kpi-label{
        margin-top:6px;
        font-size:12px;
        line-height:1.55;
    }

    .erp3-kpi-meta{
        margin-top:4px;
        font-size:9px;
    }


    /* ---------- DASHBOARD PANELS ---------- */

    .erp3-main-grid,
    .erp3-lower-grid{
        gap:16px;
        margin-top:16px;
    }

    .erp3-panel{
        padding:20px;
        border-radius:17px;
    }

    .erp3-panel-head{
        margin-bottom:16px;
    }

    .erp3-panel-head h2{
        font-size:16px;
        line-height:1.45;
    }

    .erp3-panel-head p,
    .erp3-panel-head small{
        margin-top:4px;
        font-size:10px;
    }


    /* ---------- EMPTY STATES ---------- */

    .erp3-chart-empty,
    .erp3-data-empty{
        min-height:205px;
    }

    .erp3-chart-empty strong,
    .erp3-data-empty strong{
        font-size:12px;
    }

    .erp3-chart-empty small,
    .erp3-data-empty small{
        margin-top:5px;
        font-size:9px;
    }

    .erp3-empty-icon,
    .erp3-data-empty > span{
        width:48px;
        height:48px;
        margin-bottom:10px;
    }

    .erp3-empty-icon svg,
    .erp3-data-empty > span svg{
        width:22px;
        height:22px;
    }


    /* ---------- ORDER STATUS ---------- */

    .erp3-donut{
        width:118px;
        height:118px;
    }

    .erp3-donut::after{
        width:82px;
        height:82px;
    }

    .erp3-donut-center strong{
        font-size:22px;
    }

    .erp3-donut-center small{
        font-size:9px;
    }

    .erp3-status-row{
        min-height:30px;
        font-size:10px;
    }

    .erp3-status-row b{
        font-size:11px;
    }


    /* ---------- SYSTEM STATUS ---------- */

    .erp3-system-row{
        min-height:49px;
        gap:11px;
    }

    .erp3-system-icon{
        width:36px;
        height:36px;
        flex:0 0 36px;
        border-radius:10px;
    }

    .erp3-system-icon svg{
        width:17px;
        height:17px;
    }

    .erp3-system-copy strong{
        font-size:11px;
    }

    .erp3-system-copy small{
        margin-top:3px;
        font-size:9px;
    }

    .erp3-system-state{
        padding:4px 8px;
        font-size:8px;
    }


    /* ---------- NEEDS ACTION ---------- */

    .erp3-action-row{
        min-height:49px;
        padding:8px 10px;
    }

    .erp3-action-row strong{
        font-size:10px;
    }

    .erp3-action-row small{
        font-size:8px;
    }

    .erp3-action-count{
        min-width:28px;
        height:28px;
        font-size:10px;
    }


    /* ---------- LIVE DATA ---------- */

    .erp3-live-chart{
        height:245px;
    }

    .erp3-recent-orders > a{
        min-height:54px;
        grid-template-columns:68px 1fr auto;
        gap:12px;
    }

    .erp3-order-number{
        font-size:10px;
    }

    .erp3-order-customer strong{
        font-size:11px;
    }

    .erp3-order-customer small{
        font-size:9px;
    }

    .erp3-order-amount{
        font-size:11px;
    }

    .erp3-product-row{
        grid-template-columns:minmax(0,1fr) 115px 55px;
        gap:12px;
    }

    .erp3-product-info strong{
        font-size:11px;
    }

    .erp3-product-info small{
        font-size:9px;
    }

    .erp3-product-row b{
        font-size:10px;
    }


    /* ---------- QUICK ACTIONS ---------- */

    .erp3-quickbar{
        gap:12px;
        margin-top:16px;
    }

    .erp3-quickbar a{
        min-height:66px;
        padding:12px;
        font-size:11px;
        border-radius:14px;
    }

    .erp3-quickbar svg{
        width:20px;
        height:20px;
    }
}

/* =========================================================
   THSH ERP TYPOGRAPHY V2
   Desktop readability without enlarging dashboard geometry
   ========================================================= */

@media (min-width:1200px){

    /* TOPBAR */
    .erp-topbar-page-copy h1{
        font-size:21px;
        font-weight:900;
    }

    .erp-topbar-page-copy p{
        font-size:12px;
    }

    .erp-topbar-search input{
        font-size:13px;
    }

    .erp-topbar-date strong{
        font-size:11px;
    }

    .erp-topbar-date small{
        font-size:10px;
    }

    .erp-topbar-user-copy strong{
        font-size:12px;
    }

    .erp-topbar-user-copy small{
        font-size:10px;
    }


    /* SIDEBAR */
    .nav-title{
        font-size:11px;
        font-weight:700;
    }

    .nav-item{
        font-size:14px;
        font-weight:750;
    }

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


    /* KPI */
    .erp3-kpi-value{
        font-size:26px;
        font-weight:950;
    }

    .erp3-kpi-label{
        font-size:14px;
        font-weight:850;
    }

    .erp3-kpi-meta{
        font-size:11px;
        line-height:1.6;
    }


    /* PANEL HEADERS */
    .erp3-panel-head h2{
        font-size:18px;
        font-weight:900;
    }

    .erp3-panel-head p,
    .erp3-panel-head small{
        font-size:11px;
        line-height:1.7;
    }


    /* EMPTY STATES */
    .erp3-chart-empty strong,
    .erp3-data-empty strong{
        font-size:14px;
        font-weight:850;
    }

    .erp3-chart-empty small,
    .erp3-data-empty small{
        font-size:11px;
        line-height:1.7;
    }


    /* ORDER STATUS */
    .erp3-donut-center strong{
        font-size:25px;
    }

    .erp3-donut-center small{
        font-size:10px;
    }

    .erp3-status-row{
        font-size:12px;
    }

    .erp3-status-row b{
        font-size:13px;
    }


    /* SYSTEM STATUS */
    .erp3-system-copy strong{
        font-size:13px;
        font-weight:850;
    }

    .erp3-system-copy small{
        font-size:10px;
        line-height:1.55;
    }

    .erp3-system-state{
        font-size:10px;
        font-weight:800;
    }


    /* NEEDS ACTION */
    .erp3-action-row strong{
        font-size:12px;
        font-weight:850;
    }

    .erp3-action-row small{
        font-size:10px;
        line-height:1.55;
    }

    .erp3-action-count{
        font-size:12px;
        font-weight:900;
    }


    /* RECENT ORDERS */
    .erp3-order-number{
        font-size:12px;
    }

    .erp3-order-customer strong{
        font-size:13px;
    }

    .erp3-order-customer small{
        font-size:10px;
    }

    .erp3-order-amount{
        font-size:13px;
    }

    .erp3-order-amount small{
        font-size:9px;
    }


    /* TOP PRODUCTS */
    .erp3-product-info strong{
        font-size:13px;
    }

    .erp3-product-info small{
        font-size:10px;
    }

    .erp3-product-row b{
        font-size:12px;
    }


    /* QUICK ACTIONS */
    .erp3-quickbar a{
        font-size:13px;
        font-weight:800;
    }
}

/* =========================================================
   THSH ERP TOPBAR CLEANUP V2
   Search removed - prominent Persian date/time
   ========================================================= */

@media (min-width:1200px){

    .erp-topbar{
        grid-template-columns:minmax(260px,1fr) minmax(300px,.9fr) minmax(250px,1fr);
    }

    .erp-topbar-clock{
        justify-self:center;
        min-width:260px;
        height:58px;
        display:flex;
        align-items:center;
        justify-content:center;
        gap:14px;
        padding:7px 18px;
        background:linear-gradient(180deg,#ffffff,#f8fbff);
        border:1px solid #dfe8f3;
        border-radius:15px;
        box-shadow:0 4px 15px rgba(15,23,42,.045);
    }

    .erp-topbar-clock-icon{
        width:40px;
        height:40px;
        flex:0 0 40px;
        display:grid;
        place-items:center;
        color:#2563eb;
        background:#eaf3ff;
        border-radius:11px;
    }

    .erp-topbar-clock-icon svg{
        width:19px;
        height:19px;
    }

    .erp-topbar-clock-copy{
        display:flex;
        align-items:center;
        gap:12px;
        white-space:nowrap;
    }

    .erp-topbar-clock-copy strong{
        color:#334155;
        font-size:13px;
        font-weight:900;
    }

    .erp-topbar-clock-copy span{
        min-width:52px;
        direction:ltr;
        color:#2563eb;
        font-size:18px;
        line-height:1;
        font-weight:950;
        font-variant-numeric:tabular-nums;
    }

    .erp-topbar-actions{
        justify-self:end;
    }
}

@media(max-width:1199px){

    .erp-topbar-clock{
        display:flex;
        align-items:center;
        justify-content:center;
        gap:8px;
        min-width:150px;
        padding:6px 10px;
        background:#f8fbff;
        border:1px solid #e3ebf5;
        border-radius:11px;
    }

    .erp-topbar-clock-icon{
        width:30px;
        height:30px;
        display:grid;
        place-items:center;
        color:#2563eb;
        background:#eaf3ff;
        border-radius:8px;
    }

    .erp-topbar-clock-icon svg{
        width:15px;
        height:15px;
    }

    .erp-topbar-clock-copy strong{
        display:block;
        color:#475569;
        font-size:9px;
    }

    .erp-topbar-clock-copy span{
        display:block;
        margin-top:1px;
        direction:ltr;
        color:#2563eb;
        font-size:11px;
        font-weight:900;
    }
}

@media(max-width:850px){
    .erp-topbar-clock{
        justify-self:center;
        min-width:0;
    }

    .erp-topbar-clock-copy strong{
        display:none;
    }
}


/* ============================================================
   THSH ERP - ORDERS V2
   ============================================================ */

.erp-orders-v2{
    display:flex;
    flex-direction:column;
    gap:16px;
}

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

.ov2-stat{
    min-height:108px;
    background:#fff;
    border:1px solid #e5ebf3;
    border-radius:16px;
    padding:18px 20px;
    display:flex;
    align-items:center;
    gap:15px;
    box-shadow:0 5px 18px rgba(30,64,110,.035);
}

.ov2-stat-icon{
    width:48px;
    height:48px;
    flex:0 0 48px;
    border-radius:13px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.ov2-stat-icon svg{
    width:23px;
    height:23px;
}

.ov2-blue{
    color:#2878f0;
    background:#edf5ff;
}

.ov2-orange{
    color:#f59e0b;
    background:#fff6e5;
}

.ov2-purple{
    color:#8b5cf6;
    background:#f4efff;
}

.ov2-green{
    color:#16a563;
    background:#eaf9f1;
}

.ov2-stat-copy{
    min-width:0;
    display:flex;
    flex-direction:column;
}

.ov2-stat-copy span{
    font-size:13px;
    color:#77869a;
    font-weight:600;
}

.ov2-stat-copy strong{
    margin-top:2px;
    color:#13223a;
    font-size:24px;
    line-height:1.25;
    font-weight:800;
}

.ov2-stat-copy small{
    margin-top:2px;
    color:#a0aaba;
    font-size:11px;
}

.ov2-filter-panel,
.ov2-list-panel{
    background:#fff;
    border:1px solid #e5ebf3;
    border-radius:17px;
    box-shadow:0 5px 20px rgba(30,64,110,.035);
}

.ov2-filter-panel{
    padding:16px;
}

.ov2-filters{
    display:grid;
    grid-template-columns:minmax(280px,1fr) 210px 210px auto auto;
    gap:10px;
    align-items:center;
}

.ov2-search{
    position:relative;
    min-width:0;
}

.ov2-search svg{
    position:absolute;
    right:15px;
    top:50%;
    transform:translateY(-50%);
    width:19px;
    height:19px;
    color:#91a0b5;
    pointer-events:none;
}

.ov2-search input,
.ov2-filters select{
    width:100%;
    height:46px;
    box-sizing:border-box;
    border:1px solid #dfe7f1;
    border-radius:11px;
    background:#fff;
    color:#24354d;
    font-family:inherit;
    font-size:13px;
    outline:none;
    transition:border-color .16s ease,box-shadow .16s ease;
}

.ov2-search input{
    padding:0 44px 0 14px;
}

.ov2-filters select{
    padding:0 13px;
}

.ov2-search input:focus,
.ov2-filters select:focus{
    border-color:#a9c8fa;
    box-shadow:0 0 0 3px rgba(47,120,237,.08);
}

.ov2-search-button,
.ov2-clear-button{
    height:46px;
    border-radius:11px;
    padding:0 22px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-family:inherit;
    font-size:13px;
    font-weight:700;
    text-decoration:none;
    white-space:nowrap;
}

.ov2-search-button{
    border:0;
    color:#fff;
    background:#276fee;
    cursor:pointer;
}

.ov2-search-button:hover{
    background:#1f61d8;
}

.ov2-clear-button{
    border:1px solid #dfe7f1;
    color:#66768d;
    background:#fff;
}

.ov2-list-panel{
    overflow:hidden;
}

.ov2-list-header{
    min-height:76px;
    padding:0 20px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-bottom:1px solid #edf1f6;
}

.ov2-list-header h2{
    margin:0;
    color:#17253a;
    font-size:17px;
    font-weight:800;
}

.ov2-list-header p{
    margin:5px 0 0;
    color:#98a4b5;
    font-size:11px;
}

.ov2-list-count{
    min-width:62px;
    height:38px;
    padding:0 12px;
    border-radius:10px;
    background:#f2f6fc;
    color:#253a57;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    font-weight:800;
    font-size:14px;
}

.ov2-list-count span{
    color:#8996a8;
    font-size:10px;
    font-weight:600;
}

.ov2-table-head{
    display:grid;
    grid-template-columns:150px minmax(220px,1.3fr) 150px 220px 180px 32px;
    gap:12px;
    padding:11px 18px;
    background:#f8fafc;
    border-bottom:1px solid #edf1f6;
    color:#8c99aa;
    font-size:11px;
    font-weight:700;
}

.ov2-orders-list{
    display:flex;
    flex-direction:column;
}

.ov2-order-row{
    display:grid;
    grid-template-columns:150px minmax(220px,1.3fr) 150px 220px 180px 32px;
    gap:12px;
    align-items:center;
    min-height:92px;
    padding:13px 18px;
    border-bottom:1px solid #edf1f6;
    color:inherit;
    text-decoration:none;
    transition:background .16s ease,box-shadow .16s ease;
}

.ov2-order-row:last-child{
    border-bottom:0;
}

.ov2-order-row:hover{
    background:#f9fbfe;
    box-shadow:inset -3px 0 #2f78ed;
}

.ov2-order-id{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:4px;
}

.ov2-order-id strong{
    color:#1d4f91;
    font-size:15px;
    direction:ltr;
}

.ov2-order-id span{
    color:#909daf;
    font-size:10px;
}

.ov2-source{
    padding:3px 8px;
    border-radius:999px;
    font-size:9px;
    font-style:normal;
    font-weight:700;
}

.source-bale{
    background:#edf6ff;
    color:#2873ca;
}

.source-web{
    background:#f3efff;
    color:#7751cf;
}

.source-erp{
    background:#eaf8f1;
    color:#168357;
}

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

.ov2-avatar{
    width:39px;
    height:39px;
    flex:0 0 39px;
    border-radius:11px;
    background:#edf4ff;
    color:#3277dc;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
    font-size:15px;
}

.ov2-customer > div:last-child{
    min-width:0;
    display:flex;
    flex-direction:column;
}

.ov2-customer strong{
    color:#1d2b3f;
    font-size:13px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.ov2-customer span{
    margin-top:2px;
    color:#748398;
    font-size:11px;
    direction:ltr;
    text-align:right;
}

.ov2-customer small{
    margin-top:2px;
    color:#a0aaba;
    font-size:9px;
}

.ov2-delivery{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.ov2-delivery strong{
    color:#293b54;
    font-size:13px;
}

.ov2-delivery span,
.ov2-delivery small{
    color:#8996a8;
    font-size:10px;
}

.ov2-workflow{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:7px;
}

.ov2-main-status{
    display:inline-flex;
    align-items:center;
    min-height:26px;
    padding:0 9px;
    border-radius:8px;
    background:#edf4ff;
    color:#2769c7;
    font-size:10px;
    font-weight:800;
}

.ov2-mini-statuses{
    display:flex;
    flex-wrap:wrap;
    gap:4px;
}

.ov2-mini-statuses span{
    min-width:37px;
    padding:3px 7px;
    border-radius:6px;
    text-align:center;
    font-size:8px;
    font-weight:800;
}

.ov2-mini-statuses .ok{
    color:#148556;
    background:#e9f8f0;
}

.ov2-mini-statuses .wait{
    color:#a86b00;
    background:#fff5df;
}

.ov2-mini-statuses .bad{
    color:#c94545;
    background:#fff0f0;
}

.ov2-amount{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
}

.ov2-amount strong{
    color:#14243a;
    font-size:14px;
    direction:ltr;
}

.ov2-amount span{
    color:#8996a8;
    font-size:9px;
}

.ov2-amount small{
    margin-top:3px;
    color:#d15c5c;
    font-size:9px;
}

.ov2-arrow{
    width:30px;
    height:30px;
    border-radius:8px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#9aa8ba;
}

.ov2-arrow svg{
    width:17px;
    height:17px;
}

.ov2-order-row:hover .ov2-arrow{
    background:#edf4ff;
    color:#2f78ed;
}

.ov2-empty{
    min-height:330px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:30px;
}

.ov2-empty-icon{
    width:58px;
    height:58px;
    border-radius:15px;
    background:#eff5fd;
    color:#6094da;
    display:flex;
    align-items:center;
    justify-content:center;
}

.ov2-empty-icon svg{
    width:27px;
    height:27px;
}

.ov2-empty h3{
    margin:14px 0 5px;
    color:#26374e;
    font-size:15px;
}

.ov2-empty p{
    margin:0;
    color:#98a4b5;
    font-size:11px;
}

.ov2-empty a{
    margin-top:15px;
    min-height:38px;
    padding:0 16px;
    border-radius:9px;
    background:#edf4ff;
    color:#276fe5;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    font-size:11px;
    font-weight:700;
}

@media (max-width:1200px){

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

    .ov2-filters{
        grid-template-columns:1fr 1fr;
    }

    .ov2-search{
        grid-column:1 / -1;
    }

    .ov2-table-head{
        display:none;
    }

    .ov2-order-row{
        grid-template-columns:130px minmax(180px,1fr) 130px 190px 150px 30px;
        overflow-x:auto;
    }
}

@media (max-width:760px){

    .erp-orders-v2{
        gap:12px;
    }

    .ov2-stats{
        grid-template-columns:1fr 1fr;
        gap:9px;
    }

    .ov2-stat{
        min-height:90px;
        padding:13px;
    }

    .ov2-stat-icon{
        width:40px;
        height:40px;
        flex-basis:40px;
    }

    .ov2-stat-copy strong{
        font-size:20px;
    }

    .ov2-filters{
        display:flex;
        flex-direction:column;
    }

    .ov2-filters > *{
        width:100%;
    }

    .ov2-order-row{
        display:grid;
        grid-template-columns:1fr auto;
        gap:12px;
        padding:15px;
    }

    .ov2-order-id,
    .ov2-customer,
    .ov2-delivery,
    .ov2-workflow,
    .ov2-amount{
        grid-column:auto;
    }

    .ov2-customer{
        grid-column:1 / -1;
    }

    .ov2-workflow{
        grid-column:1 / -1;
    }

    .ov2-arrow{
        display:none;
    }

    .ov2-list-header{
        padding:0 15px;
    }
}


/* ==========================================================
   THSH ERP - ORDER DETAIL V2
   Scoped to .od2-page
   ========================================================== */

.od2-page{
    --od2-blue:#2563eb;
    --od2-blue-soft:#eff6ff;
    --od2-green:#16a36a;
    --od2-green-soft:#ecfdf5;
    --od2-amber:#d58a13;
    --od2-amber-soft:#fff8e8;
    --od2-ink:#172033;
    --od2-muted:#8491a6;
    --od2-line:#e6ecf4;
    --od2-surface:#fff;
    --od2-soft:#f7f9fc;
    direction:rtl;
    width:100%;
    padding-bottom:32px;
}

.od2-page *,
.od2-page *::before,
.od2-page *::after{
    box-sizing:border-box;
}

.od2-page svg{
    width:22px;
    height:22px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.od2-toolbar{
    min-height:48px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin-bottom:14px;
}

.od2-back{
    display:inline-flex;
    align-items:center;
    gap:8px;
    color:var(--od2-blue);
    text-decoration:none;
    font-size:13px;
    font-weight:700;
}

.od2-back:hover{
    opacity:.76;
}

.od2-toolbar-meta{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:12px;
    color:var(--od2-muted);
}

.od2-toolbar-meta strong{
    color:#5f6d82;
    font-weight:700;
}

.od2-summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:28px;
    padding:22px 26px;
    background:linear-gradient(135deg,#101b2d 0%,#17263d 100%);
    border:1px solid rgba(255,255,255,.04);
    border-radius:18px;
    box-shadow:0 10px 30px rgba(17,31,52,.08);
    color:#fff;
    margin-bottom:14px;
}

.od2-summary-main{
    display:flex;
    align-items:center;
    gap:16px;
    min-width:0;
}

.od2-summary-icon{
    width:52px;
    height:52px;
    border-radius:15px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    background:rgba(59,130,246,.16);
    color:#72a8ff;
    border:1px solid rgba(114,168,255,.16);
}

.od2-summary-icon svg{
    width:25px;
    height:25px;
}

.od2-eyebrow{
    font-size:11px;
    color:#91a1b8;
    margin-bottom:2px;
}

.od2-summary h1{
    margin:0;
    font-size:25px;
    line-height:1.25;
    font-weight:900;
    letter-spacing:-.3px;
}

.od2-summary-tags{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-top:9px;
}

.od2-chip{
    display:inline-flex;
    align-items:center;
    min-height:24px;
    padding:3px 9px;
    border-radius:999px;
    background:rgba(255,255,255,.08);
    border:1px solid rgba(255,255,255,.06);
    color:#d6dfeb;
    font-size:10px;
    font-weight:700;
}

.od2-chip-blue{
    background:rgba(59,130,246,.18);
    color:#a9caff;
    border-color:rgba(96,165,250,.16);
}

.od2-total{
    min-width:220px;
    text-align:left;
    direction:rtl;
}

.od2-total > span{
    display:block;
    color:#91a1b8;
    font-size:11px;
    margin-bottom:2px;
}

.od2-total strong{
    display:inline-block;
    direction:ltr;
    font-size:27px;
    font-weight:900;
    line-height:1.25;
    letter-spacing:-.4px;
}

.od2-total small{
    display:inline-block;
    margin-right:6px;
    color:#9eacc0;
    font-size:11px;
    font-weight:700;
}

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

.od2-stage{
    min-height:92px;
    display:flex;
    align-items:center;
    gap:13px;
    padding:15px 16px;
    background:var(--od2-surface);
    border:1px solid var(--od2-line);
    border-radius:15px;
    box-shadow:0 5px 18px rgba(34,58,94,.035);
    position:relative;
    overflow:hidden;
}

.od2-stage::after{
    content:"";
    position:absolute;
    right:0;
    top:16px;
    bottom:16px;
    width:3px;
    border-radius:0 3px 3px 0;
    background:#d9e1ec;
}

.od2-stage.is-primary::after{background:var(--od2-blue);}
.od2-stage.is-success::after{background:var(--od2-green);}
.od2-stage.is-warning::after{background:#e6a12a;}

.od2-stage-icon{
    width:42px;
    height:42px;
    flex:0 0 auto;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    background:#f3f6fa;
    color:#8290a5;
}

.od2-stage.is-primary .od2-stage-icon{
    background:var(--od2-blue-soft);
    color:var(--od2-blue);
}

.od2-stage.is-success .od2-stage-icon{
    background:var(--od2-green-soft);
    color:var(--od2-green);
}

.od2-stage.is-warning .od2-stage-icon{
    background:var(--od2-amber-soft);
    color:var(--od2-amber);
}

.od2-stage-copy{
    min-width:0;
}

.od2-stage-copy > span{
    display:block;
    color:var(--od2-muted);
    font-size:10px;
    margin-bottom:3px;
}

.od2-stage-copy strong{
    display:block;
    color:var(--od2-ink);
    font-size:13px;
    font-weight:800;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.od2-stage-copy small{
    display:block;
    color:#9aa6b7;
    font-size:9px;
    margin-top:4px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.od2-layout{
    display:grid;
    grid-template-columns:minmax(0,1.8fr) minmax(310px,.72fr);
    gap:14px;
    align-items:start;
}

.od2-main,
.od2-side{
    display:grid;
    gap:14px;
}

.od2-card{
    background:var(--od2-surface);
    border:1px solid var(--od2-line);
    border-radius:17px;
    box-shadow:0 5px 20px rgba(34,58,94,.035);
    overflow:hidden;
}

.od2-card-head{
    min-height:70px;
    padding:16px 18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    border-bottom:1px solid #edf1f6;
}

.od2-card-head h2{
    margin:0;
    color:var(--od2-ink);
    font-size:15px;
    font-weight:900;
}

.od2-card-head p{
    margin:4px 0 0;
    color:var(--od2-muted);
    font-size:10px;
}

.od2-card-head-icon{
    width:37px;
    height:37px;
    flex:0 0 auto;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:10px;
    background:var(--od2-blue-soft);
    color:var(--od2-blue);
}

.od2-card-head-icon svg{
    width:19px;
    height:19px;
}

.od2-table-wrap{
    overflow-x:auto;
}

.od2-table{
    width:100%;
    border-collapse:collapse;
    min-width:690px;
}

.od2-table th{
    padding:11px 15px;
    background:#f8fafc;
    color:#8a97aa;
    font-size:10px;
    font-weight:700;
    text-align:right;
    border-bottom:1px solid #eaf0f6;
}

.od2-table td{
    padding:15px;
    color:#4c596d;
    font-size:11px;
    border-bottom:1px solid #edf1f6;
    vertical-align:middle;
}

.od2-table tbody tr:last-child td{
    border-bottom:0;
}

.od2-table tbody tr:hover{
    background:#fbfcfe;
}

.od2-sku{
    direction:ltr;
    display:inline-flex;
    padding:5px 8px;
    border-radius:7px;
    background:#f3f6fa;
    color:#657389;
    font-size:10px;
    font-weight:800;
}

.od2-product-name{
    color:var(--od2-ink) !important;
    font-weight:800;
}

.od2-quality{
    display:inline-flex;
    min-width:40px;
    justify-content:center;
    padding:4px 8px;
    border-radius:7px;
    background:#f1f5ff;
    color:#4f6fa9;
    font-weight:800;
    font-size:10px;
}

.od2-money{
    direction:ltr;
    text-align:right;
    white-space:nowrap;
    font-weight:700;
}

.od2-money small,
.od2-grand-total small{
    color:#9ca8b8;
    font-size:8px;
    margin-right:3px;
}

.od2-money-total{
    color:#25344d !important;
    font-weight:900 !important;
}

.od2-table tfoot td{
    padding:14px 15px;
    background:#fbfcfe;
    border-top:1px solid #e7edf5;
    color:#657389;
    font-size:11px;
    font-weight:800;
}

.od2-grand-total{
    direction:ltr;
    color:var(--od2-blue) !important;
    font-size:13px !important;
    font-weight:900 !important;
}

.od2-info-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:0;
    padding:6px 18px 16px;
}

.od2-info{
    min-height:72px;
    padding:15px 8px;
    border-bottom:1px solid #eef2f6;
}

.od2-info:nth-last-child(-n+3){
    border-bottom:0;
}

.od2-info span{
    display:block;
    color:var(--od2-muted);
    font-size:9px;
    margin-bottom:5px;
}

.od2-info strong{
    display:block;
    color:var(--od2-ink);
    font-size:12px;
    font-weight:800;
}

.od2-address{
    margin:0 18px 18px;
    padding:13px 14px;
    border-radius:11px;
    background:#f8fafc;
    border:1px solid #edf1f5;
}

.od2-address span{
    display:block;
    color:var(--od2-muted);
    font-size:9px;
    margin-bottom:5px;
}

.od2-address p{
    margin:0;
    color:#4f5c70;
    font-size:11px;
    line-height:1.8;
}

.od2-customer-link-row{
    padding:0 18px 18px;
}

.od2-secondary-link{
    display:inline-flex;
    align-items:center;
    gap:8px;
    color:var(--od2-blue);
    text-decoration:none;
    font-size:11px;
    font-weight:800;
}

.od2-action-card{
    overflow:visible;
}

.od2-live-dot{
    width:9px;
    height:9px;
    border-radius:50%;
    background:#2ecc71;
    box-shadow:0 0 0 5px rgba(46,204,113,.11);
    margin-left:6px;
}

.od2-actions{
    padding:16px;
}

.od2-action-context{
    display:flex;
    align-items:flex-start;
    gap:11px;
    padding:13px;
    margin-bottom:11px;
    background:#f6f9ff;
    border:1px solid #e4edff;
    border-radius:12px;
}

.od2-action-context.is-warning{
    background:#fffaf0;
    border-color:#f8e9c9;
}

.od2-action-context.is-success{
    background:#f1fbf6;
    border-color:#d9f1e5;
}

.od2-action-context-icon{
    width:37px;
    height:37px;
    flex:0 0 auto;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:10px;
    background:#eaf2ff;
    color:var(--od2-blue);
}

.od2-action-context.is-warning .od2-action-context-icon{
    background:#fff0d3;
    color:var(--od2-amber);
}

.od2-action-context.is-success .od2-action-context-icon{
    background:#e1f7eb;
    color:var(--od2-green);
}

.od2-action-context-icon svg{
    width:18px;
    height:18px;
}

.od2-action-context > div:last-child{
    min-width:0;
}

.od2-action-context span{
    display:block;
    color:#8996a9;
    font-size:9px;
    margin-bottom:3px;
}

.od2-action-context strong{
    display:block;
    color:#24334c;
    font-size:12px;
    font-weight:900;
}

.od2-action-context small{
    display:block;
    color:#8a97aa;
    font-size:9px;
    line-height:1.7;
    margin-top:4px;
}

.od2-primary-action{
    width:100%;
    min-height:43px;
    border:0;
    border-radius:10px;
    background:var(--od2-blue);
    color:#fff;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    padding:10px 14px;
    font-family:inherit;
    font-size:11px;
    font-weight:900;
    box-shadow:0 6px 15px rgba(37,99,235,.14);
    transition:transform .15s ease,box-shadow .15s ease,background .15s ease;
}

.od2-primary-action:hover{
    background:#1f58d6;
    box-shadow:0 8px 18px rgba(37,99,235,.20);
    transform:translateY(-1px);
}

.od2-action-success{
    background:var(--od2-green);
    box-shadow:0 6px 15px rgba(22,163,106,.13);
}

.od2-action-success:hover{
    background:#128a59;
    box-shadow:0 8px 18px rgba(22,163,106,.18);
}

.od2-select{
    width:100%;
    height:42px;
    margin-bottom:10px;
    padding:0 12px;
    border:1px solid #dce5f0;
    border-radius:10px;
    background:#fff;
    color:#344158;
    font-family:inherit;
    font-size:11px;
    outline:none;
}

.od2-select:focus{
    border-color:#a8c7ff;
    box-shadow:0 0 0 3px rgba(37,99,235,.08);
}

.od2-waiting{
    padding:15px;
    border-radius:12px;
    background:#f8fafc;
    border:1px solid #e8edf3;
}

.od2-waiting.is-success{
    background:#f1fbf6;
    border-color:#d9f1e5;
}

.od2-waiting strong{
    display:block;
    color:#344158;
    font-size:12px;
    font-weight:900;
}

.od2-waiting span{
    display:block;
    color:#8b97a8;
    font-size:9px;
    margin-top:5px;
    line-height:1.7;
}

.od2-completed{
    padding:22px 14px;
    text-align:center;
    border-radius:12px;
    background:#f2fbf6;
    border:1px solid #d9f0e3;
}

.od2-completed-icon{
    width:39px;
    height:39px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:0 auto 9px;
    border-radius:50%;
    background:#daf4e6;
    color:var(--od2-green);
    font-size:17px;
    font-weight:900;
}

.od2-completed strong{
    display:block;
    color:#226a4c;
    font-size:12px;
    font-weight:900;
}

.od2-completed span{
    display:block;
    color:#789487;
    font-size:9px;
    margin-top:5px;
}

.od2-timeline{
    padding:16px 17px 18px;
}

.od2-timeline-item{
    position:relative;
    padding:0 23px 20px 0;
}

.od2-timeline-item:last-child{
    padding-bottom:0;
}

.od2-timeline-item:not(:last-child)::before{
    content:"";
    position:absolute;
    right:5px;
    top:13px;
    bottom:-3px;
    width:1px;
    background:#e1e7ef;
}

.od2-timeline-marker{
    position:absolute;
    right:0;
    top:5px;
    width:11px;
    height:11px;
    border-radius:50%;
    background:#fff;
    border:3px solid #4c7df0;
    z-index:1;
}

.od2-timeline-body{
    min-width:0;
}

.od2-timeline-title{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
}

.od2-timeline-title strong{
    color:#344158;
    font-size:10px;
    font-weight:900;
    overflow-wrap:anywhere;
}

.od2-timeline-title span{
    direction:ltr;
    color:#5c7cc0;
    background:#f1f5ff;
    border-radius:6px;
    padding:3px 6px;
    font-size:8px;
    font-weight:700;
}

.od2-timeline-body p{
    margin:5px 0;
    color:#6f7c8f;
    font-size:9px;
    line-height:1.7;
}

.od2-timeline-body small{
    color:#a0abba;
    font-size:8px;
}

.od2-empty{
    padding:22px 10px;
    text-align:center;
    color:#9aa6b6;
    font-size:10px;
}


@media (min-width:1400px){

    .od2-summary{
        padding:24px 28px;
    }

    .od2-stage{
        min-height:98px;
        padding:16px 18px;
    }

    .od2-stage-copy strong{
        font-size:14px;
    }

    .od2-layout{
        grid-template-columns:minmax(0,1.95fr) minmax(330px,.68fr);
    }

    .od2-card-head h2{
        font-size:16px;
    }

    .od2-table td{
        font-size:12px;
    }

    .od2-info strong{
        font-size:13px;
    }
}


@media (max-width:1050px){

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

    .od2-layout{
        grid-template-columns:1fr;
    }

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


@media (max-width:720px){

    .od2-toolbar{
        align-items:flex-start;
        flex-direction:column;
    }

    .od2-summary{
        align-items:flex-start;
        flex-direction:column;
        padding:18px;
    }

    .od2-total{
        min-width:0;
        width:100%;
        text-align:right;
        padding-top:14px;
        border-top:1px solid rgba(255,255,255,.08);
    }

    .od2-total strong{
        font-size:23px;
    }

    .od2-progress{
        grid-template-columns:1fr;
    }

    .od2-stage{
        min-height:82px;
    }

    .od2-side{
        grid-template-columns:1fr;
    }

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

    .od2-info:nth-last-child(-n+3){
        border-bottom:1px solid #eef2f6;
    }

    .od2-info:nth-last-child(-n+2){
        border-bottom:0;
    }
}


@media (max-width:460px){

    .od2-summary-main{
        align-items:flex-start;
    }

    .od2-summary-icon{
        width:45px;
        height:45px;
        border-radius:12px;
    }

    .od2-summary h1{
        font-size:21px;
    }

    .od2-info-grid{
        grid-template-columns:1fr;
    }

    .od2-info,
    .od2-info:nth-last-child(-n+2),
    .od2-info:nth-last-child(-n+3){
        border-bottom:1px solid #eef2f6;
    }

    .od2-info:last-child{
        border-bottom:0;
    }
}

/* ==========================================================
   ORDER DETAIL - PRE WAREHOUSE SALES EDIT
   ========================================================== */

.od2-edit-items{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:12px;
}

.od2-edit-item-form{
    display:grid;
    grid-template-columns:minmax(0,1fr) 82px;
    gap:10px;
    padding:12px;
    border:1px solid #e5edf7;
    border-radius:14px;
    background:#fff;
}

.od2-edit-item-info{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:3px;
}

.od2-edit-item-info strong{
    font-size:12px;
    color:#17233b;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.od2-edit-item-info small{
    font-size:10px;
    color:#8794a8;
}

.od2-edit-item-qty{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.od2-edit-item-qty label{
    font-size:9px;
    color:#8a97aa;
}

.od2-edit-item-qty input{
    width:100%;
    height:34px;
    border:1px solid #dce6f2;
    border-radius:9px;
    padding:0 8px;
    background:#f8fbff;
    color:#14213d;
    font:inherit;
    text-align:center;
    outline:none;
}

.od2-edit-item-qty input:focus{
    border-color:#4285f4;
    box-shadow:0 0 0 3px rgba(66,133,244,.09);
}

.od2-edit-save{
    grid-column:1 / -1;
    height:36px;
    border:0;
    border-radius:10px;
    background:#1769e8;
    color:#fff;
    font:inherit;
    font-size:11px;
    font-weight:700;
    cursor:pointer;
}

.od2-edit-save:hover{
    filter:brightness(.96);
}

@media (max-width:760px){
    .od2-edit-item-form{
        grid-template-columns:minmax(0,1fr) 72px;
    }
}

/* ==========================================================
   ORDER DETAIL - DELETE ITEM / CANCEL INVOICE
   ========================================================== */

.od2-edit-delete{
    grid-column:1 / -1;
    height:34px;
    border:1px solid #ffd7d7;
    border-radius:10px;
    background:#fff7f7;
    color:#d92d20;
    font:inherit;
    font-size:11px;
    font-weight:700;
    cursor:pointer;
}

.od2-edit-delete:hover{
    background:#fff0f0;
}

.od2-cancel-order-form{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:14px;
    padding-top:14px;
    border-top:1px dashed #e1e8f2;
}

.od2-cancel-order-form label{
    font-size:10px;
    font-weight:700;
    color:#66758c;
}

.od2-cancel-order-form textarea{
    width:100%;
    min-height:62px;
    resize:vertical;
    border:1px solid #dce6f2;
    border-radius:10px;
    padding:9px 10px;
    background:#fff;
    color:#17233b;
    font:inherit;
    font-size:11px;
    outline:none;
}

.od2-cancel-order-form textarea:focus{
    border-color:#e45a5a;
    box-shadow:0 0 0 3px rgba(228,90,90,.08);
}

.od2-cancel-order{
    height:38px;
    border:0;
    border-radius:10px;
    background:#d92d20;
    color:#fff;
    font:inherit;
    font-size:11px;
    font-weight:800;
    cursor:pointer;
}

.od2-cancel-order:hover{
    filter:brightness(.96);
}

.od2-cancel-order-form small{
    color:#8c98a9;
    font-size:9px;
    line-height:1.8;
}


/* V3 PHASE 2A - ORDER PRODUCT ADD */

.od2-add-product{
    margin:18px 0;
    padding:18px;
    border:1px solid var(--border);
    border-radius:16px;
    background:var(--surface);
}

.od2-add-product-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
}

.od2-add-product-head strong{
    display:block;
    font-size:14px;
}

.od2-add-product-head small{
    display:block;
    margin-top:5px;
    color:var(--muted);
    line-height:1.8;
}

.od2-product-search{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    align-items:center;
}

.od2-product-search input{
    width:100%;
    min-height:44px;
    padding:0 14px;
    border:1px solid var(--border);
    border-radius:12px;
    background:#fff;
    font:inherit;
    outline:none;
}

.od2-product-search input:focus{
    border-color:var(--primary);
}

.od2-product-results{
    display:grid;
    gap:8px;
    margin-top:14px;
}

.od2-product-result{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto auto;
    gap:14px;
    align-items:center;
    padding:12px 14px;
    border:1px solid var(--border);
    border-radius:13px;
    background:#fff;
}

.od2-product-result-info strong,
.od2-product-result-info small{
    display:block;
}

.od2-product-result-info small{
    margin-top:4px;
    color:var(--muted);
}

.od2-product-result-price{
    text-align:left;
    white-space:nowrap;
}

.od2-product-result-price strong,
.od2-product-result-price small{
    display:block;
}

.od2-product-result-price small{
    color:var(--muted);
    margin-top:3px;
}

.od2-add-product-button{
    min-height:38px;
    padding:0 14px;
    border:0;
    border-radius:10px;
    background:var(--primary);
    color:#fff;
    font:inherit;
    font-weight:700;
    cursor:pointer;
    white-space:nowrap;
}

.od2-product-empty{
    margin-top:12px;
    padding:12px 14px;
    border:1px dashed var(--border);
    border-radius:12px;
    color:var(--muted);
    text-align:center;
}

@media (max-width:760px){
    .od2-product-search{
        grid-template-columns:1fr;
    }

    .od2-product-result{
        grid-template-columns:1fr;
    }

    .od2-product-result-price{
        text-align:right;
    }

    .od2-add-product-button{
        width:100%;
    }
}


/* V3 INVOICE INLINE EDIT UI */

.od3-invoice-tools{
    padding:0 18px 14px;
}

.od3-add-drawer{
    border:1px solid #dfe8f4;
    border-radius:12px;
    background:#fff;
    overflow:hidden;
}

.od3-add-drawer > summary{
    min-height:46px;
    padding:0 14px;
    display:flex;
    align-items:center;
    gap:9px;
    cursor:pointer;
    list-style:none;
    color:#24344d;
    font-size:11px;
    font-weight:900;
    user-select:none;
}

.od3-add-drawer > summary::-webkit-details-marker{
    display:none;
}

.od3-add-drawer > summary::after{
    content:"⌄";
    margin-right:auto;
    color:#8290a5;
    font-size:15px;
    transition:transform .18s ease;
}

.od3-add-drawer[open] > summary::after{
    transform:rotate(180deg);
}

.od3-add-drawer > summary small{
    color:#9aa6b7;
    font-size:9px;
    font-weight:600;
}

.od3-add-icon{
    width:26px;
    height:26px;
    border-radius:8px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#eaf2ff;
    color:#1769e8;
    font-size:18px;
    font-weight:700;
}

.od3-add-drawer-body{
    padding:14px;
    border-top:1px solid #edf1f6;
    background:#fafcff;
}

.od3-product-search{
    display:grid;
    grid-template-columns:minmax(0,1fr) 90px;
    gap:8px;
}

.od3-product-search input{
    width:100%;
    height:40px;
    padding:0 12px;
    border:1px solid #dce5f0;
    border-radius:9px;
    background:#fff;
    color:#1f2d43;
    font:inherit;
    font-size:11px;
    outline:none;
}

.od3-product-search input:focus{
    border-color:#4b83e9;
    box-shadow:0 0 0 3px rgba(75,131,233,.08);
}

.od3-product-search button{
    border:0;
    border-radius:9px;
    background:#1769e8;
    color:#fff;
    font:inherit;
    font-size:10px;
    font-weight:800;
    cursor:pointer;
}

.od3-search-results{
    margin-top:10px;
    max-height:310px;
    overflow:auto;
    border:1px solid #e4eaf2;
    border-radius:10px;
    background:#fff;
}

.od3-search-row{
    min-height:58px;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto auto;
    align-items:center;
    gap:14px;
    padding:9px 11px;
    border-bottom:1px solid #eef2f6;
}

.od3-search-row:last-child{
    border-bottom:0;
}

.od3-search-row:hover{
    background:#f8fbff;
}

.od3-search-product{
    min-width:0;
}

.od3-search-product strong{
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:#223049;
    font-size:10px;
    font-weight:800;
}

.od3-search-product span{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    align-items:center;
    margin-top:4px;
    color:#8794a8;
    font-size:9px;
}

.od3-search-product b{
    padding:2px 6px;
    border-radius:5px;
    background:#eef4ff;
    color:#5574a8;
    font-size:8px;
}

.od3-search-product em{
    color:#178454;
    font-style:normal;
}

.od3-search-price{
    direction:ltr;
    text-align:right;
    white-space:nowrap;
}

.od3-search-price strong{
    display:block;
    color:#273650;
    font-size:10px;
}

.od3-search-price small{
    color:#9aa6b6;
    font-size:8px;
}

.od3-result-add{
    height:32px;
    padding:0 11px;
    border:0;
    border-radius:8px;
    background:#1769e8;
    color:#fff;
    font:inherit;
    font-size:9px;
    font-weight:800;
    cursor:pointer;
    white-space:nowrap;
}

.od3-search-empty{
    margin-top:10px;
    padding:14px;
    border:1px dashed #dce5f0;
    border-radius:9px;
    background:#fff;
    color:#8794a8;
    text-align:center;
    font-size:10px;
}

.od3-edit-hint{
    margin-top:7px;
    color:#94a0b1;
    font-size:9px;
}

.od3-operation-head{
    width:155px;
    text-align:center !important;
}

.od3-row-actions{
    min-width:155px;
    white-space:nowrap;
}

.od3-qty-control{
    display:inline-flex;
    align-items:center;
    direction:ltr;
    height:32px;
    border:1px solid #dce5ef;
    border-radius:9px;
    background:#fff;
    overflow:hidden;
    vertical-align:middle;
}

.od3-qty-control form{
    margin:0;
}

.od3-qty-btn{
    width:31px;
    height:30px;
    padding:0;
    border:0;
    background:#f7f9fc;
    color:#1769e8;
    font-family:inherit;
    font-size:17px;
    font-weight:800;
    cursor:pointer;
}

.od3-qty-btn:hover{
    background:#edf4ff;
}

.od3-qty-btn.is-disabled{
    color:#c6ced9;
    background:#fafbfc;
    cursor:not-allowed;
}

.od3-qty-direct-form{
    height:30px;
}

.od3-qty-value{
    width:38px;
    height:30px;
    padding:0;
    border:0;
    border-right:1px solid #e5eaf1;
    border-left:1px solid #e5eaf1;
    background:#fff;
    color:#25344c;
    font:inherit;
    font-size:10px;
    font-weight:900;
    text-align:center;
    outline:none;
    appearance:textfield;
    -moz-appearance:textfield;
}

.od3-qty-value::-webkit-inner-spin-button,
.od3-qty-value::-webkit-outer-spin-button{
    -webkit-appearance:none;
    margin:0;
}

.od3-delete-row-form{
    display:inline-block;
    margin:0 7px 0 0;
    vertical-align:middle;
}

.od3-delete-row{
    height:32px;
    padding:0 9px;
    border:1px solid #f1d4d4;
    border-radius:8px;
    background:#fff;
    color:#c94444;
    font:inherit;
    font-size:9px;
    font-weight:800;
    cursor:pointer;
}

.od3-delete-row:hover{
    background:#fff5f5;
    border-color:#e9bcbc;
}

@media (max-width:900px){

    .od3-search-row{
        grid-template-columns:minmax(0,1fr) auto;
    }

    .od3-search-row > form{
        grid-column:1 / -1;
    }

    .od3-result-add{
        width:100%;
    }
}

@media (max-width:640px){

    .od3-product-search{
        grid-template-columns:1fr;
    }

    .od3-product-search button{
        height:38px;
    }

    .od3-add-drawer > summary small{
        display:none;
    }
}


/* ==========================================================
   ORDER DETAIL READABILITY V1
   Larger typography / spacing without changing ERP sidebar
   ========================================================== */

.od2-page{
    font-size:14px;
}

/* Card headings */
.od2-card-head h2{
    font-size:17px;
    line-height:1.6;
}

.od2-card-head p{
    font-size:12px;
    line-height:1.8;
}

/* Main invoice table */
.od2-table{
    font-size:13px;
}

.od2-table th{
    padding:14px 12px;
    font-size:12px;
    font-weight:800;
    white-space:nowrap;
}

.od2-table td{
    padding:15px 12px;
    font-size:13px;
    line-height:1.7;
    vertical-align:middle;
}

.od2-sku{
    font-size:11px;
    padding:5px 8px;
}

.od2-product-name{
    font-size:13px !important;
    font-weight:800;
}

.od2-quality{
    font-size:11px;
    padding:5px 9px;
}

.od2-money{
    font-size:13px;
    font-weight:700;
}

.od2-money small,
.od2-grand-total small{
    font-size:10px;
}

.od2-money-total{
    font-size:14px;
    font-weight:900;
}

.od2-grand-total{
    font-size:15px !important;
    font-weight:900;
}

/* Add product drawer */
.od3-invoice-tools{
    padding:0 18px 16px;
}

.od3-add-drawer > summary{
    min-height:52px;
    padding:0 16px;
    gap:10px;
    font-size:13px;
}

.od3-add-drawer > summary small{
    font-size:11px;
}

.od3-add-icon{
    width:30px;
    height:30px;
    font-size:20px;
}

.od3-edit-hint{
    margin-top:9px;
    font-size:11px;
    line-height:1.7;
}

/* Search drawer */
.od3-product-search input{
    height:44px;
    font-size:13px;
}

.od3-product-search button{
    font-size:12px;
    font-weight:800;
}

.od3-search-row{
    min-height:66px;
    padding:11px 13px;
}

.od3-search-product strong{
    font-size:12px;
}

.od3-search-product span{
    margin-top:5px;
    font-size:11px;
}

.od3-search-product b{
    font-size:10px;
}

.od3-search-price strong{
    font-size:12px;
}

.od3-search-price small{
    font-size:10px;
}

.od3-result-add{
    height:36px;
    padding:0 14px;
    font-size:11px;
}

/* Inline invoice actions */
.od3-operation-head{
    width:180px;
}

.od3-row-actions{
    min-width:180px;
}

.od3-qty-control{
    height:38px;
    border-radius:10px;
}

.od3-qty-btn{
    width:37px;
    height:36px;
    font-size:20px;
}

.od3-qty-direct-form{
    height:36px;
}

.od3-qty-value{
    width:44px;
    height:36px;
    font-size:13px;
}

.od3-delete-row{
    height:38px;
    padding:0 11px;
    font-size:11px;
}

/* Customer information */
.od2-info span{
    font-size:11px;
}

.od2-info strong{
    font-size:13px;
}

.od2-address span{
    font-size:11px;
}

.od2-address p{
    font-size:13px;
    line-height:1.9;
}

/* Left order operations card */
.od2-action-card{
    font-size:13px;
}

.od2-action-card strong{
    font-size:13px;
}

.od2-action-card small,
.od2-action-card p{
    font-size:11px;
    line-height:1.8;
}

/* Timeline */
.od2-timeline{
    font-size:12px;
}

.od2-timeline strong{
    font-size:12px;
}

.od2-timeline small{
    font-size:10px;
    line-height:1.7;
}

/* Keep it usable on smaller screens */
@media (max-width:1100px){

    .od2-table th{
        padding:12px 9px;
        font-size:11px;
    }

    .od2-table td{
        padding:13px 9px;
        font-size:12px;
    }

    .od3-operation-head,
    .od3-row-actions{
        min-width:165px;
        width:165px;
    }
}



/* =========================================================
   THSH WAREHOUSE CONTROL CENTER V2
   ========================================================= */

.wh-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 28px;
    margin-bottom: 18px;
    border: 1px solid #dbeafe;
    border-radius: 22px;
    background:
        radial-gradient(circle at 8% 10%, rgba(37,99,235,.10), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 60%, #eff6ff 100%);
    box-shadow: 0 10px 30px rgba(15,23,42,.05);
}

.wh-hero-copy {
    min-width: 0;
}

.wh-eyebrow,
.wh-section-kicker,
.wh-tool-copy > span,
.wh-team-head > div > span {
    display: block;
    margin-bottom: 5px;
    color: #2563eb;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .4px;
}

.wh-hero h2 {
    margin: 0;
    color: #0f172a;
    font-size: 24px;
    line-height: 1.45;
}

.wh-hero p {
    max-width: 650px;
    margin: 7px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.9;
}

.wh-hero-total {
    flex: 0 0 155px;
    padding: 17px 18px;
    border: 1px solid rgba(37,99,235,.14);
    border-radius: 18px;
    background: rgba(255,255,255,.86);
    text-align: center;
}

.wh-hero-total span,
.wh-hero-total small {
    display: block;
    color: #64748b;
    font-size: 11px;
}

.wh-hero-total strong {
    display: block;
    margin: 2px 0;
    color: #1d4ed8;
    font-size: 34px;
    line-height: 1.2;
}

.wh-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.wh-kpi {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(15,23,42,.035);
}

.wh-kpi-icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    font-size: 19px;
    font-weight: 900;
}

.wh-kpi-blue .wh-kpi-icon {
    background: #eff6ff;
    color: #2563eb;
}

.wh-kpi-orange .wh-kpi-icon {
    background: #fff7ed;
    color: #ea580c;
}

.wh-kpi-green .wh-kpi-icon {
    background: #ecfdf5;
    color: #059669;
}

.wh-kpi-purple .wh-kpi-icon {
    background: #f5f3ff;
    color: #7c3aed;
}

.wh-kpi > div:last-child {
    min-width: 0;
}

.wh-kpi span,
.wh-kpi small {
    display: block;
}

.wh-kpi span {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.wh-kpi strong {
    display: block;
    margin: 1px 0;
    color: #0f172a;
    font-size: 24px;
}

.wh-kpi small {
    overflow: hidden;
    color: #94a3b8;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-focus,
.wh-ready-section {
    margin-bottom: 25px;
}

.wh-section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.wh-section-title h2 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
}

.wh-live-dot {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.wh-live-dot i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}

.wh-work-grid,
.wh-ready-grid,
.wh-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 14px;
}

.wh-work-panel,
.wh-ready-panel,
.wh-tool-card,
.wh-team-card,
.wh-history {
    min-width: 0;
    border: 1px solid #e5e7eb;
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(15,23,42,.04);
}

.wh-work-panel {
    overflow: hidden;
}

.wh-panel-head,
.wh-ready-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 18px;
    border-bottom: 1px solid #eef2f7;
}

.wh-panel-head > div,
.wh-ready-head > div {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.wh-panel-icon,
.wh-ready-icon {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    font-weight: 900;
}

.wh-work-picking .wh-panel-icon {
    background: #fff7ed;
    color: #ea580c;
}

.wh-work-new .wh-panel-icon {
    background: #eff6ff;
    color: #2563eb;
}

.wh-panel-head h3,
.wh-ready-head h3,
.wh-tool-copy h3,
.wh-team-head h3 {
    margin: 0;
    color: #0f172a;
    font-size: 14px;
}

.wh-panel-head p,
.wh-ready-head p,
.wh-tool-copy p {
    margin: 3px 0 0;
    color: #94a3b8;
    font-size: 10px;
}

.wh-panel-head > strong,
.wh-ready-head > strong,
.wh-team-head > strong {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
}

.wh-order-stack {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.wh-order-card {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.wh-order-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 22px rgba(15,23,42,.06);
    transform: translateY(-1px);
}

.wh-order-card.active {
    border-color: #fed7aa;
    background: linear-gradient(180deg,#fff 0%,#fffdf9 100%);
}

.wh-order-main {
    display: block;
    padding: 14px;
    color: inherit;
    text-decoration: none;
}

.wh-order-top,
.wh-order-customer,
.wh-order-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wh-order-top > div {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.wh-order-label {
    color: #94a3b8;
    font-size: 10px;
}

.wh-order-top strong {
    color: #0f172a;
    font-size: 17px;
}

.wh-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}

.wh-status.new {
    background: #eff6ff;
    color: #1d4ed8;
}

.wh-status.picking {
    background: #fff7ed;
    color: #c2410c;
}

.wh-status.pickup {
    background: #ecfdf5;
    color: #047857;
}

.wh-status.courier {
    background: #f5f3ff;
    color: #6d28d9;
}

.wh-order-customer {
    margin-top: 12px;
}

.wh-order-customer strong {
    overflow: hidden;
    color: #334155;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-order-customer span {
    color: #64748b;
    font-size: 10px;
}

.wh-order-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 9px;
}

.wh-order-meta span {
    padding: 5px 8px;
    border-radius: 7px;
    background: #f8fafc;
    color: #64748b;
    font-size: 9px;
}

.wh-order-actions {
    display: grid;
    grid-template-columns: minmax(0,.75fr) minmax(0,1.25fr);
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #f1f5f9;
    background: #fafcff;
}

.wh-order-actions form {
    margin: 0;
}

.wh-btn {
    display: flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 0;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
}

.wh-btn.primary {
    background: #2563eb;
    color: #fff;
}

.wh-btn.success {
    background: #16a34a;
    color: #fff;
}

.wh-btn.secondary {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
}

.wh-empty {
    padding: 34px 18px;
    text-align: center;
}

.wh-empty > span {
    display: grid;
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    place-items: center;
    border-radius: 50%;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 18px;
    font-weight: 900;
}

.wh-empty strong {
    display: block;
    color: #475569;
    font-size: 12px;
}

.wh-empty p {
    margin: 5px 0 0;
    color: #94a3b8;
    font-size: 10px;
}

.wh-ready-panel {
    overflow: hidden;
}

.wh-ready-icon.pickup {
    background: #ecfdf5;
    color: #059669;
}

.wh-ready-icon.courier {
    background: #f5f3ff;
    color: #7c3aed;
}

.wh-mini-list {
    display: grid;
    gap: 7px;
    padding: 10px;
}

.wh-mini-order {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid #f1f5f9;
    border-radius: 11px;
    color: inherit;
    text-decoration: none;
}

.wh-mini-order > div {
    min-width: 0;
}

.wh-mini-order strong,
.wh-mini-order span {
    display: block;
}

.wh-mini-order strong {
    color: #334155;
    font-size: 11px;
}

.wh-mini-order span:not(.wh-status) {
    color: #94a3b8;
    font-size: 9px;
}

.wh-mini-empty {
    padding: 20px;
    color: #94a3b8;
    font-size: 11px;
    text-align: center;
}

.wh-bottom-grid {
    margin-bottom: 20px;
}

.wh-tool-card,
.wh-team-card {
    padding: 17px;
}

.wh-tool-card {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 13px;
}

.wh-tool-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: #f8fafc;
    color: #475569;
    font-size: 20px;
    font-weight: 900;
}

.wh-team-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.wh-team-list {
    display: grid;
    gap: 8px;
}

.wh-person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px;
    border-radius: 11px;
    background: #f8fafc;
}

.wh-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: #fff;
    color: #2563eb;
}

.wh-person strong,
.wh-person span {
    display: block;
}

.wh-person strong {
    color: #334155;
    font-size: 11px;
}

.wh-person span {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 9px;
}

.wh-history {
    overflow: hidden;
    margin-bottom: 20px;
}

.wh-history summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 17px;
    cursor: pointer;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    list-style: none;
}

.wh-history summary::-webkit-details-marker {
    display: none;
}

.wh-history summary span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    background: #f8fafc;
    color: #64748b;
}

.wh-history-list {
    display: grid;
    gap: 7px;
    padding: 0 10px 10px;
}

.wh-history-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 11px;
    border: 1px solid #f1f5f9;
    border-radius: 11px;
    color: inherit;
    text-decoration: none;
}

.wh-history-row strong,
.wh-history-row span {
    display: block;
}

.wh-history-row strong {
    color: #334155;
    font-size: 10px;
}

.wh-history-row span {
    color: #94a3b8;
    font-size: 9px;
}

.wh-history-open {
    color: #2563eb !important;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .wh-kpis {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .wh-work-grid,
    .wh-ready-grid,
    .wh-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .wh-hero {
        align-items: stretch;
        flex-direction: column;
        padding: 19px;
        border-radius: 17px;
    }

    .wh-hero h2 {
        font-size: 20px;
    }

    .wh-hero-total {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        flex-basis: auto;
        text-align: right;
    }

    .wh-hero-total strong {
        grid-column: 2;
        grid-row: 1 / 3;
        padding-right: 12px;
    }

    .wh-hero-total small {
        margin-top: 2px;
    }

    .wh-kpis {
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 8px;
    }

    .wh-kpi {
        align-items: flex-start;
        padding: 12px;
    }

    .wh-kpi-icon {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .wh-kpi strong {
        font-size: 20px;
    }

    .wh-kpi small {
        display: none;
    }

    .wh-panel-head,
    .wh-ready-head {
        padding: 14px;
    }

    .wh-order-actions {
        grid-template-columns: 1fr 1.4fr;
    }

    .wh-mini-order {
        grid-template-columns: minmax(0,1fr) auto;
    }

    .wh-mini-order .wh-status {
        grid-column: 2;
        grid-row: 1 / 3;
    }

    .wh-tool-card {
        grid-template-columns: auto minmax(0,1fr);
    }

    .wh-tool-card .wh-btn {
        grid-column: 1 / -1;
    }

    .wh-history-row {
        grid-template-columns: 1fr auto;
    }

    .wh-history-row > div:nth-child(2),
    .wh-history-open {
        display: none;
    }
}



/* =========================================================
   THSH WAREHOUSE CONTROL CENTER V3
   ========================================================= */

.wh-hero {
    min-height: 0;
    padding-top: 18px;
    padding-bottom: 18px;
}

.wh-hero h2 {
    font-size: 21px;
}

.wh-hero p {
    margin-top: 4px;
}

.wh-hero-total {
    padding-top: 12px;
    padding-bottom: 12px;
}

.wh-order-card.active {
    position: relative;
}

.wh-order-card.active::before {
    position: absolute;
    top: 14px;
    right: 0;
    bottom: 14px;
    width: 3px;
    border-radius: 3px 0 0 3px;
    background: #f59e0b;
    content: "";
}

.wh-order-actions-v3 {
    grid-template-columns:
        minmax(0,.72fr)
        minmax(0,.92fr)
        minmax(0,1.25fr);
}

.wh-btn.warning {
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.wh-btn.warning:hover {
    background: #ffedd5;
}

.wh-btn.warning-solid {
    border: 0;
    background: #ea580c;
    color: #fff;
}

.wh-btn.warning-solid:hover {
    background: #c2410c;
}

.wh-revision-box[hidden] {
    display: none !important;
}

.wh-revision-box {
    margin: 0 10px 10px;
    padding: 13px;
    border: 1px solid #fed7aa;
    border-radius: 13px;
    background: linear-gradient(
        180deg,
        #fffaf5 0%,
        #fff 100%
    );
}

.wh-revision-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.wh-revision-head strong,
.wh-revision-head span {
    display: block;
}

.wh-revision-head strong {
    color: #9a3412;
    font-size: 11px;
}

.wh-revision-head span {
    margin-top: 3px;
    color: #9a6a55;
    font-size: 9px;
}

.wh-revision-close {
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: #ffedd5;
    color: #9a3412;
    cursor: pointer;
    font-family: inherit;
    font-size: 18px;
}

.wh-revision-box form {
    display: grid;
    grid-template-columns:
        minmax(0,1fr)
        auto;
    gap: 8px;
    margin: 0;
}

.wh-revision-box textarea {
    width: 100%;
    min-height: 42px;
    resize: vertical;
    box-sizing: border-box;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    outline: none;
    padding: 10px 11px;
    background: #fff;
    color: #334155;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.7;
}

.wh-revision-box textarea:focus {
    border-color: #fb923c;
    box-shadow:
        0 0 0 3px
        rgba(251,146,60,.12);
}

@media (max-width: 760px) {
    .wh-order-actions-v3 {
        grid-template-columns:
            1fr 1fr;
    }

    .wh-order-actions-v3 form {
        grid-column: 1 / -1;
    }

    .wh-revision-box form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 460px) {
    .wh-order-actions-v3 {
        grid-template-columns: 1fr;
    }

    .wh-order-actions-v3 form {
        grid-column: auto;
    }
}

/* =========================================================
   THSH CUSTOMER INVOICE — BLACK & WHITE PREMIUM V2
   ========================================================= */

.wi-page{
    max-width:1100px;
    margin:0 auto;
    direction:rtl;
}

.wi-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin:0 0 18px;
    padding:14px 16px;
    background:#fff;
    border:1px solid #e1e5ea;
    border-radius:14px;
}

.wi-toolbar-info{
    display:flex;
    align-items:center;
    gap:16px;
}

.wi-toolbar-info > div{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.wi-toolbar-info strong{
    font-size:14px;
    color:#111;
}

.wi-toolbar-info small{
    font-size:11px;
    color:#777;
}

.wi-back{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:38px;
    padding:0 13px;
    border:1px solid #ddd;
    border-radius:9px;
    color:#222;
    background:#fff;
    text-decoration:none;
    white-space:nowrap;
}

.wi-print-actions{
    display:flex;
    gap:8px;
}

.wi-print-btn{
    min-width:92px;
    min-height:40px;
    padding:0 15px;
    border-radius:9px;
    cursor:pointer;
    font:inherit;
    font-weight:800;
}

.wi-print-btn.primary{
    border:1px solid #111;
    background:#111;
    color:#fff;
}

.wi-print-btn.secondary{
    border:1px solid #bbb;
    background:#fff;
    color:#111;
}

.wi-paper{
    background:#fff;
    color:#111;
    border:1px solid #d8d8d8;
    border-radius:12px;
    padding:28px 30px 22px;
    box-shadow:0 6px 24px rgba(0,0,0,.035);
}

.wi-header{
    display:grid;
    grid-template-columns:1fr 1.15fr 1fr;
    align-items:center;
    gap:22px;
    padding-bottom:17px;
    border-bottom:2px solid #111;
}

.wi-brand{
    text-align:right;
}

.wi-brand-en{
    direction:ltr;
    font-size:29px;
    line-height:1;
    font-weight:950;
    letter-spacing:1.5px;
    color:#111;
}

.wi-brand-fa{
    margin-top:7px;
    font-size:12px;
    font-weight:850;
    color:#222;
}

.wi-title{
    text-align:center;
}

.wi-title h1{
    margin:0 0 8px;
    font-size:24px;
    line-height:1.2;
    font-weight:950;
    color:#000;
}

.wi-order-number{
    font-size:11px;
    color:#444;
}

.wi-order-number strong{
    display:inline-block;
    direction:ltr;
    margin-right:5px;
    padding:2px 8px;
    border:1px solid #333;
    border-radius:4px;
    font-size:14px;
    color:#000;
}

.wi-meta{
    display:flex;
    flex-direction:column;
    gap:9px;
}

.wi-meta > div{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    font-size:10.5px;
}

.wi-meta span,
.wi-customer span{
    color:#666;
}

.wi-meta strong{
    color:#111;
    font-weight:800;
}

.wi-customer{
    display:grid;
    grid-template-columns:1.4fr 1fr 1fr;
    gap:14px;
    margin:14px 0;
    padding:10px 12px;
    border:1px solid #cfcfcf;
    border-radius:7px;
    background:#fff;
}

.wi-customer > div{
    display:flex;
    flex-direction:column;
    gap:3px;
    font-size:10px;
}

.wi-customer strong{
    font-size:11.5px;
    color:#111;
}

.wi-table-wrap{
    width:100%;
    overflow:hidden;
    border:1px solid #aaa;
    border-radius:6px;
}

.wi-table{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
}

.wi-table th{
    padding:8px 6px;
    background:#f2f2f2;
    border-bottom:1px solid #999;
    border-left:1px solid #ddd;
    font-size:9.5px;
    font-weight:900;
    color:#111;
    text-align:center;
}

.wi-table th:last-child{
    border-left:0;
}

.wi-table td{
    padding:9px 6px;
    border-bottom:1px solid #ddd;
    border-left:1px solid #eee;
    font-size:10px;
    text-align:center;
    vertical-align:middle;
    color:#111;
}

.wi-table td:last-child{
    border-left:0;
}

.wi-table tbody tr:nth-child(even){
    background:#fafafa;
}

.wi-table tbody tr:last-child td{
    border-bottom:0;
}

.wi-table .wi-row-no{
    width:5%;
}

.wi-table .wi-code{
    width:12%;
}

.wi-table .wi-product{
    width:29%;
    text-align:right;
    font-weight:850;
}

.wi-table .wi-quality{
    width:9%;
}

.wi-table .wi-qty{
    width:7%;
}

.wi-table .wi-price{
    width:19%;
}

.wi-qty-value{
    font-weight:900;
    font-size:11px !important;
}

.wi-money{
    direction:rtl;
    white-space:nowrap;
    font-weight:700;
}

.wi-table small{
    font-size:7px;
    color:#666;
    font-weight:500;
}

.wi-ltr{
    direction:ltr;
}

.wi-summary{
    display:grid;
    grid-template-columns:1fr 290px;
    gap:14px;
    margin-top:14px;
}

.wi-note{
    min-height:64px;
    padding:10px 12px;
    border:1px solid #ccc;
    border-radius:6px;
    display:flex;
    flex-direction:column;
    gap:6px;
    font-size:9.5px;
}

.wi-note strong{
    color:#111;
}

.wi-note span{
    color:#555;
}

.wi-total{
    padding:11px 14px;
    border:2px solid #111;
    border-radius:6px;
    background:#fff;
    color:#111;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.wi-total span{
    font-size:10.5px;
    font-weight:800;
}

.wi-total strong{
    font-size:17px;
    white-space:nowrap;
    color:#000;
}

.wi-total small{
    font-size:8px;
    font-weight:600;
}

.wi-signatures{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:70px;
    margin:25px 24px 17px;
}

.wi-signatures > div{
    text-align:center;
    font-size:9.5px;
    color:#444;
}

.wi-sign-line{
    height:34px;
    border-bottom:1px solid #888;
}

.wi-footer{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:20px;
    padding-top:11px;
    border-top:1px solid #aaa;
    font-size:8.5px;
    color:#222;
}

.wi-footer-brand{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.wi-footer-brand strong{
    color:#000;
}

.wi-footer-contact{
    direction:ltr;
    display:flex;
    gap:14px;
    font-weight:850;
    color:#000;
}

@media (max-width:760px){
    .wi-toolbar{
        align-items:stretch;
        flex-direction:column;
    }

    .wi-toolbar-info{
        align-items:flex-start;
    }

    .wi-print-actions{
        display:grid;
        grid-template-columns:1fr 1fr;
    }

    .wi-header{
        grid-template-columns:1fr;
        text-align:center;
    }

    .wi-brand{
        text-align:center;
    }

    .wi-meta{
        max-width:320px;
        width:100%;
        margin:auto;
    }

    .wi-customer{
        grid-template-columns:1fr;
    }

    .wi-paper{
        padding:14px;
        overflow-x:auto;
    }

    .wi-table{
        min-width:700px;
    }

    .wi-summary{
        grid-template-columns:1fr;
    }
}


/* ================= PRINT ================= */

@media print{

    html,
    body{
        background:#fff !important;
    }

    body{
        margin:0 !important;
        padding:0 !important;
        color:#000 !important;
    }

    .no-print,
    .sidebar,
    .erp-topbar,
    nav{
        display:none !important;
    }

    .main-content,
    main,
    .content,
    .page-content{
        margin:0 !important;
        padding:0 !important;
        width:100% !important;
        max-width:none !important;
    }

    .wi-page{
        width:100% !important;
        max-width:none !important;
        margin:0 !important;
    }

    .wi-paper{
        width:100% !important;
        box-sizing:border-box !important;
        margin:0 !important;
        border:0 !important;
        border-radius:0 !important;
        box-shadow:none !important;
        background:#fff !important;
        color:#000 !important;
    }

    .wi-header,
    .wi-customer,
    .wi-summary,
    .wi-signatures,
    .wi-footer{
        break-inside:avoid;
    }

    .wi-table thead{
        display:table-header-group;
    }

    .wi-table tr{
        break-inside:avoid;
        page-break-inside:avoid;
    }

    .wi-table th{
        background:#f3f3f3 !important;
        color:#000 !important;
        -webkit-print-color-adjust:exact;
        print-color-adjust:exact;
    }

    .wi-table tbody tr:nth-child(even){
        background:#fafafa !important;
        -webkit-print-color-adjust:exact;
        print-color-adjust:exact;
    }

    .wi-total{
        background:#fff !important;
        color:#000 !important;
    }


    /* ---------- A5 / کم‌قلم ---------- */

    body.warehouse-print-a5 .wi-paper{
        page:warehouseA5;
        padding:0 !important;
    }

    body.warehouse-print-a5 .wi-header{
        grid-template-columns:.8fr 1.15fr .95fr;
        gap:7px;
        padding-bottom:7px;
    }

    body.warehouse-print-a5 .wi-brand-en{
        font-size:19px;
    }

    body.warehouse-print-a5 .wi-brand-fa{
        margin-top:3px;
        font-size:8.5px;
    }

    body.warehouse-print-a5 .wi-title h1{
        margin-bottom:4px;
        font-size:16px;
    }

    body.warehouse-print-a5 .wi-order-number{
        font-size:7.5px;
    }

    body.warehouse-print-a5 .wi-order-number strong{
        font-size:9px;
        padding:1px 5px;
    }

    body.warehouse-print-a5 .wi-meta{
        gap:4px;
    }

    body.warehouse-print-a5 .wi-meta > div{
        gap:5px;
        font-size:7px;
    }

    body.warehouse-print-a5 .wi-customer{
        margin:6px 0;
        padding:5px 6px;
        gap:5px;
    }

    body.warehouse-print-a5 .wi-customer > div{
        gap:1px;
        font-size:7px;
    }

    body.warehouse-print-a5 .wi-customer strong{
        font-size:8px;
    }

    body.warehouse-print-a5 .wi-table th{
        padding:4px 2px;
        font-size:6.7px;
    }

    body.warehouse-print-a5 .wi-table td{
        padding:4px 2px;
        font-size:7px;
    }

    body.warehouse-print-a5 .wi-qty-value{
        font-size:8px !important;
    }

    body.warehouse-print-a5 .wi-table small{
        font-size:5.5px;
    }

    body.warehouse-print-a5 .wi-summary{
        grid-template-columns:1fr 165px;
        gap:6px;
        margin-top:6px;
    }

    body.warehouse-print-a5 .wi-note{
        min-height:38px;
        padding:5px 6px;
        gap:3px;
        font-size:6.5px;
    }

    body.warehouse-print-a5 .wi-total{
        padding:5px 7px;
        border-width:1.5px;
    }

    body.warehouse-print-a5 .wi-total span{
        font-size:7px;
    }

    body.warehouse-print-a5 .wi-total strong{
        font-size:10px;
    }

    body.warehouse-print-a5 .wi-total small{
        font-size:5.5px;
    }

    body.warehouse-print-a5 .wi-signatures{
        gap:28px;
        margin:8px 8px 6px;
    }

    body.warehouse-print-a5 .wi-signatures > div{
        font-size:6.5px;
    }

    body.warehouse-print-a5 .wi-sign-line{
        height:18px;
    }

    body.warehouse-print-a5 .wi-footer{
        gap:8px;
        padding-top:5px;
        font-size:6px;
    }

    body.warehouse-print-a5 .wi-footer-brand{
        gap:2px;
    }

    body.warehouse-print-a5 .wi-footer-contact{
        gap:7px;
    }


    /* ---------- A4 / پرقلم ---------- */

    body.warehouse-print-a4 .wi-paper{
        page:warehouseA4;
        padding:0 !important;
    }

    body.warehouse-print-a4 .wi-header{
        gap:14px;
        padding-bottom:12px;
    }

    body.warehouse-print-a4 .wi-brand-en{
        font-size:26px;
    }

    body.warehouse-print-a4 .wi-title h1{
        font-size:22px;
    }

    body.warehouse-print-a4 .wi-customer{
        margin:11px 0;
        padding:8px 10px;
    }

    body.warehouse-print-a4 .wi-table th{
        padding:7px 5px;
        font-size:8.5px;
    }

    body.warehouse-print-a4 .wi-table td{
        padding:7px 5px;
        font-size:9px;
    }

    body.warehouse-print-a4 .wi-summary{
        grid-template-columns:1fr 250px;
        margin-top:11px;
    }

    body.warehouse-print-a4 .wi-signatures{
        margin-top:20px;
    }
}

@page warehouseA5{
    size:A5 portrait;
    margin:7mm;
}

@page warehouseA4{
    size:A4 portrait;
    margin:9mm;
}

/* =========================================================
   THSH CUSTOMER INVOICE — A5 READABILITY TUNE V3
   Customer-facing / monochrome printer
   ========================================================= */

@media print {

    body.warehouse-print-a5 .wi-header{
        grid-template-columns:.9fr 1.15fr 1fr;
        gap:9px;
        padding-bottom:9px;
    }

    body.warehouse-print-a5 .wi-brand-en{
        font-size:23px;
        letter-spacing:1.2px;
    }

    body.warehouse-print-a5 .wi-brand-fa{
        margin-top:4px;
        font-size:10px;
    }

    body.warehouse-print-a5 .wi-title h1{
        margin-bottom:5px;
        font-size:19px;
    }

    body.warehouse-print-a5 .wi-order-number{
        font-size:9px;
    }

    body.warehouse-print-a5 .wi-order-number strong{
        font-size:11px;
        padding:2px 6px;
    }

    body.warehouse-print-a5 .wi-meta{
        gap:6px;
    }

    body.warehouse-print-a5 .wi-meta > div{
        gap:6px;
        font-size:8.5px;
    }

    body.warehouse-print-a5 .wi-customer{
        margin:9px 0;
        padding:8px 9px;
        gap:8px;
    }

    body.warehouse-print-a5 .wi-customer > div{
        gap:2px;
        font-size:8.5px;
    }

    body.warehouse-print-a5 .wi-customer strong{
        font-size:10px;
    }

    body.warehouse-print-a5 .wi-table th{
        padding:6px 3px;
        font-size:8px;
    }

    body.warehouse-print-a5 .wi-table td{
        padding:7px 3px;
        font-size:8.5px;
        line-height:1.45;
    }

    body.warehouse-print-a5 .wi-table .wi-product{
        font-size:9px;
    }

    body.warehouse-print-a5 .wi-qty-value{
        font-size:9.5px !important;
    }

    body.warehouse-print-a5 .wi-table small{
        font-size:6.5px;
    }

    body.warehouse-print-a5 .wi-summary{
        grid-template-columns:1fr 185px;
        gap:8px;
        margin-top:9px;
    }

    body.warehouse-print-a5 .wi-note{
        min-height:48px;
        padding:7px 8px;
        gap:4px;
        font-size:8px;
        line-height:1.6;
    }

    body.warehouse-print-a5 .wi-total{
        padding:8px 9px;
        border-width:1.5px;
    }

    body.warehouse-print-a5 .wi-total span{
        font-size:8.5px;
    }

    body.warehouse-print-a5 .wi-total strong{
        font-size:13px;
    }

    body.warehouse-print-a5 .wi-total small{
        font-size:7px;
    }

    body.warehouse-print-a5 .wi-signatures{
        gap:35px;
        margin:14px 10px 10px;
    }

    body.warehouse-print-a5 .wi-signatures > div{
        font-size:8px;
    }

    body.warehouse-print-a5 .wi-sign-line{
        height:28px;
    }

    body.warehouse-print-a5 .wi-footer{
        gap:10px;
        padding-top:7px;
        font-size:7.2px;
        line-height:1.55;
    }

    body.warehouse-print-a5 .wi-footer-brand{
        gap:3px;
    }

    body.warehouse-print-a5 .wi-footer-contact{
        gap:9px;
        font-size:7.2px;
    }
}

/* =========================================================
   THSH INVOICE — TRUE A5 TABLE LAYOUT V5
   Fixed physical widths for 148mm A5 portrait
   ========================================================= */

@media print {

    body.warehouse-print-a5 .wi-table-wrap{
        width:100% !important;
        max-width:100% !important;
        overflow:visible !important;
        box-sizing:border-box !important;
    }

    body.warehouse-print-a5 .wi-table{
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        table-layout:fixed !important;
        border-collapse:collapse !important;
    }

    /*
       A5 usable width is distributed deliberately:
       row 6 + code 17 + product 28 + quality 10 +
       qty 8 + unit price 15.5 + total 15.5 = 100%
    */

    body.warehouse-print-a5 .wi-table .wi-row-no{
        width:6% !important;
    }

    body.warehouse-print-a5 .wi-table .wi-code{
        width:17% !important;
    }

    body.warehouse-print-a5 .wi-table .wi-product{
        width:28% !important;
    }

    body.warehouse-print-a5 .wi-table .wi-quality{
        width:10% !important;
    }

    body.warehouse-print-a5 .wi-table .wi-qty{
        width:8% !important;
    }

    body.warehouse-print-a5 .wi-table .wi-price{
        width:15.5% !important;
    }

    body.warehouse-print-a5 .wi-table th,
    body.warehouse-print-a5 .wi-table td{
        box-sizing:border-box !important;
        padding-left:2px !important;
        padding-right:2px !important;
    }

    body.warehouse-print-a5 .wi-money{
        direction:ltr !important;
        text-align:center !important;
        white-space:normal !important;
        overflow:visible !important;
        line-height:1.15 !important;
    }

    body.warehouse-print-a5 .wi-money-number{
        display:block !important;
        direction:ltr !important;
        unicode-bidi:isolate !important;
        white-space:nowrap !important;
        font-size:7.4px !important;
        font-weight:800 !important;
        letter-spacing:-0.25px !important;
    }

    body.warehouse-print-a5 .wi-money-unit{
        display:block !important;
        direction:rtl !important;
        margin-top:2px !important;
        font-size:5.5px !important;
        font-weight:500 !important;
        color:#555 !important;
    }

    body.warehouse-print-a5 .wi-table .wi-product{
        font-size:8px !important;
        line-height:1.25 !important;
        overflow-wrap:anywhere !important;
    }

    body.warehouse-print-a5 .wi-table td.wi-ltr{
        font-size:7px !important;
        overflow-wrap:anywhere !important;
    }
}

/* =========================================================
   THSH INVOICE — A5 TRUE WIDTH FIX V5
   Keep complete table inside printable A5 width
   ========================================================= */

@media print {

    body.warehouse-print-a5 .wi-paper{
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        box-sizing:border-box !important;
        overflow:visible !important;
    }

    body.warehouse-print-a5 .wi-table-wrap{
        display:block !important;
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        overflow:visible !important;
        box-sizing:border-box !important;
    }

    body.warehouse-print-a5 .wi-table{
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        table-layout:fixed !important;
        box-sizing:border-box !important;
    }

    body.warehouse-print-a5 .wi-table .wi-row-no{
        width:6% !important;
    }

    body.warehouse-print-a5 .wi-table .wi-code{
        width:15% !important;
    }

    body.warehouse-print-a5 .wi-table .wi-product{
        width:27% !important;
    }

    body.warehouse-print-a5 .wi-table .wi-quality{
        width:9% !important;
    }

    body.warehouse-print-a5 .wi-table .wi-qty{
        width:7% !important;
    }

    body.warehouse-print-a5 .wi-table .wi-price{
        width:18% !important;
    }

    body.warehouse-print-a5 .wi-table th,
    body.warehouse-print-a5 .wi-table td{
        box-sizing:border-box !important;
        min-width:0 !important;
        padding-left:2px !important;
        padding-right:2px !important;
        overflow:hidden !important;
    }

    body.warehouse-print-a5 .wi-money{
        direction:ltr !important;
        text-align:center !important;
        white-space:normal !important;
    }

    body.warehouse-print-a5 .wi-money-number{
        display:block !important;
        direction:ltr !important;
        unicode-bidi:isolate !important;
        white-space:nowrap !important;
        font-size:8px !important;
        line-height:1.25 !important;
        font-weight:800 !important;
        letter-spacing:-0.15px !important;
    }

    body.warehouse-print-a5 .wi-money-unit{
        display:block !important;
        margin-top:1px !important;
        direction:rtl !important;
        font-size:5.5px !important;
        line-height:1 !important;
        color:#555 !important;
    }

    body.warehouse-print-a5 .wi-table td.wi-ltr{
        direction:ltr !important;
        unicode-bidi:isolate !important;
        white-space:nowrap !important;
        font-size:7.5px !important;
    }

    body.warehouse-print-a5 .wi-table .wi-product{
        font-size:8.5px !important;
        overflow-wrap:anywhere !important;
    }
}

/* =========================================================
   THSH INVOICE — A5 FINAL POLISH V6
   Visual polish only — V5 widths remain untouched
   ========================================================= */

@media print {

    /* Slightly more breathing room under the header */
    body.warehouse-print-a5 .wi-header{
        padding-bottom:11px !important;
    }

    body.warehouse-print-a5 .wi-title h1{
        font-size:20px !important;
        line-height:1.2 !important;
    }

    body.warehouse-print-a5 .wi-brand-fa{
        font-size:10.5px !important;
    }

    body.warehouse-print-a5 .wi-meta > div{
        font-size:9px !important;
        line-height:1.45 !important;
    }

    /* Customer information */
    body.warehouse-print-a5 .wi-customer{
        margin:10px 0 !important;
        padding:10px 10px !important;
        min-height:58px !important;
        align-items:center !important;
    }

    body.warehouse-print-a5 .wi-customer > div{
        font-size:9px !important;
        line-height:1.5 !important;
    }

    body.warehouse-print-a5 .wi-customer strong{
        font-size:10.5px !important;
        line-height:1.45 !important;
    }

    /* Table readability — widths intentionally NOT changed */
    body.warehouse-print-a5 .wi-table th{
        padding-top:7px !important;
        padding-bottom:7px !important;
        font-size:8.4px !important;
        line-height:1.25 !important;
    }

    body.warehouse-print-a5 .wi-table td{
        padding-top:9px !important;
        padding-bottom:9px !important;
        font-size:9px !important;
        line-height:1.5 !important;
        vertical-align:middle !important;
    }

    body.warehouse-print-a5 .wi-table .wi-product{
        font-size:9px !important;
        font-weight:700 !important;
        line-height:1.45 !important;
    }

    body.warehouse-print-a5 .wi-qty-value{
        font-size:10px !important;
        font-weight:800 !important;
    }

    body.warehouse-print-a5 .wi-money-number{
        font-size:8.2px !important;
        line-height:1.3 !important;
    }

    body.warehouse-print-a5 .wi-money-unit{
        font-size:6px !important;
        margin-top:2px !important;
    }

    /* Summary */
    body.warehouse-print-a5 .wi-summary{
        margin-top:11px !important;
        gap:9px !important;
    }

    body.warehouse-print-a5 .wi-note{
        min-height:60px !important;
        padding:9px 10px !important;
        font-size:8.5px !important;
        line-height:1.7 !important;
    }

    body.warehouse-print-a5 .wi-total{
        min-height:60px !important;
        padding:10px 10px !important;
        display:flex !important;
        flex-direction:column !important;
        justify-content:center !important;
    }

    body.warehouse-print-a5 .wi-total span{
        font-size:9px !important;
    }

    body.warehouse-print-a5 .wi-total strong{
        font-size:14px !important;
        line-height:1.35 !important;
    }

    body.warehouse-print-a5 .wi-total small{
        font-size:6.5px !important;
    }

    /* Give signatures deliberate separation from invoice body */
    body.warehouse-print-a5 .wi-signatures{
        margin-top:28px !important;
        margin-bottom:18px !important;
        gap:40px !important;
    }

    body.warehouse-print-a5 .wi-signatures > div{
        min-height:42px !important;
        font-size:8.5px !important;
    }

    /* Footer */
    body.warehouse-print-a5 .wi-footer{
        margin-top:14px !important;
        padding-top:7px !important;
        font-size:7px !important;
        line-height:1.55 !important;
    }
}

/* =========================================================
   THSH INVOICE — A5 VERTICAL BALANCE V7
   Vertical/readability only — V5 column widths untouched
   ========================================================= */

@media print {

    body.warehouse-print-a5 .wi-paper{
        min-height:185mm !important;
    }

    body.warehouse-print-a5 .wi-header{
        padding-top:3px !important;
        padding-bottom:13px !important;
    }

    body.warehouse-print-a5 .wi-brand-en{
        font-size:25px !important;
    }

    body.warehouse-print-a5 .wi-brand-fa{
        font-size:11px !important;
        margin-top:5px !important;
    }

    body.warehouse-print-a5 .wi-title h1{
        font-size:21px !important;
    }

    body.warehouse-print-a5 .wi-order-number{
        font-size:9.5px !important;
    }

    body.warehouse-print-a5 .wi-order-number strong{
        font-size:12px !important;
        padding:3px 7px !important;
    }

    body.warehouse-print-a5 .wi-meta > div{
        font-size:9.5px !important;
        line-height:1.55 !important;
    }

    body.warehouse-print-a5 .wi-customer{
        margin:12px 0 !important;
        padding:12px 11px !important;
        min-height:68px !important;
    }

    body.warehouse-print-a5 .wi-customer > div{
        font-size:9.5px !important;
        line-height:1.65 !important;
    }

    body.warehouse-print-a5 .wi-customer strong{
        font-size:11px !important;
    }

    /* Column widths intentionally untouched */
    body.warehouse-print-a5 .wi-table th{
        padding-top:8px !important;
        padding-bottom:8px !important;
        font-size:8.6px !important;
    }

    body.warehouse-print-a5 .wi-table td{
        padding-top:11px !important;
        padding-bottom:11px !important;
        font-size:9.2px !important;
    }

    body.warehouse-print-a5 .wi-table .wi-product{
        font-size:9.3px !important;
    }

    body.warehouse-print-a5 .wi-qty-value{
        font-size:10.5px !important;
    }

    body.warehouse-print-a5 .wi-money-number{
        font-size:8.2px !important;
    }

    body.warehouse-print-a5 .wi-summary{
        margin-top:13px !important;
        gap:10px !important;
    }

    body.warehouse-print-a5 .wi-note{
        min-height:72px !important;
        padding:11px !important;
        font-size:9px !important;
        line-height:1.8 !important;
    }

    body.warehouse-print-a5 .wi-total{
        min-height:72px !important;
        padding:11px !important;
    }

    body.warehouse-print-a5 .wi-total span{
        font-size:9.5px !important;
    }

    body.warehouse-print-a5 .wi-total strong{
        font-size:15px !important;
        line-height:1.45 !important;
    }

    body.warehouse-print-a5 .wi-total small{
        font-size:7px !important;
    }

    body.warehouse-print-a5 .wi-signatures{
        margin-top:38px !important;
        margin-bottom:27px !important;
        gap:42px !important;
    }

    body.warehouse-print-a5 .wi-signatures > div{
        min-height:48px !important;
        font-size:9px !important;
    }

    body.warehouse-print-a5 .wi-footer{
        margin-top:18px !important;
        padding-top:9px !important;
        font-size:7.5px !important;
        line-height:1.7 !important;
    }
}

/* =========================================================
   THSH CUSTOMER INVOICE — A4 PROFESSIONAL V1
   A4 only — A5 V7 remains untouched
   ========================================================= */

@media print {

    body.warehouse-print-a4 .wi-paper{
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        box-sizing:border-box !important;
        overflow:visible !important;
        padding:0 !important;
    }

    body.warehouse-print-a4 .wi-table-wrap{
        display:block !important;
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        overflow:visible !important;
    }

    body.warehouse-print-a4 .wi-table{
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        table-layout:fixed !important;
    }

    /* ---------- Header ---------- */

    body.warehouse-print-a4 .wi-header{
        grid-template-columns:1fr 1.15fr 1fr !important;
        gap:18px !important;
        padding:5px 4px 16px !important;
        align-items:center !important;
    }

    body.warehouse-print-a4 .wi-brand-en{
        font-size:32px !important;
        line-height:1 !important;
        letter-spacing:1.5px !important;
    }

    body.warehouse-print-a4 .wi-brand-fa{
        margin-top:7px !important;
        font-size:12px !important;
        line-height:1.4 !important;
    }

    body.warehouse-print-a4 .wi-title h1{
        margin-bottom:7px !important;
        font-size:25px !important;
        line-height:1.2 !important;
    }

    body.warehouse-print-a4 .wi-order-number{
        font-size:11px !important;
    }

    body.warehouse-print-a4 .wi-order-number strong{
        font-size:14px !important;
        padding:4px 9px !important;
    }

    body.warehouse-print-a4 .wi-meta{
        gap:8px !important;
    }

    body.warehouse-print-a4 .wi-meta > div{
        gap:8px !important;
        font-size:10.5px !important;
        line-height:1.6 !important;
    }

    /* ---------- Customer ---------- */

    body.warehouse-print-a4 .wi-customer{
        margin:14px 0 !important;
        padding:14px 16px !important;
        min-height:78px !important;
        gap:16px !important;
        align-items:center !important;
    }

    body.warehouse-print-a4 .wi-customer > div{
        gap:4px !important;
        font-size:10.5px !important;
        line-height:1.65 !important;
    }

    body.warehouse-print-a4 .wi-customer strong{
        font-size:13px !important;
        line-height:1.45 !important;
    }

    /* ---------- Product table ---------- */

    body.warehouse-print-a4 .wi-table th{
        padding:9px 5px !important;
        font-size:10px !important;
        line-height:1.35 !important;
    }

    body.warehouse-print-a4 .wi-table td{
        padding:12px 5px !important;
        font-size:10.5px !important;
        line-height:1.55 !important;
        vertical-align:middle !important;
        box-sizing:border-box !important;
    }

    body.warehouse-print-a4 .wi-table .wi-product{
        font-size:11px !important;
        font-weight:700 !important;
        line-height:1.5 !important;
    }

    body.warehouse-print-a4 .wi-qty-value{
        font-size:11.5px !important;
        font-weight:800 !important;
    }

    body.warehouse-print-a4 .wi-money{
        direction:ltr !important;
        text-align:center !important;
        white-space:normal !important;
    }

    body.warehouse-print-a4 .wi-money-number{
        display:block !important;
        direction:ltr !important;
        unicode-bidi:isolate !important;
        white-space:nowrap !important;
        font-size:10.5px !important;
        line-height:1.35 !important;
        font-weight:800 !important;
    }

    body.warehouse-print-a4 .wi-money-unit{
        display:block !important;
        margin-top:2px !important;
        font-size:7px !important;
        line-height:1.1 !important;
    }

    /* ---------- Summary ---------- */

    body.warehouse-print-a4 .wi-summary{
        grid-template-columns:1fr 230px !important;
        gap:12px !important;
        margin-top:15px !important;
    }

    body.warehouse-print-a4 .wi-note{
        min-height:82px !important;
        padding:13px 15px !important;
        gap:6px !important;
        font-size:10px !important;
        line-height:1.8 !important;
    }

    body.warehouse-print-a4 .wi-total{
        min-height:82px !important;
        padding:13px 15px !important;
        border-width:1.5px !important;
        display:flex !important;
        flex-direction:column !important;
        justify-content:center !important;
    }

    body.warehouse-print-a4 .wi-total span{
        font-size:10.5px !important;
    }

    body.warehouse-print-a4 .wi-total strong{
        font-size:18px !important;
        line-height:1.4 !important;
    }

    body.warehouse-print-a4 .wi-total small{
        font-size:8px !important;
    }

    /* ---------- Signatures ---------- */

    body.warehouse-print-a4 .wi-signatures{
        gap:70px !important;
        margin:35px 25px 26px !important;
    }

    body.warehouse-print-a4 .wi-signatures > div{
        min-height:55px !important;
        font-size:10px !important;
    }

    /* ---------- Footer ---------- */

    body.warehouse-print-a4 .wi-footer{
        margin-top:18px !important;
        padding-top:10px !important;
        font-size:8.5px !important;
        line-height:1.7 !important;
    }
}

/* =========================================================
   THSH CUSTOMER INVOICE — A4 BALANCED V3
   Compact customer / stronger product area
   A5 V7 untouched
   ========================================================= */

@media print {

    /* ---------- Header: compact but readable ---------- */

    body.warehouse-print-a4 .wi-header{
        grid-template-columns:1fr 1.15fr 1fr !important;
        gap:16px !important;
        padding:3px 4px 12px !important;
        align-items:center !important;
    }

    body.warehouse-print-a4 .wi-brand-en{
        font-size:34px !important;
        line-height:1 !important;
        letter-spacing:1.4px !important;
    }

    body.warehouse-print-a4 .wi-brand-fa{
        margin-top:5px !important;
        font-size:12px !important;
        line-height:1.35 !important;
    }

    body.warehouse-print-a4 .wi-title h1{
        margin-bottom:6px !important;
        font-size:27px !important;
        line-height:1.15 !important;
    }

    body.warehouse-print-a4 .wi-order-number{
        font-size:11px !important;
    }

    body.warehouse-print-a4 .wi-order-number strong{
        font-size:14px !important;
        padding:3px 8px !important;
    }

    body.warehouse-print-a4 .wi-meta{
        gap:5px !important;
    }

    body.warehouse-print-a4 .wi-meta > div{
        gap:6px !important;
        font-size:10.5px !important;
        line-height:1.35 !important;
    }

    /* ---------- Customer: deliberately compact ---------- */

    body.warehouse-print-a4 .wi-customer{
        margin:10px 0 12px !important;
        padding:8px 12px !important;
        min-height:0 !important;
        gap:8px !important;
        align-items:center !important;
    }

    body.warehouse-print-a4 .wi-customer > div{
        gap:1px !important;
        font-size:9.5px !important;
        line-height:1.35 !important;
    }

    body.warehouse-print-a4 .wi-customer strong{
        font-size:11.5px !important;
        line-height:1.3 !important;
    }

    /* ---------- Product table gets visual priority ---------- */

    body.warehouse-print-a4 .wi-table-wrap{
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        overflow:visible !important;
    }

    body.warehouse-print-a4 .wi-table{
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        table-layout:fixed !important;
    }

    body.warehouse-print-a4 .wi-table th{
        padding-top:9px !important;
        padding-bottom:9px !important;
        font-size:11px !important;
        line-height:1.3 !important;
    }

    body.warehouse-print-a4 .wi-table td{
        padding-top:12px !important;
        padding-bottom:12px !important;
        padding-left:4px !important;
        padding-right:4px !important;
        font-size:11px !important;
        line-height:1.5 !important;
        vertical-align:middle !important;
        box-sizing:border-box !important;
    }

    body.warehouse-print-a4 .wi-table .wi-product{
        font-size:11.5px !important;
        font-weight:700 !important;
        line-height:1.45 !important;
    }

    body.warehouse-print-a4 .wi-qty-value{
        font-size:12px !important;
        font-weight:800 !important;
    }

    body.warehouse-print-a4 .wi-money{
        direction:ltr !important;
        text-align:center !important;
        white-space:normal !important;
    }

    body.warehouse-print-a4 .wi-money-number{
        display:block !important;
        direction:ltr !important;
        unicode-bidi:isolate !important;
        white-space:nowrap !important;
        font-size:11px !important;
        line-height:1.3 !important;
        font-weight:800 !important;
    }

    body.warehouse-print-a4 .wi-money-unit{
        display:block !important;
        margin-top:2px !important;
        direction:rtl !important;
        font-size:7px !important;
        line-height:1 !important;
    }

    /* ---------- Summary ---------- */

    body.warehouse-print-a4 .wi-summary{
        grid-template-columns:1fr 245px !important;
        gap:12px !important;
        margin-top:13px !important;
    }

    body.warehouse-print-a4 .wi-note{
        min-height:74px !important;
        padding:11px 13px !important;
        gap:4px !important;
        font-size:10px !important;
        line-height:1.65 !important;
    }

    body.warehouse-print-a4 .wi-total{
        min-height:74px !important;
        padding:11px 13px !important;
        border-width:1.5px !important;
        display:flex !important;
        flex-direction:column !important;
        justify-content:center !important;
    }

    body.warehouse-print-a4 .wi-total span{
        font-size:10.5px !important;
    }

    body.warehouse-print-a4 .wi-total strong{
        font-size:19px !important;
        line-height:1.35 !important;
    }

    body.warehouse-print-a4 .wi-total small{
        font-size:8px !important;
    }

    /* ---------- Signatures ---------- */

    body.warehouse-print-a4 .wi-signatures{
        gap:75px !important;
        margin:30px 25px 22px !important;
    }

    body.warehouse-print-a4 .wi-signatures > div{
        min-height:48px !important;
        font-size:10px !important;
    }

    /* ---------- Footer ---------- */

    body.warehouse-print-a4 .wi-footer{
        margin-top:14px !important;
        padding-top:9px !important;
        font-size:8.5px !important;
        line-height:1.55 !important;
    }
}


/* THSH CONTROL CENTER NOTIFICATIONS V1 */

.erp-notification-wrap {
    position: relative;
}

.erp-notification-button {
    position: relative;
}

.erp-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    border: 2px solid var(--erp-surface, #fff);
    font-size: 10px;
    font-weight: 800;
    line-height: 14px;
    text-align: center;
}

.erp-notification-panel {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: min(390px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 110px));
    overflow: hidden;
    z-index: 1200;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow:
        0 20px 45px rgba(15, 23, 42, .14),
        0 4px 12px rgba(15, 23, 42, .06);
    direction: rtl;
}

.erp-notification-panel[hidden] {
    display: none !important;
}

.erp-notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef0f3;
}

.erp-notification-head strong {
    font-size: 14px;
    color: #111827;
}

.erp-notification-head span {
    font-size: 11px;
    color: #6b7280;
}

.erp-notification-list {
    max-height: 490px;
    overflow-y: auto;
}

.erp-notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 15px;
    border-bottom: 1px solid #f1f3f5;
    background: #fff;
}

.erp-notification-item:last-child {
    border-bottom: 0;
}

.erp-notification-item.is-unread {
    background: #f8fbff;
}

.erp-notification-item.is-unread::before {
    content: "";
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2563eb;
}

.erp-notification-item.is-important {
    border-right: 3px solid #111827;
}

.erp-notification-item-main {
    flex: 1;
    min-width: 0;
}

.erp-notification-item-main strong {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #111827;
}

.erp-notification-item-main p {
    margin: 0 0 5px;
    color: #4b5563;
    font-size: 11px;
    line-height: 1.8;
}

.erp-notification-item-main small {
    display: block;
    color: #9ca3af;
    font-size: 9px;
}

.erp-notification-item-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    flex: 0 0 auto;
}

.erp-notification-open,
.erp-notification-read {
    min-width: 56px;
    padding: 5px 8px;
    border-radius: 7px;
    font-family: inherit;
    font-size: 10px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
}

.erp-notification-open {
    color: #fff;
    background: #111827;
    border: 1px solid #111827;
}

.erp-notification-read {
    color: #374151;
    background: #fff;
    border: 1px solid #d1d5db;
}

.erp-notification-empty {
    padding: 28px 18px;
    text-align: center;
    color: #6b7280;
    font-size: 12px;
}

@media (max-width: 700px) {
    .erp-notification-panel {
        position: fixed;
        top: 72px;
        left: 16px;
        right: 16px;
        width: auto;
        max-height: calc(100vh - 92px);
    }
}

