/* ==========================================================================
   Modern SaaS Dashboard Stylesheet (Section 1: Overview - 1:1 Figma Design)
   ========================================================================== */



/* Base resets & global wrapper */
.content-wrapper {
    background-color: var(--dash-bg) !important;
    font-family: var(--dash-font);
}

.content-custom {
    padding: 16px 20px 30px !important;
}

/* --------------------------------------------------------------------------
   Header & Actions
   -------------------------------------------------------------------------- */
.dash-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.dash-overview-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dash-heading);
    margin: 0;
    letter-spacing: -0.2px;
}

.dash-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-location-wrapper {
    min-width: 170px;
}

.dash-location-wrapper .select2-container .select2-selection--single {
    height: 32px;
    border: 1px solid var(--dash-border-input) !important;
    border-radius: var(--dash-radius-lg) !important;
    background-color: var(--dash-surface);
    display: flex;
    align-items: center;
}

.dash-location-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--dash-heading);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 30px;
    padding-left: 10px;
}

.btn-modern-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--dash-blue-action);
    color: #ffffff !important;
    border: none;
    border-radius: var(--dash-radius-lg);
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 144, 255, 0.2);
    text-decoration: none !important;
    height: 32px;
}

.btn-modern-refresh:hover {
    background: var(--dash-blue-action-hover);
    color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(0, 144, 255, 0.25);
}

.btn-modern-refresh:active {
    transform: translateY(0);
}

.btn-modern-refresh i.spinning,
.btn-modern-refresh i.fa-spin {
    animation: dash-spin 0.8s linear infinite;
}

@keyframes dash-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-modern-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--dash-surface);
    color: var(--dash-body) !important;
    border: 1px solid var(--dash-border-input);
    border-radius: var(--dash-radius-lg);
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    height: 32px;
}

.btn-modern-filter:hover {
    background: var(--dash-surface-sub);
    border-color: #cbd5e1;
    color: var(--dash-heading) !important;
}

.btn-modern-filter i {
    color: var(--dash-body);
    font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   3-Column Overview Main Grid (Frame 67)
   -------------------------------------------------------------------------- */
.dash-main-grid {
    display: grid;
    grid-template-columns: 510fr 414fr 414fr;
    gap: 14px;
    margin-bottom: 20px;
    align-items: stretch;
}

@media (max-width: 1300px) {
    .dash-main-grid {
        grid-template-columns: 1.25fr 1fr 1fr;
    }
}

@media (max-width: 1100px) {
    .dash-main-grid {
        grid-template-columns: 1fr 1fr;
    }
    .dash-col-1 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .dash-main-grid {
        grid-template-columns: 1fr;
    }
    .dash-col-1 {
        grid-column: span 1;
    }
}

/* --------------------------------------------------------------------------
   Shared Typography & Reusable Card Styles
   -------------------------------------------------------------------------- */
.dash-card-outer,
.dash-sales-outer,
.dash-purchases-outer,
.dash-expense-outer {
    background: #ffffff;
    border-radius: 6px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 315px;
    height: 315px;
}

.dash-title-gray {
    font-weight: 400;
    font-size: 18px;
    line-height: 18px;
    color: var(--dash-text-secondary);
    margin: 0;
}

.dash-info-icon-gray {
    width: 16px;
    height: 16px;
    color: var(--dash-text-muted);
    cursor: pointer;
    font-size: 14px;
}

.dash-val-26-dark {
    font-weight: 700;
    font-size: 20px;
    line-height: 26px;
    color: var(--dash-text-primary);
    font-feature-settings: "tnum";
}

.dash-val-26-green {
    font-weight: 700;
    font-size: 26px;
    line-height: 26px;
    color: var(--dash-green-bold);
    font-feature-settings: "tnum";
}

.dash-val-26-red {
    font-weight: 700;
    font-size: 26px;
    line-height: 26px;
    color: var(--dash-red-primary);
    font-feature-settings: "tnum";
}

.dash-icon-badge {
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    flex-shrink: 0;
}

.badge-bg-green {
    background: var(--dash-green-surface);
    color: var(--dash-green-bright);
}

.badge-bg-coral {
    background: var(--dash-red-surface);
    color: var(--dash-red-primary);
}

.badge-bg-orange {
    background: var(--dash-orange-surface);
    color: var(--dash-orange-primary);
}

.badge-bg-red {
    background: var(--dash-red-surface-soft);
    color: var(--dash-red-primary);
    border-radius: 4px;
}

.badge-bg-blue {
    background: var(--dash-blue-surface);
    color: var(--dash-blue-primary);
}

/* --------------------------------------------------------------------------
   COLUMN 1: Total Sales Outer Frame (Frame 36)
   -------------------------------------------------------------------------- */
.dash-sales-outer {
    padding: 13px 16px;
}

.dash-sales-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.dash-sales-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 18px;
    width: 100%;
}

.dash-sales-highlight {
    background: var(--dash-surface-sub);
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    box-sizing: border-box;
}

