/* =========================================================
   PREMIUM ERP DASHBOARD
   File: assets/css/dashboard.css

   Purpose:
   - Premium SaaS ERP dashboard UI
   - Responsive dashboard layout
   - KPI cards, panels, charts, tables, activities
   - CONSISTENT ICON COLOR SYSTEM (FIXED)
   ========================================================= */

/* =========================================================
   DASHBOARD ROOT
   ========================================================= */

.premium-dashboard {
    padding: 8px;
    max-width: 100%;
    overflow-x: hidden;
}

html,
body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* =========================================================
   HERO HEADER
   ========================================================= */

.dash-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.dash-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.dash-title-icon {
    width: 52px;
    height: 52px;
    border-radius: 22px;
    background: #e7f8ef;
    color: #10b981;
    display: grid;
    place-items: center;
    font-size: 26px;
    font-weight: 900;
    flex: 0 0 auto;
}

.dash-title-wrap h1 {
    font-size: 24px;
    color: #0f172a;
    margin: 0 0 4px;
}

.dash-title-wrap p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.dash-hero-actions {
    display: flex;
    gap: 12px;
    flex: 0 0 auto;
}

.dash-date-btn,
.dash-export-btn {
    height: 46px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 0 18px;
    font-weight: 700;
    color: #334155;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    white-space: nowrap;
}

.dash-export-btn {
    background: #e8f9f1;
    color: #059669;
}

/* =========================================================
   KPI GRID
   ========================================================= */

.dash-kpi-grid {
    display: grid;
    /*
     * The Dashboard contains exactly six KPI cards.
     * Use six real tracks instead of auto-fill, because auto-fill creates
     * empty tracks on wide screens and incorrectly keeps visible cards narrow.
     */
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
    width: 100%;
}

.dash-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 16px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    min-width: 0;
    overflow: hidden;
}

.dash-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

/* =========================================================
   KPI ICON COLORS (FIXED - PREMIUM PALETTE)
   ========================================================= */

.dash-kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    font-size: 20px;
}

/* BLUE */
.dash-kpi-icon.blue {
    background: #e8f1ff;
    color: #2563eb;
}

/* PURPLE */
.dash-kpi-icon.purple {
    background: #f3e8ff;
    color: #9333ea;
}

/* ORANGE */
.dash-kpi-icon.orange {
    background: #fff1e7;
    color: #ea580c;
}

/* GREEN */
.dash-kpi-icon.green {
    background: #e7f8ef;
    color: #059669;
}

/* PINK */
.dash-kpi-icon.pink {
    background: #ffe8f1;
    color: #db2777;
}

.dash-kpi-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 6px;
}

.dash-kpi-card strong {
    display: block;
    font-size: clamp(16px, 2.2cqw, 22px);
    font-size: 22px;
    color: #0f172a;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
}

.dash-kpi-card small {
    display: block;
    color: #059669;
    font-weight: 800;
    font-size: 13px;
}

.dash-kpi-card em {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-style: normal;
    margin-top: 4px;
}

/* =========================================================
   SHARED PANEL STYLE
   ========================================================= */

.dash-panel {
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.055);
    min-width: 0;
}

.dash-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.dash-panel-header h2 {
    font-size: 17px;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

/* =========================================================
   UNIFIED BUTTON STYLES (View All buttons)
   ========================================================= */

/* All panel header buttons - Same style as low stock button */
.dash-panel-header button,
.low-stock-panel #btnViewLowStockTop {
    border: none;
    background: #f8fafc;
    color: #059669;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Hover effect for all buttons */
.dash-panel-header button:hover,
.low-stock-panel #btnViewLowStockTop:hover {
    background: #ecfdf5;
    color: #047857;
    transform: translateY(-1px);
}

/* Active/click effect */
.dash-panel-header button:active,
.low-stock-panel #btnViewLowStockTop:active {
    transform: translateY(0px);
}

