/* ============================================ */
/* 📊 TABLE CONTRAST FIX */
/* Bolja čitljivost tabela - tamnije boje */
/* ============================================ */

/* Fix za LIŠĆARI kolonu - tamnije žuto/narandžasto */
.col-group-liscari {
    background: linear-gradient(to bottom, #fbbf24 0%, #f59e0b 100%) !important;
    border-left: 2px solid #d97706 !important;
    border-right: 2px solid #d97706 !important;
    color: #78350f !important;
    font-weight: 600 !important;
}

/* Fix za žute highlight redove - tamnija žuta */
.worker-table tbody tr.mjesec-9 {
    background: linear-gradient(to right, #fde047 0%, #fbbf24 100%) !important;
}

.worker-table tbody tr.mjesec-9:hover {
    background: linear-gradient(to right, #fbbf24 0%, #f59e0b 100%) !important;
    box-shadow: inset 4px 0 0 #d97706 !important;
}

/* Fix za narandžaste redove - dublji ton */
.worker-table tbody tr.mjesec-10 {
    background: linear-gradient(to right, #fb923c 0%, #f97316 100%) !important;
}

.worker-table tbody tr.mjesec-10:hover {
    background: linear-gradient(to right, #f97316 0%, #ea580c 100%) !important;
    box-shadow: inset 4px 0 0 #c2410c !important;
}

/* Fix za opće žute background-e */
[style*="background: #fef3c7"],
[style*="background: #fef9c3"],
[style*="background: #fed7aa"] {
    background: #fde047 !important; /* Tamnija žuta */
    color: #78350f !important; /* Tamni tekst */
}

/* Fix za light yellow gradients */
[style*="linear-gradient(135deg, #fffbeb"],
[style*="linear-gradient(135deg, #fef3c7"] {
    background: linear-gradient(135deg, #fde047 0%, #fbbf24 100%) !important;
}

/* Override inline styles sa světlim bojama */
.month-row[style*="#fef3c7"],
.data-row[style*="#fef3c7"],
td[style*="background: #fef3c7"] {
    background: #fde047 !important;
    color: #78350f !important;
}

/* Općenito pravilo za sve svijetle žute ćelije */
td[style*="background-color: rgb(254, 243, 199)"],
td[style*="background-color: rgb(254, 249, 195)"],
td[style*="background-color: rgb(254, 215, 170)"],
td[style*="background: linear-gradient"][style*="254, 243"] {
    background: #fbbf24 !important;
    color: #78350f !important;
    font-weight: 500 !important;
}

/* Fix za izvještaje tabele */
.izvjestaj-table td[style*="background"],
.izvjestaj-table th[style*="background"] {
    /* Osiguraj dovoljnu kontrast */
}

.izvjestaj-table td[style*="#fef3c7"],
.izvjestaj-table td[style*="#fef9c3"],
.izvjestaj-table td[style*="#fed7aa"] {
    background: #fbbf24 !important;
    color: #78350f !important;
}

/* Specifično za mjesečni izvještaj tabele */
#primac-mjesecni-content table td,
#otpremac-mjesecni-content table td {
    min-width: 80px;
}

#primac-mjesecni-content table td[style*="background"],
#otpremac-mjesecni-content table td[style*="background"] {
    font-weight: 500;
}

/* Svijetle žute ćelije -> Tamnije */
#primac-mjesecni-content table td[style*="#fef3c7"],
#primac-mjesecni-content table td[style*="#fef9c3"],
#primac-mjesecni-content table td[style*="#fed7aa"],
#otpremac-mjesecni-content table td[style*="#fef3c7"],
#otpremac-mjesecni-content table td[style*="#fef9c3"],
#otpremac-mjesecni-content table td[style*="#fed7aa"] {
    background: #fbbf24 !important;
    color: #78350f !important;
    font-weight: 600 !important;
}

/* Badge warning - tamniji */
.badge.warning {
    background: #fbbf24 !important;
    color: #78350f !important;
}

/* Cache status warning - tamniji */
.cache-status.cache-loading {
    background: #fbbf24 !important;
    color: #78350f !important;
}

/* Ensure text contrast na svim svijetlim background-ima */
*[style*="background: #fef"],
*[style*="background: #ffc"],
*[style*="background: #fed"],
*[style*="background-color: rgb(254, 2"] {
    color: #78350f !important;
}

/* ============================================ */
/* 🔧 FIX ZA MJESEČNE IZVJEŠTAJE (ADMIN) */
/* Fix za TRUPCI kolone koje imaju bijeli tekst */
/* ============================================ */

/* Mjesečni sortimenti tabele - sve col-group-liscari kolone */
#mjesecna-sjeca-table .col-group-liscari,
#mjesecna-otprema-table .col-group-liscari {
    background: linear-gradient(to bottom, #fbbf24 0%, #f59e0b 100%) !important;
    color: #78350f !important;
    font-weight: 600 !important;
}

/* Header za TRUPCI i sve lišćari sortimente */
#mjesecna-sjeca-table thead .col-group-liscari,
#mjesecna-otprema-table thead .col-group-liscari {
    background: #d97706 !important;
    color: white !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Body cells za TRUPCI - tamniji background sa tamnim tekstom */
#mjesecna-sjeca-table tbody .col-group-liscari,
#mjesecna-otprema-table tbody .col-group-liscari {
    background: #fde047 !important;
    color: #78350f !important;
    font-weight: 600 !important;
}

/* Agregat kolone - col-liscari (LIŠĆARI ukupno) */
#mjesecna-sjeca-table .col-liscari,
#mjesecna-otprema-table .col-liscari {
    background: #fbbf24 !important;
    color: #78350f !important;
    font-weight: 700 !important;
}

/* Header za LIŠĆARI agregat */
#mjesecna-sjeca-table thead .col-liscari,
#mjesecna-otprema-table thead .col-liscari {
    background: #d97706 !important;
    color: white !important;
}