.dash-stat-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.dash-badge-growth {
    font-weight: 400;
    font-size: 14px;
    line-height: 14px;
    color: var(--dash-green-bright);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.dash-badge-growth i {
    font-size: 11px;
}

.dash-date-text {
    font-weight: 300;
    font-size: 12px;
    line-height: 12px;
    color: var(--dash-text-muted);
}

.dash-sales-legend {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    height: 10px;
    margin-top: 6px;
    opacity: 0.8;
}

.legend-item-sales {
    font-weight: 400;
    font-size: 10px;
    line-height: 10px;
    color: var(--dash-green-legend);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.legend-item-return {
    font-weight: 400;
    font-size: 10px;
    line-height: 10px;
    color: var(--dash-red-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.legend-dot-green {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--dash-green-legend);
    display: inline-block;
}

.legend-dot-red {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--dash-red-primary);
    display: inline-block;
}

.dash-chart-area {
    position: relative;
    width: 100%;
    height: 140px;
    margin-top: 4px;
    display: flex;
    align-items: flex-end;
}

.dash-svg-full {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Tooltip Pins (Frame 24 & Frame 23) */
.figma-pin-return {
    position: absolute;
    left: 33.5%;
    top: 85.7%;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.1));
    z-index: 2;
    pointer-events: none;
    transition: left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.figma-pin-sales {
    position: absolute;
    left: 65%;
    top: 85.7%;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.1));
    z-index: 2;
    pointer-events: none;
    transition: left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pin-badge-red {
    background: var(--dash-red-primary);
    border-radius: 4px;
    padding: 3px 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pin-badge-dark {
    background: var(--dash-text-primary);
    border-radius: 4px;
    padding: 3px 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pin-label-white {
    font-weight: 500;
    font-size: 8px;
    line-height: 8px;
    color: #ffffff;
    white-space: nowrap;
}

.pin-white-box {
    background: #ffffff;
    border-radius: 3px;
    padding: 2px 4px;
    text-align: center;
}

.pin-val-red {
    font-weight: 700;
    font-size: 9.5px;
    line-height: 10px;
    color: var(--dash-red-primary);
}

.pin-val-dark {
    font-weight: 700;
    font-size: 9.5px;
    line-height: 10px;
    color: var(--dash-text-primary);
}

.pin-arrow-red {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--dash-red-primary);
}

.pin-arrow-dark {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--dash-text-primary);
}

/* --------------------------------------------------------------------------
   COLUMN 2: Total Purchases Outer Frame (Frame 63)
   -------------------------------------------------------------------------- */
.dash-purchases-outer {
    padding: 12px 13px 13px;
    gap: 10px;
}

.dash-purchases-top-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 10px 13px;
    gap: 10px;
    width: 100%;
    height: 140px;
    border: 1px solid #f3f3f3;
    border-radius: 6px;
    background: #ffffff;
}

.dash-card-header-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 28px;
}

.dash-green-highlight-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 14px;
    gap: 5px;
    width: 100%;
    height: 73px;
    background: #e6fbe6;
    border-radius: 6px;
    box-sizing: border-box;
}

.dash-subtext-green {
    font-weight: 300;
    font-size: 12px;
    line-height: 12px;
    color: #699884;
}

.dash-purchases-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    height: 140px;
}

.dash-purchases-subcard {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 10px 9px;
    gap: 8px;
    height: 140px;
    border: 1px solid #f4f4f4;
    border-radius: 4px;
    background: #ffffff;
    justify-content: space-between;
}

.dash-subcard-title-gray {
    font-weight: 400;
    font-size: 18px;
    line-height: 18px;
    color: var(--dash-text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.dash-amount-icon-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 28px;
}

.dash-divider-line {
    width: 100%;
    height: 0px;
    border-top: 0.6px solid #f4f4f4;
    margin: 2px 0;
}

.dash-bullets-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dash-bullet-item {
    font-weight: 300;
    font-size: 10px;
    line-height: 10px;
    color: var(--dash-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 3px;
}

.bullet-dot-sm {
    font-size: 8px;
}

/* --------------------------------------------------------------------------
   COLUMN 3: Expense Outer Frame (Frame 66)
   -------------------------------------------------------------------------- */
.dash-expense-outer {
    padding: 12px 13px 13px;
    gap: 10px;
}

.dash-expense-top-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 10px 10px;
    gap: 8px;
    width: 100%;
    height: 185px;
    border: 1px solid #f4f4f4;
    border-radius: 6px;
    background: #ffffff;
    justify-content: space-between;
}

.dash-subtext-gray {
    font-weight: 300;
    font-size: 12px;
    line-height: 12px;
    color: var(--dash-text-muted);
    margin-top: 2px;
}

.dash-expense-visual-section {
    position: relative;
    width: 100%;
    height: 65px;
    margin-top: 4px;
}

.dash-expense-legend-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 14px;
    margin-bottom: 3px;
}

