:root {
    --gd-font: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
    --gd-primary: #0F52BA;
    --gd-primary-dark: #0D4499;
    --gd-accent: #0D9488;
    --gd-accent-light: #14B8A6;
    --gd-success: #10B981;
    --gd-warning: #F59E0B;
    --gd-danger: #EF4444;
    --gd-info: #06B6D4;
    --gd-bg: #F8FAFC;
    --gd-surface: #FFFFFF;
    --gd-border: #E2E8F0;
    --gd-text: #1E293B;
    --gd-muted: #64748B;
    --gd-sidebar-bg: #1E293B;
    --gd-sidebar-text: #CBD5E1;
    --gd-sidebar-hover: rgba(255, 255, 255, 0.06);
    --gd-sidebar-active-bg: rgba(15, 82, 186, 0.25);
    --gd-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --gd-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --gd-radius: 10px;
    --gd-radius-lg: 12px;
    --gd-sidebar-width: 260px;
    --gd-header-height: 64px;
    --gd-header-control-height: 40px;
    --bs-font-sans-serif: var(--gd-font);
    --bs-body-font-family: var(--gd-font);
    --bs-primary: var(--gd-primary);
    --bs-primary-rgb: 15, 82, 186;
    --bs-secondary: #64748B;
    --bs-secondary-rgb: 100, 116, 139;
    --bs-success: #10B981;
    --bs-success-rgb: 16, 185, 129;
    --bs-warning: #F59E0B;
    --bs-warning-rgb: 245, 158, 11;
    --bs-danger: #EF4444;
    --bs-danger-rgb: 239, 68, 68;
    --bs-body-bg: #F8FAFC;
    --bs-body-color: #1E293B;
    --bs-dark: #1E293B;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--gd-bg);
    color: var(--gd-text);
    font-family: var(--gd-font);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
}

.text-muted { color: var(--gd-muted) !important; }

/* ── App Shell ── */
.gd-app {
    display: flex;
    min-height: 100vh;
}

.gd-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.gd-content {
    flex: 1;
    padding: 1.5rem 2rem 2.5rem;
}

.gd-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 41, 59, 0.5);
    z-index: 1040;
}

/* ── Sidebar ── */
.gd-sidebar {
    width: var(--gd-sidebar-width);
    min-width: var(--gd-sidebar-width);
    background: var(--gd-sidebar-bg);
    color: var(--gd-sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1050;
    overflow-y: auto;
}

.gd-sidebar-brand {
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gd-brand {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.gd-brand:hover {
    color: #fff;
    opacity: 0.92;
}

.gd-brand-mark {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: block;
}

.gd-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    line-height: 1.2;
}

.gd-brand-name {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.gd-brand-tagline {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(203, 213, 225, 0.85);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gd-brand--lg .gd-brand-mark {
    width: 44px;
    height: 44px;
}

.gd-brand--lg .gd-brand-name {
    font-size: 1.35rem;
    color: var(--gd-text);
}

.gd-brand--lg .gd-brand-tagline {
    font-size: 0.75rem;
    color: var(--gd-muted);
    text-transform: none;
    letter-spacing: 0.02em;
}

.gd-sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gd-nav-section {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(203, 213, 225, 0.5);
    padding: 0.75rem 0.75rem 0.375rem;
    margin-top: 0.5rem;
}

.gd-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--gd-radius);
    color: var(--gd-sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    border-inline-end: 3px solid transparent;
}

.gd-nav-item i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    opacity: 0.75;
}

.gd-nav-item:hover {
    background: var(--gd-sidebar-hover);
    color: #fff;
}

.gd-nav-item.active {
    background: var(--gd-sidebar-active-bg);
    color: #fff;
    border-inline-end-color: var(--gd-primary);
    box-shadow: 0 0 12px rgba(15, 82, 186, 0.15);
}

.gd-nav-item.active i { opacity: 1; }

.gd-sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Header ── */
.gd-header {
    height: var(--gd-header-height);
    background: var(--gd-surface);
    border-bottom: 1px solid var(--gd-border);
    box-shadow: var(--gd-shadow-sm);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.gd-header-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gd-text);
    font-size: 1.35rem;
    padding: 0.25rem;
    cursor: pointer;
    line-height: 1;
}

.gd-search {
    flex: 1;
    max-width: 420px;
    position: relative;
    display: flex;
    align-items: center;
}

.gd-search i {
    position: absolute;
    inset-inline-start: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gd-muted);
    pointer-events: none;
}