/* Override inline styles sa !important specificity */
#mjesecna-sjeca-table th[style*="color: white"],
#mjesecna-otprema-table th[style*="color: white"] {
    /* Headers mogu ostati bijeli */
}

#mjesecna-sjeca-table tbody td.col-group-liscari[style],
#mjesecna-otprema-table tbody td.col-group-liscari[style] {
    color: #78350f !important;
    background: #fde047 !important;
}

/* Fix za col-cetinari takođe (zelene kolone) */
#mjesecna-sjeca-table .col-group-cetinari,
#mjesecna-otprema-table .col-group-cetinari {
    background: linear-gradient(to bottom, #d1fae5 0%, #a7f3d0 100%) !important;
    color: #065f46 !important;
    font-weight: 600 !important;
}

#mjesecna-sjeca-table thead .col-group-cetinari,
#mjesecna-otprema-table thead .col-group-cetinari {
    background: #059669 !important;
    color: white !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#mjesecna-sjeca-table tbody .col-group-cetinari,
#mjesecna-otprema-table tbody .col-group-cetinari {
    background: #d1fae5 !important;
    color: #065f46 !important;
}

/* ============================================ */
/* 🔧 NOVI IZVJEŠTAJI - Profesionalne tabele */
/* Konzistentne boje sa pravilnim borderima */
/* ============================================ */

.izvjestaji-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #e5e7eb;
    font-size: 14px;
}

.izvjestaji-table thead th {
    padding: 12px;
    text-align: right;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.izvjestaji-table thead th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 20;
    background: #374151 !important;
    color: white !important;
    border-right: 2px solid #1f2937;
}

.izvjestaji-table tbody td {
    padding: 12px;
    text-align: right;
    font-weight: 600;
    border: 1px solid #e5e7eb;
}

.izvjestaji-table tbody td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 10;
    background: white !important;
    color: #1f2937 !important;
    font-weight: 700;
    border-right: 2px solid #d1d5db;
}

.izvjestaji-table tbody tr:hover {
    background: #f9fafb;
}

.izvjestaji-table tbody tr:hover td:first-child {
    background: #f3f4f6 !important;
}

/* ============================================ */
/* 📊 GLOBAL TYPOGRAPHY FOR NUMERIC DATA */
/* Inter font za SVE brojeve na SVIM panelima */
/* ============================================ */

