/* SpeedOk Admin - the Telefonai, Sistema and Duomenys ir paketai pages (GitHub #107, mockups approved 2026-11-02): tiles, cards,
   one table per job, a detail panel next to it. Colours come from the shell's tokens (shell.css), so both themes follow. */

.pg {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.pg-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.pg-bar .pg-grow {
    flex: 1 1 auto;
}

.pg-dim {
    color: var(--sz-mut);
    font-size: 13px;
}

/* ---- Tiles ------------------------------------------------------------------------------------------------------------ */

.pg-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.pg-tile {
    background: var(--sz-surf);
    border: 1px solid var(--sz-line);
    border-radius: 16px;
    padding: 14px 16px;
    min-width: 0;
    color: var(--sz-text);
    text-decoration: none;
    display: block;
}

a.pg-tile:hover {
    border-color: var(--sz-sky);
}

.pg-tile-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--sz-mut);
}

.pg-tile-value {
    font-size: 26px;
    font-weight: 800;
    margin-top: 4px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.pg-tile-value small, .pg-tile-sub {
    font-size: 13px;
    font-weight: 700;
    color: var(--sz-mut);
}

.pg-tile-value small {
    margin-left: 4px;
}

.pg-tile-sub {
    display: block;
    font-weight: 600;
    margin-top: 2px;
    overflow-wrap: anywhere;
}

/* 2026-11-02 (GitHub #233): the tile's explanation button - a real button, 28 px (the whole label row is the touch target on a phone). */
.pg-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 4px;
    vertical-align: middle;
    border-radius: 999px;
    border: 1px solid var(--sz-line);
    background: var(--sz-surf);
    color: var(--sz-mut);
    font: 700 12px/1 inherit;
    cursor: pointer;
}

.pg-info:hover, .pg-info[aria-expanded="true"] {
    border-color: var(--sz-acc);
    color: var(--sz-text);
}

.pg-info:focus-visible {
    outline: 2px solid var(--sz-sky);
    outline-offset: 1px;
}

.pg-ok {
    color: var(--sz-okfg) !important;
}

.pg-warn {
    color: var(--sz-warnfg) !important;
}

.pg-bad {
    color: var(--sz-badfg) !important;
}

/* ---- Cards and tables ------------------------------------------------------------------------------------------------- */

.pg-card {
    background: var(--sz-surf);
    border: 1px solid var(--sz-line);
    border-radius: 16px;
    overflow: hidden;
    min-width: 0;
}

.pg-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--sz-hair);
}

.pg-card-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    flex: 1 1 auto;
}

.pg-card-body {
    padding: 14px 16px;
}

.pg-scroll {
    overflow-x: auto;
}

.pg-table {
    width: 100%;
    border-collapse: collapse;
}

.pg-table th {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sz-mut);
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
}

.pg-table td {
    padding: 12px;
    border-top: 1px solid var(--sz-hair);
    font-size: 13px;
    vertical-align: middle;
}

.pg-table.pg-top td {
    vertical-align: top;
}

.pg-table tr.pg-click {
    cursor: pointer;
}

.pg-table tr.pg-click:hover td {
    background: var(--sz-raised);
}

.pg-table tr.sel td {
    background: var(--sz-accbg);
}

.pg-table tr.pg-fold td {
    background: var(--sz-raised);
}

.pg-name {
    font-weight: 800;
    font-size: 14px;
}

.pg-sub {
    font-size: 12px;
    color: var(--sz-mut);
    margin-top: 3px;
}

.pg-mono {
    font-family: var(--sz-mono);
    font-size: 12px;
}

.pg-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.pg-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    background: var(--sz-raised);
    color: var(--sz-soft);
    border: 1px solid var(--sz-line);
}

button.pg-chip {
    cursor: pointer;
    font-family: inherit;
}

button.pg-chip:disabled {
    cursor: default;
}

.pg-chip.info {
    background: var(--sz-accbg);
    border-color: rgba(46, 156, 202, .35);
    color: var(--sz-sky);
}

.pg-chip.ok {
    background: rgba(76, 217, 100, .1);
    border-color: rgba(76, 217, 100, .4);
    color: var(--sz-okfg);
}

.pg-chip.warn {
    background: rgba(245, 166, 35, .12);
    border-color: rgba(245, 166, 35, .4);
    color: var(--sz-warnfg);
}

.pg-chip.bad {
    background: rgba(255, 107, 94, .12);
    border-color: rgba(255, 107, 94, .4);
    color: var(--sz-badfg);
}

/* ---- List + panel ----------------------------------------------------------------------------------------------------- */

.pg-split {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-start;
}

.pg-split > .pg-main {
    flex: 3 1 560px;
}

.pg-split > .pg-aside {
    flex: 2 1 320px;
}

.pg-aside {
    background: var(--sz-surf);
    border: 1px solid var(--sz-line);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.pg-aside h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.pg-aside h3 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--sz-mut);
}