.gd-search input {
    width: 100%;
    height: var(--gd-header-control-height);
    padding: 0 1rem 0 2.5rem;
    border: 1px solid var(--gd-border);
    border-radius: var(--gd-radius);
    background: var(--gd-bg);
    font-family: var(--gd-font);
    font-size: 0.875rem;
    line-height: 1.25;
    color: var(--gd-text);
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

[dir="rtl"] .gd-search input {
    padding: 0 2.5rem 0 1rem;
}

.gd-search input:focus {
    outline: none;
    border-color: var(--gd-primary);
    box-shadow: 0 0 0 3px rgba(15, 82, 186, 0.12);
    background: var(--gd-surface);
}

.gd-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-inline-start: auto;
    flex-shrink: 0;
}

.gd-header-actions > .dropdown {
    display: flex;
    align-items: center;
}

.gd-icon-btn {
    width: var(--gd-header-control-height);
    height: var(--gd-header-control-height);
    box-sizing: border-box;
    flex-shrink: 0;
    border-radius: var(--gd-radius);
    border: 1px solid var(--gd-border);
    background: var(--gd-surface);
    color: var(--gd-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.gd-icon-btn:hover {
    background: var(--gd-bg);
    color: var(--gd-text);
}

.gd-icon-btn .gd-notif-dot {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    width: 8px;
    height: 8px;
    background: var(--gd-danger);
    border-radius: 50%;
    border: 2px solid var(--gd-surface);
}

.gd-icon-btn.dropdown-toggle::after {
    display: none;
}

.gd-user-menu .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: var(--gd-header-control-height);
    padding: 0 0.625rem;
    border: 1px solid var(--gd-border);
    border-radius: var(--gd-radius);
    background: var(--gd-surface);
    color: var(--gd-text);
    font-family: var(--gd-font);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    box-sizing: border-box;
    cursor: pointer;
    text-decoration: none;
}

.gd-user-menu .dropdown-toggle::after { margin-inline-start: 0.25rem; }

.gd-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gd-primary), var(--gd-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.gd-notif-dropdown .dropdown-item {
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
}

.gd-notif-dropdown .dropdown-item small {
    display: block;
    color: var(--gd-muted);
    margin-top: 0.125rem;
}

/* ── Page Header ── */
.gd-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.gd-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--gd-text);
}

