/* ==========================================================================
   IDT POS — Modern Charts & Dashboard Sections CSS
   Date: 2026-05-16
   
   Modernizes:
   - Chart containers (Sales Last 30 Days, Sales Current Financial Year)
   - Section headers with colorful icon badges
   - Table styling improvements
   - Pagination & export buttons
   ========================================================================== */

/* --------------------------------------------------------------------------
   CHART CONTAINERS — Wrap charts in a beautiful card
   -------------------------------------------------------------------------- */

/* The h4 titles "Sales Last 30 Days" etc — give them modern look */
.content-custom h4 {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    line-height: 1.3 !important;
}

/* Add a gradient icon badge before chart titles */
.content-custom h4::before {
    content: '';
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    background-image: 
        linear-gradient(135deg, #3b82f6, #2563eb),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 17 9 11 13 15 21 7'/><polyline points='14 7 21 7 21 14'/></svg>");
    background-blend-mode: normal;
    background-size: cover, 18px 18px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Different colors for different sections */
.content-custom h4.text-warning::before,
.content-custom h4:has(.fa-warning)::before,
.content-custom h4:has(.fa-exclamation-triangle)::before {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3) !important;
    background-image: 
        linear-gradient(135deg, #f59e0b, #d97706),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/><line x1='12' y1='9' x2='12' y2='13'/><line x1='12' y1='17' x2='12.01' y2='17'/></svg>") !important;
    background-size: cover, 16px 16px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Hide the existing warning icons inside h4 (we replaced them with ::before) */
.content-custom h4 > i.fa-warning,
.content-custom h4 > i.fa-exclamation-triangle,
.content-custom h4 > i.fa-shopping-cart,
.content-custom h4 > i.fa-list,
.content-custom h4 > i.fa-truck {
    display: none !important;
}

/* Chart wrapper boxes - wrap in card style */
.box-body {
    padding: 20px !important;
}

/* Highcharts container modernization */
.highcharts-container,
.highcharts-root {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif !important;
}

/* Remove Highcharts watermark/credits */
.highcharts-credits {
    display: none !important;
}

/* Modern chart background */
.highcharts-background {
    fill: transparent !important;
}

/* Better chart grid lines */
.highcharts-grid-line {
    stroke: #f1f5f9 !important;
    stroke-dasharray: 4 4;
}

/* --------------------------------------------------------------------------
   TABLES — Modern look with better spacing
   -------------------------------------------------------------------------- */
.content-custom table.table,
.content-custom .dataTables_wrapper table {
    border: 0 !important;
    background: transparent !important;
}

.content-custom table.table thead th,
.content-custom .dataTables_wrapper table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 12px 14px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: 0 !important;
}

.content-custom table.table tbody td,
.content-custom .dataTables_wrapper table tbody td {
    padding: 12px 14px !important;
    font-size: 13px !important;
    color: #0f172a !important;
    border-top: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
}

.content-custom table.table tbody tr:hover td {
    background: #f8fafc !important;
}

/* "No data available" empty state */
.content-custom .dataTables_empty {
    color: #94a3b8 !important;
    font-style: italic !important;
    padding: 30px !important;
    text-align: center !important;
}

/* --------------------------------------------------------------------------
   EXPORT BUTTONS (CSV, Excel, Print, etc.)
   -------------------------------------------------------------------------- */
.dt-buttons .btn,
.dt-buttons .dt-button {
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    border-radius: 8px !important;
    padding: 7px 14px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    margin-right: 6px !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.dt-buttons .btn:hover,
.dt-buttons .dt-button:hover {
    background: #f8fafc !important;
    background-image: none !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
}

.dt-buttons .btn i,
.dt-buttons .dt-button i {
    margin-right: 4px !important;
    color: #64748b !important;
}

/* --------------------------------------------------------------------------
   DATATABLES SEARCH BOX & ENTRIES SELECT
   -------------------------------------------------------------------------- */
.dataTables_filter input,
.dataTables_length select {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    color: #0f172a !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

.dataTables_filter input:focus,
.dataTables_length select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    outline: none !important;
}

.dataTables_filter label,
.dataTables_length label {
    color: #475569 !important;
    font-weight: 500 !important;
    font-size: 13px !important;
}

/* --------------------------------------------------------------------------
   PAGINATION (Previous / Next / Page numbers)
   -------------------------------------------------------------------------- */
.dataTables_paginate .paginate_button {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    margin: 0 2px !important;
    color: #475569 !important;
    background: #ffffff !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.15s ease !important;
}

.dataTables_paginate .paginate_button:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

.dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
}

.dataTables_paginate .paginate_button.disabled {
    color: #cbd5e1 !important;
    background: #f8fafc !important;
    cursor: not-allowed !important;
}

.dataTables_info {
    color: #64748b !important;
    font-size: 12px !important;
    padding: 12px 0 !important;
}

/* --------------------------------------------------------------------------
   STOCK BADGES (low stock indicators)
   -------------------------------------------------------------------------- */
.content-custom table tbody td:last-child:not(:has(.btn)):not(:has(a)):not(:has(input)) {
    /* For numeric stock cells in product alert table */
}

/* If you want to make the stock numbers stand out, we can add classes via JS later */

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media screen and (max-width: 767px) {
    .content-custom h4 {
        font-size: 14px !important;
        gap: 8px !important;
    }
    
    .content-custom h4::before {
        width: 28px !important;
        height: 28px !important;
    }
    
    .content-custom table.table thead th,
    .content-custom table.table tbody td {
        padding: 10px 8px !important;
        font-size: 12px !important;
    }
    
    .dt-buttons .btn {
        padding: 5px 10px !important;
        font-size: 11px !important;
    }
}

/* --------------------------------------------------------------------------
   PRINT
   -------------------------------------------------------------------------- */
@media print {
    .content-custom h4::before {
        display: none !important;
    }
    .dt-buttons,
    .dataTables_filter,
    .dataTables_paginate,
    .dataTables_length {
        display: none !important;
    }
}