.dash-legend-expense-text {
    font-weight: 300;
    font-size: 10px;
    line-height: 8px;
    color: var(--dash-red-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dash-expense-marker-val {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-left: 0.6px solid var(--dash-red-primary);
    padding-left: 4px;
}

.marker-sales-sub {
    font-weight: 300;
    font-size: 6px;
    line-height: 6px;
    color: var(--dash-red-sub);
}

.marker-price-red {
    font-weight: 500;
    font-size: 12px;
    line-height: 12px;
    color: var(--dash-red-primary);
}

.dash-expense-bar-wrap {
    position: relative;
    width: 100%;
    height: 26px;
    display: flex;
    border-radius: 2px;
    overflow: hidden;
}

.dash-bar-solid-red {
    width: 68%;
    height: 26px;
    background: var(--dash-red-primary);
}

.dash-bar-stripes {
    width: 32%;
    height: 26px;
    display: flex;
    gap: 3px;
    padding-left: 2px;
    background: #ffffff;
}

.stripe-line {
    width: 0.6px;
    height: 26px;
    border-left: 0.6px solid var(--dash-red-primary);
}

.dash-expense-periods {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 4px;
}

.period-text {
    font-weight: 300;
    font-size: 10px;
    line-height: 10px;
    color: var(--dash-text-muted);
}

.dash-expense-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    height: 95px;
}

.dash-net-subcard {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 12px;
    gap: 10px;
    height: 95px;
    background: #ffffff;
    border: 1px solid #f4f4f4;
    border-radius: 4px;
    justify-content: space-between;
}

.dash-subcard-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* ==========================================================================
   SECTION 2: 2-Column Grid (Sales Last 30 Days & Top Selling Products)
   ========================================================================== */
.dash-row-2col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 20px;
    align-items: stretch;
    width: 100%;
}

.dash-row-2col > * {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 1100px) {
    .dash-row-2col {
        grid-template-columns: 1fr;
    }
}

.dash-sec2-card {
    background: var(--dash-surface);
    border-radius: var(--dash-radius-lg);
    min-height: 372px;
    height: 372px;
    padding: 18px 16px 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Header & Action Buttons */
.dash-sec2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 30px;
    gap: 10px;
}

.dash-title-dark-18 {
    font-weight: 400;
    font-size: 18px;
    line-height: 18px;
    color: #3B3B3B;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.dash-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-dash-action {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    height: 30px;
    border: 1px solid var(--dash-border-subcard);
    border-radius: var(--dash-radius-sm);
    background: transparent;
    color: #5B5B5B;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.btn-dash-action:hover {
    background: var(--dash-surface-sub);
    color: var(--dash-heading);
    border-color: #e2e8f0;
}

.btn-dash-action i {
    font-size: 11.5px;
    color: #696969;
}

/* --------------------------------------------------------------------------
   Left Card: Sales last 30 days (Frame 241)
   -------------------------------------------------------------------------- */
.dash-sec2-subhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 6px;
    margin-bottom: 4px;
}

.dash-subhead-text {
    font-weight: 400;
    font-size: 12px;
    line-height: 12px;
    color: var(--dash-text-secondary);
}

.dash-legend-daily-order {
    font-weight: 300;
    font-size: 12px;
    line-height: 12px;
    color: var(--dash-green-legend);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dash-chart-canvas-30days {
    position: relative;
    width: 100%;
    height: 235px;
    display: flex;
    align-items: flex-end;
}

/* Tooltip Pin (Frame 22/21) */
.pin-daily-users {
    position: absolute;
    left: 56%;
    top: 55%;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.1));
    z-index: 3;
    pointer-events: none;
}

.pin-badge-daily {
    background: var(--dash-green-legend);
    border-radius: var(--dash-radius-sm);
    padding: 3px 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pin-label-users {
    font-weight: 300;
    font-size: 6px;
    line-height: 6px;
    color: #ffffff;
    white-space: nowrap;
}

.pin-val-users {
    font-weight: 400;
    font-size: 8px;
    line-height: 8px;
    color: var(--dash-green-legend);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.pin-arrow-daily {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--dash-green-legend);
}

.pin-vertical-line {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 0;
    height: 60px;
    border-left: 0.6px dashed var(--dash-text-muted);
}

/* Modern High-Precision SVG Chart Tooltip */
.dash-svg-tooltip {
    position: absolute;
    transform: translate(-50%, -100%);
    margin-top: -8px;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
}

.dash-svg-tooltip-content {
    background: #0F172A;
    color: #FFFFFF;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.35;
    padding: 5px 9px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dash-svg-tooltip-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #0F172A;
    margin: 0 auto;
}

.sales-point-circle {
    cursor: pointer;
    transition: r 0.15s ease, stroke-width 0.15s ease;
}

/* --------------------------------------------------------------------------
   Right Card: Top Selling Products - 2026 (Frame 143)
   -------------------------------------------------------------------------- */
.dash-donut-content-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    margin-top: 10px;
}

