/* ===================================================
   EXECUTIVE DASHBOARD STYLING (10PX RADIUS THEME)
   =================================================== */

/* Unified Page Background */
body:not([data-layout-color="dark"]) .content-page {
    background-color: #f6f8fb !important;
}

/* Executive Header Icon & Custom Branch Dropdown (10px Radius) */
.dashboard-header-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.16) 0%, rgba(37, 99, 235, 0.06) 100%);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.25);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
    border-radius: 10px !important;
}

.branch-pill-button {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px !important;
    padding: 6px 14px 6px 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none !important;
}

.branch-pill-button:hover,
.branch-pill-button[aria-expanded="true"] {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.16);
}

.branch-pill-badge {
    width: 26px;
    height: 26px;
    border-radius: 6px !important;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 8px;
    flex-shrink: 0;
}

.branch-custom-dropdown {
    border-radius: 10px !important;
    min-width: 210px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
    margin-top: 6px !important;
}

.branch-custom-dropdown .dropdown-item {
    font-size: 0.84rem;
    font-weight: 500;
    color: #475569;
    border-radius: 6px !important;
    margin: 2px 6px;
    width: auto !important;
    transition: all 0.15s ease;
}

.branch-custom-dropdown .dropdown-item:hover {
    background: #f1f3fa;
    color: #2563eb;
}

.branch-custom-dropdown .dropdown-item.active {
    background: rgba(37, 99, 235, 0.12) !important;
    color: #2563eb !important;
    font-weight: 600;
}

body[data-layout-color="dark"] .branch-pill-button {
    background: #2b3040 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body[data-layout-color="dark"] .branch-pill-name {
    color: #e3eaef !important;
}

body[data-layout-color="dark"] .branch-custom-dropdown {
    background: #2b3040 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
}

body[data-layout-color="dark"] .branch-custom-dropdown .dropdown-item {
    color: #cbd5e1;
}

body[data-layout-color="dark"] .branch-custom-dropdown .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

/* Uniform 10px Card Corner Radius on All Dashboard Cards */
.card,
.stat-widget-card,
.card.h-100 {
    border-radius: 10px !important;
}

/* Stat Widget Cards - Strict Fixed Layout & Height Uniformity */
.stat-widget-card {
    border-radius: 10px !important;
    background: #ffffff !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
    min-height: 120px;
}

/* Premium Subtle Color Gradients per Card Category */
.stat-widget-card.stat-primary {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, #ffffff 65%) !important;
    border-color: rgba(37, 99, 235, 0.2) !important;
}

.stat-widget-card.stat-info {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.06) 0%, #ffffff 65%) !important;
    border-color: rgba(14, 165, 233, 0.22) !important;
}

.stat-widget-card.stat-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, #ffffff 65%) !important;
    border-color: rgba(16, 185, 129, 0.22) !important;
}

.stat-widget-card.stat-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.07) 0%, #ffffff 65%) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}

.stat-widget-card.stat-secondary {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.05) 0%, #ffffff 65%) !important;
    border-color: rgba(108, 117, 125, 0.2) !important;
}

.stat-widget-card.stat-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.07) 0%, #ffffff 65%) !important;
    border-color: rgba(239, 68, 68, 0.22) !important;
}

.stat-widget-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.stat-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 36px;
    gap: 6px;
}

.stat-title-wrap {
    flex: 1;
    min-width: 0;
}

.stat-title-wrap .stat-title-text {
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.stat-widget-anchor {
    cursor: pointer;
}

.stat-widget-anchor:hover .stat-widget-card {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08) !important;
}

.stat-widget-anchor:hover .stat-widget-card.stat-primary {
    border-color: rgba(37, 99, 235, 0.5) !important;
}

.stat-widget-anchor:hover .stat-widget-card.stat-info {
    border-color: rgba(14, 165, 233, 0.5) !important;
}

.stat-widget-anchor:hover .stat-widget-card.stat-success {
    border-color: rgba(16, 185, 129, 0.5) !important;
}

.stat-widget-anchor:hover .stat-widget-card.stat-warning {
    border-color: rgba(245, 158, 11, 0.55) !important;
}

.stat-widget-anchor:hover .stat-widget-card.stat-secondary {
    border-color: rgba(108, 117, 125, 0.5) !important;
}

