/* LinkLista Statistika — styles */

/* Osnovni wrapper */
.ll-stats {
    background: #F7F5F2;
    color: #4B4539;
    font-family: Nunito Sans, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    padding: 24px;
    box-sizing: border-box;
}

.ll-stats .ll-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* Kartica (generička, za grafove i sl.) */
.ll-card {
    background: #E6E4E1;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    margin: 16px 0;
}

/* Skrol kontejner za grafike na mobilu */
.canvas-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    background: transparent;
}

.canvas-inner {
    /* širina se postavlja inline iz PHP-a */
    height: 360px;
    position: relative;
}

@media (max-width:600px) {
    .canvas-inner {
        height: 320px;
    }
}

/* Legenda ispod grafa */
.ll-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0, 0, 0, .08);
}

.ll-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #4B4539;
}

.ll-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid #CFCFCF;
}

/* === LL Statistika: 2×2 mreža + tabela === */

/* Desktop: 2 kolone */
.ll-months-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Kartica meseca */
.ll-month-card {
    background: #fff;
    border: 1px solid #E6E4E1;
    border-radius: 12px;
    padding: 16px;
}

/* Tabela */
.ll-table,
.ll-table-odlazni {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /* kolone poštuju širine */
    font-size: 14px;
}

.ll-table th,
.ll-table td,
.ll-table-odlazni th,
.ll-table-odlazni td {
    border-bottom: 1px solid #E6E4E1;
    padding: 8px 10px;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Fiksne širine kolona – DESKTOP */
.ll-table-odlazni th:first-child,
.ll-table-odlazni td:first-child {
    width: 60% !important;
}

.ll-table-odlazni th:nth-child(2),
.ll-table-odlazni td:nth-child(2),
.ll-table-odlazni th:nth-child(3),
.ll-table-odlazni td:nth-child(3) {
    width: 20% !important;
}

/* Boja zaglavlja */
.ll-table-odlazni thead th {
    background: #E6E4E1 !important;
    font-weight: 600;
    white-space: normal;
    line-height: 1.2;
}

/* Poravnanje brojeva udesno */
.ll-number-column {
    text-align: right !important;
    white-space: nowrap;
}

/* Redni broj uži i centriran */
.ll-rb {
    width: 34px;
    text-align: center;
}

/* Link kolona — DESKTOP: jedan red + … */
.ll-table-odlazni td.ll-link-cell {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ll-link-cell a {
    text-decoration: none;
    color: #3B6A58;
    display: block;
    max-width: 100%;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Fallback ako je link ipak u prvoj koloni bez klase */
.ll-table-odlazni td:first-child a {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Istakni ZBIR */
.ll-row-zbir td {
    background: #E6E4E1 !important;
    font-weight: 700;
}

/* === MOBILNI: grafovi + tabele (50/25/25, link 2 reda + …) === */
@media (max-width:768px) {

    /* 1 kolona kartica umesto 2 */
    .ll-months-grid {
        grid-template-columns: 1fr !important;
    }

    /* GRAFIČKI KARTONI – niži da stanu */
    .canvas-inner {
        height: 240px !important;
        max-width: 100% !important;
    }

    /* TABELA: raspored kolona 50 / 25 / 25 */
    .ll-table-odlazni thead th:first-child,
    .ll-table-odlazni tbody td:first-child {
        width: 50% !important;
    }

    .ll-table-odlazni thead th:nth-child(2),
    .ll-table-odlazni tbody td:nth-child(2),
    .ll-table-odlazni thead th:nth-child(3),
    .ll-table-odlazni tbody td:nth-child(3) {
        width: 25% !important;
    }

    .ll-table-odlazni th,
    .ll-table-odlazni td {
        min-width: 0 !important;
        padding: 4px 6px !important;
        font-size: 12px !important;
    }

    /* LINK: clamp SAMO na <a> */
    .ll-table-odlazni td:first-child a,
    .ll-table-odlazni td a.ll-odl-link,
    .ll-table-odlazni td.ll-link-cell a {
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;

        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;

        font-size: 11px !important;
        line-height: 1.2em !important;
        margin: 0 !important;
    }

    /* ZBIR red */
    .ll-table-odlazni .ll-row-zbir td {
        background: #E6E4E1 !important;
    }
}

/* Desktop safety net (ostavi 1 red + …) */
@media (min-width:769px) {

    .ll-table-odlazni td.ll-link-cell a,
    .ll-table-odlazni td:first-child a {
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
}