.dash-donut-chart-box {
    position: relative;
    width: 226px;
    height: 226px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-donut-center-text {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.dash-donut-pct-large {
    font-weight: 400;
    font-size: 21px;
    line-height: 21px;
    color: #5B5B5B;
}

.dash-donut-sub-text {
    font-weight: 400;
    font-size: 11px;
    line-height: 12px;
    color: #5B5B5B;
    margin-top: 3px;
}

/* Product Breakdown List (Frame 125) */
.dash-product-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.dash-breakdown-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 16px;
}

.dash-breakdown-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.dash-product-color-box {
    box-sizing: border-box;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.dash-product-name-label {
    font-weight: 400;
    font-size: 14px;
    line-height: 14px;
    white-space: nowrap;
}

.dash-breakdown-dots {
    flex: 1;
    height: 0;
    border-top: 0.6px dashed var(--dash-text-muted);
    margin: 0 8px;
    min-width: 20px;
}

.dash-breakdown-pct {
    font-weight: 400;
    font-size: 12px;
    line-height: 12px;
    color: var(--dash-text-primary);
    flex-shrink: 0;
}

/* Footer Quote (Frame 127 / Frame 126) */
.dash-card-footer-quote {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
}

.dash-footer-divider {
    width: 100%;
    height: 0;
    border-top: 1px solid var(--dash-border-subcard);
}

.dash-quote-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.dash-quote-accent-bar {
    width: 2px;
    height: 16px;
    background: #E3E3E3;
    flex-shrink: 0;
}

.dash-quote-text {
    font-weight: 300;
    font-size: 13.5px;
    line-height: 14px;
    color: var(--dash-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   SECTION 3: Modern DataTables Cards (Product Stock Alert & Order Cancellation)
   ========================================================================== */
.dash-table-sec-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #EAEAEA;
    min-height: auto;
    padding: 18px 20px 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.dash-warning-icon-orange {
    color: #FF9F29;
    font-size: 16px;
}

.dash-warning-icon-red {
    color: var(--dash-red-sub);
    font-size: 16px;
}

/* Modern Minimal DataTables Styling */
.dash-table-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1;
    overflow-x: auto;
    margin-top: 10px;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.dash-table-wrapper .dataTables_wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.dash-modern-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-bottom: 0 !important;
    border: none !important;
    table-layout: auto !important;
}

.dash-modern-table thead th {
    background: #F5F5F5 !important;
    color: #333333 !important;
    font-weight: 500 !important;
    font-size: 13.5px !important;
    line-height: 18px !important;
    height: 38px !important;
    padding: 10px 12px !important;
    border: none !important;
    white-space: nowrap;
}

.dash-modern-table thead th:first-child {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.dash-modern-table thead th:last-child {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

.dash-modern-table tbody td {
    background: #FFFFFF !important;
    color: #4A5568 !important;
    font-weight: 400 !important;
    font-size: 13px !important;
    line-height: 18px !important;
    padding: 8px 12px !important;
    border-top: none !important;
    border-bottom: 1px solid #F1F5F9 !important;
    border-left: none !important;
    border-right: none !important;
    vertical-align: middle !important;
}

.dash-modern-table tbody tr:hover td {
    background: #FAFAFA !important;
}

.dash-modern-table tbody td.dataTables_empty {
    text-align: center !important;
    padding: 40px 16px !important;
    color: #8F8F8F !important;
    font-size: 13.5px !important;
    font-weight: 400 !important;
}

/* Specific Column Rules to prevent layout distortion from long location / product text */
#stock_alert_table th:nth-child(1),
#stock_alert_table td:nth-child(1) {
    max-width: 220px !important;
    min-width: 120px !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.35 !important;
    font-weight: 500 !important;
    color: #1E293B !important;
}

#stock_alert_table th:nth-child(2),
#stock_alert_table td:nth-child(2) {
    max-width: 190px !important;
    min-width: 110px !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.35 !important;
    font-size: 12.5px !important;
    color: #64748B !important;
}

#stock_alert_table th:nth-child(3),
#stock_alert_table td:nth-child(3) {
    white-space: nowrap !important;
    text-align: right !important;
    min-width: 75px !important;
    font-weight: 600 !important;
    color: #0F172A !important;
}

#order_cancellation_table th:nth-child(1),
#order_cancellation_table td:nth-child(1) {
    white-space: nowrap !important;
    min-width: 75px !important;
    color: #64748B !important;
}

#order_cancellation_table th:nth-child(2),
#order_cancellation_table td:nth-child(2) {
    max-width: 130px !important;
    min-width: 85px !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.35 !important;
}

#order_cancellation_table th:nth-child(3),
#order_cancellation_table td:nth-child(3) {
    max-width: 120px !important;
    min-width: 80px !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.35 !important;
}

