/* Bizmart Admin CSS - Enhanced */
body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', system-ui, Arial, sans-serif;
}

/* Hide default WP admin footer text on Bizmart admin pages (extra selector for compatibility) */
body[class*="bizmart"] #footer-left,
body[class*="bizmart"] #footer-upgrade {
    display: none !important;
}

#biz-supplier-modal {
    display: none;
}

/* Settings Page Enhancements */
.biz-settings-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f7f9fb;
}

.biz-settings-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

/* Invoice Print Styles */
@media print {

    .biz-modal-header,
    .invoice-print-actions,
    .no-print {
        display: none !important;
    }

    body * {
        visibility: hidden;
    }

    .invoice-print-preview,
    .invoice-print-preview * {
        visibility: visible;
    }

    .invoice-print-preview {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 20px;
    }
}

/* View Tabs */
.biz-view-tab {
    background: none;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.biz-view-tab:hover {
    color: #1f2937;
    background: #f3f4f6;
}

.biz-view-tab.active {
    color: #059669;
    border-bottom-color: #059669;
}

/* Responsive Tables */
@media screen and (max-width: 768px) {
    .biz-table {
        font-size: 12px;
    }

    .biz-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* DASHBOARD LAYOUT */
.biz-dashboard {
    font-family: 'Inter', system-ui, sans-serif;
    max-width: 100%;
    margin: 0;
    color: #1e293b;
    padding: 20px;
}

.biz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.biz-title {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.biz-subtitle {
    color: #64748b;
    margin: 5px 0 0 0;
}

.biz-actions {
    display: flex;
    gap: 10px;
}

.biz-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: white;
}

.biz-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: inline-block;
    background: #4f46e5;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.4;
}

.biz-btn.primary {
    background: #4f46e5;
    color: white;
}

.biz-btn.secondary {
    background: white;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.biz-btn:hover {
    transform: translateY(-1px);
    background: #4338ca;
    color: #ffffff;
}

/* GRID SYSTEMS */
.biz-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.biz-grid-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

@media (max-width: 1000px) {
    .biz-grid-main {
        grid-template-columns: 1fr;
    }
}

/* CARDS */
.biz-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

/* Small info icon next to card labels that shows the data range tooltip */
.biz-range-icon {
    display: inline-block;
    margin-left: 8px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 50%;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    text-align: center;
    font-weight: 700;
    cursor: help;
    border: 1px solid rgba(67,56,202,0.08);
    vertical-align: middle;
}

/* On small screens reduce spacing */
@media (max-width: 600px) {
    .biz-range-icon { margin-left: 6px; width:16px; height:16px; line-height:16px; font-size:11px; }
}

/* KPI CARDS */
.kpi-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.kpi-icon.income {
    background: #dcfce7;
    color: #15803d;
}

.kpi-icon.expense {
    background: #fee2e2;
    color: #b91c1c;
}

.kpi-icon.profit {
    background: #e0e7ff;
    color: #4338ca;
}

.kpi-icon.debt {
    background: #ffedd5;
    color: #c2410c;
}

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 2px 0;
}

.kpi-trend {
    font-size: 12px;
    font-weight: 500;
}

.kpi-trend.positive {
    color: #16a34a;
}

.kpi-trend.negative {
    color: #dc2626;
}

/* CHARTS */
.chart-card {
    min-height: 400px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

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

.legend-dot.sales {
    background: #4f46e5;
}

.legend-dot.expenses {
    background: #cbd5e1;
}

/* LISTS */
.biz-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.biz-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.biz-list li:last-child {
    border-bottom: none;
}

.list-name {
    display: block;
    font-weight: 600;
    color: #334155;
}

.list-desc {
    font-size: 12px;
    color: #94a3b8;
}

.list-amount {
    font-weight: 700;
    color: #0f172a;
}

.list-amount.negative {
    color: #dc2626;
}

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

.status-dot.positive {
    background: #16a34a;
}

.status-dot.warning {
    background: #ca8a04;
}

.status-dot.negative {
    background: #dc2626;
}

.card-link {
    display: block;
    margin-top: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: none;
}

/** 
 * FULL WIDTH LAYOUT ENHANCEMENTS 
 * Targets specific WordPress containers to remove margins and paddings
 */
.bizmart-page #wpcontent {
    padding-left: 0 !important;
}

.bizmart-page #wpbody-content {
    padding-bottom: 0 !important;
    float: none !important;
    width: auto !important;
}

.bizmart-page .wrap,
.bizmart-page .biz-container,
.bizmart-page .biz-dashboard,
.bizmart-page .biz-quick-products {
    padding: 30px 50px !important;
    max-width: 1600px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

/* Ensure the content fills the bottom space as much as possible */
.bizmart-page #wpfooter {
    display: none !important;
}

