:root {
  --color-ink: #243247;
  --color-muted: #64748b;
  --color-surface: #ffffff;
  --color-canvas: #f3f6fa;
  --color-border: #dce3ec;
  --color-primary: #315b7d;
  --color-primary-hover: #254967;
  --color-success: #2e7d55;
  --color-danger: #b54747;
  --shadow-card: 0 8px 24px rgba(34, 52, 76, .08);
  --radius-card: 10px;
  --radius-control: 6px;
}
html { color-scheme: light; }
body { font-family: Arial, Helvetica, sans-serif; color: var(--color-ink); background: var(--color-canvas); line-height: 1.5; }
.app-panel, .box { border-color: var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
button, input, select, textarea { font: inherit; }
button, [type=submit], [type=button] { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(49, 91, 125, .35); outline-offset: 2px; }
th { background: #edf2f7; }
th, td { border-color: var(--color-border); }
@media (max-width: 700px) { body { padding: 12px; } .app-layout { gap: 12px; } .app-data { overflow-x: auto; } }
body {
    font-family: Arial;
    background: #f4f4f4;
    margin: 0;
    padding: 20px;
}

.app-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 20px;
    align-items: start;
}

.app-data {
    min-width: 0;
    overflow-x: auto;
}

.app-sidebar {
    min-width: 0;
}

.app-sidebar > * {
    max-width: 100%;
    box-sizing: border-box;
}

.app-panel {
    background: #f9f9f9;
    border: 1px solid #ccc;
    padding: 10px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, .1);
    margin-bottom: 15px;
}

.app-panel h3 {
    margin-top: 0;
}

.app-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-nav a {
    display: block;
    padding: 6px 8px;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
}

.app-nav a:hover {
    background: #e8e8e8;
}

.app-nav a.app-nav-current {
    background: #333;
    color: #fff;
    font-weight: bold;
}

.app-nav-sep {
    border: 0;
    border-top: 1px solid #ccc;
    margin: 8px 0;
}

.app-nav-list + .app-user {
    border-top: 1px solid #ccc;
    margin-top: 8px;
    padding-top: 8px;
}

.app-user-name {
    font-weight: bold;
    padding: 0 8px 4px;
}

.app-logout {
    margin: 6px 0 0;
}

.app-sidebar input,
.app-sidebar select,
.app-sidebar textarea,
.app-sidebar button {
    width: 100%;
    box-sizing: border-box;
}

.app-sidebar input[type="checkbox"],
.app-sidebar input[type="radio"] {
    width: auto;
}

.box {
    background: #fff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
    max-width: 100%;
    box-sizing: border-box;
}

table {
    border-collapse: collapse;
}

th, td {
    border: 1px solid #ccc;
    padding: 6px 8px;
    text-align: left;
}

th {
    background: #eee;
}

.app-msg {
    padding: 8px 10px;
    margin: 0 0 10px;
    border-radius: 4px;
}

.app-msg-ok {
    background: #e9f7ef;
    border: 1px solid #27ae60;
    color: #1e7e46;
}

.app-msg-error {
    background: #fdecea;
    border: 1px solid #c0392b;
    color: #a93226;
}

.app-form {
    max-width: 400px;
}

.app-form label {
    display: block;
    margin-bottom: 10px;
}

.app-form input[type="text"],
.app-form input[type="password"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    padding: 6px;
}

.app-form fieldset {
    margin: 0 0 10px;
    padding: 6px 10px;
    border: 1px solid #ccc;
}

.app-form fieldset label,
.app-form label.app-check {
    margin-bottom: 4px;
}

.app-form button {
    width: 100%;
    padding: 8px;
    cursor: pointer;
}

.app-form-cancel {
    display: block;
    margin-top: 8px;
    text-align: center;
}

.app-bare {
    max-width: 360px;
    margin: 10vh auto 0;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
}

.app-bare h1 {
    margin-top: 0;
    font-size: 1.5em;
}

@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-sidebar {
        order: -1;
    }
}

/* Extracted from akcie.php */
.box {
            background: #fff;
            padding: 15px;
            margin-bottom: 15px;
            width: max-content;
            max-width: 100%;
            border-radius: 6px;
            box-shadow:
                0 2px 5px rgba(0, 0, 0, .1);
            box-sizing:
                border-box;
        }

        .nastaveni {
            background: #f9f9f9;
            border:
                1px solid #ccc;
            padding: 10px;
            box-shadow:
                2px 2px 5px rgba(0, 0, 0, .1);
        }

        input,
        select,
        textarea {
            box-sizing:
                border-box;
            padding: 6px;
            margin-bottom: 6px;
        }

        input[type="text"],
        input[type="number"],
        input[type="datetime-local"],
        select {
            width: 100%;
        }

        button {
            cursor:
                pointer;
        }

        table {
            border-collapse:
                collapse;
            width:
                100%;
        }

        th,
        td {
            padding:
                8px;
            border-bottom:
                1px solid #ddd;
            text-align:
                left;
            white-space:
                nowrap;
        }

        th {
            background:
                #f5f5f5;
        }

        .positive {
            color:
                green;
        }

        .negative {
            color:
                red;
        }

        .neutral {
            color:
                #777;
        }

        .card {
            display:
                inline-block;
            width:
                180px;
            padding:
                15px;
            margin-right:
                10px;
            margin-bottom:
                10px;
            background:
                #fff;
            border-radius:
                6px;
            box-shadow:
                0 2px 5px rgba(0, 0, 0, .1);
            vertical-align:
                top;
        }

        .card h3 {
            margin-top:
                0;
        }

        .message {
            padding:
                10px;
            margin-bottom:
                15px;
            width:
                600px;
            border-radius:
                6px;
        }

        .success {
            background:
                #dff0d8;
            color:
                #3c763d;
        }

        .error {
            background:
                #f2dede;
            color:
                #a94442;
        }

        hr {
            border:
                0;
            border-top:
                1px solid #ddd;
            margin:
                20px 0;
        }

        .small {
            color:
                #777;
            font-size:
                12px;
        }

        .change {
            font-weight:
                bold;
        }