#order_cancellation_table th:nth-child(4),
#order_cancellation_table td:nth-child(4) {
    white-space: nowrap !important;
    text-align: right !important;
    min-width: 75px !important;
    font-weight: 600 !important;
    color: #0F172A !important;
}

/* DataTables Info & Pagination Footer */
.dash-table-footer-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding-top: 12px !important;
    padding-bottom: 2px !important;
    margin-top: auto !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.dash-table-footer-row .dataTables_info {
    font-size: 12px !important;
    color: #64748B !important;
    padding: 0 !important;
    margin: 0 !important;
    font-weight: 400 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Reset Bootstrap 3 pagination margin, float and overflow */
.dash-table-footer-row .dataTables_paginate {
    margin: 0 !important;
    margin-left: auto !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.dash-table-footer-row .dataTables_paginate ul.pagination {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    background: #F8FAFC !important;
    border-radius: 8px !important;
    padding: 2px 3px !important;
    gap: 2px !important;
    border: none !important;
    white-space: nowrap !important;
}

.dash-table-footer-row .dataTables_paginate ul.pagination > li {
    display: inline-flex !important;
    flex-shrink: 0 !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dash-table-footer-row .dataTables_paginate ul.pagination > li > a,
.dash-table-footer-row .dataTables_paginate ul.pagination > li > span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    float: none !important;
    padding: 3px 7px !important;
    min-width: 26px !important;
    height: 26px !important;
    line-height: 20px !important;
    font-size: 11.5px !important;
    border-radius: 6px !important;
    border: none !important;
    background: transparent !important;
    color: #64748B !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.dash-table-footer-row .dataTables_paginate ul.pagination > li > a:hover {
    background: #E2E8F0 !important;
    color: #1E293B !important;
}

.dash-table-footer-row .dataTables_paginate ul.pagination > li.active > a,
.dash-table-footer-row .dataTables_paginate ul.pagination > li.active > a:hover,
.dash-table-footer-row .dataTables_paginate ul.pagination > li.active > span {
    background: #0090FF !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 2px rgba(0, 144, 255, 0.25) !important;
}

.dash-table-footer-row .dataTables_paginate ul.pagination > li.disabled > a,
.dash-table-footer-row .dataTables_paginate ul.pagination > li.disabled > a:hover,
.dash-table-footer-row .dataTables_paginate ul.pagination > li.disabled > span {
    color: #CBD5E1 !important;
    background: transparent !important;
    cursor: not-allowed !important;
}

.dash-table-footer-row .dataTables_paginate ul.pagination > li.previous > a,
.dash-table-footer-row .dataTables_paginate ul.pagination > li.next > a {
    padding: 3px 8px !important;
    font-weight: 500 !important;
    font-size: 11.5px !important;
}

/* Fallback for DataTables native paginate_button */
.dash-table-footer-row .dataTables_paginate .paginate_button {
    padding: 3px 7px !important;
    min-width: 26px !important;
    height: 26px !important;
    font-size: 11.5px !important;
    border-radius: 6px !important;
    border: none !important;
    background: transparent !important;
    color: #64748B !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    float: none !important;
    margin: 0 !important;
}

/* ==========================================================================
   SECTION 4: Sales Current Financial Year Bar Chart (Full Width Card)
   ========================================================================== */
.dash-fy-chart-card {
    background: var(--dash-surface);
    border-radius: var(--dash-radius-lg);
    width: 100%;
    min-height: 447px;
    padding: 18px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 14px;
}

.dash-fy-legend-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: -6px;
}

.dash-fy-legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1F6648;
}

.dash-fy-legend-text {
    font-size: 12px;
    line-height: 14px;
    font-weight: 400;
    color: #1F6648;
}

/* FY Chart Area */
.dash-fy-chart-wrapper {
    position: relative;
    width: 100%;
    height: 330px;
    display: flex;
    flex-direction: column;
}

.dash-fy-chart-canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ==========================================================================
   Modern Dropdown Menus (Column Visibility & Exports)
   ========================================================================== */
.dash-colvis-dropdown,
.dash-export-dropdown {
    min-width: 170px;
    padding: 6px 0;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    margin-top: 4px;
}

.dash-colvis-dropdown li a,
.dash-export-dropdown li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 13px;
    color: #4A5568;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.dash-colvis-dropdown li a:hover,
.dash-export-dropdown li a:hover {
    background: #F7FAFC;
    color: #1F6648;
}

.dash-colvis-dropdown li a i {
    width: 14px;
    font-size: 12px;
    text-align: center;
    transition: opacity 0.15s;
}

.dash-colvis-dropdown li a:not(.active) i {
    opacity: 0;
}