/* ────────────────────────────────────────────────────────────────────── */
/* DASHBOARD STYLES (moved from inline <style> in dashboard.php)        */
/* ────────────────────────────────────────────────────────────────────── */

.biz-wrap { max-width:1200px; margin:0 auto; }
.biz-row { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:16px; }

/* Dashboard cards */
#biz-analytics-dashboard .biz-card {
    background:#fff;
    border-radius:16px;
    padding:24px;
    box-shadow:0 4px 20px rgba(0,0,0,0.08);
    flex:1;
    min-width:220px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
#biz-analytics-dashboard .biz-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
#biz-analytics-dashboard .biz-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
}

.biz-label { font-size:13px; color:#6B7280; margin-bottom:8px; font-weight: 500; }
.biz-value { font-size:24px; font-weight:700; color:#111827; margin-bottom: 4px; }
.biz-small { font-size:12px; color:#6B7280; }

.biz-panel {
    background:#fff;
    padding:24px;
    border-radius:16px;
    box-shadow:0 4px 20px rgba(0,0,0,0.08);
    margin-top:20px;
    transition: all 0.3s ease;
}
.biz-panel:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.12); }

.biz-chip {
    background:#eef2ff;
    color:#1d4ed8;
    padding:8px 14px;
    border-radius:20px;
    text-decoration:none;
    margin-left:8px;
    transition: all 0.3s ease;
    font-weight: 500;
}
.biz-chip:hover { background: #1d4ed8; color: white; transform: translateY(-2px); }

.biz-table { width:100%; border-collapse:collapse; border-radius:8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.biz-table th, .biz-table td { padding:16px; border-bottom:1px solid #f1f5f9; text-align:left; vertical-align:middle; }
.biz-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}
.biz-table tr:hover td { background: #f9fafb; transition: background 0.2s ease; }

.biz-badge {
    display:inline-block;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color:#fff;
    padding:6px 12px;
    border-radius:20px;
    font-weight:600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.biz-flex { display:flex; justify-content:space-between; align-items:center; }

/* Stats grid */
.biz-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.biz-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100px;
}
.biz-stat-card:hover { transform: scale(1.02); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.biz-stat-card.positive { background: linear-gradient(135deg, #48bb78 0%, #38b2ac 100%); }
.biz-stat-card.negative { background: linear-gradient(135deg, #f56565 0%, #ed64a6 100%); }
.biz-stat-card.neutral { background: linear-gradient(135deg, #ed8936 0%, #ecc94b 100%); }
.biz-stat-value { font-size: 28px; font-weight: bold; margin: 4px 0; }
.biz-stat-label { font-size: 14px; opacity: 0.9; font-weight: 500; }

/* Compact tables */
.biz-scroll { width:100%; }
.biz-table-compact th, .biz-table-compact td { padding: 10px 12px; font-size:13px; }
.biz-table-compact tbody tr td { border-bottom: 1px solid #eef2f7; }
.biz-scroll thead th { position: sticky; top: 0; z-index: 3; background: #ffffff; }

/* Custom scrollbars */
.biz-scroll::-webkit-scrollbar { width: 10px; height:10px; }
.biz-scroll::-webkit-scrollbar-track { background: transparent; }
.biz-scroll::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.12); border-radius: 8px; }
.biz-scroll:hover::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.18); }
.biz-scroll { scrollbar-width: thin; scrollbar-color: rgba(15,23,42,0.12) transparent; }

/* Enhanced header */
.biz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.biz-header h1 { margin: 0; font-size: 28px; font-weight: 700; }
.biz-header p { margin: 8px 0 0; opacity: 0.9; font-size: 16px; }

/* Responsive */
@media (max-width:720px) {
    .biz-value { font-size:20px; }
    .biz-stat-value { font-size:24px; }
}
@media (max-width: 768px) {
    .biz-table, .biz-table-compact {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
#biz-analytics-dashboard .biz-card,
#biz-analytics-dashboard .biz-panel {
    animation: fadeInUp 0.6s ease-out;
}
#biz-analytics-dashboard .biz-card:nth-child(1) { animation-delay: 0.1s; }
#biz-analytics-dashboard .biz-card:nth-child(2) { animation-delay: 0.2s; }
#biz-analytics-dashboard .biz-card:nth-child(3) { animation-delay: 0.3s; }
#biz-analytics-dashboard .biz-card:nth-child(4) { animation-delay: 0.4s; }

/* Dashboard button variants */
.biz-btn-secondary {
    background: white !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}
.biz-btn-secondary:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}
.biz-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
}
.biz-btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}