/* Base numeric typography - INTER for ALL tables */
table td {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-weight: 600 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Numeric cells - INTER BOLD for all right-aligned cells */
table td[style*="text-align: right"],
table td.number,
table td.right,
.izvjestaji-table tbody td,
.izvjestaj-table tbody td,
.worker-table tbody td,
#odjeli-table-body td,
#stanje-table-body td,
#realizacija-table-body td,
#primke-table-body td,
#otpreme-table-body td,
#kupci-godisnji-tbody td,
#kupci-mjesecni-tbody td,
#primaci-body td,
#otpremaci-body td,
#primaci-daily-body td,
#primaci-radilista-body td,
#primaci-izvodjaci-body td,
.monthly-table tbody td,
.kupci-table tbody td {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #0f172a !important;
    font-feature-settings: 'tnum' 1 !important;
    -webkit-font-smoothing: antialiased !important;
}

/* Data values with green color - BOLD */
table td.green,
table td.number.green,
td[style*="color: #059669"],
td[style*="color: #047857"],
td[style*="color: #10b981"] {
    font-weight: 800 !important;
    color: #047857 !important;
}

/* Data values with blue color - BOLD */
table td.blue,
table td.number.blue,
td[style*="color: #2563eb"],
td[style*="color: #3b82f6"],
td[style*="color: #1d4ed8"] {
    font-weight: 800 !important;
    color: #1d4ed8 !important;
}

/* Data values with red color - BOLD */
table td.red,
table td.number.red,
td[style*="color: #dc2626"],
td[style*="color: #ef4444"] {
    font-weight: 800 !important;
    color: #b91c1c !important;
}

/* UKUPNO/Total rows - MAXIMUM emphasis */
table tbody tr:last-child td,
table tfoot td,
.ukupno-row td,
.total-row td {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 900 !important;
    font-size: 15px !important;
}

/* CRITICAL: Dark background rows MUST have white text */
/* Override the color: #0f172a from above */
tr[style*="background: #047857"] td,
tr[style*="background: #065f46"] td,
tr[style*="background: #059669"] td,
tr[style*="background: #0369a1"] td,
tr[style*="background: #0891b2"] td,
tr[style*="background: #0e7490"] td,
tr[style*="background: linear-gradient"][style*="#047857"] td,
tr[style*="background: linear-gradient"][style*="#065f46"] td,
tr[style*="background: linear-gradient"][style*="#0369a1"] td {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    font-weight: 700 !important;
}

/* White text on dark backgrounds */
td[style*="color: white"],
td[style*="color: #ffffff"],
th[style*="color: white"],
th[style*="color: #ffffff"] {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
}

/* Dashboard cards - numeric values - INTER */
.stat-value,
.card-value,
.metric-value {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 800 !important;
    -webkit-font-smoothing: antialiased !important;
}

/* Monthly report tables - INTER BOLD */
#mjesecna-sjeca-table td,
#mjesecna-otprema-table td {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px !important;
}

/* Primaci and Otpremaci detail tables - INTER */
#primac-detail-content table td,
#otpremac-detail-content table td,
#primac-mjesecni-content table td,
#otpremac-mjesecni-content table td,
#primac-odjeli-content table td,
#otpremac-odjeli-content table td {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #0f172a !important;
}

/* Sortimenti tables - INTER */
#sortimenti-content table td,
#primke-content table td,
#otpreme-content table td {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #0f172a !important;
}

/* Poslovođa panel tables - INTER */
#poslovodja-stanje-content table td,
#poslovodja-realizacija-content table td,
#poslovodja-zadnjih5-content table td,
#poslovodja-suma-content table td {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #0f172a !important;
}

/* Radnici panel tables - INTER */
#radnici-content table td,
#primac-personal-content table td,
#otpremac-personal-content table td {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #0f172a !important;
}

/* Stanje Zaliha tables - INTER */
.stanje-zaliha-card table td {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    color: #0f172a !important;
}

/* Kupci tables - INTER */
#kupci-content table td {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #0f172a !important;
}

/* Mobile: all numeric cells BIGGER and BOLDER */
@media (max-width: 768px) {
    table td,
    table td[style*="text-align: right"] {
        font-size: 15px !important;
        font-weight: 800 !important;
    }

    table tbody tr:last-child td,
    .ukupno-row td {
        font-size: 16px !important;
        font-weight: 900 !important;
    }
}

/* TABLE CONTRAST FIX - Loaded successfully */
/* Svijetle žute boje zamijenjene tamnijim + TRUPCI fix za sve tabele + Typography improvements */

/* ============================================ */
/* 🎯 WHITE TEXT ON DARK BACKGROUNDS */
/* Fix za tamne pozadine - bijeli tekst */
/* ============================================ */

/* Expert table header - force white text */
.expert-table thead th,
.expert-table thead th * {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Expert table footer - force white text (UKUPNO/REKAPITULACIJA rows) */
.expert-table tfoot td,
.expert-table tfoot td *,
#otpremaci-po-kupcima-footer td,
#otpremaci-po-kupcima-footer td * {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    font-weight: 700 !important;
}