.stat-widget-anchor:hover .stat-arrow-icon {
    color: #2563eb !important;
    transform: translateX(3px);
}

.stat-arrow-icon {
    color: #98a6ad;
    transition: all 0.2s ease;
    display: inline-block;
}

/* Solid Vibrant Icon Badges with 10px Radius */
.stat-icon-box {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 10px !important;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-widget-anchor:hover .stat-icon-box {
    transform: scale(1.1);
}

.stat-icon-box.stat-primary {
    background: linear-gradient(135deg, #2563eb 0%, #5d68ec 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.stat-icon-box.stat-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #229bbb 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.35);
}

.stat-icon-box.stat-success {
    background: linear-gradient(135deg, #10b981 0%, #08b383 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.stat-icon-box.stat-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #f39c12 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

.stat-icon-box.stat-secondary {
    background: linear-gradient(135deg, #7987a1 0%, #68758e 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(108, 117, 125, 0.35);
}

.stat-icon-box.stat-danger {
    background: linear-gradient(135deg, #ef4444 0%, #e84163 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}

.stat-count-value {
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    color: #313a46;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.stat-card-highlight {
    border: 1.5px solid #ef4444 !important;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.18) !important;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse-red 1.5s infinite;
    vertical-align: middle;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ApexCharts Tooltip Visibility & Contrast Fix */
.apexcharts-tooltip {
    background: #1e2430 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35) !important;
    border-radius: 8px !important;
}

.apexcharts-tooltip-title {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    font-weight: 700 !important;
    padding: 6px 10px !important;
}

.apexcharts-tooltip-text,
.apexcharts-tooltip-text-y-label,
.apexcharts-tooltip-text-y-value,
.apexcharts-tooltip-series-group {
    color: #ffffff !important;
}

/* Critical Stock Table Search & Controls (10px Radius & Responsive) */
.dashboard-search-wrap input {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    height: 34px;
    border-radius: 10px !important;
}

.dashboard-search-wrap input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

.btn-clear-search {
    line-height: 1;
    color: #98a6ad;
    transition: color 0.15s ease, transform 0.15s ease;
    z-index: 5;
}

.btn-clear-search:hover {
    color: #ef4444 !important;
    transform: translateY(-50%) scale(1.15) !important;
}

#criticalStockTable_wrapper .dataTables_length select {
    border-radius: 8px !important;
    border: 1px solid #e2e8f0;
    padding: 2px 24px 2px 8px;
    font-size: 0.8rem;
    height: 30px;
    color: #475569;
    background-color: #ffffff;
}

.btn,
.btn-sm {
    border-radius: 8px !important;
}

.badge {
    border-radius: 6px !important;
}

.rounded-3 {
    border-radius: 10px !important;
}

.pagination-rounded .page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
}

.pagination-rounded .page-item.active .page-link {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

/* Mobile Responsiveness for Critical Stock Table */
@media (max-width: 576px) {
    .stock-table-header-wrap {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .stock-table-actions {
        width: 100% !important;
        justify-content: space-between !important;
    }

    .dashboard-search-wrap {
        flex-grow: 1 !important;
    }

    .dashboard-search-wrap input {
        width: 100% !important;
    }

    #criticalStockTable_wrapper .dataTables_paginate {
        margin-top: 8px !important;
    }
}

/* Dark Mode Adjustments */
body[data-layout-color="dark"] .content-page {
    background-color: #222736 !important;
}

body[data-layout-color="dark"] .stat-widget-card,
body[data-layout-color="dark"] .card {
    background: #2b3040 !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
}

body[data-layout-color="dark"] .stat-count-value {
    color: #e3eaef !important;
}

body[data-layout-color="dark"] .table-light th {
    background-color: #374151 !important;
    color: #cbd5e1 !important;
}

body[data-layout-color="dark"] .dashboard-search-wrap input {
    background: #313a46 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e3eaef !important;
}

body[data-layout-color="dark"] #criticalStockTable_wrapper .dataTables_length select {
    background-color: #313a46 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e3eaef !important;
}

body[data-layout-color="dark"] .page-link {
    background-color: #313a46;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e3eaef;
}