.gd-page-header .gd-page-subtitle {
    color: var(--gd-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.gd-page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ── Cards ── */
.gd-card {
    background: var(--gd-surface);
    border: 1px solid var(--gd-border);
    border-radius: var(--gd-radius-lg);
    box-shadow: var(--gd-shadow-sm);
}

.gd-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gd-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.gd-card-header i {
    color: var(--gd-primary);
}

.gd-card-header .btn i {
    color: inherit;
}

.gd-card-body {
    padding: 1.25rem;
}

.card {
    border-color: var(--gd-border);
    border-radius: var(--gd-radius-lg);
    box-shadow: var(--gd-shadow-sm);
}

/* ── KPI Cards ── */
.kpi-card,
.gd-kpi-card {
    background: var(--gd-surface);
    border: 1px solid var(--gd-border);
    border-radius: var(--gd-radius-lg);
    padding: 1.25rem;
    height: 100%;
    box-shadow: var(--gd-shadow-sm);
    transition: box-shadow 0.15s;
}

.kpi-card:hover,
.gd-kpi-card:hover {
    box-shadow: var(--gd-shadow-md);
}

.kpi-card .kpi-label,
.gd-kpi-card .kpi-label {
    color: var(--gd-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.kpi-card .kpi-value,
.gd-kpi-card .kpi-value {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
}

.kpi-card .kpi-footer,
.gd-kpi-card .kpi-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
}

.gd-kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
}

.gd-kpi-trend.up {
    color: var(--gd-success);
    background: rgba(16, 185, 129, 0.1);
}

.gd-kpi-trend.down {
    color: var(--gd-danger);
    background: rgba(239, 68, 68, 0.1);
}

.gd-kpi-trend.neutral {
    color: var(--gd-muted);
    background: rgba(100, 116, 139, 0.1);
}

.kpi-card.success .kpi-value,
.gd-kpi-card.success .kpi-value { color: var(--gd-success); }
.kpi-card.warning .kpi-value,
.gd-kpi-card.warning .kpi-value { color: var(--gd-warning); }
.kpi-card.danger .kpi-value,
.gd-kpi-card.danger .kpi-value { color: var(--gd-danger); }
.kpi-card.info .kpi-value,
.gd-kpi-card.info .kpi-value { color: var(--gd-accent); }
.kpi-card.accent .kpi-value,
.gd-kpi-card.accent .kpi-value { color: var(--gd-accent-light); }

.gd-kpi-card.hero {
    padding: 1.5rem;
}

.gd-kpi-card.hero .kpi-value {
    font-size: 1.375rem;
}

/* ── Tables ── */
.gd-table-wrap {
    overflow-x: auto;
    border-radius: var(--gd-radius-lg);
}

.gd-table,
.table.gd-table {
    width: 100%;
    margin-bottom: 0;
    line-height: 1.4;
}

.gd-table thead th,
.table.gd-table thead th {
    background: var(--gd-bg);
    color: var(--gd-muted);
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gd-border);
    white-space: nowrap;
}

.gd-table tbody td,
.table.gd-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gd-border);
    vertical-align: middle;
    font-size: 0.875rem;
}

.gd-table.table-striped > tbody > tr:nth-of-type(odd),
.table.gd-table.table-striped > tbody > tr:nth-of-type(odd) {
    background: rgba(248, 250, 252, 0.6);
}

.gd-table tbody tr:hover,
.table.gd-table tbody tr:hover {
    background: rgba(15, 82, 186, 0.04);
}

.gd-table tbody tr:last-child td {
    border-bottom: none;
}

.table th { color: var(--gd-muted); font-weight: 600; }

/* ── Badges ── */
.gd-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.gd-badge.verified,
.gd-badge.active {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.gd-badge.pending,
.gd-badge.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #D97706;
}

.gd-badge.inactive,
.gd-badge.stopped {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.gd-badge.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #DC2626;
}

.gd-badge.info {
    background: rgba(13, 148, 136, 0.12);
    color: #0F766E;
}

/* ── Buttons ── */
.btn-primary,
.gd-btn-primary {
    background: linear-gradient(135deg, var(--gd-primary), var(--gd-primary-dark));
    border-color: var(--gd-primary-dark);
    color: #fff;
    border-radius: var(--gd-radius);
    font-weight: 600;
    font-family: var(--gd-font);
    box-shadow: 0 1px 2px rgba(15, 82, 186, 0.2);
    transition: transform 0.1s, box-shadow 0.15s;
}