/* Kupci table UKUPNO row (last row in tbody) */
.kupci-table tbody tr:last-child[style*="background: #047857"] td,
.kupci-table tbody tr:last-child[style*="background: linear-gradient"] td,
#kupci-godisnji-body tr:last-child td,
#kupci-mjesecni-body tr:last-child td {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* All dark teal/green backgrounds - white text */
*[style*="background: #0891b2"] td,
*[style*="background: #0e7490"] td,
*[style*="background: #047857"] td,
*[style*="background: #065f46"] td,
*[style*="background: #064e3b"] td,
*[style*="background: #059669"] td,
*[style*="background: linear-gradient"][style*="#047857"] td,
*[style*="background: linear-gradient"][style*="#065f46"] td,
*[style*="background: linear-gradient"][style*="#0891b2"] td,
tr[style*="background: #047857"] td,
tr[style*="background: #065f46"] td,
tr[style*="background: #0891b2"] td,
tr[style*="background: #0e7490"] td,
tr[style*="background: linear-gradient"][style*="#047857"] td,
tr[style*="background: linear-gradient"][style*="#065f46"] td {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Kupci table - totals row (dark green background) */
.kupci-table .totals-row td,
.kupci-table tfoot td,
.kupci-table tbody tr:last-child[style*="background: #047857"] td,
.kupci-table tbody tr:last-child[style*="background: linear-gradient"] td {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Monthly table dark rows */
.monthly-table tfoot td,
.monthly-table .ukupno-row td,
.monthly-table tbody tr[style*="background: #047857"] td,
.monthly-table tbody tr[style*="background: #065f46"] td {
    color: white !important;
}

/* Dark blue backgrounds (#1e40af, #1d4ed8, #2563eb) - white text */
*[style*="background: #1e40af"] td,
*[style*="background: #1d4ed8"] td,
*[style*="background: #2563eb"] td,
tr[style*="background: #1e40af"] td,
tr[style*="background: #1d4ed8"] td {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Red/Maroon backgrounds - white text */
*[style*="background: #dc2626"] td,
*[style*="background: #b91c1c"] td,
*[style*="background: #991b1b"] td,
tr[style*="background: #dc2626"] td,
tr[style*="background: #b91c1c"] td {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Professional monthly table UKUPNO rows */
.professional-monthly-table tfoot td,
.professional-monthly-table tbody tr.ukupno-row td {
    color: white !important;
}

/* Stanje zaliha dark backgrounds */
.stanje-zaliha-card table tfoot td,
.stanje-zaliha-card table tr[style*="background: #047857"] td,
.stanje-zaliha-card table tr[style*="background: #065f46"] td {
    color: white !important;
}

/* Generic: any element with dark background should have white text */
th[style*="background: #047857"],
th[style*="background: #065f46"],
th[style*="background: #0891b2"],
th[style*="background: #0e7490"],
th[style*="background: #1e40af"],
th[style*="background: #1d4ed8"],
td[style*="background: #047857"],
td[style*="background: #065f46"],
td[style*="background: #0891b2"],
td[style*="background: #0e7490"],
td[style*="background: #1e40af"],
td[style*="background: #1d4ed8"] {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Rows with inline dark background gradient - white text */
tr[style*="linear-gradient"][style*="#047857"] td,
tr[style*="linear-gradient"][style*="#065f46"] td,
tr[style*="linear-gradient"][style*="#0891b2"] td,
tr[style*="linear-gradient"][style*="#0e7490"] td,
tr[style*="linear-gradient"][style*="#0369a1"] td {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
}

/* Force override for ANY td with dark color inline style */
tr[style*="background: #047857"] td,
tr[style*="background: #065f46"] td,
tr[style*="background: #0369a1"] td,
tr[style*="background: #0891b2"] td {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Header row with dark background - white text */
tr[style*="background: #047857"] th,
tr[style*="background: #065f46"] th,
tr[style*="background: #0369a1"] th,
tr[style*="background: #0891b2"] th {
    color: white !important;
}

/* Kupci godisnji/mjesecni tables - ensure white text on dark rows */
#kupci-godisnji-body tr[style*="background: #047857"] td,
#kupci-godisnji-body tr[style*="background: linear-gradient"] td,
#kupci-mjesecni-body tr[style*="background: #047857"] td,
#kupci-mjesecni-body tr[style*="background: linear-gradient"] td,
#kupci-godisnji-body tr:last-child td,
#kupci-mjesecni-body tr:last-child td {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Worker table totals-row dark mode */
body.dark-mode .worker-table .totals-row td {
    color: white !important;
}

/* Override ALL table tds that have color: white inline style to ensure it stays white */
td[style*="color: white"],
th[style*="color: white"] {
    color: white !important;
}

/* ============================================ */
/* 📱 MJESEČNA SJEČA/OTPREMA - MOBILE READABILITY */
/* Maksimalna čitljivost numeričkih vrijednosti */
/* Font: Inter - odličan za brojeve, debeo i čitak */
/* ============================================ */

/* Pro mjesečna tabela - base styling */
.pro-mjesecna-table {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.pro-mjesecna-table td {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    padding: 14px 10px !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
    letter-spacing: -0.01em !important;
    font-feature-settings: 'tnum' 1, 'ss01' 1 !important;
    -webkit-font-smoothing: antialiased !important;
}

.pro-mjesecna-table th {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    padding: 14px 8px !important;
    line-height: 1.2 !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
}

/* Sticky MJESEC column - labels use Comfortaa */
.pro-mjesecna-table td:first-child {
    font-family: 'Comfortaa', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

.pro-mjesecna-table th:first-child {
    font-family: 'Comfortaa', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

/* Numeric cells - BOLD and DARK */
.pro-mjesecna-table tbody td {
    text-shadow: none !important;
    font-weight: 700 !important;
}

/* Values > 0 - extra bold */
.pro-mjesecna-table tbody td[style*="font-weight: 5"],
.pro-mjesecna-table tbody td[style*="font-weight: 6"],
.pro-mjesecna-table tbody td[style*="font-weight: 7"],
.pro-mjesecna-table tbody td[style*="font-weight: 8"] {
    color: #000000 !important;
    font-weight: 800 !important;
}

/* Zero values - still readable */
.pro-mjesecna-table tbody td[style*="font-weight: 4"] {
    color: #475569 !important;
    font-weight: 600 !important;
}

/* UKUPNO row - maximum emphasis */
.pro-mjesecna-table tbody tr:nth-last-child(2) td {
    font-size: 16px !important;
    font-weight: 900 !important;
    letter-spacing: -0.02em !important;
}

/* % UČEŠĆE row */
.pro-mjesecna-table tbody tr:last-child td {
    font-size: 14px !important;
    font-weight: 700 !important;
}

/* Četinari columns - blue tones with DARK text */
.pro-mjesecna-table td[style*="background: #dbeafe"],
.pro-mjesecna-table td[style*="background: #bfdbfe"],
.pro-mjesecna-table td[style*="background: #93c5fd"] {
    color: #1e3a8a !important;
    font-weight: 800 !important;
}

/* Lišćari columns - yellow/orange tones with DARK text */
.pro-mjesecna-table td[style*="background: #fef3c7"],
.pro-mjesecna-table td[style*="background: #fde68a"],
.pro-mjesecna-table td[style*="background: #fcd34d"] {
    color: #713f12 !important;
    font-weight: 800 !important;
}

/* SVEUKUPNO column - red tone with DARK text */
.pro-mjesecna-table td[style*="background: #fecaca"] {
    color: #7f1d1d !important;
    font-weight: 900 !important;
}

/* ============================================ */
/* 📱 MOBILE RESPONSIVE - max-width: 768px */
/* Inter font + BOLD weights for mobile */
/* ============================================ */

@media (max-width: 768px) {
    .pro-mjesecna-table {
        font-size: 14px !important;
    }

    .pro-mjesecna-table td {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
        font-size: 16px !important;
        font-weight: 800 !important;
        padding: 16px 10px !important;
        line-height: 1.4 !important;
        min-height: 52px !important;
        color: #000000 !important;
        -webkit-font-smoothing: antialiased !important;
    }

    .pro-mjesecna-table th {
        font-size: 11px !important;
        font-weight: 800 !important;
        padding: 14px 6px !important;
        line-height: 1.3 !important;
    }

    /* Sticky MJESEC column - larger on mobile */
    .pro-mjesecna-table td:first-child {
        font-family: 'Comfortaa', sans-serif !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        min-width: 65px !important;
        padding: 16px 8px !important;
    }

    .pro-mjesecna-table th:first-child {
        font-size: 12px !important;
        min-width: 65px !important;
    }

    /* UKUPNO row - MAXIMUM emphasis on mobile */
    .pro-mjesecna-table tbody tr:nth-last-child(2) td {
        font-size: 18px !important;
        font-weight: 900 !important;
        padding: 18px 10px !important;
        letter-spacing: -0.02em !important;
    }

    /* % UČEŠĆE row */
    .pro-mjesecna-table tbody tr:last-child td {
        font-size: 15px !important;
        font-weight: 800 !important;
        padding: 16px 10px !important;
    }

    /* Zero values - still BOLD on mobile */
    .pro-mjesecna-table tbody td[style*="font-weight: 4"] {
        font-weight: 700 !important;
        color: #374151 !important;
    }

    /* All numeric values BOLD */
    .pro-mjesecna-table tbody td[style*="font-weight: 5"],
    .pro-mjesecna-table tbody td[style*="font-weight: 6"] {
        font-weight: 800 !important;
    }

    /* Card headers on mobile */
    .mjesecni-card h2 {
        font-size: 16px !important;
    }

    .mjesecni-card p {
        font-size: 12px !important;
    }
}

/* ============================================ */
/* 📱 SMALL MOBILE - max-width: 480px */
/* ============================================ */

@media (max-width: 480px) {
    .pro-mjesecna-table td {
        font-size: 14px !important;
        padding: 12px 6px !important;
        min-width: 55px !important;
    }

    .pro-mjesecna-table th {
        font-size: 10px !important;
        padding: 10px 4px !important;
        min-width: 55px !important;
    }

    .pro-mjesecna-table td:first-child {
        font-size: 13px !important;
        min-width: 60px !important;
    }

    .pro-mjesecna-table tbody tr:nth-last-child(2) td {
        font-size: 15px !important;
    }
}

/* ============================================ */
/* 🎨 STANJE ZALIHA - TABLE READABILITY */
/* ============================================ */

.stanje-zaliha-table td {
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 10px 8px !important;
    color: #1e293b !important;
}

.stanje-zaliha-table th {
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 12px 8px !important;
}

@media (max-width: 768px) {
    .stanje-zaliha-table td {
        font-size: 14px !important;
        font-weight: 700 !important;
        padding: 12px 8px !important;
    }

    .stanje-zaliha-table th {
        font-size: 10px !important;
        padding: 10px 6px !important;
    }
}

/* ============================================ */
/* 🏭 PRIKAZ PO ODJELIMA - TABLE HEADERS */
/* Poboljšana čitljivost zaglavlja tabela */
/* ============================================ */

/* Kupci table headers - Inter font, veći i čitljiviji */
.kupci-table thead th {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 14px 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #065f46 !important;
    white-space: nowrap !important;
}

/* Sortiment column headers - specifično za nazive sortimenta */
.kupci-table thead .sortiment-col {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 12px 6px !important;
    min-width: 70px !important;
    text-align: center !important;
    white-space: nowrap !important;
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    color: white !important;
}

/* Ukupno column header - naglašeno */
.kupci-table thead .ukupno-col {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #065f46 0%, #064e3b 100%) !important;
    color: white !important;
    min-width: 90px !important;
}

/* Body cells - Inter font za brojeve */
.kupci-table tbody td {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
}

.kupci-table tbody .sortiment-col {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 700 !important;
    text-align: right !important;
}

.kupci-table tbody .ukupno-col {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #047857 !important;
}

/* Otpremač tabele - plava tema */
#otpremac-odjeli-container .kupci-table thead th {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%) !important;
    border-color: #1e3a8a !important;
}

#otpremac-odjeli-container .kupci-table thead .sortiment-col {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
}

#otpremac-odjeli-container .kupci-table thead .ukupno-col {
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%) !important;
}

#otpremac-odjeli-container .kupci-table tbody .ukupno-col {
    color: #1e40af !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .kupci-table thead th {
        font-size: 10px !important;
        padding: 10px 4px !important;
        letter-spacing: 0 !important;
    }

    .kupci-table thead .sortiment-col {
        font-size: 9px !important;
        padding: 8px 3px !important;
        min-width: 55px !important;
    }

    .kupci-table thead .ukupno-col {
        font-size: 11px !important;
        min-width: 70px !important;
    }

    .kupci-table tbody td {
        font-size: 13px !important;
    }

    .kupci-table tbody .ukupno-col {
        font-size: 14px !important;
    }
}

/* ============================================ */
/* 📊 IZVJEŠTAJI - Sedmični i Mjesečni */
/* Uniformne, profesionalne tabele */
/* ============================================ */

.izvjestaj-week-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    font-size: 14px;
    border: 2px solid #374151;
    border-radius: 8px;
    overflow: hidden;
}

/* Header - tamno siva, uniformna */
.izvjestaj-week-table thead th {
    background: #1f2937 !important;
    color: #ffffff !important;
    padding: 12px 10px;
    text-align: right;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #374151;
    white-space: nowrap;
}

.izvjestaj-week-table thead th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 20;
    background: #111827 !important;
    min-width: 180px;
    border-right: 2px solid #4b5563;
}

/* Body rows */
.izvjestaj-week-table tbody tr {
    transition: background-color 0.15s ease;
}

.izvjestaj-week-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.izvjestaj-week-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.izvjestaj-week-table tbody tr:hover {
    background: #e0f2fe !important;
}

.izvjestaj-week-table tbody td {
    padding: 10px;
    text-align: right;
    font-weight: 600;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-feature-settings: 'tnum' 1;
    border: 1px solid #e5e7eb;
    color: #1f2937;
}

.izvjestaj-week-table tbody td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 10;
    background: inherit;
    font-weight: 700;
    color: #111827;
    border-right: 2px solid #d1d5db;
}