/* =========================================================
   PANEL HEADER ICON COLORS
   ========================================================= */

/* Recent Sales - Green */
.dash-panel-header h2 i.fa-cart-shopping {
    color: #10b981 !important;
}

/* Recent Purchases - Purple */
.dash-panel-header h2 i.fa-truck-ramp-box {
    color: #8b5cf6 !important;
}

/* Recent Activities - Blue */
.dash-panel-header h2 i.fa-clock-rotate-left {
    color: #3b82f6 !important;
}

/* Cash & Bank - Green */
.dash-panel-header h2 i.fa-landmark,
.dash-panel-header h2 i.fa-vault {
    color: #059669 !important;
}

/* Receivables & Payables - Orange */
.dash-panel-header h2 i.fa-scale-balanced {
    color: #f59e0b !important;
}

/* Online Orders - Blue */
.dash-panel-header h2 i.fa-globe {
    color: #3b82f6 !important;
}

/* Low Stock - Red */
.dash-panel-header h2 i.fa-triangle-exclamation {
    color: #ef4444 !important;
}

/* Sales Chart - Green */
.dash-panel-header h2 i.fa-chart-line {
    color: #10b981 !important;
}

/* Expense Breakdown - Orange */
.dash-panel-header h2 i.fa-chart-pie {
    color: #f59e0b !important;
}

/* =========================================================
   OVERVIEW GRID
   ========================================================= */

.dash-overview-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr 0.85fr;
    gap: 14px;
    margin-bottom: 18px;
}

/* =========================================================
   MINI CARDS (UPDATED ICON COLORS)
   ========================================================= */

.dash-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

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

.dash-mini-card {
    border-radius: 18px;
    padding: 18px;
    background: #f8fafc;
    min-width: 0;
}

.dash-mini-card.green {
    background: #eefbf5;
}

.dash-mini-card.blue {
    background: #eef5ff;
}

.dash-mini-card.teal {
    background: #e8fbf8;
}

.dash-mini-card.orange {
    background: #fff4e8;
}

/* Mini Icon Container */
.dash-mini-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.9);
}

/* Cash Card (Green) Icon */
.dash-mini-card.green .dash-mini-icon {
    color: #059669;
}

/* Bank Card (Blue) Icon */
.dash-mini-card.blue .dash-mini-icon {
    color: #2563eb;
}

/* Receivables Card (Orange) Icon */
.dash-mini-card.orange .dash-mini-icon {
    color: #ea580c;
}

/* Payables Card (Pink/Teal) Icon */
.dash-mini-card.teal .dash-mini-icon,
.dash-mini-card.pink .dash-mini-icon {
    color: #0891b2;
}

.dash-mini-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 8px;
}

.dash-mini-card strong {
    display: block;
    color: #0f172a;
    font-size: 24px;
    overflow-wrap: anywhere;
}

/* =========================================================
   ONLINE ORDER GRID WITH ICON COLORS
   ========================================================= */

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

.order-grid div {
    border-radius: 16px;
    padding: 16px;
    background: #f8fafc;
}