.pg-mini {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.pg-mini > div {
    background: var(--sz-raised);
    border-radius: 12px;
    padding: 10px 12px;
    min-width: 0;
}

.pg-mini span {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--sz-mut);
    text-transform: uppercase;
}

.pg-mini b {
    display: block;
    font-size: 20px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.pg-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--sz-hair);
    border-radius: 12px;
    overflow: hidden;
}

.pg-list > a, .pg-list > div {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--sz-text);
    border-bottom: 1px solid var(--sz-hair);
    font-size: 13px;
    min-width: 0;
}

.pg-list > a:last-child, .pg-list > div:last-child {
    border-bottom: 0;
}

.pg-list > a:hover {
    background: var(--sz-raised);
}

.pg-list .pg-grow {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.pg-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--sz-sky);
}

.pg-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pg-btns.tight {
    gap: 6px;
}

.wb-btn.dark {
    background: var(--sz-pbg);
    border-color: var(--sz-pbg);
    color: var(--sz-pfg);
}

.pg-edit {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--sz-line);
    border-radius: 12px;
}

.pg-edit label {
    font-size: 12px;
    font-weight: 700;
    color: var(--sz-mut);
}

.pg-check {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--sz-text) !important;
}

/* ---- Attention banner, source cards ----------------------------------------------------------------------------------- */

.pg-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 14px;
    background: rgba(245, 166, 35, .12);
    border: 1px solid rgba(245, 166, 35, .4);
}

.pg-banner.bad {
    background: rgba(255, 107, 94, .12);
    border-color: rgba(255, 107, 94, .4);
}

.pg-banner.ok {
    background: rgba(76, 217, 100, .1);
    border-color: rgba(76, 217, 100, .4);
}

.pg-banner b {
    color: var(--sz-warnfg);
}

.pg-banner.bad b {
    color: var(--sz-badfg);
}

.pg-banner.ok b {
    color: var(--sz-okfg);
}

.pg-banner .pg-grow {
    flex: 1 1 240px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.pg-banners {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pg-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pg-source {
    flex: 1 1 260px;
    background: var(--sz-surf);
    border: 1px solid var(--sz-line);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.pg-source .pg-grow {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

details.pg-more {
    background: var(--sz-surf);
    border: 1px solid var(--sz-line);
    border-radius: 16px;
    padding: 12px 16px;
}

details.pg-more > summary {
    cursor: pointer;
    font-weight: 800;
}

/* ---- Narrow screens --------------------------------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .pg-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .pg-tile-value {
        font-size: 22px;
    }

    .pg-mini {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pg-split > .pg-main, .pg-split > .pg-aside {
        flex-basis: 100%;
    }

    /* The tables become cards: one row = one block, the header text in front of each value. */
    .pg-table.pg-stack thead {
        display: none;
    }

    .pg-table.pg-stack, .pg-table.pg-stack tbody, .pg-table.pg-stack td {
        display: block;
        width: 100%;
    }

    .pg-table.pg-stack td {
        box-sizing: border-box;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    /* Two values side by side; the main cell (.pg-wide: the name, the explanation, the buttons) takes the whole width. */
    .pg-table.pg-stack tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        border-top: 1px solid var(--sz-line);
        padding: 6px 0;
    }

    .pg-table.pg-stack td.pg-wide, .pg-table.pg-stack td[colspan] {
        grid-column: 1 / -1;
    }

    .pg-table.pg-stack td {
        border-top: 0;
        padding: 6px 14px;
    }

    .pg-table.pg-stack td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--sz-mut);
        margin-bottom: 2px;
    }
}

/* ---- Shell additions: the account card and the tab count chips -------------------------------------------------------- */

.sz-account-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sz-account-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
}

.sz-account-links a, .sz-account-logout {
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--sz-sky);
    text-decoration: none;
    background: none;
    border: 0;
    padding: 3px 0;
    text-align: left;
    cursor: pointer;
}

.sz-account-links a.active {
    color: var(--sz-text);
}

.sz-account-logout {
    color: var(--sz-soft);
}

.sz-account-links a:hover, .sz-account-logout:hover {
    text-decoration: underline;
}

.sz-tab-count {
    display: inline-flex;
    align-items: center;
    height: 20px;
    min-width: 20px;
    justify-content: center;
    padding: 0 7px;
    margin-left: 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(245, 166, 35, .16);
    color: var(--sz-warnfg);
}

/* "Šalys ir paketai": room for the two switch chips and the pack buttons (wide screens; narrow ones stack). 2026-11-02: at 1280 px with
   the menu the 250 + 290 px minimums pushed the "Valdymas" column past the card's edge - the buttons now wrap under each other instead. */
@media (min-width: 601px) {
    #data-countries td:first-child {
        min-width: 200px;
    }

    #data-countries td:last-child {
        min-width: 180px;
    }
}

@media (min-width: 601px) and (max-width: 1599px) {
    #data-countries td:last-child .pg-btns {
        flex-direction: column;
        align-items: stretch;
    }
}

.pg-age {
    white-space: nowrap;
}