/* Extracted from darky.php */
.dar-wrap{max-width:1700px}
.dar-grid{display:grid;grid-template-columns:minmax(230px,290px) minmax(0,1fr) minmax(280px,360px);gap:16px;align-items:start}
.dar-panel{background:#fff;padding:15px;margin-bottom:15px;border-radius:6px;box-shadow:0 2px 5px rgba(0,0,0,.1);box-sizing:border-box;min-width:0}
.dar-panel h2,.dar-panel h3{margin-top:0}
.dar-muted{color:#777;font-size:12px}
.dar-field{margin-bottom:8px}
.dar-field label{display:block;font-size:13px;margin-bottom:3px;color:#444}
.dar-field input,.dar-field select,.dar-field textarea{width:100%;box-sizing:border-box;padding:7px;border:1px solid #bbb;border-radius:3px}
.dar-field input[type=checkbox]{width:auto;margin-right:5px}
.dar-field textarea{min-height:68px;resize:vertical}
.dar-btn{padding:7px 10px;border:1px solid #aaa;border-radius:4px;background:#f7f7f7;color:#222;cursor:pointer}
.dar-btn:hover{background:#eee}
.dar-btn-primary{background:#245b86;color:white;border-color:#245b86}
.dar-btn-ok{background:#e1f2e1;border-color:#a5d3a5}
.dar-btn-danger{background:#fff0f0;border-color:#e0b0b0}
.dar-message{padding:10px;margin-bottom:15px;border-radius:5px}
.dar-message.success{background:#dff0d8;color:#3c763d}
.dar-message.error{background:#f2dede;color:#a94442}
.dar-person-link{display:block;text-decoration:none;color:#222;padding:10px;border:1px solid #ddd;border-radius:5px;margin:7px 0}
.dar-person-link.active{border-color:#337ab7;background:#eef6fc}
.dar-family-nav{margin:8px 0;border:1px solid #ddd;border-radius:6px;overflow:hidden}
.dar-family-nav-head{display:flex;align-items:center;gap:6px;background:#f5f5f5;padding:8px 10px}
.dar-family-nav details{min-width:0;flex:1}
.dar-family-nav summary{cursor:pointer;font-weight:bold;list-style:none;display:flex;align-items:center;gap:7px;min-width:0}
.dar-family-nav summary::-webkit-details-marker{display:none}
.dar-family-nav summary:before{content:'›';font-size:21px;line-height:14px;display:inline-block;transition:transform .15s}
.dar-family-nav details[open] summary:before{transform:rotate(90deg)}
.dar-family-nav .dar-family-members{padding:2px 8px 5px 24px}
.dar-family-nav .dar-person-link{margin:5px 0;padding:8px}
.dar-loose-people{margin-top:12px}
.dar-loose-people>small{display:block;color:#777;margin:8px 2px}
.dar-person-link small{display:block;color:#777;margin-top:4px}
.dar-person-link.unassigned{border-style:dashed}
.dar-person-link.hidden-person{background:#fdf6e3}
.dar-stats{display:flex;gap:10px;flex-wrap:wrap}
.dar-stat{background:#f7f7f7;border:1px solid #e5e5e5;border-radius:5px;padding:9px 12px;min-width:100px}
.dar-stat b{display:block;font-size:18px}
.dar-stat.over{background:#f2dede;border-color:#e0b0b0;color:#922}
.dar-bar{height:10px;background:#e8e8e8;border-radius:6px;overflow:hidden;margin:8px 0 4px}
.dar-bar span{display:block;height:100%;background:#5cb85c}
.dar-bar.over span{background:#d9534f}
.dar-group{border:1px solid #ddd;border-radius:6px;margin:12px 0;overflow:hidden}
.dar-group-head{background:#f5f5f5;padding:10px 12px}
.dar-group-title{font-weight:bold}
.dar-item{padding:0;border-top:1px solid #eee;scroll-margin-top:20px}
.dar-gift-collapse{width:100%}
.dar-gift-summary{display:flex;align-items:center;gap:7px;min-height:44px;padding:9px 12px;cursor:pointer;list-style:none;box-sizing:border-box}
.dar-gift-summary::-webkit-details-marker{display:none}
.dar-gift-chevron{display:inline-block;font-size:21px;line-height:14px;transition:transform .15s;color:#666}
.dar-gift-collapse[open]>.dar-gift-summary .dar-gift-chevron{transform:rotate(90deg)}
.dar-gift-summary .dar-item-title{flex:0 1 auto;min-width:0}
.dar-gift-summary:hover{background:#fafafa}
.dar-gift-content{padding:0 12px 12px}
.dar-item-title{font-weight:bold;font-size:16px}
.dar-item-meta{font-size:12px;color:#666;margin:5px 0}
.dar-item-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px;align-items:center}
.dar-inline{display:inline}
.dar-badge{display:inline-block;font-size:11px;padding:3px 7px;border-radius:10px;background:#eee;margin-left:4px}
.dar-badge.approved{background:#dff0d8;color:#27632a}
.dar-badge.bought{background:#d9edf7;color:#245b86}
.dar-badge.rejected{background:#f2dede;color:#922}
.dar-badge.hidden{background:#fcf0c8;color:#7a5b00}
.dar-two{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.dar-comments{background:#fafafa;padding:8px;margin-top:8px;border-radius:4px}
.dar-comment{font-size:12px;border-bottom:1px solid #eee;padding:5px 0}
.dar-comment:last-child{border-bottom:0}
.dar-details summary{cursor:pointer;color:#245b86;font-size:13px}
.dar-modal{width:min(900px,calc(100% - 30px));max-height:85vh;border:0;border-radius:8px;padding:0;box-shadow:0 12px 50px rgba(0,0,0,.35)}
.dar-modal::backdrop{background:rgba(0,0,0,.55)}
.dar-modal-head{position:sticky;top:0;background:#fff;padding:14px 18px;border-bottom:1px solid #ddd;display:flex;justify-content:space-between;align-items:center;z-index:2}
.dar-modal-head h2{margin:0}
.dar-modal-body{padding:16px;overflow:auto}
.dar-modal-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.dar-modal-row{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:9px 0;border-bottom:1px solid #eee}
.dar-modal-row form{margin:0}
@media(max-width:650px){.dar-modal-grid{grid-template-columns:1fr}.dar-modal-row{align-items:flex-start;flex-direction:column}}
@media(max-width:1100px){
 .dar-grid{grid-template-columns:1fr}
}

/* Credit-card tables */
.kr-table-wrap {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
}

.kr-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 1000px;
    table-layout: fixed;
    font-size: 13px;
}

.kr-table th,
.kr-table td {
    border-bottom: 1px solid #e8ecef;
    padding: 7px 9px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.kr-table thead th {
    background: #f3f5f7;
    position: sticky;
    top: 0;
    white-space: normal;
    border-bottom: 2px solid #cfd8dc;
}

.kr-table .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.kr-table tfoot td {
    font-weight: 700;
    background: #f3f5f7;
    border-top: 2px solid #b8c2cc;
}

.kr-table tr.kr-op td {
    color: #78909c;
    background: #fafbfc;
}

.kr-table tr:hover td { background: #f6faff; }

.kr-category-table th:nth-child(1) { width: 24%; }
.kr-category-table th:nth-child(2) { width: 17%; }
.kr-category-table th:nth-child(3) { width: 10%; }
.kr-category-table th:nth-child(4) { width: 8%; }
.kr-category-table th:nth-child(5) { width: 20%; }
.kr-category-table th:nth-child(6) { width: 21%; }

/* Transakce: automatická šířka sloupců podle obsahu */
#kr-tx-table {
    table-layout: auto;
    min-width: 0;
}

#kr-tx-table th,
#kr-tx-table td {
    overflow-wrap: normal;
}

/* datum, kategorie, částky, kurz: bez zalamování, šířka podle obsahu */
#kr-tx-table th:nth-child(1), #kr-tx-table td:nth-child(1),
#kr-tx-table th:nth-child(3), #kr-tx-table td:nth-child(3),
#kr-tx-table th:nth-child(4), #kr-tx-table td:nth-child(4),
#kr-tx-table th:nth-child(5), #kr-tx-table td:nth-child(5),
#kr-tx-table th:nth-child(6), #kr-tx-table td:nth-child(6) {
    white-space: nowrap;
    width: 1%;
}

/* název protiúčtu dostane zbytek místa a může se zalamovat */
#kr-tx-table th:nth-child(2), #kr-tx-table td:nth-child(2) {
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 180px;
}

#kr-tx-table td:nth-child(4),
#kr-tx-table td:nth-child(5),
#kr-tx-table td:nth-child(6) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

#kr-tx-table th:nth-child(4),
#kr-tx-table th:nth-child(5),
#kr-tx-table th:nth-child(6) {
    text-align: right;
}

/* Správa příjemců: stejně jako transakce necháme sloupce přizpůsobit obsahu. */
#kr-rcp-table {
    table-layout: auto;
    min-width: 900px;
}

#kr-rcp-table th,
#kr-rcp-table td {
    overflow-wrap: normal;
    vertical-align: middle;
}

/* Výběr, počty, součty a datum zabírají jen tolik místa, kolik potřebují. */
#kr-rcp-table th:nth-child(1),
#kr-rcp-table td:nth-child(1),
#kr-rcp-table th:nth-child(3),
#kr-rcp-table td:nth-child(3),
#kr-rcp-table th:nth-child(4),
#kr-rcp-table td:nth-child(4),
#kr-rcp-table th:nth-child(5),
#kr-rcp-table td:nth-child(5) {
    width: 1%;
    white-space: nowrap;
}

/* Název příjemce dostane volné místo a může se případně zalomit. */
#kr-rcp-table th:nth-child(2),
#kr-rcp-table td:nth-child(2) {
    min-width: 190px;
    white-space: normal;
    overflow-wrap: anywhere;
}

#kr-rcp-table th:nth-child(3),
#kr-rcp-table th:nth-child(4),
#kr-rcp-table td:nth-child(3),
#kr-rcp-table td:nth-child(4) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

#kr-rcp-table th:nth-child(6),
#kr-rcp-table td:nth-child(6) {
    min-width: 125px;
    white-space: nowrap;
}

#kr-rcp-table th:nth-child(7),
#kr-rcp-table td:nth-child(7) {
    min-width: 190px;
}

#kr-rcp-table .kr-cat-select {
    width: 100%;
    min-width: 180px;
}

/* Extracted from dovolena.php */
.dov-wrap{max-width:1500px}
.dov-grid{display:grid;grid-template-columns:minmax(260px,330px) minmax(0,1fr);gap:16px;align-items:start}
.dov-panel{background:#fff;padding:15px;margin-bottom:15px;border-radius:6px;box-shadow:0 2px 5px rgba(0,0,0,.1);box-sizing:border-box;min-width:0}
.dov-panel h2,.dov-panel h3{margin-top:0}
.dov-muted{color:#777;font-size:12px}
.dov-field{margin-bottom:8px}
.dov-field label{display:block;font-size:13px;margin-bottom:3px;color:#444}
.dov-field input,.dov-field select,.dov-field textarea{width:100%;box-sizing:border-box;padding:7px;border:1px solid #bbb;border-radius:3px}
.dov-field textarea{min-height:68px;resize:vertical}
.dov-btn{padding:7px 10px;border:1px solid #aaa;border-radius:4px;background:#f7f7f7;color:#222;cursor:pointer}
.dov-btn:hover{background:#eee}
.dov-btn-primary{background:#245b86;color:white;border-color:#245b86}
.dov-btn-ok{background:#e1f2e1;border-color:#a5d3a5}
.dov-btn-danger{background:#fff0f0;border-color:#e0b0b0}
.dov-message{padding:10px;margin-bottom:15px;border-radius:5px}
.dov-message.success{background:#dff0d8;color:#3c763d}
.dov-message.error{background:#f2dede;color:#a94442}
.dov-trip-link{display:block;text-decoration:none;color:#222;padding:10px;border:1px solid #ddd;border-radius:5px;margin:7px 0}
.dov-trip-link.active{border-color:#337ab7;background:#eef6fc}
.dov-trip-link small{display:block;color:#777;margin-top:4px}
.dov-stats{display:flex;gap:10px;flex-wrap:wrap}
.dov-stat{background:#f7f7f7;border:1px solid #e5e5e5;border-radius:5px;padding:9px 12px;min-width:100px}
.dov-stat b{display:block;font-size:18px}
.dov-section{border:1px solid #ddd;border-radius:6px;margin:12px 0;overflow:hidden}
.dov-section-head{background:#f5f5f5;padding:10px 12px;font-weight:bold}
.dov-item{padding:12px;border-top:1px solid #eee;scroll-margin-top:20px}
.dov-item:first-child{border-top:0}
.dov-item-title{font-weight:bold;font-size:16px}
.dov-item-meta{font-size:12px;color:#666;margin:5px 0}
.dov-item-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.dov-inline{display:inline}
.dov-badge{display:inline-block;font-size:11px;padding:3px 7px;border-radius:10px;background:#eee;margin-left:4px}
.dov-badge.approved{background:#dff0d8;color:#27632a}
.dov-badge.rejected{background:#f2dede;color:#922}
.dov-two{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.dov-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 10px}
.dov-form-grid .wide{grid-column:1/-1}
#dov-map{height:430px;border-radius:5px;z-index:1}
#dov-gps-picker{height:360px;border-radius:5px;z-index:1;margin-top:8px}
.dov-gps-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:4px 0 10px}
.dov-gps-coords{font-size:12px;color:#555}
.dov-comments{background:#fafafa;padding:8px;margin-top:8px;border-radius:4px}
.dov-comment{font-size:12px;border-bottom:1px solid #eee;padding:5px 0}
.dov-comment:last-child{border-bottom:0}
@media(max-width:900px){
 .dov-grid{grid-template-columns:1fr}
 .dov-form-grid{grid-template-columns:1fr}
 .dov-form-grid .wide{grid-column:auto}
 #dov-map{height:350px}
}

/* Extracted from foto.php */
.gallery {
            display: flex;
            flex-wrap: wrap;
        }
        .gallery img {
            width: 150px;
            height: auto;
            margin: 10px;
            cursor: pointer; /* Přidáno pro indikaci kliknutí */
	    object-fit: cover; /* Udržení poměru stran 3:4 */
        }
        .navigation {
            margin: 20px 0;
        }
        .navigation a {
            margin: 0 10px;
            text-decoration: none;
        }
        .pagination {
            margin-top: 20px;
        }
        .pagination a {
            margin: 0 5px;
            text-decoration: none;
            padding: 5px 10px;
            border: 1px solid #ccc;
            color: #333;
        }
        /* Styl pro modální okno */
        .modal {
            display: none; /* Skryté ve výchozím stavu */
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0, 0, 0, 0.9);
        }
        .modal img {
            margin: auto;
            display: block;
            max-width: 90%;
            max-height: 90%;
        }
        .close {
            position: absolute;
            top: 20px;
            right: 30px;
            color: white;
            font-size: 40px;
            font-weight: bold;
            cursor: pointer;
        }

/* Extracted from internet.php */
.log-block {
        border: 1px solid #ccc;
        border-left: 5px solid #999;
        margin: 1em 0;
        padding: 0.5em 1em;
        background: #f9f9f9;
        border-radius: 8px;
    }

    .log-block.restored { border-left-color: #4CAF50; }
    .log-block.open { border-left-color: #f44336; }

    .log-title {
        font-size: 1.1em;
        font-weight: bold;
        margin-bottom: 0.5em;
    }

    .log-details {
        font-family: monospace;
        color: #666;
        font-size: 0.9em;
    }
    .sidebar {
        border: 1px solid #ccc;
        padding: 10px;
        background-color: #f9f9f9;
        box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
        max-width: 300px;
    }

/* Media-library-specific cards, detail view, and audio controls. */
body.media-library, body.media-library * {
box-sizing: border-box;
}

body.media-library,
body.media-library {
margin: 0;
        padding: 0;
        background: #101010;
        color: #eee;
        font-family:
            Arial,
            Helvetica,
            sans-serif;
}

body.media-library {
min-height: 100vh;
}

body.media-library a {
color: inherit;
        text-decoration: none;
}

body.media-library .header {
position: sticky;
        top: 0;
        z-index: 100;
        height: 64px;
        display: flex;
        align-items: center;
        padding: 0 30px;
        background:
            rgba(15, 15, 15, 0.96);
        border-bottom:
            1px solid #292929;
        backdrop-filter:
            blur(10px);
}

body.media-library .logo {
font-size: 23px;
        font-weight: bold;
        letter-spacing: 1px;
        margin-right: 35px;
}

body.media-library .logo span {
color: #e5a900;
}

body.media-library .search {
margin-left: auto;
}

body.media-library .search input {
width: 250px;
        padding:
            9px 13px;
        background: #202020;
        color: white;
        border:
            1px solid #383838;
        border-radius: 5px;
        outline: none;
}

body.media-library .container {
padding:
            28px 35px 60px;
}

body.media-library .page-title {
margin:
            0 0 22px;
        font-size: 28px;
}

body.media-library .toolbar {
display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 25px;
}

body.media-library .filter {
padding:
            8px 15px;
        background: #202020;
        border:
            1px solid #333;
        border-radius: 20px;
        color: #aaa;
        cursor: pointer;
}

body.media-library .filter:hover,
body.media-library .filter.active {
background: #ddd;
        color: #111;
}

body.media-library .grid {
display: grid;
        grid-template-columns:
            repeat(auto-fill,
                minmax(175px, 1fr));
        gap:
            22px 16px;
}

body.media-library .card {
position: relative;
        min-width: 0;
        cursor: pointer;
        transition:
            transform 0.18s ease,
            z-index 0s;
}

body.media-library .card:hover {
transform:
            scale(1.035);
        z-index: 5;
}

body.media-library .poster {
position: relative;
        aspect-ratio: 2 / 3;
        overflow: hidden;
        border-radius: 7px;
        background:
            linear-gradient(135deg, #292929, #171717);
        box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.5);
}

body.media-library .poster img {
width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
}

body.media-library .no-poster {
width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        text-align: center;
        color: #777;
        font-size: 15px;
}

body.media-library .card-title {
margin-top: 9px;
        font-size: 15px;
        font-weight: bold;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
}

body.media-library .card-meta {
color: #888;
        font-size: 13px;
        margin-top: 4px;
}

body.media-library .series-card .poster {
position: relative;
}

body.media-library .series-card .poster::after {
content: '';
        position: absolute;
        inset: 0;
        background:
            linear-gradient(transparent 45%,
                rgba(0, 0, 0, 0.72));
}

body.media-library .series-count {
position: absolute;
        z-index: 2;
        left: 10px;
        bottom: 10px;
        padding:
            6px 9px;
        border-radius: 5px;
        background:
            rgba(0, 0, 0, 0.78);
        color: #fff;
        font-size: 13px;
        font-weight: bold;
}

body.media-library .series-duration {
position: absolute;
        z-index: 2;
        right: 10px;
        bottom: 10px;
        padding:
            6px 9px;
        border-radius: 5px;
        background:
            rgba(0, 0, 0, 0.78);
        color: #ddd;
        font-size: 12px;
}

body.media-library .audio-modal {
position: fixed;
        inset: 0;
        z-index: 2000;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 30px;
        background:
            rgba(0, 0, 0, 0.84);
        backdrop-filter:
            blur(8px);
}

body.media-library .audio-modal.open {
display: flex;
}

body.media-library .audio-modal-content {
width: min(900px, 100%);
        max-height:
            calc(100vh - 60px);
        overflow: hidden;
        background: #181818;
        border:
            1px solid #353535;
        border-radius: 10px;
        box-shadow:
            0 20px 80px rgba(0, 0, 0, 0.8);
        display: flex;
        flex-direction: column;
}

body.media-library .audio-modal-header {
display: flex;
        align-items: center;
        justify-content: space-between;
        padding:
            20px 25px;
        border-bottom:
            1px solid #303030;
        flex-shrink: 0;
}

body.media-library .audio-modal-title {
margin: 0;
        font-size: 26px;
}

body.media-library .audio-modal-subtitle {
color: #888;
        font-size: 13px;
        margin-top: 5px;
}

body.media-library .audio-modal-close {
width: 38px;
        height: 38px;
        border: 0;
        border-radius: 50%;
        background: #292929;
        color: #ccc;
        font-size: 23px;
        cursor: pointer;
}

body.media-library .audio-modal-close:hover {
background: #3a3a3a;
        color: white;
}

body.media-library .audio-books {
padding: 10px 20px 20px;
        overflow-y: auto;
}

body.media-library .audio-book {
display: grid;
        grid-template-columns:
            65px 1fr auto;
        gap: 15px;
        align-items: center;
        padding:
            10px;
        border-radius: 7px;
        cursor: pointer;
        transition:
            background 0.15s ease;
}

body.media-library .audio-book:hover {
background: #252525;
}

body.media-library .audio-book-poster {
width: 65px;
        height: 95px;
        object-fit: cover;
        border-radius: 4px;
        background: #252525;
}

body.media-library .audio-book-info {
min-width: 0;
}

body.media-library .audio-book-title {
font-size: 16px;
        font-weight: bold;
        line-height: 1.3;
        color: #eee;
}

body.media-library .audio-book-meta {
margin-top: 6px;
        color: #888;
        font-size: 13px;
}

body.media-library .audio-book-duration {
white-space: nowrap;
        color: #bbb;
        font-size: 14px;
        text-align: right;
}

body.media-library .audio-book-arrow {
color: #666;
        margin-left: 7px;
}

body.media-library .detail {
position: relative;
        min-height:
            calc(100vh - 64px);
        overflow: hidden;
}

body.media-library .detail-background {
position: absolute;
        inset: 0;
        background-size: cover;
        background-position:
            center top;
        filter: blur(2px);
        transform:
            scale(1.04);
        opacity: 0.34;
}

body.media-library .detail-gradient {
position: absolute;
        inset: 0;
        background:
            linear-gradient(90deg,
                #101010 0%,
                rgba(16, 16, 16, 0.90) 30%,
                rgba(16, 16, 16, 0.48) 65%,
                rgba(16, 16, 16, 0.85) 100%);
}

body.media-library .detail-gradient-bottom {
position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 350px;
        background:
            linear-gradient(transparent, #101010);
}

body.media-library .detail-content {
position: relative;
        z-index: 2;
        max-width: 1450px;
        margin: auto;
        padding:
            55px 45px 100px;
        display: grid;
        grid-template-columns:
            270px 1fr;
        gap: 45px;
}

body.media-library .detail-poster {
width: 270px;
        border-radius: 8px;
        box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.7);
}

body.media-library .detail-info {
max-width: 900px;
}

body.media-library .detail-type {
color: #bbb;
        text-transform: uppercase;
        font-size: 13px;
        letter-spacing: 1.5px;
        margin-bottom: 10px;
}

body.media-library .detail-title {
font-size: 48px;
        line-height: 1.05;
        margin:
            0 0 10px;
}

body.media-library .clearlogo {
max-width: 420px;
        max-height: 130px;
        object-fit: contain;
        object-position:
            left center;
        margin:
            5px 0 20px;
}

body.media-library .detail-meta {
display: flex;
        gap: 15px;
        flex-wrap: wrap;
        color: #ccc;
        margin-bottom: 20px;
}

body.media-library .rating {
color: #ffd54a;
        font-weight: bold;
}

body.media-library .detail-plot {
max-width: 850px;
        line-height: 1.65;
        color: #ddd;
        font-size: 16px;
        margin-bottom: 25px;
}

body.media-library .tagline {
font-style: italic;
        color: #aaa;
        margin-bottom: 15px;
}

body.media-library .info-row {
margin: 8px 0;
        color: #bbb;
}

body.media-library .info-row strong {
color: #fff;
}

body.media-library .chips {
display: flex;
        gap: 7px;
        flex-wrap: wrap;
        margin:
            15px 0 25px;
}

body.media-library .chip {
padding:
            6px 10px;
        border-radius: 4px;
        background: #292929;
        color: #ccc;
        font-size: 13px;
}

body.media-library .section-title {
margin-top: 38px;
        margin-bottom: 15px;
        font-size: 21px;
}

body.media-library .actors {
margin-top: 20px;
}

body.media-library .actor {
display: inline;
}

body.media-library .actor-name {
display: inline;
        font-weight: 600;
}

body.media-library .actor-role {
display: inline;
        margin-left: 4px;
        opacity: 0.7;
}

body.media-library .actor-role::before {
content: "– ";
}

body.media-library .settings {
max-width: 1000px;
}

body.media-library .settings-box {
background: #1b1b1b;
        border:
            1px solid #303030;
        border-radius: 8px;
        padding: 25px;
        margin-top: 20px;
}

@media (max-width: 800px) {
body.media-library .header {
padding: 0 15px;
}

body.media-library .logo {
margin-right: 10px;
}

body.media-library .search input {
width: 130px;
}

body.media-library .container {
padding:
                20px 15px 40px;
}

body.media-library .detail-content {
padding:
                35px 20px 80px;
            grid-template-columns:
                150px 1fr;
            gap: 25px;
}

body.media-library .detail-poster {
width: 150px;
}

body.media-library .detail-title {
font-size: 30px;
}

body.media-library .clearlogo {
max-width: 250px;
            max-height: 80px;
}
}

@media (max-width: 550px) {
body.media-library .header {
height: auto;
            padding: 12px;
            flex-wrap: wrap;
            gap: 10px;
}

body.media-library .search {
margin-left: auto;
}

body.media-library .detail-content {
grid-template-columns:
                1fr;
}

body.media-library .detail-poster {
width: 200px;
}

body.media-library .detail-title {
font-size: 32px;
}

body.media-library .audio-modal {
padding: 10px;
}

body.media-library .audio-modal-content {
max-height:
                calc(100vh - 20px);
}

body.media-library .audio-book {
grid-template-columns:
                55px 1fr;
}

body.media-library .audio-book-poster {
width: 55px;
            height: 80px;
}

body.media-library .audio-book-duration {
grid-column: 2;
            text-align: left;
            margin-top: -8px;
}
}

/* Extracted from pytle.php */
table { border-collapse: collapse; margin-top: 20px; width: 100%; }
        th, td { border: 1px solid #ccc; padding: 8px; text-align: left; }
        th { background-color: #eee; }
        .form-container {
            border: 1px solid #ccc; padding: 10px; background-color: #f9f9f9;
        }

/* Extracted from sportka.php */
.box {
            background: #fff;
            padding: 15px;
            margin-bottom: 15px;
            width: 600px;
            border-radius: 6px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, .1)
        }


        .nastaveni {
            background: #f9f9f9;
            border: 1px solid #ccc;
            padding: 10px;
            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
        }

        input {
            width: 50px
        }

        .num, .hit{
            display:inline-block;
            width:28px;
            text-align:center;
            margin-right:4px;
            padding:2px 0;
        }

        .hit{
            background:#4CAF50;
            color:white;
            border-radius:4px;
        }

/* Extracted from spotreba.php */
.nastaveni {
            background: #f9f9f9;
            border: 1px solid #ccc;
            padding: 10px;
            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
        }

        .box {
            background: #fff;
            padding: 15px;
            margin-bottom: 15px;
            width: 480px;
            border-radius: 6px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, .1)
        }

        .up {
            color: #c0392b
        }

        .down {
            color: #27ae60
        }

        canvas {
            background: #fff;
            margin-bottom: 20px
        }

/* Extracted from stahovani.php */
.jd-wrap{max-width:1200px;margin:0 auto;color:#252525}
.jd-grid{display:grid;grid-template-columns:minmax(260px,330px) minmax(0,1fr);gap:16px;align-items:start}
.jd-left,.jd-right{min-width:0}
.jd-panel{background:#fff;border:1px solid #ddd;border-radius:9px;padding:18px;margin:0 0 16px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.jd-panel h2{font-size:19px;margin:0 0 14px}
.jd-muted{color:#666;font-size:13px}
.jd-field{display:block;margin:10px 0}
.jd-field span{display:block;font-weight:600;margin-bottom:5px}
.jd-field input,.jd-field select,.jd-field textarea{box-sizing:border-box;width:100%;padding:9px;border:1px solid #bbb;border-radius:5px;font:inherit}
.jd-field textarea{min-height:110px}
.jd-btn{border:0;border-radius:5px;background:#315b7d;color:white;padding:9px 14px;cursor:pointer;font:inherit}
.jd-btn.secondary{background:#666}.jd-btn.danger{background:#9c3434}
.jd-message{padding:11px 14px;border-radius:6px;background:#eaf4e8;margin:0 0 16px}
.jd-message.error{background:#fde9e7;color:#842a22}
.jd-table-wrap{overflow-x:auto}
.jd-table{border-collapse:collapse;width:100%;font-size:14px}
.jd-table th,.jd-table td{padding:9px;border-bottom:1px solid #e5e5e5;text-align:left;vertical-align:top}
.jd-table th{background:#f6f6f6}
.jd-progress{height:7px;background:#eee;border-radius:8px;overflow:hidden;min-width:70px}
.jd-progress span{display:block;height:100%;background:#5c9b66}
.jd-status{white-space:nowrap}.jd-inline{display:inline-block;margin:0 7px 7px 0}
.jd-speed{font-size:25px;font-weight:700;margin:8px 0 14px}
@media(max-width:760px){.jd-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){.jd-panel{padding:13px}.jd-table{font-size:12px}}

/* Extracted from stahovani_old.php */
table { border-collapse: collapse; margin-top: 20px; width: 100%; }
        th, td { border: 1px solid #ccc; padding: 8px; text-align: left; }
        th { background-color: #eee; }
        .akce a { margin-right: 10px; }
        .nastaveni {
            border: 1px solid #ccc;
            padding: 10px;
            padding-top: 0px;
            background-color: #f9f9f9;
            width: 100%;
            box-sizing: border-box;
            box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
        }

/* Extracted from tmobile.php */
table {
        border-collapse: collapse;
        width: 100%;
    }

    th,
    td {
        border: 1px solid #ccc;
        padding: 5px;
    }

    th {
        background: #eee;
    }

    .nastaveni {
        border: 1px solid #ccc;
        padding: 10px;
    }

    tr.zaplaceno {
        background-color: #d9f2d9;
    }

/* Extracted from uzivatele.php */
.uzivatele-akce { white-space: nowrap; }
    .uzivatele-akce form { display: inline; margin-left: 8px; }

/* Extracted from zlato.php */
.nastaveni {
    background: #f9f9f9;
    border: 1px solid #ccc;
    padding: 12px;
    box-shadow: 2px 2px 5px rgba(0,0,0,.1);
}

.box {
    background: #fff;
    padding: 15px;
    margin-bottom: 15px;
    width: 650px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,.1);
}

table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    border: 1px solid #ccc;
    padding: 6px;
    text-align: right;
}

th {
    background: #eee;
}

td:first-child, th:first-child {
    text-align: left;
}

.up   { color: #27ae60 }
.down { color: #c0392b }

form input, form select {
    width: 100%;
    margin-bottom: 8px;
}

/* Shared component normalization for legacy pages. */
.box { width: auto; max-width: 100%; background: var(--color-surface); padding: 16px; margin-bottom: 16px; box-sizing: border-box; }
.nastaveni, .form-container, .sidebar { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 14px; box-shadow: var(--shadow-card); }
input, select, textarea { max-width: 100%; border: 1px solid #c6d0dc; border-radius: var(--radius-control); }
button, [type=submit], [type=button] { border-radius: var(--radius-control); transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease; }
button:hover:not(:disabled), [type=submit]:hover:not(:disabled), [type=button]:hover:not(:disabled) { filter: brightness(.96); }
button:disabled, [type=submit]:disabled { cursor: not-allowed; opacity: .6; }
table { max-width: 100%; }
@media (max-width: 700px) { .app-data { min-width: 0; } .app-layout { grid-template-columns: minmax(0,1fr); } }

/* Shared dashboard and reporting components used by standalone pages. */
body.app-page { min-height: 100vh; padding: 0; background: #f2f5fa; color: #243247; font-family: Arial, Helvetica, sans-serif; }
.app-page .top { padding: 28px 24px 22px; color: #fff; background: linear-gradient(120deg, #263b5a, #405d84); }
.app-page .topline { display: flex; align-items: center; gap: 16px; max-width: 1500px; margin: 0 auto; }
.app-page .logo { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; background: rgba(255,255,255,.14); font-size: 24px; }
.app-page .top h1 { margin: 0; font-size: 25px; }
.app-page .top p { margin: 4px 0 0; color: #d5e0ef; }
.app-page .wrap { max-width: 1500px; margin: 0 auto; padding: 22px 24px 40px; }
.app-page .tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.app-page .tabs a, .app-page .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 13px; border: 1px solid #d8e0ea; border-radius: 8px; background: #fff; color: #34465e; text-decoration: none; }
.app-page .tabs a.active, .app-page .btn:not(.secondary) { border-color: #315b7d; background: #315b7d; color: #fff; }
.app-page .filters, .app-page .panel, .app-page .kpi { border: 1px solid #e0e6ee; border-radius: 12px; background: #fff; box-shadow: 0 6px 20px rgba(34,52,76,.06); }
.app-page .filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 15px; margin-bottom: 20px; }
.app-page .field { display: grid; gap: 5px; color: #52627a; font-size: 13px; }
.app-page input, .app-page select { min-height: 38px; padding: 7px 9px; background: #fff; }
.app-page .kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 22px; }
.app-page .kpi { min-width: 0; padding: 16px; }
.app-page .label, .app-page .hint, .app-page .muted, .app-page .sub, .app-page .footnote { color: #718096; }
.app-page .value { margin: 5px 0; color: #263b5a; font-size: 26px; font-weight: 700; }
.app-page .section-head, .app-page .table-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 12px; }
.app-page .section-head h2, .app-page .table-title h2, .app-page .panel h2 { margin: 0 0 4px; font-size: 18px; }
.app-page .section-head p { margin: 0; color: #718096; }
.app-page .content-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.app-page .panel { min-width: 0; padding: 17px; margin-bottom: 16px; }
.app-page .chart-wrap { position: relative; height: 300px; }
.app-page .twocol { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 16px 0; }
.app-page .pill { display: inline-block; padding: 4px 9px; border-radius: 99px; background: #edf2f8; color: #405d84; font-size: 12px; }
.app-page .bar { height: 7px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: #e7edf4; }
.app-page .bar span { display: block; height: 100%; border-radius: inherit; background: #4e9a7b; }
.app-page .table-wrap { overflow-x: auto; }
.app-page table { width: 100%; border-collapse: collapse; font-size: 13px; }
.app-page th, .app-page td { padding: 9px 10px; border-bottom: 1px solid #e7ecf2; text-align: left; white-space: nowrap; }
.app-page th { position: sticky; top: 0; background: #f2f5f9; color: #52627a; }
.app-page td.num { text-align: right; font-variant-numeric: tabular-nums; }
body.investment-dashboard .portfolio-panel th.num,
body.investment-dashboard .portfolio-panel td.num { text-align: right; font-variant-numeric: tabular-nums; }
body.investment-dashboard .portfolio-panel td.num { color: #edf3ff; font-weight: 600; }
.app-page .empty { padding: 26px 12px; color: #718096; text-align: center; }
.app-page .footnote { margin-top: 18px; font-size: 12px; }
@media (max-width: 850px) { .app-page .kpis { grid-template-columns: repeat(2,minmax(0,1fr)); } .app-page .content-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .app-page .top { padding: 20px 15px; } .app-page .wrap { padding: 15px 12px 28px; } .app-page .kpis { gap: 8px; } .app-page .kpi { padding: 12px; } .app-page .value { font-size: 22px; } .app-page .section-head, .app-page .table-title { align-items: flex-start; flex-direction: column; } }


/* Portfolio reference: responsive investment dashboard */
body.investment-dashboard {
    --portfolio-ink: #18283f;
    --portfolio-muted: #64748b;
    --portfolio-line: #e2e8f0;
    --portfolio-canvas: #f4f7fb;
    --portfolio-surface: #ffffff;
    --portfolio-accent: #315f91;
    --portfolio-accent-soft: #eaf2fb;
    --portfolio-positive: #167653;
    --portfolio-negative: #bd4545;
    --portfolio-radius: 12px;
    --portfolio-shadow: 0 5px 18px rgba(25, 46, 74, .055);
    padding: 0;
    background: var(--portfolio-canvas);
    color: var(--portfolio-ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}
body.investment-dashboard .app-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 24px;
    align-items: start;
    max-width: 1760px;
    margin: 0 auto;
    padding: 24px 28px 40px;
}
body.investment-dashboard .app-data { min-width: 0; overflow: visible; }
body.investment-dashboard .app-sidebar { min-width: 0; }
body.investment-dashboard .investment-dashboard-content { min-width: 0; }
body.investment-dashboard .portfolio-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 2px 22px;
}
body.investment-dashboard .portfolio-eyebrow, body.investment-dashboard .portfolio-kicker {
    margin: 0 0 6px;
    color: var(--portfolio-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}
body.investment-dashboard .portfolio-eyebrow span { padding: 0 4px; color: #9aa8b9; }
body.investment-dashboard .portfolio-hero h1 {
    margin: 0;
    color: var(--portfolio-ink);
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.15;
}
body.investment-dashboard .portfolio-intro { margin: 8px 0 0; color: var(--portfolio-muted); font-size: 14px; }
body.investment-dashboard .portfolio-market-note {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border: 1px solid var(--portfolio-line, #dce3ec);
    border-radius: 8px;
    background: #fff;
    color: #52657c;
    font-size: 12px;
    white-space: nowrap;
}
body.investment-dashboard .portfolio-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #29936c; }
body.investment-dashboard .portfolio-panel, body.investment-dashboard .portfolio-controls, body.investment-dashboard .app-nav {
    border: 1px solid var(--portfolio-line, #dce3ec);
    border-radius: var(--portfolio-radius);
    background: var(--portfolio-surface);
    box-shadow: var(--portfolio-shadow);
}
body.investment-dashboard .portfolio-panel {
    width: auto;
    max-width: none;
    margin: 0 0 18px;
    padding: 18px;
}
body.investment-dashboard .portfolio-panel > h2, body.investment-dashboard .portfolio-panel-heading h2 {
    margin: 0;
    color: var(--portfolio-ink);
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -.01em;
}
body.investment-dashboard .portfolio-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
body.investment-dashboard .portfolio-panel-heading .portfolio-kicker { margin-bottom: 3px; }
body.investment-dashboard .portfolio-currency-tag { padding: 4px 8px; border-radius: 6px; background: var(--portfolio-accent-soft); color: var(--portfolio-accent); font-size: 11px; font-weight: 700; }
body.investment-dashboard .portfolio-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; }
body.investment-dashboard .portfolio-stat {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    margin: 0;
    padding: 13px;
    border: 1px solid var(--portfolio-line, #dce3ec);
    border-radius: 9px;
    background: #fbfcfe;
    box-shadow: none;
    vertical-align: initial;
}
body.investment-dashboard .portfolio-stat h3 { margin: 0; color: var(--portfolio-muted); font-size: 12px; font-weight: 600; }
body.investment-dashboard .portfolio-stat b { color: var(--portfolio-ink); font-size: 17px; font-variant-numeric: tabular-nums; }
body.investment-dashboard .portfolio-stat-total { border-color: #cbdcf0; background: #f4f8fd; }
body.investment-dashboard .portfolio-stat-total b:first-of-type { font-size: 21px; }
body.investment-dashboard .portfolio-stat .positive, body.investment-dashboard .positive { color: var(--portfolio-positive); }
body.investment-dashboard .portfolio-stat .negative, body.investment-dashboard .negative { color: var(--portfolio-negative); }
body.investment-dashboard .neutral { color: var(--portfolio-muted); }
body.investment-dashboard .portfolio-currencies { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
body.investment-dashboard .portfolio-currency { padding: 5px 8px; border: 1px solid var(--portfolio-line, #dce3ec); border-radius: 6px; color: #52657c; font-size: 11px; font-variant-numeric: tabular-nums; }
body.investment-dashboard .portfolio-meta { display: flex; flex-wrap: wrap; gap: 7px 18px; margin-top: 12px; padding-top: 11px; border-top: 1px solid #edf1f5; color: var(--portfolio-muted); font-size: 11px; }
body.investment-dashboard .portfolio-panel table { width: 100%; min-width: 760px; border: 0; border-collapse: separate; border-spacing: 0; font-size: 12px; }
body.investment-dashboard .portfolio-panel th, body.investment-dashboard .portfolio-panel td { padding: 10px 11px; border: 0; border-bottom: 1px solid #edf1f5; text-align: left; vertical-align: middle; white-space: nowrap; }
body.investment-dashboard .portfolio-panel th { position: sticky; top: 0; z-index: 1; background: #f5f8fc; color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
body.investment-dashboard .portfolio-panel tbody tr:hover { background: #f8fafd; }
body.investment-dashboard .table-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
body.investment-dashboard .table-scroll table { margin: 0; }
body.investment-dashboard .portfolio-panel .small { color: #75849a; font-size: 11px; }
body.investment-dashboard .portfolio-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
body.investment-dashboard .portfolio-charts .portfolio-panel { min-width: 0; }
body.investment-dashboard .portfolio-chart-frame { position: relative; width: 100%; max-width: 600px; aspect-ratio: 2 / 1; margin: 0 auto; }
body.investment-dashboard .portfolio-chart-frame canvas { display: block; max-width: 100%; margin: 0; background: transparent; }
body.investment-dashboard .message { margin: 0 0 16px; padding: 11px 13px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; }
body.investment-dashboard .message.success { border-color: #b9dfd0; background: #edf8f3; color: #176b4b; }
body.investment-dashboard .message.error { border-color: #efc5c5; background: #fff2f1; color: #a33333; }
body.investment-dashboard .portfolio-controls { position: sticky; top: 18px; padding: 16px; }
body.investment-dashboard .portfolio-controls h3 { margin: 0 0 14px; color: var(--portfolio-ink); font-size: 15px; }
body.investment-dashboard .portfolio-controls h4 { margin: 0 0 9px; color: #52657c; font-size: 12px; }
body.investment-dashboard .portfolio-controls form { margin: 0; }
body.investment-dashboard .portfolio-controls input:not([type=checkbox]), body.investment-dashboard .portfolio-controls select {
    display: block;
    width: 100%;
    min-height: 39px;
    margin: 0 0 9px;
    padding: 8px 10px;
    border: 1px solid #d5dee8;
    border-radius: 7px;
    background: #fff;
    color: var(--portfolio-ink);
    font: inherit;
    font-size: 12px;
}
body.investment-dashboard .portfolio-controls input:focus, body.investment-dashboard .portfolio-controls select:focus { border-color: #6c91b8; outline: 3px solid rgba(49,95,145,.13); }
body.investment-dashboard .portfolio-primary-action {
    width: 100%;
    min-height: 39px;
    padding: 9px 12px;
    border: 1px solid var(--portfolio-accent);
    border-radius: 7px;
    background: var(--portfolio-accent);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    transition: background-color .15s ease, border-color .15s ease;
}
body.investment-dashboard .portfolio-primary-action:hover { border-color: #24496f; background: #24496f; }
body.investment-dashboard .portfolio-controls hr { height: 1px; margin: 15px 0; border: 0; background: var(--portfolio-line, #dce3ec); }
body.investment-dashboard .app-nav { position: static; margin-bottom: 12px; padding: 10px; }
body.investment-dashboard .app-nav-list { display: grid; gap: 2px; }
body.investment-dashboard .app-nav a { min-height: 38px; padding: 9px 10px; border-radius: 7px; color: #52657c; font-size: 12px; }
body.investment-dashboard .app-nav a:hover { background: #f2f6fb; color: var(--portfolio-ink); }
body.investment-dashboard .app-nav a.app-nav-current { background: var(--portfolio-accent-soft); color: #244f7c; font-weight: 700; }
body.investment-dashboard .app-nav-sep { border-color: var(--portfolio-line, #dce3ec); }
body.investment-dashboard .app-nav-list + .app-user { border-color: var(--portfolio-line, #dce3ec); }
body.investment-dashboard .app-user-name { padding: 6px 9px; color: var(--portfolio-ink); font-size: 12px; }
body.investment-dashboard .app-logout button { min-height: 36px; border: 1px solid var(--portfolio-line, #dce3ec); border-radius: 7px; background: #fff; color: #52657c; font-size: 12px; }
body.investment-dashboard :focus-visible { outline-color: rgba(49,95,145,.45); }
@media (max-width: 1100px) {
    body.investment-dashboard .app-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 18px; }
    body.investment-dashboard .app-sidebar { display: flex; flex-direction: column; gap: 10px; }
    body.investment-dashboard .app-nav, body.investment-dashboard .portfolio-controls { position: static; }
    body.investment-dashboard .portfolio-charts { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 900px) {
    body.investment-dashboard .app-layout { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 12px; }
    body.investment-dashboard .app-nav-list { display: flex; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain; }
    body.investment-dashboard .app-nav-list li { flex: 0 0 auto; }
    body.investment-dashboard .app-nav a { min-height: 40px; white-space: nowrap; }
    body.investment-dashboard .app-nav-sep { display: none; }
    body.investment-dashboard .app-user { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--portfolio-line, #dce3ec); margin-top: 8px; padding-top: 8px; }
    body.investment-dashboard .app-user-name { margin-right: auto; }
    body.investment-dashboard .portfolio-hero { align-items: flex-start; flex-direction: column; gap: 12px; padding: 4px 2px 16px; }
    body.investment-dashboard .portfolio-panel { padding: 14px; }
    body.investment-dashboard .portfolio-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
    body.investment-dashboard .portfolio-stat { padding: 11px; }
    body.investment-dashboard .portfolio-stat b { font-size: 15px; }
    body.investment-dashboard .portfolio-stat-total b:first-of-type { font-size: 18px; }
}
@media (max-width: 420px) {
    body.investment-dashboard .app-layout { padding: 9px; }
    body.investment-dashboard .portfolio-intro { max-width: 34ch; font-size: 13px; }
    body.investment-dashboard .portfolio-market-note { font-size: 11px; }
    body.investment-dashboard .portfolio-controls { padding: 13px; }
    body.investment-dashboard .portfolio-panel table { min-width: 700px; }
}
@media (prefers-reduced-motion: reduce) {
    body.investment-dashboard *, body.investment-dashboard *::before, body.investment-dashboard *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

body.investment-dashboard .portfolio-field { display: block; margin: 0 0 11px; color: #52657c; font-size: 11px; font-weight: 650; }
body.investment-dashboard .portfolio-field input, body.investment-dashboard .portfolio-field select { margin-top: 5px; }
body.investment-dashboard .portfolio-controls h4 { padding-bottom: 2px; }

body.investment-dashboard .app-nav-heading { margin: 2px 8px 8px; color: #8795a8; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 900px) { body.investment-dashboard .app-nav-heading { flex: 0 0 100%; margin: 2px 8px 4px; } body.investment-dashboard .app-nav { display: flex; flex-wrap: wrap; } }

body.investment-dashboard .portfolio-stat { width: auto; }
body.investment-dashboard .app-nav a { min-height: 34px; padding: 7px 10px; line-height: 1.35; }
body.investment-dashboard .app-nav-list { margin: 0; padding: 0; list-style: none; }


body.investment-dashboard .app-layout, body.investment-dashboard .app-data, body.investment-dashboard .app-nav, body.investment-dashboard .portfolio-page-content, body.investment-dashboard .portfolio-panel, body.investment-dashboard .portfolio-kpis { min-width: 0; box-sizing: border-box; }
@media (max-width: 900px) { body.investment-dashboard .app-layout, body.investment-dashboard .app-data, body.investment-dashboard .app-nav, body.investment-dashboard .portfolio-controls { width: 100%; max-width: 100%; } }

@media (max-width: 900px) { body.investment-dashboard .app-nav { overflow: hidden; } body.investment-dashboard .app-nav-list { flex: 1 1 100%; min-width: 0; max-width: 100%; } body.investment-dashboard .app-sidebar { min-width: 0; } }


@media (max-width: 900px) { body.investment-dashboard .app-layout, body.investment-dashboard .app-data, body.investment-dashboard .investment-dashboard-content, body.investment-dashboard .portfolio-panel, body.investment-dashboard .portfolio-kpis, body.investment-dashboard .portfolio-stat, body.investment-dashboard .app-nav { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; } body.investment-dashboard .app-layout { overflow-x: clip; } body.investment-dashboard .portfolio-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); } body.investment-dashboard .portfolio-stat { overflow-wrap: anywhere; } }


@media (max-width: 900px) { body.investment-dashboard { width: 100%; max-width: 100vw; overflow-x: hidden; } body.investment-dashboard .app-layout { width: 100%; max-width: 100vw; } body.investment-dashboard .portfolio-stat b { overflow-wrap: anywhere; } }


body.investment-dashboard .app-nav a { min-height: 30px; padding: 5px 8px; line-height: 1.3; }


/* Explicit dashboard grid keeps navigation placement independent of nested grid flattening. */
body.investment-dashboard .investment-dashboard-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
    grid-template-rows: min-content min-content;
    grid-template-areas: "data navigation" "data controls";
    align-items: start;
}
body.investment-dashboard .investment-dashboard-layout > .app-data { grid-area: data; grid-column: 1; grid-row: 1 / span 2; min-width: 0; }
body.investment-dashboard .investment-dashboard-layout > .app-navigation { grid-area: navigation; grid-column: 2; grid-row: 1; min-width: 0; width: 100%; }
body.investment-dashboard .investment-dashboard-layout > .app-sidebar { grid-area: controls; grid-column: 2; grid-row: 2; display: block; min-width: 0; width: 100%; }
body.investment-dashboard .investment-dashboard-layout > .app-navigation .app-nav { margin-bottom: 0; }
body.investment-dashboard .investment-dashboard-layout > .app-sidebar .portfolio-controls { position: sticky; top: 18px; }
body.investment-dashboard .portfolio-charts { align-items: start; }
@media (max-width: 1100px) {
    body.investment-dashboard .investment-dashboard-layout { grid-template-columns: minmax(0,1fr) minmax(250px,300px); grid-template-areas: "data navigation" "data controls"; }
    body.investment-dashboard .investment-dashboard-layout > .app-sidebar { display: block; }
}
@media (max-width: 900px) {
    body.investment-dashboard .investment-dashboard-layout { grid-template-columns: minmax(0,1fr); grid-template-rows: auto auto auto; grid-template-areas: "navigation" "data" "controls"; }
    body.investment-dashboard .investment-dashboard-layout > .app-navigation { grid-column: 1; grid-row: 1; }
    body.investment-dashboard .investment-dashboard-layout > .app-data { grid-column: 1; grid-row: 2; }
    body.investment-dashboard .investment-dashboard-layout > .app-sidebar { grid-column: 1; grid-row: 3; }
    body.investment-dashboard .investment-dashboard-layout > .app-navigation { width: 100%; max-width: 100%; }
    body.investment-dashboard .investment-dashboard-layout > .app-sidebar { display: block; width: 100%; max-width: 100%; }
    body.investment-dashboard .investment-dashboard-layout > .app-sidebar .portfolio-controls { position: static; }
    body.investment-dashboard .investment-dashboard-layout > .app-navigation .app-nav { display: flex; flex-wrap: wrap; overflow: hidden; }
    body.investment-dashboard .investment-dashboard-layout > .app-navigation .app-nav-heading { flex: 0 0 100%; }
    body.investment-dashboard .investment-dashboard-layout > .app-navigation .app-nav-list { display: flex; flex: 1 1 100%; min-width: 0; max-width: 100%; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain; }
    body.investment-dashboard .investment-dashboard-layout > .app-navigation .app-nav-list li { flex: 0 0 auto; }
    body.investment-dashboard .investment-dashboard-layout > .app-navigation .app-nav a { white-space: nowrap; }
    body.investment-dashboard .investment-dashboard-layout > .app-navigation .app-nav-sep { display: none; }
}


/* Portfolio navigation: compact category tabs above the dashboard. */
body.investment-dashboard .investment-dashboard-shell { max-width: 1760px; margin: 0 auto; padding: 18px 28px 40px; }
body.investment-dashboard .investment-dashboard-shell > .app-navigation { position: relative; z-index: 20; margin: 0 0 18px; }
body.investment-dashboard .app-nav-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 10px 14px; margin: 0; overflow: visible; }
body.investment-dashboard .app-nav-tabs > .app-nav-heading { margin: 0 8px 0 0; flex: 0 0 auto; }
body.investment-dashboard .app-nav-categories { display: flex; flex: 1 1 auto; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; }
body.investment-dashboard .app-nav-category { position: relative; }
body.investment-dashboard .app-nav-category > summary { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 12px; border: 1px solid transparent; border-radius: 8px; color: #52657c; cursor: pointer; font-size: 13px; font-weight: 650; list-style: none; }
body.investment-dashboard .app-nav-category > summary::-webkit-details-marker { display: none; }
body.investment-dashboard .app-nav-category > summary:after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
body.investment-dashboard .app-nav-category-active > summary, body.investment-dashboard .app-nav-category > summary:hover, body.investment-dashboard .app-nav-category[open] > summary { background: #f1f5fa; color: #244f7c; }
body.investment-dashboard .app-nav-category > summary:focus-visible { outline: 3px solid rgba(49,95,145,.35); outline-offset: 2px; }
body.investment-dashboard .app-nav-active-label { color: #244f7c; font-size: 11px; font-weight: 500; }
body.investment-dashboard .app-nav-dropdown { position: absolute; top: 100%; left: 0; z-index: 30; display: grid; gap: 3px; min-width: 190px; max-width: min(280px, calc(100vw - 28px)); padding: 6px; border: 1px solid var(--portfolio-line, #dce3ec); border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(24,45,72,.14); }
body.investment-dashboard .app-nav-dropdown a { display: block; min-height: 38px; padding: 9px 10px; border-radius: 7px; color: #52657c; font-size: 13px; line-height: 1.4; text-decoration: none; }
body.investment-dashboard .app-nav-dropdown a:hover, body.investment-dashboard .app-nav-dropdown a:focus-visible { background: #f1f5fa; color: #244f7c; outline: none; }
body.investment-dashboard .app-nav-dropdown a.app-nav-current { background: var(--portfolio-accent-soft); color: #244f7c; font-weight: 700; }
.app-nav-tabs .app-user { display: flex; align-items: center; gap: 8px; margin: 0 0 0 auto; padding: 0; border: 0; }
body.investment-dashboard .investment-dashboard-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(250px,300px); gap: 20px; align-items: start; max-width: none; margin: 0; padding: 0; }
body.investment-dashboard .investment-dashboard-layout > .app-data { grid-column: 1; grid-row: 1; }
body.investment-dashboard .investment-dashboard-layout > .app-sidebar { grid-column: 2; grid-row: 1; }
@media (max-width: 900px) {
 body.investment-dashboard .investment-dashboard-shell { padding: 12px; }
 body.investment-dashboard .app-nav-tabs { gap: 6px; padding: 9px; }
 body.investment-dashboard .app-nav-categories { gap: 3px; }
 body.investment-dashboard .app-nav-category > summary { min-height: 40px; padding: 7px 10px; }
 body.investment-dashboard .app-nav-active-label { display: none; }
 .app-nav-tabs .app-user { flex: 1 0 100%; margin: 4px 0 0; padding-top: 8px; border-top: 1px solid var(--portfolio-line, #dce3ec); }
 body.investment-dashboard .investment-dashboard-layout { grid-template-columns: minmax(0,1fr); gap: 12px; }
 body.investment-dashboard .investment-dashboard-layout > .app-data { grid-column: 1; grid-row: 1; }
 body.investment-dashboard .investment-dashboard-layout > .app-sidebar { grid-column: 1; grid-row: 2; }
 body.investment-dashboard .app-nav-dropdown { position: absolute; left: 0; right: auto; top: 100%; width: max-content; max-width: calc(100vw - 24px); }
}
@media (max-width: 420px) {
 body.investment-dashboard .investment-dashboard-shell { padding: 8px; }
 body.investment-dashboard .app-nav-tabs > .app-nav-heading { flex-basis: 100%; }
 body.investment-dashboard .app-nav-categories { justify-content: flex-start; }
 body.investment-dashboard .app-nav-category > summary { padding: 7px 8px; font-size: 12px; }
}
body.investment-dashboard .app-nav-single { display: inline-flex; align-items: center; min-height: 38px; padding: 7px 12px; border: 1px solid transparent; border-radius: 8px; color: #52657c; font-size: 13px; font-weight: 650; text-decoration: none; }
body.investment-dashboard .app-nav-single:hover, body.investment-dashboard .app-nav-single:focus-visible { background: #f1f5fa; color: #244f7c; outline: none; }
body.investment-dashboard .app-nav-single.app-nav-current { background: var(--portfolio-accent-soft); color: #244f7c; }
@media (max-width: 900px) { body.investment-dashboard .app-nav-single { min-height: 40px; padding: 7px 10px; } }
/* Account actions use the same hover and disclosure pattern as navigation categories. */
.app-nav-tabs .app-user { position: relative; display: flex; align-items: center; margin: 0 0 0 auto; padding: 0; border: 0; }
.app-user-menu { position: relative; }
.app-user-menu > summary { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; color: #52657c; cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; }
.app-user-menu > summary::-webkit-details-marker { display: none; }
.app-user-menu > summary:hover, .app-user-menu[open] > summary { background: #f1f5fa; color: #244f7c; }
.app-user-menu > summary:focus-visible { outline: 3px solid rgba(49,95,145,.35); outline-offset: 2px; }
.app-user-avatar { font-size: 15px; }
.app-user-chevron { color: #77869a; font-size: 12px; }
.app-user-dropdown { position: absolute; top: calc(100% + 5px); right: 0; z-index: 40; width: min(320px, calc(100vw - 28px)); padding: 14px; border: 1px solid var(--portfolio-line, #dce3ec); border-radius: 11px; background: #fff; box-shadow: 0 12px 30px rgba(24,45,72,.14); }
.app-user-name-edit button, .app-user-dropdown .app-logout button { min-height: 38px; padding: 7px 10px; border: 1px solid var(--portfolio-line, #dce3ec); border-radius: 7px; background: #fff; color: #244f7c; font-weight: 650; }
.app-user-dropdown-link { display: block; min-height: 38px; padding: 9px 10px; border-radius: 7px; color: #52657c; font-size: 13px; text-decoration: none; }
.app-user-dropdown-link:hover, .app-user-dropdown-link:focus-visible { background: #f1f5fa; color: #244f7c; outline: none; }
.app-user-dropdown .app-logout { margin: 4px 0 0; }
.app-user-dropdown .app-logout button { width: 100%; color: #9f3434; }
.app-user-dropdown .app-logout button:hover { background: #fff5f5; }
@media (max-width: 900px) {
 .app-nav-tabs .app-user { flex: 0 0 auto; margin: 0 0 0 auto; padding: 0; border: 0; }
 .app-user-dropdown { right: 0; width: min(320px, calc(100vw - 24px)); }
}.app-user-edit-open { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; font: inherit; }
.app-user-edit-open:hover, .app-user-edit-open:focus-visible { background: #f1f5fa; color: #244f7c; outline: none; }
.app-profile-dialog { width: min(520px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); overflow-y: auto; margin: auto; padding: 22px; border: 1px solid var(--color-border, #dce3ec); border-radius: 14px; background: #fff; color: var(--color-ink, #243247); box-shadow: 0 24px 70px rgba(19,35,55,.22); }
.app-profile-dialog::backdrop { background: rgba(19,35,55,.42); backdrop-filter: blur(2px); }
.app-profile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.app-profile-eyebrow { color: var(--color-muted, #64748b); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.app-profile-head h2 { margin: 4px 0 0; font-size: 21px; line-height: 1.3; }
.app-profile-close { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--color-border, #dce3ec); border-radius: 8px; background: #fff; color: #52657c; font-size: 23px; line-height: 1; }
.app-profile-form { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
.app-profile-form > label { margin-top: 5px; color: #52657c; font-size: 13px; font-weight: 650; }
.app-profile-form > input { width: 100%; min-height: 42px; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--color-border, #dce3ec); border-radius: 8px; background: #fff; color: var(--color-ink, #243247); }
.app-profile-form > input:focus { border-color: #7b9dc3; outline: 3px solid rgba(49,95,145,.16); }
.app-profile-section { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--color-border, #dce3ec); }
.app-profile-section h3 { margin: 0; font-size: 15px; }
.app-profile-section p { margin: 4px 0 2px; color: var(--color-muted, #64748b); font-size: 12px; }
.app-profile-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.app-profile-actions button { min-height: 42px; padding: 9px 14px; border: 1px solid var(--color-border, #dce3ec); border-radius: 8px; background: #fff; color: #52657c; font-weight: 650; }
.app-profile-actions .app-profile-save { border-color: #315f91; background: #315f91; color: #fff; }
.app-profile-actions .app-profile-save:hover { background: #244f7c; }
.app-global-message { position: relative; z-index: 10; width: min(1100px, calc(100% - 32px)); margin: 12px auto 0; }
.app-global-message .app-msg { margin: 0; }
@media (max-width: 480px) { .app-profile-dialog { width: calc(100vw - 24px); max-height: calc(100vh - 24px); padding: 17px; } .app-profile-actions button { flex: 1; } }
/* With navigation moved above the dashboard, let content use the full viewport width. */
body.investment-dashboard .investment-dashboard-shell { width: 100%; max-width: none; box-sizing: border-box; padding-right: clamp(16px, 2vw, 36px); padding-left: clamp(16px, 2vw, 36px); }
body.investment-dashboard .investment-dashboard-layout { grid-template-columns: minmax(0,1fr); width: 100%; }
body.investment-dashboard .investment-dashboard-layout > .app-data { grid-column: 1; grid-row: 1; width: 100%; max-width: none; }
body.investment-dashboard .investment-dashboard-layout > .app-sidebar { grid-column: 1; grid-row: 2; width: 100%; max-width: none; }
@media (max-width: 900px) {
 body.investment-dashboard .investment-dashboard-shell { padding-right: 12px; padding-left: 12px; }
 body.investment-dashboard .investment-dashboard-layout { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 420px) {
 body.investment-dashboard .investment-dashboard-shell { padding-right: 8px; padding-left: 8px; }
}
/* Shared application shell and component system for all regular pages. */
body.site-application { min-height: 100vh; margin: 0; padding: 0; background: #f3f6fa; color: #243247; font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.55; }
body.site-application * { box-sizing: border-box; }
body.site-application .site-shell { width: 100%; max-width: none; margin: 0; padding: 18px clamp(12px,2vw,36px) 40px; }
body.site-application .site-navigation { position: relative; z-index: 30; width: 100%; margin: 0 0 20px; }
body.site-application .app-nav-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-width: 0; padding: 10px 14px; margin: 0; overflow: visible; border: 1px solid #e1e7ef; border-radius: 12px; background: #fff; box-shadow: 0 4px 16px rgba(34,52,76,.055); }
body.site-application .app-nav-tabs > .app-nav-heading { flex: 0 0 auto; margin: 0 4px 0 0; color: #8290a3; font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
body.site-application .app-nav-categories { display: flex; flex: 1 1 auto; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
body.site-application .app-nav-category, body.site-application .app-user-menu { position: relative; }
body.site-application .app-nav-category > summary { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 7px 12px; border: 1px solid transparent; border-radius: 8px; color: #52657c; cursor: pointer; font-size: 13px; font-weight: 650; list-style: none; }
body.site-application .app-nav-category > summary::-webkit-details-marker { display: none; }
body.site-application .app-nav-category > summary:after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
body.site-application .app-nav-category-active > summary, body.site-application .app-nav-category > summary:hover, body.site-application .app-nav-category[open] > summary { background: #eef4fb; color: #244f7c; }
body.site-application .app-nav-category > summary:focus-visible { outline: 3px solid rgba(49,95,145,.35); outline-offset: 2px; }
body.site-application .app-nav-dropdown { position: absolute; top: 100%; left: 0; z-index: 50; display: grid; gap: 3px; min-width: 190px; max-width: min(280px,calc(100vw - 24px)); padding: 6px; border: 1px solid #dce3ec; border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(24,45,72,.14); }
body.site-application .app-nav-dropdown a, body.site-application .app-nav-single { display: block; min-height: 38px; padding: 9px 11px; border-radius: 7px; color: #52657c; font-size: 13px; text-decoration: none; }
body.site-application .app-nav-dropdown a:hover, body.site-application .app-nav-dropdown a:focus-visible, body.site-application .app-nav-single:hover, body.site-application .app-nav-single:focus-visible { background: #f1f5fa; color: #244f7c; outline: none; }
body.site-application .app-nav-dropdown a.app-nav-current, body.site-application .app-nav-single.app-nav-current { background: #e8f0fa; color: #244f7c; font-weight: 700; }
body.site-application .app-nav-single { display: inline-flex; align-items: center; font-weight: 650; }
body.site-application .app-nav-tabs .app-user { display: flex; align-items: center; flex: 0 0 auto; margin: 0 0 0 auto; padding: 0; border: 0; }
body.site-application .app-user-menu > summary { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; color: #52657c; cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; }
body.site-application .app-user-menu > summary::-webkit-details-marker { display: none; }
body.site-application .app-user-menu > summary:hover, body.site-application .app-user-menu[open] > summary { background: #f1f5fa; color: #244f7c; }
body.site-application .app-user-dropdown { position: absolute; top: calc(100% + 5px); right: 0; z-index: 60; width: min(300px,calc(100vw - 24px)); padding: 10px; border: 1px solid #dce3ec; border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(24,45,72,.14); }
body.site-application .app-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 22px; align-items: start; width: 100%; max-width: none; margin: 0; padding: 0; }
body.site-application .app-layout:not(.has-sidebar) { grid-template-columns: minmax(0,1fr); }
body.site-application .app-data { min-width: 0; overflow-x: auto; color: #243247; }
body.site-application .app-sidebar { display: grid; gap: 14px; min-width: 0; }
body.site-application .app-sidebar > * { width: 100%; max-width: 100%; margin-bottom: 0; }
body.site-application h1, body.site-application h2, body.site-application h3 { color: #1e2e43; line-height: 1.3; }
body.site-application h1 { font-size: clamp(25px,3vw,34px); letter-spacing: -.025em; }
body.site-application h2 { font-size: clamp(19px,2vw,24px); letter-spacing: -.015em; }
body.site-application p { line-height: 1.6; }
body.site-application a { color: #315f91; }
body.site-application .box, body.site-application .app-panel { border: 1px solid #e0e7ef; border-radius: 12px; background: #fff; box-shadow: 0 5px 18px rgba(25,46,74,.055); }
body.site-application .box { padding: clamp(16px,2vw,24px); }
body.site-application .app-panel { padding: 16px; }
body.site-application input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]), body.site-application select, body.site-application textarea { min-height: 40px; max-width: 100%; padding: 8px 10px; border: 1px solid #d3dce8; border-radius: 7px; background: #fff; color: #243247; font: inherit; }
body.site-application input:focus, body.site-application select:focus, body.site-application textarea:focus { border-color: #7b9dc3; outline: 3px solid rgba(49,95,145,.14); }
body.site-application button, body.site-application [type=submit], body.site-application [type=button] { min-height: 38px; border-radius: 7px; font: inherit; }
body.site-application .app-data table { max-width: 100%; border-collapse: collapse; }
body.site-application .app-data th { background: #f1f5f9; color: #52657c; font-weight: 650; }
body.site-application .app-data th, body.site-application .app-data td { border-color: #e2e8f0; }
body.site-application .app-data tr:hover td { background-color: #f8fafc; }
@media (max-width: 1000px) { body.site-application .app-layout.has-sidebar { grid-template-columns: minmax(0,1fr) 280px; gap: 16px; } }
@media (max-width: 760px) {
 body.site-application .site-shell { padding: 10px 12px 24px; }
 body.site-application .site-navigation { margin-bottom: 12px; }
 body.site-application .app-nav-tabs { gap: 5px; padding: 8px; }
 body.site-application .app-nav-tabs > .app-nav-heading { flex-basis: 100%; margin: 0 6px; }
 body.site-application .app-nav-categories { gap: 2px; }
 body.site-application .app-nav-category > summary, body.site-application .app-nav-single { min-height: 40px; padding: 7px 9px; }
 body.site-application .app-nav-tabs .app-user { flex: 0 0 auto; margin-left: auto; }
 body.site-application .app-layout.has-sidebar { grid-template-columns: minmax(0,1fr); }
 body.site-application .app-sidebar { grid-row: auto; }
 body.site-application .app-data { overflow-x: auto; }
}
@media (max-width: 420px) { body.site-application .site-shell { padding: 8px 8px 18px; } body.site-application .app-nav-category > summary, body.site-application .app-nav-single { padding-right: 7px; padding-left: 7px; font-size: 12px; } }/* The asset entry form remains a sidebar on desktop; stack it after content on small screens. */
body.investment-dashboard .investment-dashboard-layout { grid-template-columns: minmax(0,1fr) minmax(290px,340px); }
body.investment-dashboard .investment-dashboard-layout > .app-data { grid-column: 1; grid-row: 1; }
body.investment-dashboard .investment-dashboard-layout > .app-sidebar { grid-column: 2; grid-row: 1; }
@media (max-width: 900px) {
 body.investment-dashboard .investment-dashboard-layout { grid-template-columns: minmax(0,1fr); }
 body.investment-dashboard .investment-dashboard-layout > .app-data { grid-column: 1; grid-row: 1; }
 body.investment-dashboard .investment-dashboard-layout > .app-sidebar { grid-column: 1; grid-row: 2; }
}

/* Responsive photo gallery inside the shared application shell. */
body.site-application .photo-page { padding: clamp(16px,2.2vw,28px); border: 1px solid #e0e7ef; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(25,46,74,.055); }
body.site-application .photo-page h1 { margin: 0 0 18px; }
body.site-application .photo-page .navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 12px 14px; border: 1px solid #e0e7ef; border-radius: 10px; background: #f8fafc; }
body.site-application .photo-page .navigation strong { margin-right: 5px; color: #47576c; font-size: 13px; }
body.site-application .photo-page .navigation a { display: inline-flex; align-items: center; min-height: 36px; padding: 7px 10px; border: 1px solid #dce3ec; border-radius: 7px; background: #fff; color: #315f91; font-size: 13px; text-decoration: none; }
body.site-application .photo-page .navigation a:hover { background: #eef4fb; }
body.site-application .photo-page .gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 14px; }
body.site-application .photo-page .gallery img { display: block; width: 100%; height: auto; max-height: 320px; aspect-ratio: 3 / 4; margin: 0; border-radius: 9px; background: #edf1f5; object-fit: contain; box-shadow: 0 3px 12px rgba(25,46,74,.1); transition: transform .16s ease, box-shadow .16s ease; }
body.site-application .photo-page .gallery img:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(25,46,74,.17); }
body.site-application .photo-page .gallery > p { grid-column: 1 / -1; padding: 28px; color: #64748b; text-align: center; }
body.site-application .photo-page .pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; }
body.site-application .photo-page .pagination a { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 38px; padding: 7px 10px; border: 1px solid #dce3ec; border-radius: 7px; background: #fff; color: #315f91; text-decoration: none; }
body.site-application .photo-page .pagination a:hover { background: #eef4fb; }
body.site-application .photo-page .modal { display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(15,23,42,.92); }
body.site-application .photo-page .modal.is-open { display: flex !important; }
body.site-application .photo-page .modal img { width: auto; height: auto; max-width: min(92vw,1400px); max-height: 90vh; object-fit: contain; border-radius: 8px; }
body.site-application .photo-page .close { top: 14px; right: 22px; }

/* Media library keeps its poster art while sharing the site’s light navigation and surfaces. */
body.media-library.site-application { background: #f3f6fa; color: #243247; }
body.media-library.site-application .header { position: relative; top: auto; min-height: 62px; height: auto; padding: 10px clamp(16px,2vw,30px); background: #fff; border: 1px solid #e0e7ef; border-radius: 12px; box-shadow: 0 4px 14px rgba(25,46,74,.05); backdrop-filter: none; }
body.media-library.site-application .logo { color: #243247; }
body.media-library.site-application .search input { min-height: 40px; border: 1px solid #d3dce8; border-radius: 8px; background: #fff; color: #243247; }
body.media-library.site-application .container { width: 100%; max-width: 1600px; margin: 0 auto; padding: 28px clamp(16px,2vw,30px) 40px; }
body.media-library.site-application .page-title { margin-bottom: 18px; color: #1e2e43; }
body.media-library.site-application .toolbar { gap: 7px; }
body.media-library.site-application .filter { min-height: 38px; padding: 8px 12px; border: 1px solid #dce3ec; border-radius: 8px; background: #fff; color: #52657c; text-decoration: none; }
body.media-library.site-application .filter:hover, body.media-library.site-application .filter.active { border-color: #315f91; background: #315f91; color: #fff; }
body.media-library.site-application .card-title { color: #243247; }
body.media-library.site-application .card-meta { color: #64748b; }
body.media-library.site-application .poster { border-radius: 10px; box-shadow: 0 5px 15px rgba(25,46,74,.14); }
body.media-library.site-application .card:hover { transform: translateY(-3px); }
body.media-library.site-application .settings-box { background: #fff; border-color: #e0e7ef; border-radius: 12px; color: #243247; box-shadow: 0 5px 18px rgba(25,46,74,.055); }
@media (max-width: 760px) {
 body.site-application .photo-page { padding: 14px; }
 body.site-application .photo-page .gallery { grid-template-columns: repeat(auto-fill,minmax(125px,1fr)); gap: 10px; }
 body.media-library.site-application .header { border-radius: 10px; }
 body.media-library.site-application .container { padding: 20px 14px 30px; }
}
@media (max-width: 420px) {
 body.site-application .photo-page { padding: 11px; }
 body.site-application .photo-page .gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
}body.media-library.site-application .app-data, body.site-application.photo-gallery .app-data { overflow: visible; }
/* High-contrast media detail and an explicit return action. */
body.media-library.site-application .detail { background: #172336; }
body.media-library.site-application .detail-background { opacity: .22; filter: blur(3px); }
body.media-library.site-application .detail-gradient { background: linear-gradient(90deg,rgba(15,23,42,.68),rgba(15,23,42,.28) 58%,rgba(15,23,42,.62)); }
body.media-library.site-application .detail-gradient-bottom { background: linear-gradient(transparent,rgba(15,23,42,.8)); }
body.media-library.site-application .detail-content { padding-top: 82px; }
body.media-library.site-application .detail-info { padding: clamp(18px,2.4vw,30px); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(17,28,43,.97); color: #f8fafc; box-shadow: 0 16px 44px rgba(5,12,22,.24); }
body.media-library.site-application .detail-info h1, body.media-library.site-application .detail-info h2, body.media-library.site-application .detail-info h3, body.media-library.site-application .detail-title { color: #fff; }
body.media-library.site-application .detail-type { color: #cbd5e1; }
body.media-library.site-application .detail-meta { color: #e2e8f0; }
body.media-library.site-application .detail-plot { color: #f1f5f9; }
body.media-library.site-application .tagline { color: #e2e8f0; }
body.media-library.site-application .info-row, body.media-library.site-application .actor-role { color: #e2e8f0; }
body.media-library.site-application .info-row strong, body.media-library.site-application .actor-name { color: #fff; }
body.media-library.site-application .detail-info .section-title { color: #fff; }
body.media-library.site-application .detail-info .chip { border: 1px solid rgba(255,255,255,.16); background: #26384e; color: #f1f5f9; }
body.media-library.site-application .rating { color: #ffdf70; }
body.media-library.site-application .detail-back { position: absolute; top: 18px; left: clamp(16px,3vw,42px); z-index: 5; display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; background: rgba(17,28,43,.96); color: #fff; font-size: 14px; font-weight: 650; text-decoration: none; box-shadow: 0 5px 18px rgba(5,12,22,.2); }
body.media-library.site-application .detail-back:hover, body.media-library.site-application .detail-back:focus-visible { border-color: #8fb8e7; background: #26384e; outline: 3px solid rgba(143,184,231,.35); outline-offset: 2px; }
@media (max-width: 550px) { body.media-library.site-application .detail-content { padding-top: 76px; } body.media-library.site-application .detail-back { top: 12px; left: 12px; min-height: 40px; font-size: 13px; } }
/* Media detail dialog */
body.media-detail-open { overflow: hidden; }
body.media-library .media-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    overflow: auto;
    background: rgba(15, 23, 42, .78);
    backdrop-filter: blur(5px);
}
body.media-library .media-detail-overlay .detail {
    min-height: 100vh;
    max-height: none;
    overflow: auto;
}
body.media-library .detail-back {
    z-index: 5;
    cursor: pointer;
    font: inherit;
}
@media (max-width: 600px) {
    body.media-library .media-detail-overlay .detail { min-height: 100vh; }
}
/* Media detail is contained by the application content area, below navigation. */
body.media-library.site-application .app-layout { position: relative; }
body.media-library.site-application .media-detail-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    overflow: auto;
    background: rgba(226, 232, 240, .84);
    backdrop-filter: blur(3px);
    border-radius: 12px;
}
body.media-library.site-application .media-detail-overlay .detail { min-height: 100%; background: #eef3f8; color: #243247; }
body.media-library.site-application .media-detail-overlay .detail-background { opacity: .12; filter: blur(2px); }
body.media-library.site-application .media-detail-overlay .detail-gradient { background: linear-gradient(90deg,rgba(238,243,248,.94),rgba(238,243,248,.78) 58%,rgba(238,243,248,.90)); }
body.media-library.site-application .media-detail-overlay .detail-gradient-bottom { background: linear-gradient(transparent,rgba(238,243,248,.96)); }
body.media-library.site-application .media-detail-overlay .detail-info { background: rgba(255,255,255,.96); color: #243247; border-color: #d7e0ea; box-shadow: 0 14px 34px rgba(38,58,82,.12); }
body.media-library.site-application .media-detail-overlay .detail-info h1,
body.media-library.site-application .media-detail-overlay .detail-info h2,
body.media-library.site-application .media-detail-overlay .detail-info h3,
body.media-library.site-application .media-detail-overlay .detail-title,
body.media-library.site-application .media-detail-overlay .detail-info .section-title,
body.media-library.site-application .media-detail-overlay .info-row strong,
body.media-library.site-application .media-detail-overlay .actor-name { color: #172b43; }
body.media-library.site-application .media-detail-overlay .detail-type,
body.media-library.site-application .media-detail-overlay .detail-meta,
body.media-library.site-application .media-detail-overlay .detail-plot,
body.media-library.site-application .media-detail-overlay .tagline,
body.media-library.site-application .media-detail-overlay .info-row,
body.media-library.site-application .media-detail-overlay .actor-role { color: #40536b; }
body.media-library.site-application .media-detail-overlay .detail-info .chip { border-color: #dbe4ee; background: #edf3f8; color: #334a63; }
body.media-library.site-application .media-detail-overlay .detail-back { background: #fff; color: #243247; border-color: #d4deea; box-shadow: 0 3px 12px rgba(38,58,82,.1); }
body.media-library.site-application .media-detail-overlay .detail-back:hover,
body.media-library.site-application .media-detail-overlay .detail-back:focus-visible { background: #f0f6fc; border-color: #93b6dc; }
@media (max-width: 700px) {
    body.media-library.site-application .media-detail-overlay { border-radius: 8px; }
    body.media-library.site-application .media-detail-overlay .detail { min-height: 100%; }
    body.media-library.site-application .media-detail-overlay .detail-content { grid-template-columns: minmax(0,1fr); gap: 18px; padding: 72px 16px 28px; }
    body.media-library.site-application .media-detail-overlay .detail-poster { width: min(58vw,220px); }
}
body.site-application .photo-page .modal { z-index: 10000; }
body.site-application .photo-page .modal.is-open { display: flex !important; }
body.site-application .photo-page .modal img { object-fit: contain; }

/* T-Mobile filters and admin phone picker */
body.site-application .tmobile-filter-form { margin: 0 0 18px; }
body.site-application .tmobile-filter-row { display: flex; align-items: flex-end; gap: 8px; flex-wrap: nowrap; }
body.site-application .tmobile-date-range { display: grid; grid-template-columns: repeat(2, minmax(0, 160px)); gap: 8px; width: auto; min-width: 0; flex: 0 0 auto; }
body.site-application .tmobile-date-range label { display: grid; gap: 5px; width: 160px; max-width: 160px; color: #52657c; font-size: 13px; font-weight: 600; }
body.site-application .tmobile-date-range input[type="date"] { box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px; margin: 0; }
body.site-application .tmobile-filter-row > button { flex: 0 0 auto; min-height: 40px; margin: 0; }
body.site-application .tmobile-number-picker { display: grid; gap: 9px; }
body.site-application .tmobile-number-picker label { color: #33465d; font-weight: 650; }
body.site-application .tmobile-number-picker select { box-sizing: border-box; width: 100%; min-height: 210px; padding: 5px; }
body.site-application .tmobile-number-picker option { padding: 7px 8px; }
body.site-application .tmobile-current-number { display: block; margin-bottom: 10px; }

@media (max-width: 760px) {
    body.site-application .tmobile-filter-row { align-items: stretch; flex-wrap: wrap; }
    body.site-application .tmobile-date-range { grid-template-columns: repeat(2, minmax(0, 160px)); width: auto; }
    body.site-application .tmobile-filter-row > button { width: auto; }
}
@media (max-width: 420px) {
    body.site-application .tmobile-date-range { grid-template-columns: repeat(2, minmax(0, 160px)); }
}

/* Credit-card page */
.kr-wrap {
    margin: 0 auto;
    padding: 0 8px 40px;
    color: #263238;
}

.kr-muted { color: #78909c; }

.kr-message {
    padding: 10px 14px;
    border-radius: 6px;
    margin: 0 0 12px;
}

.kr-message.success {
    background: #e6f4ea;
    border: 1px solid #a8d5b5;
    color: #1e5e33;
}

.kr-message.error {
    background: #fdeaea;
    border: 1px solid #e6a5a5;
    color: #8a2323;
}

.kr-panel {
    background: #fff;
    border: 1px solid #dde2e7;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
}

.kr-panel h3 { margin: 0 0 12px; font-size: 16px; }
.kr-panel h4 { margin: 0 0 8px; font-size: 14px; }

.kr-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.kr-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.kr-layout {
    display: grid;
    grid-template-columns: 225px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.kr-sidebar {
    background: #fff;
    border: 1px solid #dde2e7;
    border-radius: 10px;
    padding: 14px;
    position: sticky;
    top: 12px;
}

.kr-sidebar h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

.kr-main {
    min-width: 0;
}

.kr-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 2px solid #dde2e7;
}

.kr-tab-btn {
    border: 0;
    background: transparent;
    padding: 9px 16px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    color: #546e7a;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.kr-tab-btn.active {
    color: #1b5e8c;
    border-bottom-color: #2878c7;
}

.kr-tab-pane { display: none; }
.kr-tab-pane.active { display: block; }

.kr-pills {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kr-pill {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    border: 1px solid #cbd2da;
    border-radius: 8px;
    background: #f3f5f7;
    color: #263238;
    text-decoration: none;
    line-height: 1.25;
}

.kr-pill small {
    color: #78909c;
    font-size: 12px;
}

.kr-pill:hover { background: #e8eef4; }

.kr-pill.active {
    background: #2878c7;
    border-color: #2878c7;
    color: #fff;
}

.kr-pill.active small { color: #dbe9f7; }

.kr-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.kr-kpi {
    background: #f7f9fb;
    border: 1px solid #e3e8ed;
    border-radius: 10px;
    padding: 10px 14px;
}

.kr-kpi span {
    display: block;
    font-size: 12px;
    color: #78909c;
}

.kr-kpi b {
    display: block;
    font-size: 19px;
    margin-top: 2px;
}

.kr-kpi small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
}

.kr-up { color: #c83d3d; font-weight: 600; }
.kr-down { color: #23834b; font-weight: 600; }

.kr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    box-sizing: border-box;
    padding: 7px 12px;
    border: 1px solid #cbd2da;
    border-radius: 6px;
    background: #f3f5f7;
    color: #263238;
    font: inherit;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.kr-btn:hover { filter: brightness(.96); }

.kr-btn-primary {
    background: #2878c7;
    border-color: #2878c7;
    color: #fff;
}

.kr-btn-danger {
    background: #c83d3d;
    border-color: #c83d3d;
    color: #fff;
}

.kr-field { margin-bottom: 10px; }

.kr-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
}

.kr-field input[type=text],
.kr-field select,
.kr-input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 9px;
    border: 1px solid #cbd2da;
    border-radius: 6px;
    font: inherit;
    background: #fff;
}

.kr-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.kr-toolbar .kr-input {
    width: auto;
    min-width: 220px;
}

.kr-neg { color: #b23b3b; }
.kr-pos { color: #23834b; }

.kr-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: #fff3cd;
    color: #7a5b00;
    border: 1px solid #e8d48a;
}

.kr-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.kr-alert {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: 8px;
    background: #fff8e1;
    border: 1px solid #e8d48a;
}

.kr-alert.ok {
    background: #e6f4ea;
    border-color: #a8d5b5;
}

.kr-row-new td { background: #fffbea; }
.kr-row-new td:first-child { box-shadow: inset 4px 0 0 #e0b030; }

.kr-cat-select {
    min-width: 210px;
    border-left-width: 6px;
}

.kr-flash {
    color: #23834b;
    font-weight: 700;
    opacity: 0;
    transition: opacity .3s;
    margin-left: 6px;
}

.kr-flash.show { opacity: 1; }

.kr-bulk {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 10px 0 0;
    padding: 10px;
    background: #f3f5f7;
    border-radius: 8px;
}

.kr-bulk .kr-input {
    width: auto;
    min-width: 210px;
}

.kr-donut-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.kr-donut-row > div:first-child {
    width: min(100%, 240px);
    justify-self: center;
}

.kr-donut {
    width: 100%;
    height: auto;
    transform: rotate(0deg);
}

.kr-donut-big {
    font-size: 5px;
    font-weight: 700;
    fill: #263238;
}

.kr-donut-small {
    font-size: 2.6px;
    fill: #78909c;
}

.kr-chart {
    width: 100%;
    height: auto;
    display: block;
}

.kr-chart-val {
    font-size: 11px;
    fill: #455a64;
    font-weight: 600;
}

.kr-chart-lbl {
    font-size: 11px;
    fill: #78909c;
}

.kr-chart a { cursor: pointer; }

.kr-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 8px;
    font-size: 12px;
    color: #546e7a;
}

.kr-hbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    font-size: 13px;
}

.kr-hbar .kr-hbar-label {
    flex: 0 0 38%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kr-hbar .kr-hbar-track {
    flex: 1;
    height: 10px;
    background: #eceff1;
    border-radius: 5px;
    overflow: hidden;
}

.kr-hbar .kr-hbar-track i {
    display: block;
    height: 100%;
    border-radius: 5px;
}

.kr-hbar .kr-hbar-val {
    flex: 0 0 auto;
    min-width: 78px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Modální okna */

.kr-modal {
    border: 1px solid #cbd2da;
    border-radius: 12px;
    padding: 0;
    width: 94%;
    max-width: 1050px;
    max-height: 90vh;
    overflow: auto;
}

.kr-modal::backdrop { background: rgba(0,0,0,.4); }

.kr-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid #e0e5ea;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.kr-modal-head h2 {
    margin: 0;
    font-size: 18px;
}

.kr-modal-body { padding: 16px 18px; }

.kr-modal-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eef1f4;
}

.kr-modal-row form {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
}

.kr-modal-row input[type=text] {
    padding: 6px 8px;
    border: 1px solid #cbd2da;
    border-radius: 6px;
    font: inherit;
    min-width: 190px;
}

.kr-modal-row input[type=color],
.kr-color {
    width: 42px;
    height: 34px;
    padding: 2px;
    border: 1px solid #cbd2da;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.kr-modal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

@media (max-width: 900px) {
    .kr-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .kr-sidebar {
        position: static;
    }

    .kr-pills {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .kr-pill {
        flex: 1 1 120px;
    }

    .kr-grid-2,
    .kr-grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 700px) {
    .kr-donut-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .kr-donut {
        max-width: 260px;
        margin: 0 auto;
    }

    .kr-tabs {
        overflow-x: auto;
    }

    .kr-tab-btn {
        white-space: nowrap;
        padding: 9px 12px;
    }

    .kr-modal-body {
        padding: 12px;
    }

    .kr-toolbar .kr-input {
        min-width: 0;
        width: 100%;
    }
}

/* ------------------------------------------------------------------ */
/* Výběr účtu (osobní účet / kreditka)                                 */
/* ------------------------------------------------------------------ */

.kr-layout.kr-layout-3 {
    grid-template-columns: 150px 225px minmax(0, 1fr);
}

.kr-accounts {
    background: #fff;
    border: 1px solid #dde2e7;
    border-radius: 10px;
    padding: 14px;
    position: sticky;
    top: 12px;
}

.kr-accounts h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

.kr-account {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    margin-bottom: 6px;
    border: 1px solid #cbd2da;
    border-radius: 8px;
    background: #f3f5f7;
    color: #263238;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.25;
}

.kr-account:hover { background: #e8eef4; }

.kr-account.active {
    background: #2878c7;
    border-color: #2878c7;
    color: #fff;
}

.kr-layout-3 .kr-empty {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .kr-layout.kr-layout-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .kr-accounts {
        position: static;
    }

    .kr-accounts .kr-account {
        display: inline-flex;
        margin-right: 6px;
    }

    .kr-layout-3 .kr-empty {
        grid-column: auto;
    }
}