.order-grid span {
    color: #64748b;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Individual icon colors */
.order-grid div:first-child i {
    color: #f59e0b !important;
}

.order-grid div:nth-child(2) i {
    color: #3b82f6 !important;
}

.order-grid div:nth-child(3) i {
    color: #10b981 !important;
}

.order-grid div:nth-child(4) i {
    color: #ef4444 !important;
}

.order-grid strong {
    display: block;
    font-size: 22px;
    color: #0f172a;
    margin-top: 4px;
}

/* =========================================================
   LOW STOCK COMPACT CARD (COMPLETE FIX)
   ========================================================= */

.low-stock-panel .dash-panel-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.low-stock-panel .dash-panel-header h2 i {
    color: #ef4444 !important;
}

.low-stock-panel .low-stock-content {
    padding: 0;
    text-align: left;
}

.low-stock-panel .low-stock-icon {
    display: none;
}

.low-stock-panel #lowStockCount,
.low-stock-panel .low-stock-content>span {
    display: none;
}

.low-stock-panel .low-stock-mini-list {
    margin: 0;
    display: grid;
    gap: 8px;
}

/* Flexbox for horizontal alignment */
.low-stock-panel .low-stock-mini-item {
    min-height: 42px;
    border-radius: 12px;
    padding: 9px 11px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.low-stock-panel .low-stock-mini-item span {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.low-stock-panel .low-stock-mini-item strong {
    color: #dc2626;
    font-size: 13px;
    font-weight: 900;
    flex-shrink: 0;
}

.low-stock-panel #btnViewLowStock {
    display: none;
}

/* =========================================================
   CHART GRID
   ========================================================= */

.dash-chart-grid {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

.fake-line-chart {
    height: 260px;
    position: relative;
    overflow: hidden;
}

.fake-line-chart svg {
    width: 100%;
    height: 220px;
}

.chart-months {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    color: #64748b;
    font-size: 12px;
    text-align: center;
}

/* =========================================================
   DONUT CHART
   ========================================================= */

.donut-wrap {
    display: flex;
    align-items: center;
    gap: 24px;
}

.donut-chart {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(#10b981 0 45%,
            #3b82f6 45% 65%,
            #f59e0b 65% 80%,
            #8b5cf6 80% 90%,
            #94a3b8 90% 100%);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.donut-center {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: white;
    display: grid;
    place-items: center;
    text-align: center;
}

.donut-center strong {
    font-size: 20px;
}

.donut-center span {
    font-size: 12px;
    color: #64748b;
}

.donut-legend {
    flex: 1;
    display: grid;
    gap: 12px;
    min-width: 0;
}

.donut-legend div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: #475569;
    font-size: 14px;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.dot.green {
    background: #10b981;
}

.dot.blue {
    background: #3b82f6;
}

.dot.orange {
    background: #f59e0b;
}

.dot.purple {
    background: #8b5cf6;
}

.dot.slate {
    background: #94a3b8;
}

/* =========================================================
   BOTTOM GRID LAYOUT
   ========================================================= */

.dash-bottom-grid {
    display: grid;
    grid-template-columns: 1.25fr 1.25fr 1fr;
    gap: 24px;
    align-items: stretch;
    margin-top: 24px;
}

.dash-bottom-grid .dash-panel {
    height: 100%;
    min-height: 420px;
    padding: 24px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #edf2f7;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dash-bottom-grid .dash-panel-header {
    min-height: 34px;
    margin-bottom: 20px;
    flex: 0 0 auto;
}

.dash-bottom-grid .dash-panel-header h2 {
    font-size: 18px;
    line-height: 1.2;
    margin: 0;
}

.dash-bottom-grid .table-panel {
    overflow: auto;
    max-height: 460px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.dash-bottom-grid .table-panel::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.dash-bottom-grid .table-panel .dash-table {
    display: table;
    table-layout: fixed;
    width: 100%;
}

.dash-bottom-grid .table-panel .dash-table th,
.dash-bottom-grid .table-panel .dash-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-bottom-grid .activity-panel {
    max-height: 460px;
}

.dash-bottom-grid .activity-list {
    flex: 1;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.dash-bottom-grid .activity-list::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.dash-bottom-grid .activity-item {
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.dash-bottom-grid .activity-item:last-child {
    border-bottom: none;
}

/* =========================================================
   ACTIVITY ICON COLORS BY TYPE
   ========================================================= */

/* Sale activities - Green */
.activity-item i.fa-cart-shopping {
    color: #10b981 !important;
}

/* Purchase activities - Purple */
.activity-item i.fa-truck-ramp-box {
    color: #8b5cf6 !important;
}

/* Expense activities - Orange */
.activity-item i.fa-wallet {
    color: #f59e0b !important;
}

/* Payment activities - Blue */
.activity-item i.fa-money-bill-transfer {
    color: #3b82f6 !important;
}

/* Stock activities - Teal */
.activity-item i.fa-boxes-stacked {
    color: #14b8a6 !important;
}

/* Return activities - Red */
.activity-item i.fa-rotate-left {
    color: #ef4444 !important;
}

/* Login activities - Slate */
.activity-item i.fa-right-to-bracket {
    color: #64748b !important;
}

/* =========================================================
   ACTIVITY ICON POLISH
   ========================================================= */

.activity-list {
    display: grid;
    gap: 14px;
}

.activity-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.activity-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 900;
    flex: 0 0 auto;
    background: #eef2ff;
}

.activity-item p {
    color: #0f172a;
    font-size: 14px;
    margin-bottom: 3px;
}

.activity-item span,
.activity-empty {
    color: #64748b;
    font-size: 12px;
}

/* =========================================================
   TABLE STYLES
   ========================================================= */

.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table th {
    text-align: left;
    font-size: 12px;
    color: #64748b;
    padding: 12px 6px;
    border-bottom: 1px solid #edf2f7;
}

.dash-table td {
    padding: 13px 6px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #334155;
}

.dash-status {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: capitalize;
}

.dash-status-paid {
    background: #dcfce7;
    color: #166534;
}

.dash-status-partial {
    background: #ffedd5;
    color: #c2410c;
}

.dash-status-credit {
    background: #fee2e2;
    color: #b91c1c;
}

.dash-status-muted {
    background: #e5e7eb;
    color: #475569;
}

/* =========================================================
   CASH & BANK BALANCE + RECEIVABLES & PAYABLES
   ========================================================= */

.dash-overview-grid .dash-panel:first-child {
    display: flex;
    flex-direction: column;
}

.dash-overview-grid .dash-panel:first-child .dash-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 8px;
}

.dash-overview-grid .dash-panel:first-child .dash-mini-card {
    border-radius: 18px;
    padding: 20px;
    background: #f8fafc;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dash-overview-grid .dash-panel:first-child .dash-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.dash-overview-grid .dash-panel:first-child .dash-mini-card:first-child {
    background: linear-gradient(135deg, #eef5ff 0%, #e0eaff 100%);
    border-left: 4px solid #3b82f6;
}

.dash-overview-grid .dash-panel:first-child .dash-mini-card:last-child {
    background: linear-gradient(135deg, #eefbf5 0%, #e0f5ea 100%);
    border-left: 4px solid #10b981;
}

.dash-overview-grid .dash-panel:nth-child(2) .dash-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 8px;
}

.dash-overview-grid .dash-panel:nth-child(2) .dash-mini-card {
    border-radius: 18px;
    padding: 20px;
    background: #f8fafc;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dash-overview-grid .dash-panel:nth-child(2) .dash-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.dash-overview-grid .dash-panel:nth-child(2) .dash-mini-card:first-child {
    background: linear-gradient(135deg, #fff4e8 0%, #ffe8d6 100%);
    border-left: 4px solid #f59e0b;
}

.dash-overview-grid .dash-panel:nth-child(2) .dash-mini-card:last-child {
    background: linear-gradient(135deg, #ffe8f1 0%, #ffd6e6 100%);
    border-left: 4px solid #ec4899;
}

.dash-overview-grid .dash-mini-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.8);
}

.dash-overview-grid .dash-mini-card span {
    display: block;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dash-overview-grid .dash-mini-card strong {
    display: block;
    font-size: 20px;
    color: #0f172a;
    margin-bottom: 12px;
    font-weight: 800;
}

.dash-overview-grid .dash-mini-card small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.6);
}

.trend-up {
    color: #10b981;
}

.trend-down {
    color: #ef4444;
}

.dash-overview-grid .dash-panel:first-child,
.dash-overview-grid .dash-panel:nth-child(2) {
    padding: 20px;
}

.dash-overview-grid .dash-panel:first-child .dash-panel-header,
.dash-overview-grid .dash-panel:nth-child(2) .dash-panel-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.dash-overview-grid .dash-panel:first-child .dash-panel-header h2,
.dash-overview-grid .dash-panel:nth-child(2) .dash-panel-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.3px;
}

.dash-overview-grid .dash-panel-header button {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #3b82f6;
    font-weight: 600;
    transition: all 0.2s ease;
}

.dash-overview-grid .dash-panel-header button:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* =========================================================
   DATE RANGE FILTER & EXPORT BUTTON ICONS
   ========================================================= */

.dash-date-filter {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    color: #334155;
}

.dash-date-filter i {
    color: #10b981;
}

.dash-date-filter input {
    border: none;
    outline: none;
    background: transparent;
    color: #334155;
    font-weight: 700;
    font-size: 13px;
    width: 135px;
}

.dash-date-filter span {
    color: #94a3b8;
    font-weight: 800;
}

.dash-small-filter {
    min-height: 38px;
    border: 1px solid #e5e7eb !important;
    background: #ffffff !important;
    color: #334155 !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
    font-weight: 800;
}

/* =========================================================
   FONT AWESOME DASHBOARD ICON POLISH
   ========================================================= */

.dash-title-icon i,
.dash-kpi-icon i,
.dash-mini-icon i,
.low-stock-icon i,
.activity-dot i,
.dash-date-btn i,
.dash-export-btn i,
.dash-small-filter i {
    line-height: 1;
    display: inline-block;
}

.dash-title-icon i {
    font-size: 22px;
}

.dash-kpi-icon i {
    font-size: 20px;
}

.dash-mini-icon i {
    font-size: 20px;
}

.low-stock-icon i {
    font-size: 30px;
}

.activity-dot i {
    font-size: 14px;
}

.dash-date-btn,
.dash-export-btn,
.dash-small-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1300px) {
    .dash-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .dash-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .dash-bottom-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .dash-bottom-grid .dash-panel {
        min-height: auto;
    }

    .dash-bottom-grid .activity-list {
        max-height: none;
    }
}

@media (max-width: 900px) {

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

    .dash-overview-grid,
    .dash-chart-grid {
        grid-template-columns: 1fr;
    }

    .dash-mini-grid,
    .dash-mini-grid.two {
        grid-template-columns: 1fr;
    }

    .dash-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .dash-hero-actions {
        flex-direction: column;
    }

    .donut-wrap {
        flex-direction: column;
        align-items: flex-start;
    }

    .dash-overview-grid .dash-panel:first-child .dash-mini-grid,
    .dash-overview-grid .dash-panel:nth-child(2) .dash-mini-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dash-overview-grid .dash-mini-card strong {
        font-size: 24px;
    }
}

@media (max-width: 760px) {
    .dash-date-filter {
        width: 100%;
        justify-content: center;
    }

    .dash-date-filter input {
        width: 120px;
    }
}

@media (max-width: 560px) {

    .dash-overview-grid .dash-panel:first-child .dash-mini-card,
    .dash-overview-grid .dash-panel:nth-child(2) .dash-mini-card {
        padding: 16px;
    }

    .dash-overview-grid .dash-mini-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .dash-overview-grid .dash-mini-card strong {
        font-size: 22px;
    }
}

@media (max-width: 430px) {
    .dash-date-filter {
        flex-wrap: wrap;
        padding: 10px;
    }
}

/* =========================================================
   RECENT SALES / PURCHASE TABLE WIDTH FIX
   ========================================================= */

.dash-bottom-grid .table-panel:first-child {
    min-width: 0;
}

.dash-bottom-grid .table-panel:nth-child(2) {
    min-width: 0;
}

.dash-bottom-grid .table-panel {
    min-width: 0;
}

.dash-bottom-grid .table-panel .dash-table {
    min-width: 100%;
    table-layout: fixed;
}

.dash-bottom-grid .table-panel:first-child .dash-table th:nth-child(1),
.dash-bottom-grid .table-panel:first-child .dash-table td:nth-child(1) {
    width: 26%;
}

.dash-bottom-grid .table-panel:first-child .dash-table th:nth-child(2),
.dash-bottom-grid .table-panel:first-child .dash-table td:nth-child(2) {
    width: 34%;
}

.dash-bottom-grid .table-panel:first-child .dash-table th:nth-child(3),
.dash-bottom-grid .table-panel:first-child .dash-table td:nth-child(3) {
    width: 22%;
}

.dash-bottom-grid .table-panel:first-child .dash-table th:nth-child(4),
.dash-bottom-grid .table-panel:first-child .dash-table td:nth-child(4) {
    width: 18%;
}

.dash-bottom-grid .table-panel:nth-child(2) .dash-table th:nth-child(1),
.dash-bottom-grid .table-panel:nth-child(2) .dash-table td:nth-child(1) {
    width: 23%;
}

.dash-bottom-grid .table-panel:nth-child(2) .dash-table th:nth-child(2),
.dash-bottom-grid .table-panel:nth-child(2) .dash-table td:nth-child(2) {
    width: 39%;
}

.dash-bottom-grid .table-panel:nth-child(2) .dash-table th:nth-child(3),
.dash-bottom-grid .table-panel:nth-child(2) .dash-table td:nth-child(3) {
    width: 20%;
}

.dash-bottom-grid .table-panel:nth-child(2) .dash-table th:nth-child(4),
.dash-bottom-grid .table-panel:nth-child(2) .dash-table td:nth-child(4) {
    width: 18%;
}

.dash-bottom-grid .dash-table th,
.dash-bottom-grid .dash-table td {
    padding-left: 8px;
    padding-right: 8px;
    vertical-align: middle;
}

.dash-bottom-grid .dash-table td {
    max-width: 1px;
}

.dash-bottom-grid .dash-table td:last-child,
.dash-bottom-grid .dash-table th:last-child {
    overflow: visible;
    text-overflow: initial;
}

@media (max-width: 1180px) {
    .dash-bottom-grid .table-panel {
        overflow-x: auto;
    }

    .dash-bottom-grid .table-panel .dash-table {
        min-width: 680px;
    }
}

/* =========================================================
   CHART AXIS STYLES
   ========================================================= */

.fake-line-chart svg {
    width: 100%;
    height: 260px;
}

.chart-y-label {
    fill: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.chart-x-label {
    fill: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-anchor: middle;
}

.chart-grid-line {
    stroke: #e5e7eb;
    stroke-width: 1;
    stroke-dasharray: 5 5;
}

.chart-sales-line {
    fill: none;
    stroke: #10b981;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-sales-dot {
    fill: #10b981;
    stroke: #ffffff;
    stroke-width: 3;
}

/* ==================== LOW STOCK EMPTY CELEBRATION ==================== */
.low-stock-celebration {
  min-height: 140px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  color: hsl(160, 83%, 30%);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.low-stock-celebration i {
  font-size: 46px;
}

.low-stock-celebration strong {
  font-size: 13px;
}


/* ==================== LOW STOCK EMPTY STATE ==================== */
.low-stock-empty {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  color: hsl(160, 83%, 40%);
}

.low-stock-empty i {
  font-size: 48px;
  line-height: 1;
}

.low-stock-empty strong {
  font-size: 13px;
  letter-spacing: 0.16em;
  font-weight: 900;
  color: #064e3b;
}


/* =========================================================
   DASHBOARD KPI GRID - NARROW MOBILE SAFETY
   ========================================================= */
@media (max-width: 520px) {
    .premium-dashboard .dash-kpi-grid {
        grid-template-columns: 1fr;
    }
}
