/* ===== Zoznamy pre admina: Používatelia, Projekty, Partneri, Autá =====
 * (src/pages/users.php, projects.php, partners.php, cars.php) – vzhľad ako profil: oranžová lišta,
 * farebné karty, panel s prechodom a bielym rámikom. Doplnok k src/style/partners.css, JavaScript: scripts/js/admin_list.js
 */
.admin-list {
    --partners-accent: rgb(255, 136, 0);
    --partners-accent-dark: rgb(205, 105, 0);
    --partners-muted: #666;
    --partners-line: rgba(0, 0, 0, 0.08);
    max-width: min(1400px, 96%);
    margin-left: auto;
    margin-right: auto;
    font-family: Arial, Helvetica, sans-serif;
}
.admin-desc {
    margin: 0 0 14px;
    color: #444;
}

/* --- Oranžová lišta ako v profile (.statement-toolbar zo statement.css) --- */
.admin-toolbar {
    position: sticky;
    top: 8px;
    z-index: 40;
}
.admin-toolbar-filters,
.admin-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.admin-toolbar-filters { flex: 1 1 420px; }
.admin-toolbar-actions form { margin: 0; }
.admin-search {
    height: 32px;
    padding: 0 14px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    font-size: 14px;
    color: #222;
    box-sizing: border-box;
}
.admin-search { flex: 1 1 220px; min-width: 0; }
.admin-search:focus { outline: none; border-color: #fff; background: #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25); }
/* Prepínače skupín (zapnutá = biela, vypnutá = priehľadná a prečiarknutá) */
.admin-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.admin-group {
    --tone: #9e9e9e;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    color: #222;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, opacity 0.15s;
}
.admin-group:hover { border-color: #000; }
.admin-group-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--tone);
}
.admin-group-n {
    padding: 0 6px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 11px;
}
.admin-group.off {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.55);
    text-decoration: line-through;
}
.admin-group.off .admin-group-dot { background: transparent; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.45); }
.admin-group.muted { opacity: 0.55; }
.admin-group.tone-admin    { --tone: #c62828; }
.admin-group.tone-manager  { --tone: #ef6c00; }
.admin-group.tone-user     { --tone: #1e63c4; }
.admin-group.tone-guest    { --tone: #9e9e9e; }
.admin-group.tone-unverified { --tone: #ff8800; }
.admin-group.tone-unverified .admin-group-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--tone); }
.admin-group.tone-running  { --tone: #2e7d32; }
.admin-group.tone-planned  { --tone: #1e63c4; }
.admin-group.tone-finished { --tone: #757575; }
.admin-group.tone-none     { --tone: #bdbdbd; }

.admin-count {
    padding: 4px 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
}
/* biela zvýraznená (Pridať) – rovnako ako Uložiť v profile */
.admin-list .statement-nav.accent { background: #fff; color: #000; font-weight: bold; }
.admin-list .statement-nav.accent:hover { background: #000; color: #fff; }

/* --- Súhrnné karty (ako karty Prehľad v profile), slúžia aj ako filter --- */
.admin-list .partners-summary { margin-top: 16px; }
.admin-card {
    --tone: #ff8800;
    --tone-text: #c76f00;
    border: none;
    border-top: 4px solid var(--tone);
    background: linear-gradient(to bottom, color-mix(in srgb, var(--tone) 14%, white), rgba(255, 255, 255, 0.85) 70%);
    font-family: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.admin-card .value { font-size: 28px; font-weight: 800; color: var(--tone-text); }
.admin-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2); }
.admin-card.active { box-shadow: 0 0 0 3px var(--tone), 0 8px 18px rgba(0, 0, 0, 0.2); }
.admin-card.tone-orange { --tone: #ff8800; --tone-text: #c76f00; }
.admin-card.tone-red    { --tone: #d84315; --tone-text: #b3261e; }
.admin-card.tone-blue   { --tone: #3b7dd8; --tone-text: #1d4f9e; }
.admin-card.tone-green  { --tone: #2e9d48; --tone-text: #1e7a32; }
.admin-card.tone-gray   { --tone: #8d8d8d; --tone-text: #555; }
/* Niečo čaká na riešenie – karta svieti oranžovo */
.admin-card.warn { --tone: #ff8800; --tone-text: #c76f00; box-shadow: 0 4px 14px rgba(255, 120, 0, 0.35); }
.admin-card.warn.active { box-shadow: 0 0 0 3px var(--tone), 0 8px 18px rgba(255, 120, 0, 0.35); }

/* --- Panel s tabuľkou: prechod a biely rámik ako formulár profilu (.form-kontajner) --- */
.admin-panel {
    border: 2px solid #fff;
    border-radius: 12px;
    box-shadow: 0 0 10px #000;
    overflow: hidden;
    background: linear-gradient(to top,
                rgba(255, 40, 2, 0.2),
                rgba(155, 155, 155, 0.3),
                rgba(185, 185, 185, 0.3),
                rgba(155, 155, 155, 0.3),
                rgba(231, 140, 2, 0.4));
}
.admin-panel .partners-table-wrap { padding: 12px; }
/* Riadky ako biele karty oddelené medzerou */
.admin-table {
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: -8px;
}
.admin-table th {
    border-bottom: none;
    color: #5a3a12;
    padding-bottom: 2px;
}
.admin-table td {
    vertical-align: middle;
    border-bottom: none;
    background: #f6f2ee;   /* plná farba – polopriehľadná robí škáry medzi bunkami */
    transition: background-color 0.15s;
}
/* tieň 1px doprava prekryje škáru medzi bunkami pri zväčšení obrazovky 125 / 150 % */
.admin-table td             { box-shadow: 1px 0 0 var(--cell-bg, #f6f2ee); }
.admin-table td:first-child { border-radius: 10px 0 0 10px; box-shadow: inset 4px 0 0 var(--row-tone, #ff8800), 1px 0 0 var(--cell-bg, #f6f2ee); }
.admin-table td:last-child  { border-radius: 0 10px 10px 0; box-shadow: none; }
.admin-table tbody tr:hover { --cell-bg: #fff; }
.admin-table tbody tr:hover td { background: #fff; }
/* Farebný pruh vľavo podľa úrovne / stavu */
.admin-table tr[data-access~="Admin"]      { --row-tone: #d84315; }
.admin-table tr[data-access~="Manager"]    { --row-tone: #ff8800; }
.admin-table tr[data-access~="User"]       { --row-tone: #3b7dd8; }
.admin-table tr[data-access~="Quest"]      { --row-tone: #9e9e9e; }
.admin-table tr[data-status="running"]     { --row-tone: #2e9d48; }
.admin-table tr[data-status="planned"]     { --row-tone: #3b7dd8; }
.admin-table tr[data-status="finished"],
.admin-table tr[data-status="none"]        { --row-tone: #9e9e9e; }

/* Bunky tabuľky */
.admin-text,
.admin-sub,
.admin-link { display: block; }
.admin-sub {
    margin-top: 2px;
    font-size: 12px;
    color: var(--partners-muted);
}
.admin-link { text-decoration: none; overflow-wrap: anywhere; }
.admin-link:hover { color: var(--partners-accent-dark); text-decoration: underline; }
.admin-link.sub { font-size: 13px; color: var(--partners-muted); }
.admin-table .nowrap { white-space: nowrap; }

/* Používateľ: fotka + meno (klik = upraviť) */
.admin-person { margin: 0; }
.admin-person-link,
.admin-title-link {
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.admin-person-link {
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-avatar {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px white, 0 0 0 3px rgba(255, 136, 0, 0.5);
}
.admin-name,
.admin-title-link {
    display: block;
    font-size: 15px;
    font-weight: bold;
}
.admin-person-link:hover .admin-name,
.admin-title-link:hover { color: var(--partners-accent-dark); }

/* Štítky – plné farby ako odznaky v profile */
.admin-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    background: #9e9e9e;
    color: #fff;
}
.admin-badge.ok,
.admin-badge.status-running  { background: #2e7d32; }
.admin-badge.warn            { background: #ff8800; }
.admin-badge.access-admin    { background: #c62828; }
.admin-badge.access-manager  { background: #ef6c00; }
.admin-badge.access-user,
.admin-badge.status-planned  { background: #1e63c4; }

/* Termín projektu s pruhom priebehu */
.admin-term { min-width: 170px; }
.admin-progress {
    display: block;
    height: 6px;
    margin-top: 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
}
.admin-progress span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, rgb(255, 170, 60), var(--partners-accent));
}
.admin-table tr[data-status="finished"] td { color: var(--partners-muted); }

.partners-icon.disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    cursor: not-allowed;
}

.admin-footer {
    display: flex;
    justify-content: flex-end;
    margin: 0;
    padding: 0 12px 14px;
}


/* ===== Partneri a Autá: skupiny, riadky, štítky ===== */
.admin-card.tone-purple { --tone: #7b3fbf; --tone-text: #5b2d91; }
.admin-group.tone-customer      { --tone: #1e63c4; }
.admin-group.tone-supplier      { --tone: #7b3fbf; }
.admin-group.tone-both          { --tone: #ef6c00; }
.admin-group.tone-inactive      { --tone: #9e9e9e; }
.admin-group.tone-inactive .admin-group-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--tone); }
.admin-group.tone-check-ok      { --tone: #2e7d32; }
.admin-group.tone-check-soon    { --tone: #ef6c00; }
.admin-group.tone-check-expired { --tone: #c62828; }
.admin-group.tone-check-none    { --tone: #bdbdbd; }
.admin-table tr[data-kind="customer"]  { --row-tone: #1e63c4; }
.admin-table tr[data-kind="supplier"]  { --row-tone: #7b3fbf; }
.admin-table tr[data-kind="both"]      { --row-tone: #ef6c00; }
.admin-table tr[data-state="inactive"] { --row-tone: #9e9e9e; }
.admin-table tr[data-state="inactive"] td { color: var(--partners-muted); }
.admin-table tr[data-state="ok"]       { --row-tone: #2e9d48; }
.admin-table tr[data-state="soon"]     { --row-tone: #ef6c00; }
.admin-table tr[data-state="expired"]  { --row-tone: #c62828; }
.admin-table tr[data-state="none"]     { --row-tone: #9e9e9e; }
.admin-badge.kind-customer { background: #1e63c4; }
.admin-badge.kind-supplier { background: #7b3fbf; }
.admin-badge.kind-both     { background: #ef6c00; }
/* Riadok, ktorý je práve otvorený v editore */
.admin-table tr.editing { --cell-bg: #ffe9cc; }
.admin-table tr.editing td { background: #ffe9cc; }
.admin-table .num { text-align: right; white-space: nowrap; }
/* Autá: štítky kontrol a diaľničných známok plnou farbou (ako ostatné štítky) */
.admin-list .cars-check,
.admin-list .cars-vignette-chip { border-radius: 999px; color: #fff; font-weight: bold; }
.admin-list .cars-check.ok,
.admin-list .cars-vignette-chip.active  { background: #2e7d32; }
.admin-list .cars-check.soon,
.admin-list .cars-vignette-chip.soon    { background: #ef6c00; }
.admin-list .cars-check.expired         { background: #c62828; }
.admin-list .cars-check.none,
.admin-list .cars-vignette-chip.future  { background: #9e9e9e; font-weight: bold; }
.admin-list .cars-date { display: block; }
.admin-person-link .cars-thumb { width: 64px; height: 42px; }
.admin-empty-add { margin: 14px 0 0; }

/* ===== Editor (Partneri, Autá) ako profil: oranžová lišta s tlačidlami hore, panel s prechodom ===== */
.admin-list .admin-editor {
    margin-bottom: 20px;
    border: 2px solid #fff;
    border-radius: 12px;
    box-shadow: 0 0 10px #000;
    backdrop-filter: none;
    background: linear-gradient(to top,
                rgba(255, 40, 2, 0.2),
                rgba(155, 155, 155, 0.3),
                rgba(185, 185, 185, 0.3),
                rgba(155, 155, 155, 0.3),
                rgba(231, 140, 2, 0.4));
}
.admin-editor-bar {
    position: sticky;
    top: 8px;
    z-index: 30;
    margin: 10px 10px 0;
}
.admin-editor-title {
    font-size: 18px;
    font-weight: bold;
    color: #000;
}
.admin-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.admin-list .admin-editor fieldset {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.62);
}
.admin-list .admin-editor legend { color: #5a3a12; }
.admin-list .admin-editor .partners-panel-footer,
.admin-list .admin-editor .cars-panel-footer {
    border-top: none;
    background: transparent;
}
.admin-list .admin-editor .partners-note,
.admin-list .admin-editor .cars-note { color: #444; }

/* Mobil: tabuľka ako karty */
@media (max-width: 760px) {
    .admin-toolbar { position: static; }
    .admin-toolbar-filters { flex: none; }
    .admin-search { flex: none; width: 100%; }
    .admin-toolbar-actions { justify-content: space-between; }
    .admin-table thead { display: none; }
    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td { display: block; width: auto; }
    .admin-table { margin-top: 0; }
    .admin-table tr {
        position: relative;
        margin-bottom: 10px;
        padding: 10px 6px 10px 10px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.78);
        box-shadow: inset 4px 0 0 var(--row-tone, #ff8800);
    }
    .admin-table td,
    .admin-table td:first-child,
    .admin-table td:last-child,
    .admin-table tbody tr:hover td {
        padding: 4px 6px;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: none;
    }
    .admin-table td[data-label]::before {
        content: attr(data-label);
        font-family: Arial, Helvetica, sans-serif;
        display: block;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--partners-muted);
    }
    .admin-table td.actions {
        position: absolute;
        top: 8px;
        right: 0;
        width: auto;
    }
    .admin-table td:first-child { padding-right: 80px; }
    .admin-term { min-width: 0; }
    .admin-footer .statement-nav { width: 100%; height: 34px; }
}

/* Karta iba s údajom (bez filtra) – napr. Plánovanie */
.admin-card.static { cursor: default; }
.admin-card.static:hover { transform: none; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15); }
.admin-card.static.warn:hover { box-shadow: 0 4px 14px rgba(255, 120, 0, 0.35); }