.dash-table-sec-card .dt-buttons {
    display: none !important;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive System (@media max-width: 767px)
   ========================================================================== */
@media (max-width: 767px) {
    /* Section 1: Overview Header & Actions */
    .dash-overview-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        margin-bottom: 12px !important;
    }

    .dash-header-actions {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .dash-location-wrapper {
        flex: 1 1 100% !important;
        min-width: 100% !important;
        width: 100% !important;
    }

    .btn-modern-refresh {
        flex: 1 1 auto !important;
        justify-content: center !important;
    }

    .btn-modern-filter {
        flex: 1 1 auto !important;
        justify-content: center !important;
    }

    /* Section 1: Main 3-Column Grid -> Stack into 1-Column */
    .dash-main-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        margin-bottom: 16px !important;
        width: 100% !important;
    }

    .dash-col-1 {
        grid-column: span 1 !important;
    }

    .dash-card-outer,
    .dash-sales-outer,
    .dash-purchases-outer,
    .dash-expense-outer {
        height: auto !important;
        min-height: auto !important;
        padding: 14px 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Column 1: Total Sales */
    .dash-sales-inner {
        height: auto !important;
        gap: 10px !important;
    }

    .dash-sales-legend {
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        margin-top: 8px !important;
        height: auto !important;
    }

    .dash-chart-area {
        height: 140px !important;
        width: 100% !important;
        overflow: hidden !important;
        margin-top: 8px !important;
    }

    /* Column 2: Total Purchases */
    .dash-purchases-top-card {
        height: auto !important;
        min-height: 110px !important;
        padding: 12px 14px !important;
        box-sizing: border-box !important;
    }

    .dash-green-highlight-box {
        height: auto !important;
        padding: 10px 12px !important;
    }

    /* Stack Purchases Return & Purchases Due into 1-column so bullet text NEVER cuts off */
    .dash-purchases-bottom-row {
        grid-template-columns: 1fr !important;
        height: auto !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .dash-purchases-subcard {
        height: auto !important;
        min-height: 105px !important;
        padding: 12px 14px !important;
        gap: 8px !important;
        box-sizing: border-box !important;
    }

    .dash-bullet-item {
        white-space: normal !important;
        word-break: break-word !important;
        font-size: 11.5px !important;
        line-height: 1.35 !important;
    }

    /* Column 3: Expense */
    .dash-expense-top-card {
        height: auto !important;
        min-height: auto !important;
        padding: 12px 14px !important;
        box-sizing: border-box !important;
    }

    .dash-expense-visual-section {
        height: auto !important;
    }

    .dash-expense-bottom-row {
        grid-template-columns: 1fr 1fr !important;
        height: auto !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .dash-net-subcard {
        height: auto !important;
        min-height: 85px !important;
        padding: 12px 12px !important;
        box-sizing: border-box !important;
    }

    /* Section 2: 2-Column Grid (Sales Last 30 Days & Top Products) */
    .dash-row-2col {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        margin-bottom: 16px !important;
        width: 100% !important;
    }

    .dash-sec2-card {
        height: auto !important;
        min-height: auto !important;
        padding: 16px 14px !important;
        box-sizing: border-box !important;
    }

    .dash-chart-canvas-30days {
        height: 200px !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    .dash-donut-content-row {
        flex-direction: column !important;
        align-items: center !important;
        gap: 16px !important;
        width: 100% !important;
    }

    .dash-donut-chart-box {
        width: 180px !important;
        height: 180px !important;
    }

    .dash-product-breakdown-list {
        width: 100% !important;
        gap: 12px !important;
    }

    .dash-breakdown-row {
        height: auto !important;
    }

    .dash-quote-text {
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.35 !important;
    }

    /* Section 3: DataTables (Product Stock Alert & Order Cancellation) */
    .dash-table-sec-card {
        padding: 16px 12px !important;
        min-height: auto !important;
        box-sizing: border-box !important;
    }

    .dash-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100% !important;
    }

    .dash-modern-table thead th,
    .dash-modern-table tbody td {
        padding: 10px 10px !important;
        font-size: 12.5px !important;
    }

    .dash-table-footer-row {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }

    /* Section 4: Current FY Chart */
    .dash-fy-chart-card {
        padding: 16px 12px !important;
        min-height: auto !important;
        box-sizing: border-box !important;
    }

    .dash-fy-chart-wrapper {
        height: 240px !important;
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .dash-expense-bottom-row {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   SECTION 5: Sales Order Modern Card (1:1 Reference Design)
   ========================================================================== */
.dash-sales-order-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #EAEAEA;
    padding: 22px 24px 20px;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    margin-bottom: 24px;
    width: 100%;
}

.dash-so-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.dash-so-title {
    font-size: 18px;
    font-weight: 600;
    color: #1E293B;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: -0.2px;
}

.dash-so-info-icon {
    font-size: 14px;
    color: #94A3B8;
    cursor: pointer;
    transition: color 0.15s ease;
}

.dash-so-info-icon:hover {
    color: #64748B;
}

.dash-so-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-so-header-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FFFFFF;
    color: #334155 !important;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    height: 32px;
    line-height: 1;
}

.btn-so-header-action:hover,
.btn-so-header-action:focus {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: #0F172A !important;
}

.btn-so-header-action svg {
    color: #475569;
}

.dash-so-dropdown {
    border-radius: 8px !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
    padding: 6px 0 !important;
    min-width: 160px;
    margin-top: 4px !important;
}

.dash-so-dropdown li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px !important;
    font-size: 12.5px !important;
    color: #334155 !important;
    transition: background 0.15s ease;
}

.dash-so-dropdown li a:hover {
    background: #F1F5F9 !important;
    color: #0F172A !important;
}

.dash-so-colvis-item label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    color: inherit;
}

.dash-so-colvis-item input[type="checkbox"] {
    margin: 0;
    accent-color: #0090FF;
}

/* Toolbar Row: Search Left, Show Length Right */
.dash-so-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.dash-so-search-wrap,
.dash-po-search-wrap,
.dash-shipment-search-wrap {
    position: relative;
    width: 250px;
    max-width: 100%;
}

.dash-so-search-wrap label,
.dash-po-search-wrap label,
.dash-shipment-search-wrap label {
    width: 100%;
    margin: 0;
}

.dash-so-search-wrap input[type="search"],
.dash-po-search-wrap input[type="search"],
.dash-shipment-search-wrap input[type="search"] {
    width: 100% !important;
    height: 34px !important;
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 6px !important;
    padding: 6px 32px 6px 12px !important;
    font-size: 13px !important;
    color: #334155 !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.15s ease;
}

.dash-so-search-wrap input[type="search"]:focus,
.dash-po-search-wrap input[type="search"]:focus,
.dash-shipment-search-wrap input[type="search"]:focus {
    background: #FFFFFF !important;
    border-color: #0090FF !important;
    box-shadow: 0 0 0 2px rgba(0, 144, 255, 0.1) !important;
}

.dash-so-search-wrap input[type="search"]::placeholder,
.dash-po-search-wrap input[type="search"]::placeholder,
.dash-shipment-search-wrap input[type="search"]::placeholder {
    color: #94A3B8;
}

.dash-so-search-wrap .dash-so-search-icon,
.dash-po-search-wrap .dash-so-search-icon,
.dash-shipment-search-wrap .dash-so-search-icon {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #94A3B8;
    pointer-events: none;
}

/* Length Box Right */
.dash-so-length-wrap {
    display: flex;
    align-items: center;
}

.dash-so-length-wrap label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12.5px;
    font-weight: 500;
    color: #475569;
}

.dash-so-length-wrap select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 6px !important;
    padding: 5px 24px 5px 10px !important;
    font-size: 12.5px !important;
    color: #334155 !important;
    cursor: pointer;
    outline: none !important;
    height: 32px;
}