.izvjestaj-week-table tbody tr:nth-child(odd) td:first-child {
    background: #ffffff;
}

.izvjestaj-week-table tbody tr:nth-child(even) td:first-child {
    background: #f9fafb;
}

.izvjestaj-week-table tbody tr:hover td:first-child {
    background: #e0f2fe !important;
}

/* UKUPNO row - istaknuti */
.izvjestaj-week-table tbody tr.totals-row {
    background: #059669 !important;
    border-top: 3px solid #047857;
}

.izvjestaj-week-table tbody tr.totals-row td {
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 14px;
    padding: 14px 10px;
    border-color: #047857;
}

.izvjestaj-week-table tbody tr.totals-row td:first-child {
    background: #047857 !important;
    color: #ffffff !important;
}

.izvjestaj-week-table tfoot tr {
    background: #059669 !important;
}

.izvjestaj-week-table tfoot td {
    color: #ffffff !important;
    font-weight: 800 !important;
    padding: 14px 10px;
    text-align: right;
}

.izvjestaj-week-table tfoot td:first-child {
    background: #047857 !important;
    text-align: left;
}

/* Sortiment column groups - subtle coloring */
.izvjestaj-week-table .col-cetinari {
    background: rgba(16, 185, 129, 0.08) !important;
}

.izvjestaj-week-table .col-liscari {
    background: rgba(245, 158, 11, 0.08) !important;
}