.btn-primary:hover,
.gd-btn-primary:hover {
    background: linear-gradient(135deg, var(--gd-primary-dark), #0A3D8F);
    border-color: #0A3D8F;
    color: #fff;
    box-shadow: 0 2px 6px rgba(15, 82, 186, 0.3);
}

.btn-primary:active,
.gd-btn-primary:active {
    transform: translateY(1px);
}

.btn-outline-primary {
    color: var(--gd-primary);
    border-color: var(--gd-primary);
    border-radius: var(--gd-radius);
    font-weight: 500;
    font-family: var(--gd-font);
}

.btn-outline-primary:hover {
    background: var(--gd-primary);
    border-color: var(--gd-primary);
    color: #fff;
}

.btn-outline-secondary,
.btn-outline-warning,
.btn-outline-danger {
    border-radius: var(--gd-radius);
    font-family: var(--gd-font);
}

.bg-primary { background-color: var(--gd-primary) !important; }

/* ── Alerts ── */
.gd-alert {
    border-radius: var(--gd-radius);
    border: none;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.alert-success.gd-alert { background: rgba(16, 185, 129, 0.1); color: #065F46; }
.alert-danger.gd-alert { background: rgba(239, 68, 68, 0.1); color: #991B1B; }
.alert-warning.gd-alert { background: rgba(245, 158, 11, 0.1); color: #92400E; }

/* ── Forms ── */
.form-control,
.form-select {
    border-radius: var(--gd-radius);
    border-color: var(--gd-border);
    font-family: var(--gd-font);
    font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gd-primary);
    box-shadow: 0 0 0 3px rgba(15, 82, 186, 0.12);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gd-text);
}

/* ── Funnel ── */
.funnel-step {
    background: var(--gd-surface);
    border: 1px solid var(--gd-border);
    border-radius: var(--gd-radius);
    padding: 1rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.copy-btn { cursor: pointer; }

/* ── Login ── */
.gd-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gd-bg);
    padding: 1.5rem;
}

.gd-login-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}

.gd-login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.gd-login-logo .gd-brand--lg:hover {
    opacity: 1;
}

/* ── Persian datepicker ── */
.datepicker-container {
    z-index: 1060 !important;
    font-family: var(--gd-font);
}

.gd-persian-date-display {
    text-align: start;
    direction: ltr;
}

.gd-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--gd-border);
}

.gd-filter-clear {
    color: var(--gd-muted);
    font-size: 0.875rem;
    text-decoration: none;
}

.gd-filter-clear:hover {
    color: var(--gd-primary);
    text-decoration: underline;
}

/* ── Pagination ── */
.pagination .page-link {
    border-radius: var(--gd-radius);
    font-family: var(--gd-font);
    color: var(--gd-primary);
}

/* ── Mobile ── */
@media (max-width: 991.98px) {
    .gd-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        inset-inline-start: 0;
        inset-inline-end: auto;
        height: 100vh;
        max-width: min(var(--gd-sidebar-width), 85vw);
        transform: translateX(100%);
        transition: transform 0.25s ease;
        box-shadow: -4px 0 24px rgba(15, 23, 42, 0.2);
    }

    .gd-sidebar.is-open {
        transform: translateX(0);
    }

    .gd-sidebar-backdrop.is-visible {
        display: block;
    }

    .gd-main {
        width: 100%;
        flex: 1 1 auto;
    }

    .gd-header-toggle {
        display: flex;
    }

    .gd-content {
        padding: 1rem;
    }

    .gd-search {
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .gd-header-actions .gd-user-name {
        display: none;
    }

    .gd-page-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ── Sales: availability calendar ── */
.availability-filters {
    margin-bottom: 1.5rem;
}

.month-panel {
    background: var(--gd-surface);
    border: 1px solid var(--gd-border);
    border-radius: var(--gd-radius-lg);
    box-shadow: var(--gd-shadow-sm);
    margin-bottom: 1rem;
    overflow: hidden;
}

.month-panel-header {
    background: var(--gd-sidebar-bg);
    color: #fff;
    padding: 0;
    font-weight: 600;
}

.month-panel-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: inherit;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
}

.month-panel-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.month-panel-toggle .bi-chevron-down {
    flex-shrink: 0;
    opacity: 0.85;
    transition: transform 0.2s ease;
}

.month-panel-toggle[aria-expanded="false"] .bi-chevron-down {
    transform: rotate(-90deg);
}

.month-panel-report-link {
    flex-shrink: 0;
    margin: 0.35rem 1rem;
}

.allocation-summary .allocation-stat .gd-card-body {
    padding: 1rem 1.25rem;
}