.dash-so-length-wrap select:focus {
    border-color: #0090FF !important;
}

/* Sales Order Table Header & Rows */
.dash-so-modern-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-bottom: 0 !important;
    border: none !important;
}

.dash-so-modern-table thead th {
    background: #F8FAFC !important;
    color: #475569 !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    height: 42px !important;
    padding: 10px 14px !important;
    border: none !important;
    border-bottom: 1px solid #E2E8F0 !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}

.dash-so-modern-table thead th:first-child {
    border-top-left-radius: 6px !important;
    border-bottom-left-radius: 6px !important;
}

.dash-so-modern-table thead th:last-child {
    border-top-right-radius: 6px !important;
    border-bottom-right-radius: 6px !important;
}

/* Single clean modern sorting icon */
.dash-so-modern-table thead th.sorting,
.dash-so-modern-table thead th.sorting_asc,
.dash-so-modern-table thead th.sorting_desc {
    padding-right: 26px !important;
    position: relative !important;
    cursor: pointer !important;
}

.dash-so-modern-table thead th.sorting:after,
.dash-so-modern-table thead th.sorting_asc:after,
.dash-so-modern-table thead th.sorting_desc:after {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    bottom: auto !important;
    font-family: 'Font Awesome 5 Free', 'FontAwesome', sans-serif !important;
    font-weight: 900 !important;
    font-size: 11px !important;
    line-height: 1 !important;
    display: inline-block !important;
    pointer-events: none;
}

/* Neutral/unsorted state */
.dash-so-modern-table thead th.sorting:after {
    content: "\f0dc" !important;
    color: #CBD5E1 !important;
    opacity: 0.8 !important;
}

/* Sorted ascending */
.dash-so-modern-table thead th.sorting_asc:after {
    content: "\f0de" !important;
    color: #0090FF !important;
    opacity: 1 !important;
}

/* Sorted descending */
.dash-so-modern-table thead th.sorting_desc:after {
    content: "\f0dd" !important;
    color: #0090FF !important;
    opacity: 1 !important;
}

/* Non-sortable headers like Action and Quantity Remaining */
.dash-so-modern-table thead th:not(.sorting):not(.sorting_asc):not(.sorting_desc) {
    cursor: default !important;
    padding-right: 14px !important;
}

.dash-so-modern-table thead th:not(.sorting):not(.sorting_asc):not(.sorting_desc):after,
.dash-so-modern-table thead th:not(.sorting):not(.sorting_asc):not(.sorting_desc):before {
    display: none !important;
    content: none !important;
}

/* Ensure DataTables scroll cloned thead in modern sales order table does not add extra visual height,
   while preserving table-cell display so DataTables can accurately calculate and synchronize column widths */
div.dataTables_scrollBody table.dash-so-modern-table thead th {
    height: 0px !important;
    min-height: 0px !important;
    max-height: 0px !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    margin: 0px !important;
    border-top: none !important;
    border-bottom: none !important;
    line-height: 0px !important;
    font-size: 0px !important;
    visibility: hidden !important;
    background: transparent !important;
}
div.dataTables_scrollBody table.dash-so-modern-table thead th:after,
div.dataTables_scrollBody table.dash-so-modern-table thead th:before {
    display: none !important;
    content: none !important;
}
div.dataTables_scrollBody table.dash-so-modern-table thead th > div.dataTables_sizing {
    height: 0px !important;
    overflow: hidden !important;
    margin: 0px !important;
    padding: 0px !important;
}

.dash-so-modern-table tbody td {
    background: #FFFFFF !important;
    color: #475569 !important;
    font-weight: 400 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    height: 46px !important;
    padding: 11px 14px !important;
    border-top: none !important;
    border-bottom: 1px solid #F1F5F9 !important;
    border-left: none !important;
    border-right: none !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

.dash-so-modern-table tbody tr:hover td {
    background: #FAFAFA !important;
}

/* Action button in Table */
#sales_order_table .btn-info.dropdown-toggle,
#purchase_order_table .btn-info.dropdown-toggle,
#shipments_table .btn-info.dropdown-toggle {
    background: #0090FF !important;
    background-color: #0090FF !important;
    border: none !important;
    color: #FFFFFF !important;
    border-radius: 5px !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    padding: 4px 11px !important;
    line-height: 1.3 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    box-shadow: none !important;
    transition: background-color 0.15s ease;
}

#sales_order_table .btn-info.dropdown-toggle:hover,
#purchase_order_table .btn-info.dropdown-toggle:hover,
#shipments_table .btn-info.dropdown-toggle:hover {
    background: #0077D6 !important;
    background-color: #0077D6 !important;
}