.izvjestaj-week-table .col-sveukupno {
    background: rgba(59, 130, 246, 0.12) !important;
    font-weight: 800 !important;
}

.izvjestaj-week-table thead th.col-cetinari {
    background: #065f46 !important;
}

.izvjestaj-week-table thead th.col-liscari {
    background: #92400e !important;
}

.izvjestaj-week-table thead th.col-sveukupno {
    background: #1e40af !important;
}

/* Week section header */
.izvjestaj-week-header {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: 8px 8px 0 0;
    padding: 16px 20px;
    margin-bottom: 0;
}

.izvjestaj-week-header h3 {
    margin: 0;
    color: #166534;
    font-size: 16px;
    font-weight: 700;
}

.izvjestaj-week-header .week-dates {
    color: #15803d;
    font-size: 14px;
    margin-top: 4px;
}

/* Week container */
.izvjestaj-week-container {
    margin-bottom: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    overflow: hidden;
}

/* Empty week message */
.izvjestaj-empty-week {
    background: #f9fafb;
    padding: 24px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

/* ============================================ */
/* 🎨 PREGLED PO ODJELIMA - RADILIŠTE COLORING */
/* Centralna paleta boja za radilišta */
/* ============================================ */

/* Radilište color palette - 10 distinct colors */
.radiliste-1 { background-color: #dbeafe !important; } /* Light blue */
.radiliste-2 { background-color: #dcfce7 !important; } /* Light green */
.radiliste-3 { background-color: #fef3c7 !important; } /* Light amber */
.radiliste-4 { background-color: #fce7f3 !important; } /* Light pink */
.radiliste-5 { background-color: #e0e7ff !important; } /* Light indigo */
.radiliste-6 { background-color: #ccfbf1 !important; } /* Light teal */
.radiliste-7 { background-color: #fed7aa !important; } /* Light orange */
.radiliste-8 { background-color: #ddd6fe !important; } /* Light violet */
.radiliste-9 { background-color: #fbcfe8 !important; } /* Light rose */
.radiliste-10 { background-color: #d1fae5 !important; } /* Light emerald */

/* Radilište column text remains dark for readability */
#odjeli-table-body td.radiliste-1,
#odjeli-table-body td.radiliste-2,
#odjeli-table-body td.radiliste-3,
#odjeli-table-body td.radiliste-4,
#odjeli-table-body td.radiliste-5,
#odjeli-table-body td.radiliste-6,
#odjeli-table-body td.radiliste-7,
#odjeli-table-body td.radiliste-8,
#odjeli-table-body td.radiliste-9,
#odjeli-table-body td.radiliste-10 {
    color: #1f2937 !important;
    font-weight: 600 !important;
}

/* ============================================ */
/* 📊 REALIZACIJA HEATMAP - Percentage Classes */
/* Background colors based on percentage ranges */
/* ============================================ */

/* 0-25% - Red (critical) */
.real-0-25 {
    background-color: #fecaca !important;
    color: #991b1b !important;
    font-weight: 700 !important;
}

/* 25-50% - Orange (warning) */
.real-25-50 {
    background-color: #fed7aa !important;
    color: #9a3412 !important;
    font-weight: 700 !important;
}

/* 50-75% - Yellow (moderate) */
.real-50-75 {
    background-color: #fef08a !important;
    color: #854d0e !important;
    font-weight: 700 !important;
}

/* 75-100% - Light green (good) */
.real-75-100 {
    background-color: #bbf7d0 !important;
    color: #166534 !important;
    font-weight: 700 !important;
}

/* 100%+ - Deep green (excellent) */
.real-over-100 {
    background-color: #86efac !important;
    color: #14532d !important;
    font-weight: 800 !important;
}

/* Dark mode support for radilište colors */
body.dark-mode .radiliste-1 { background-color: #1e3a5f !important; color: #93c5fd !important; }
body.dark-mode .radiliste-2 { background-color: #14532d !important; color: #86efac !important; }
body.dark-mode .radiliste-3 { background-color: #78350f !important; color: #fde68a !important; }
body.dark-mode .radiliste-4 { background-color: #831843 !important; color: #f9a8d4 !important; }
body.dark-mode .radiliste-5 { background-color: #312e81 !important; color: #a5b4fc !important; }
body.dark-mode .radiliste-6 { background-color: #134e4a !important; color: #5eead4 !important; }
body.dark-mode .radiliste-7 { background-color: #7c2d12 !important; color: #fdba74 !important; }
body.dark-mode .radiliste-8 { background-color: #4c1d95 !important; color: #c4b5fd !important; }
body.dark-mode .radiliste-9 { background-color: #9f1239 !important; color: #fda4af !important; }
body.dark-mode .radiliste-10 { background-color: #064e3b !important; color: #6ee7b7 !important; }

/* Dark mode support for realizacija heatmap */
body.dark-mode .real-0-25 { background-color: #7f1d1d !important; color: #fecaca !important; }
body.dark-mode .real-25-50 { background-color: #7c2d12 !important; color: #fed7aa !important; }
body.dark-mode .real-50-75 { background-color: #713f12 !important; color: #fef08a !important; }
body.dark-mode .real-75-100 { background-color: #14532d !important; color: #bbf7d0 !important; }
body.dark-mode .real-over-100 { background-color: #064e3b !important; color: #86efac !important; }

/* ============================================ */
/* 🔄 KUPCI TABELE - SORTABLE HEADERS */
/* Stilovi za sortiranje po kolonama */
/* ============================================ */

/* Sortable header - hover efekat */
.sortable-header {
    cursor: pointer !important;
    user-select: none !important;
    transition: background-color 0.15s ease !important;
}

.sortable-header:hover {
    filter: brightness(1.15) !important;
}

/* Aktivna sort kolona - istaknutija */
.sortable-header.sort-active {
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
}

/* Sort strelice - inline u tekstu, vidljive */
.sortable-header .sort-arrow {
    margin-left: 4px;
    font-size: 12px;
}