.allocation-stat-label {
    font-size: 0.85rem;
    color: var(--gd-text-muted);
    margin-bottom: 0.25rem;
}

.allocation-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.allocation-stat--negative .allocation-stat-value {
    color: var(--bs-danger);
}

.allocation-stat--positive .allocation-stat-value {
    color: var(--bs-success);
}

.allocation-section-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gd-border);
    background: var(--gd-bg);
}

.allocation-section-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--gd-text);
    line-height: 1;
    text-align: start;
    cursor: pointer;
}

.allocation-section-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

.allocation-section-toggle .h6 {
    flex: 1;
    font-weight: 600;
}

.allocation-section-toggle .bi-chevron-down {
    flex-shrink: 0;
    color: var(--gd-text-muted);
    transition: transform 0.2s ease;
}

.allocation-section-toggle[aria-expanded="false"] .bi-chevron-down {
    transform: rotate(-90deg);
}

.allocation-daily-table td,
.allocation-daily-table th {
    white-space: nowrap;
}

.allocation-order-week-table {
    font-size: 0.8rem;
}

.allocation-order-week-table thead th {
    text-align: center;
    background: var(--gd-bg);
    vertical-align: middle;
}

.allocation-order-week-table .allocation-order-col {
    min-width: 8rem;
    white-space: normal !important;
}

.allocation-order-week-table .allocation-order-type-cell {
    white-space: normal !important;
    min-width: 5.5rem;
    vertical-align: middle;
}

.allocation-order-week-table .allocation-kw-summary-col {
    min-width: 6.5rem;
    white-space: normal !important;
}

.allocation-order-week-table .allocation-kw-summary-cell {
    white-space: normal !important;
    vertical-align: middle;
    min-width: 6.5rem;
    padding: 0.35rem 0.4rem;
}

.allocation-kw-summary-daily {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.2rem 0.35rem;
}

.allocation-kw-summary-budget {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    line-height: 1.3;
}

.allocation-order-week-table .allocation-week-col {
    min-width: 5.5rem;
}

.allocation-week-header {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.allocation-week-col-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 1px solid var(--gd-border);
    border-radius: 3px;
    background: #fff;
    color: var(--gd-text-muted);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
}

.allocation-week-col-toggle:hover {
    color: var(--gd-primary);
    border-color: var(--gd-primary);
    background: rgba(13, 110, 253, 0.08);
}

.allocation-order-week-table .allocation-week-cell {
    white-space: normal !important;
    vertical-align: top;
    min-width: 5.5rem;
    padding: 0.35rem 0.25rem;
}

.allocation-order-week-table .allocation-order-week-total-row td {
    background: var(--gd-bg);
    border-top: 2px solid var(--gd-border);
    vertical-align: middle;
}

.allocation-order-week-table .allocation-order-week-total-row .allocation-week-sum-kw {
    font-variant-numeric: tabular-nums;
}