#sales_order_table .btn-info.dropdown-toggle .caret,
#purchase_order_table .btn-info.dropdown-toggle .caret,
#shipments_table .btn-info.dropdown-toggle .caret {
    border-top-color: #FFFFFF !important;
    margin-left: 2px !important;
}

/* Status Badges */
#sales_order_table .label,
#purchase_order_table .label,
#shipments_table .label {
    display: inline-block !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    padding: 4px 10px !important;
    border-radius: 5px !important;
    text-align: center !important;
    min-width: 60px;
    text-decoration: none !important;
}

#sales_order_table a,
#shipments_table a {
    text-decoration: none !important;
}

#sales_order_table .label.bg-info,
#shipments_table .label.bg-info {
    background-color: #0090FF !important;
    color: #FFFFFF !important;
}

#sales_order_table .label.bg-red,
#shipments_table .label.bg-red {
    background-color: #E53935 !important;
    color: #FFFFFF !important;
}

#sales_order_table .label.bg-green,
#shipments_table .label.bg-green {
    background-color: #00C853 !important;
    color: #FFFFFF !important;
}

#sales_order_table .label.bg-yellow,
#shipments_table .label.bg-yellow {
    background-color: #00C853 !important;
    color: #FFFFFF !important;
}

/* ==========================================================================
   Payment Dues Modern Styling (Sales Payment Due & Purchase Payment Due)
   ========================================================================== */
.dash-dues-loc-wrap {
    min-width: 140px;
    max-width: 190px;
}

.dash-dues-loc-wrap .select2-container--default .select2-selection--single {
    height: 30px !important;
    border: 1px solid var(--dash-border-subcard) !important;
    border-radius: var(--dash-radius-sm) !important;
    background: #FFFFFF !important;
    display: flex !important;
    align-items: center !important;
    box-shadow: none !important;
}

.dash-dues-loc-wrap .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #5B5B5B !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 28px !important;
    padding-left: 10px !important;
    padding-right: 24px !important;
}

.dash-dues-loc-wrap .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 28px !important;
    right: 6px !important;
}

#sales_payment_dues_table .btn-xs,
#purchase_payment_dues_table .btn-xs {
    border-radius: 6px !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    background-color: #10B981 !important;
    border-color: #10B981 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2) !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    text-decoration: none !important;
}

#sales_payment_dues_table .btn-xs:hover,
#purchase_payment_dues_table .btn-xs:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

#sales_payment_dues_table a,
#purchase_payment_dues_table a {
    color: #0090FF;
    text-decoration: none;
    font-weight: 500;
}

#sales_payment_dues_table a:hover,
#purchase_payment_dues_table a:hover {
    color: #0077D6;
    text-decoration: underline;
}