.allocation-week-day-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.allocation-week-day-merged-view {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.allocation-week-day-detail-view {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.allocation-week-day-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    font-size: 0.7rem;
    line-height: 1.3;
    margin-bottom: 2px;
    padding: 1px 4px;
    border-radius: 3px;
}

.allocation-week-day-chip:last-child {
    margin-bottom: 0;
}

.allocation-week-day-num {
    font-weight: 700;
}

.allocation-week-day-kw {
    direction: ltr;
    unicode-bidi: isolate;
    font-weight: 600;
}

.allocation-week-day-chip--full-month {
    color: #084298;
    background: rgba(13, 110, 253, 0.1);
}

.allocation-week-day-chip--partial {
    color: #664d03;
    background: rgba(255, 193, 7, 0.22);
    border: 1px dashed #ffc107;
}

.allocation-week-day-chip--partial-month {
    color: #856404;
    background: rgba(255, 193, 7, 0.15);
}

.allocation-customers-cell {
    white-space: normal !important;
    min-width: 12rem;
}

.allocation-customer-badge {
    display: inline-block;
    background: var(--gd-bg);
    border: 1px solid var(--gd-border);
    border-radius: var(--gd-radius-sm);
    padding: 0.15rem 0.45rem;
    margin: 0.1rem 0.15rem 0.1rem 0;
    font-size: 0.8rem;
}

.allocation-row--over {
    background-color: rgba(var(--bs-danger-rgb), 0.08) !important;
}

.allocation-row--empty td {
    color: var(--gd-text-muted);
}

.allocation-row--min {
    background-color: rgba(var(--bs-primary-rgb), 0.08) !important;
}

.day-cell.is-min-supply {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

.day-cell.week-uniform-min {
    background-color: rgba(var(--bs-success-rgb), 0.15) !important;
}

tr.supply-week-row--uniform-min {
    background-color: rgba(var(--bs-success-rgb), 0.06);
}

.availability-week-table {
    font-size: 0.8rem;
}

.availability-week-table thead th {
    text-align: center;
    background: var(--gd-bg);
    white-space: nowrap;
}

.availability-week-table .week-col {
    width: 3rem;
    text-align: center;
    vertical-align: middle;
    background: var(--gd-bg);
}

.availability-week-table td.day-cell {
    text-align: center;
    vertical-align: middle;
    min-width: 5.5rem;
    padding: 0.35rem 0.2rem;
}

.day-cell--empty {
    background: #f1f3f5;
}

.day-cell {
    font-size: 0.75rem;
    background: #fafbfc;
}

.day-cell.has-kw {
    background: #d4edda;
    border-color: #b8dfc4;
}

.day-cell.is-today {
    outline: 2px solid var(--gd-primary);
    outline-offset: 1px;
}

.day-cell .day-num {
    font-weight: 700;
    display: block;
}

.day-cell .day-stat {
    direction: ltr;
    unicode-bidi: isolate;
    display: block;
    line-height: 1.25;
    margin-top: 1px;
}

.day-cell .day-stat--supply {
    font-weight: 600;
    color: #155724;
}

.day-cell .day-stat--sold {
    font-size: 0.65rem;
    color: #856404;
}

.day-cell .day-stat--full-month {
    font-size: 0.65rem;
    color: #084298;
}

.day-cell--final {
    min-width: 6.5rem;
    text-align: right;
}

.day-cell--final .day-num {
    text-align: center;
}

.day-order {
    display: block;
    font-size: 0.6rem;
    line-height: 1.3;
    margin-top: 2px;
    padding: 1px 3px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-order-name {
    display: inline;
}

.day-order-kw {
    direction: ltr;
    unicode-bidi: isolate;
    font-weight: 600;
    margin-inline-start: 2px;
}

.day-order--partial {
    color: #856404;
    background: rgba(255, 193, 7, 0.15);
}

.day-order--full-month {
    color: #084298;
    background: rgba(13, 110, 253, 0.1);
}

.day-order--full-month-partial {
    color: #664d03;
    background: rgba(255, 193, 7, 0.22);
    border: 1px dashed #ffc107;
}

.day-cell .day-stat--remaining {
    font-size: 0.65rem;
    font-weight: 600;
    color: #0c5460;
}

.day-cell.over-sold {
    background: #f8d7da !important;
    border-color: #f1aeb5 !important;
}

.day-cell.over-sold.is-today {
    outline-color: var(--gd-danger);
}

.day-cell .day-stat--remaining.is-negative {
    color: #b02a37;
    background: #f5c2c7;
    border-radius: 3px;
    padding: 0 2px;
    margin-top: 2px;
}

.day-cell .day-unit {
    font-size: 0.6rem;
    font-weight: 500;
    opacity: 0.85;
}

.day-cell.zero-kw .day-stat--supply {
    color: #adb5bd;
    font-weight: 400;
}

/* ── Sales: legacy persian date input ── */
.persian-date-input + .datepicker-container,
.datepicker-plot-area,
.pwt-datepicker-container,
.pwt-btn {
    font-family: var(--gd-font) !important;
}
