/* --- DEFINICE BAREV (THEMING) --- */
:root {
    /* VĂťCHOZĂŤ TMAVĂť REĹ˝IM (Dark Mode) */
    --bg-body: #212529;
    /* TmavÄ› ĹˇedĂˇ (pozadĂ­ webu) */
    --bg-card: #2c3034;
    --bg-card-rgb: 44, 48, 52;
    /* SvÄ›tlejĹˇĂ­ ĹˇedĂˇ (panely, karty) */
    --bg-input: #343a40;
    /* PozadĂ­ formulĂˇĹ™ĹŻ */
    --bg-hover: #004248;
    /* Hover efekt v menu */
    --bg-header: #212529;
    --bg-rozpocet1: #343a40;
    --bg-rozpocet2: #3c4248;
    --bg-highlight: rgba(255, 255, 255, 0.05);
    /* ZvĂ˝razĹovacĂ­ panely */

    --text-link: rgb(0, 204, 255);
    --text-main: #ffffff;
    /* HlavnĂ­ text (bĂ­lĂˇ) */
    --text-muted: #adb5bd;
    /* VedlejĹˇĂ­ text (ĹˇedivĂˇ) */

    --border-color: #495057;
    /* Barva rĂˇmeÄŤkĹŻ */
    --shadow-color: rgba(0, 0, 0, 0.5);
    /* StĂ­n */
    --btn-bg: #0d6efd;
    --btn-hover: #0b5ed7;
    --primary: #0A84FF;
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* SVÄšTLĂť REĹ˝IM (Light Mode) */
body.light-mode {
    --bg-body: #f4f6f9;
    /* Velmi svÄ›tle ĹˇedĂˇ */
    --bg-card: #ffffff;
    --bg-card-rgb: 255, 255, 255;
    /* ÄŚistÄ› bĂ­lĂˇ */
    --bg-input: #ffffff;
    /* BĂ­lĂ© inputy */
    --bg-hover: #abc837ff;
    /* SvÄ›tlĂ˝ hover */
    --bg-header: rgb(228, 228, 228);
    --bg-rozpocet1: rgb(226, 226, 226);
    --bg-rozpocet2: rgb(242, 242, 242);
    --bg-highlight: rgba(0, 0, 0, 0.05);
    /* TmavĹˇĂ­ pozadĂ­ panelu ve svÄ›tlĂ©m reĹľimu */

    --text-link: rgb(0, 102, 255);
    --text-main: #212529;
    /* TmavĂ˝ text */
    --text-muted: #6c757d;
    /* Ĺ edĂ˝ text */

    --border-color: #ced4da;
    /* SvÄ›tlejĹˇĂ­ rĂˇmeÄŤky */
    --shadow-color: rgba(0, 0, 0, 0.15);
    /* JemnÄ›jĹˇĂ­ stĂ­n */
    --btn-bg: #0d6efd;
    --btn-hover: #0b5ed7;
}

/* =========================================
   1. ZĂKLADNĂŤ NASTAVENĂŤ A RESET
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    font-size: 15px;
    padding-top: 70px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

body.no-scroll {
    overflow: hidden;
}

main.container {
    flex: 1 0 auto;
}

h1,
h2,
h3,
h4 {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-weight: 500;
}

h1 {
    font-size: 1.4rem;
}

h2 {
    font-size: 1.2rem;
}

h3 {
    font-size: 1.1rem;
}

a {
    color: var(--text-link);
    text-decoration: none;
}

a:hover {
    color: var(--text-link-hover);
    text-decoration: none;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
}

.container {
    width: 100%;
    max-width: 100%;
    padding: 20px 30px;
    box-sizing: border-box;
}

/* =========================================
   2. HLAVIÄŚKA A NAVIGACE
   ========================================= */
header {
    background-color: var(--bg-header);
    padding: 0 30px;
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}



.header-left {
    display: flex;
    align-items: center;
}

.header-left .logo {
    background: url(/img/logonazev.svg);
    background-repeat: no-repeat;
    height: 50px;
    width: 180px;
    background-size: contain;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0px;
    flex-direction: column;
    align-items: flex-end;
    background: transparent !important;
}

.header-info-group {
    display: flex;
    float: right;
    align-items: center;
    flex-direction: column;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.user-info strong {
    color: var(--text-main);
}

#datetime-container {
    white-space: nowrap;
    font-size: 12px;
    float: right;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(44, 48, 52, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    padding: 0 15px;
    height: 28px;
    color: var(--text-main);
    font-size: 0.8rem;
    z-index: 900;
    display: flex;
    align-items: stretch;
}

/* Světlý režim pro patičku */
body.light-mode footer {
    background: rgba(248, 249, 250, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: #212529;
}

body.light-mode .footer-center {
    color: #6c757d;
}

body.light-mode #footer-datetime {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode #footer-date {
    color: #6c757d;
}

body.light-mode .footer-btn {
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #212529;
}

body.light-mode .footer-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Page Loader (Preloader) */
#page-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 48, 52, 0.9);
    /* Poloprůhledné tmavé pozadí */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        backdrop-filter 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.6s;
}

#page-preloader.fade-out {
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    visibility: hidden;
}

.loader-logo {
    width: 80px;
    height: 80px;
    background: url('/assets/logo.png') no-repeat center center;
    background-size: contain;
    margin-bottom: 20px;
    animation: loader-pulse 1.5s ease-in-out infinite;
    /* Pokud logo není dostupné, použijeme fallback spinner */
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color, #0d6efd);
    border-radius: 50%;
}

@keyframes loader-pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(0.9);
        opacity: 0.5;
    }
}

/* Světlý režim pro Preloader */
.light-mode #page-preloader {
    background: rgba(253, 253, 253, 0.85);
}

.light-mode .loader-text {
    color: #495057 !important;
}

.light-mode .loader-logo {
    border-color: rgba(0, 0, 0, 0.05);
}

/* Top Navigation Progress Bar */
#top-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(to right, #0d6efd, #0dcaf0);
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.5);
    z-index: 10000;
    transition: width 0.3s ease-out;
}

#top-progress-bar.loading {
    animation: top-bar-loading 2s ease-in-out forwards;
}

@keyframes top-bar-loading {
    0% {
        width: 0;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 90%;
    }
}

/* Úprava hlavního kontejneru pro fixní patičku (28px výška + 10px gap) */
main.container {
    flex: 1 0 auto;
    padding-bottom: 42px;
}

.footer-utility-bar {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.footer-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.footer-center {
    justify-content: center;
    color: var(--text-muted);
}

.footer-right {
    justify-content: flex-end;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

/* Stavový indikátor */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: #198754;
    box-shadow: 0 0 8px #198754;
    animation: pulse-green 2s infinite;
}

.order-header-info{
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    }

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(25, 135, 84, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
    }
}

#footer-datetime {
    background: rgba(0, 0, 0, 0.2);
    padding: 0px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 20px;
    display: flex;
    align-items: center;
}

#footer-date {
    margin-right: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

#footer-time {
    color: var(--accent-color, #0a58ca);
    font-size: 0.75rem;
}

/* Tlačítka v Utility Baru */
.footer-btn {
    background: transparent;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-radius: 0;
    padding: 0 10px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: normal;
    align-self: stretch;
}

.footer-btn svg {
    display: block;
    width: 20px;
    height: 20px;
    opacity: 0.8;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.footer-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-color, #0dcaf0);
    transform: translateY(-1.5px);
}

.footer-btn:hover svg {
    opacity: 1;
}

.footer-btn:active {
    transform: translateY(0);
}

#footer-reload-btn.rotating svg {
    animation: rotate-reload 0.8s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

@keyframes rotate-reload {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#theme-toggle-footer {
    min-width: 32px;
}

/* Nav ikony — skryté na desktopu, zobrazí se na mobilu */
.nav-icon { display: none; }

/* Responzivní skrývání prvků v mini-baru */
@media (max-width: 600px) {
    .term-hide {
        display: none !important;
    }

    .footer-center {
        display: none;
    }
}

/* Navigace */
header nav ul {
    list-style: none;
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 0;
    align-items: center;
}

header nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
}

header nav a:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
    text-decoration: none;
}

header nav a[href="/logout.php"] {
    color: #ff8b82;
    font-weight: bold;
}

header nav a[href="/logout.php"]:hover {
    background-color: #dc3545;
    color: #ffffff;
}

/* User-nav — konzistentní icon-button vzhled pro top-level položky */
.user-nav > ul > li > a,
.user-nav > ul > li > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 1.15rem;
    position: relative;
    box-sizing: border-box;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.user-nav > ul > li > a:hover,
.user-nav > ul > li > button:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

/* Dropdown menu */
nav ul li.dropdown {
    position: relative;
}

/* ZĂˇkladnĂ­ definice dropdown menu v jednom Ĺ™Ăˇdku: obsahuje pozicovĂˇnĂ­, vzhled i nastavenĂ­ pĹ™echodu */
nav ul li.dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-header);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    text-align: center;
    border-radius: 6px;
    list-style: none;
    padding: 5px 0;
    margin-top: 7px;
    min-width: 200px;
    z-index: 101;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* NeviditelnĂ˝ CSS most, kterĂ˝ brĂˇnĂ­ zmizenĂ­ menu pĹ™i pĹ™eskoÄŤenĂ­ 7px prĂˇzdnĂ© ĹˇkĂ­ry myĹˇĂ­! */
nav ul li.dropdown .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    /* Pokryje kompletnÄ› celĂ˝ 7px margin mĂ­sto a pĹ™esah */
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
}

/* Stav pĹ™i najetĂ­ v jednom Ĺ™Ăˇdku: aktivuje zobrazenĂ­ a definuje poÄŤĂˇteÄŤnĂ­ styl pro animaci */
nav ul li.dropdown:hover .dropdown-menu {
    display: block;
}

nav ul li.dropdown .dropdown-menu li {
    width: 100%;
}

nav ul li.dropdown .dropdown-menu li a {
    display: block;
    padding: 8px 15px;
    width: 100%;
    box-sizing: border-box;
}

/* User-nav dropdown — položky jako konzistentní tlačítka */
.user-nav > ul > li.dropdown > .dropdown-menu > li > a {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 12px !important;
    margin: 3px 6px;
    width: auto !important;
    border-radius: 7px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted) !important;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.user-nav > ul > li.dropdown > .dropdown-menu > li > a:hover {
    background: var(--bg-hover) !important;
    color: var(--text-main) !important;
}

.user-nav > ul > li.dropdown > .dropdown-menu > li > a[href="/logout"] {
    color: #f07040 !important;
    border-color: rgba(240, 112, 64, 0.35);
}

.user-nav > ul > li.dropdown > .dropdown-menu > li > a[href="/logout"]:hover {
    background: rgba(220, 53, 69, 0.15) !important;
    border-color: rgba(220, 53, 69, 0.5);
    color: #ff6347 !important;
}

/* GlobĂˇlnĂ­ vyhledĂˇvĂˇnĂ­ */
.global-search-form input[type="search"] {
    max-width: 100%;
    margin-left: 10px;
    min-width: 215px;
    height: 38px;
    padding: 6px 12px;
    background-color: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.global-search-form input[type="search"]::placeholder {
    color: #868e96;
}

#global-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 1500;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

#global-search-results.active {
    display: block;
}

.search-result-group h3 {
    margin: 0;
    padding: 8px 12px;
    font-size: 0.9em;
    color: var(--text-muted);
    background-color: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
}

.search-result-item a {
    display: block;
    padding: 10px 12px;
    color: #e9ecef;
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item a:hover {
    background-color: var(--bg-card);
    color: var(--bg-main);
}

.search-result-item:last-child a {
    border-bottom: none;
}

.search-no-results {
    padding: 15px;
    color: var(--text-muted);
    text-align: center;
}

/* Notifikace */
#notifications-bell {
    position: relative;
    font-size: 1.5rem;
    padding: 0 10px;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: 0;
    background-color: var(--bg-card);
    color: var(--bg-main);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid var(--bg-card);
}

#notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 1020;
    margin-top: 15px;
    padding: 0;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: block;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: #e9ecef;
    text-decoration: none;
}

.notification-item:hover {
    background-color: #495057;
}

.notification-item span {
    display: block;
    font-size: 0.9rem;
}

.notification-item small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.no-notifications {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

#notifications-dropdown .view-all {
    display: block;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    background-color: var(--bg-card);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}


/* =========================================
   3. TABULKY A SEZNAMY
   ========================================= */
.table-responsive-wrapper {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.9rem;
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 2px 2px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
}

th:first-child,
td:first-child {
    white-space: normal;
}

tr td {
    border-top: 1px solid var(--border-color);
}

thead th {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-weight: 600;
    border-bottom: 2px solid #495057;
}

tbody tr:hover {
    background-color: var(--bg-hover);
}

/* OPRAVA: Styly pro akce v tabulce (mazĂˇnĂ­, editace) */
td.actions {
    white-space: nowrap;
    text-align: right;
}

td.actions a,
td.actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    margin-left: 5px;
    text-decoration: none;
    font-size: 1.1rem;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

td.actions a:hover,
td.actions button:hover {
    background-color: var(--bg-hover);
}

/* Ĺ tĂ­tky (Badges) pro stavy zakĂˇzek */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    align-self: flex-start;
}

.toolbar-nadpis {
     display:flex;
     align-items:center;
      gap:10px;
      }

/* RozpoÄŤet - specifickĂ© styly */
#rozpocet-table td,
#rozpocet-table th {
    padding: 1px 8px;
    line-height: 1.2;
    height: auto;
}

#rozpocet-table input[type="text"],
#rozpocet-table input[type="number"] {
    height: 24px;
    padding: 0 5px;
    font-size: 0.9em;
}

#rozpocet-table button,
#rozpocet-table .button-like {
    padding: 0px 6px;
    font-size: 0.8em;
    line-height: 1.5;
}

#rozpocet-table tbody tr:nth-child(odd) {
    background-color: var(--bg-rozpocet1);
}

#rozpocet-table tbody tr:nth-child(even) {
    background-color: var(--bg-rozpocet2);
}

#rozpocet-table tbody tr:hover {
    background-color: var(--bg-hover) !important;
}

#rozpocet-table tr.child-row td {
    border-top: none;
    color: #ced4da;
}

.sortable-ghost {
    opacity: 0.4;
    background-color: #0d6efd !important;
}

#rozpocet-table td:first-child {
    cursor: grab;
}

#rozpocet-table td:first-child:active {
    cursor: grabbing;
}

/* Jednotka u množství — skrytá na desktopu, viditelná na mobilu */
.mob-unit { display: none; }

/* ─── ROZPOČET: MOBILNÍ CARD LAYOUT ─── */
@media (max-width: 640px) {
    #rozpocet-table thead { display: none; }
    #rozpocet-table tfoot { display: none; }
    #rozpocet-table, #rozpocet-table tbody { display: block; }

    /* Karta = 2 řádky: [název | akce] + [celkem | marže] */
    #rozpocet-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 6px;
        overflow: hidden;
        background: var(--bg-card) !important;
    }
    #rozpocet-table tbody tr:hover { background: var(--bg-card) !important; }

    #rozpocet-table tbody tr.child-row {
        margin-left: 14px;
        border-left: 3px solid #6ea8fe;
    }
    #rozpocet-table tbody tr.child-row td { color: inherit; }

    /* Přebití globálního responsive-table padding-left: 50% pro rozpočet */
    #rozpocet-table td { padding-left: 65px !important; }
    #rozpocet-table td[data-mob="actions"],
    #rozpocet-table td[data-mob="marze"] { padding-left: 6px !important; }
    #rozpocet-table td::before { width: 0 !important; padding-right: 0 !important; }

    /* Skryté buňky — qty a prodej jsou v celkem, nakup v marži */
    #rozpocet-table td[data-mob="hide"],
    #rozpocet-table td[data-mob="unit"],
    #rozpocet-table td[data-mob="qty"],
    #rozpocet-table td[data-mob="prodej"],
    #rozpocet-table td[data-mob="nakup"] { display: none !important; }

    /* Umístění */
    #rozpocet-table td[data-mob="name"]    { grid-column: 1; grid-row: 1; }
    #rozpocet-table td[data-mob="actions"] { grid-column: 2; grid-row: 1; }
    #rozpocet-table td[data-mob="celkem"]  { grid-column: 1; grid-row: 2; }
    #rozpocet-table td[data-mob="marze"]   { grid-column: 2; grid-row: 2; }

    /* Název — zalamuje se, font se přizpůsobuje šířce */
    #rozpocet-table td[data-mob="name"] {
        min-width: 0;
        padding: 7px 8px;
        font-weight: 600;
        font-size: clamp(0.72rem, 3.5vw, 0.85rem);
        background: var(--bg-rozpocet1);
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: flex-start;
    }
    #rozpocet-table td[data-mob="name"] > div {
        display: flex;
        align-items: flex-start;
        min-width: 0;
        padding-left: 0 !important;
        flex-wrap: wrap;
    }
    #rozpocet-table td[data-mob="name"] strong,
    #rozpocet-table td[data-mob="name"] .inline-popis-label,
    #rozpocet-table td[data-mob="name"] a,
    #rozpocet-table td[data-mob="name"] span:not(.toggle-children):not(.badge) {
        word-break: break-word;
        overflow-wrap: break-word;
        min-width: 0;
        text-align: left;
    }

    /* Akce */
    #rozpocet-table td[data-mob="actions"] {
        padding: 3px 6px;
        background: var(--bg-rozpocet1);
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        gap: 2px;
        white-space: nowrap;
    }
    #rozpocet-table td[data-mob="actions"] .btn,
    #rozpocet-table td[data-mob="actions"] a {
        padding: 2px 5px !important;
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }

    /* Celkem — kliknutelné, chevron indikuje rozbalení */
    #rozpocet-table td[data-mob="celkem"] {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        font-weight: bold;
        font-size: 0.9rem;
        min-width: 0;
        cursor: pointer;
        user-select: none;
    }
    #rozpocet-table td[data-mob="celkem"]::before {
        content: 'Celkem';
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: normal;
        flex-shrink: 0;
    }
    #rozpocet-table td[data-mob="celkem"]::after {
        content: '▸';
        color: var(--text-muted);
        font-size: 0.7rem;
        margin-left: auto;
        transition: transform 0.15s;
    }
    #rozpocet-table tbody tr.mob-expanded td[data-mob="celkem"]::after { transform: rotate(90deg); }

    /* Marže — barevný badge vpravo, kliknutelné */
    #rozpocet-table td[data-mob="marze"] {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 6px 8px;
        white-space: nowrap;
        cursor: pointer;
    }
    #rozpocet-table td[data-mob="marze"] span.profit,
    #rozpocet-table td[data-mob="marze"] span.marze-low,
    #rozpocet-table td[data-mob="marze"] span.loss {
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 0.8rem;
        font-weight: bold;
    }
    #rozpocet-table td[data-mob="marze"] span.profit    { background: #28a745; color: #fff !important; }
    #rozpocet-table td[data-mob="marze"] span.marze-low { background: #fd7e14; color: #fff !important; }
    #rozpocet-table td[data-mob="marze"] span.loss      { background: #dc3545; color: #fff !important; }
    #rozpocet-table td[data-mob="marze"] .inline-marze-input { width: 46px !important; font-size: 0.8rem; }

    /* Rozbalené řádky: qty + prodej + nakup */
    #rozpocet-table tbody tr.mob-expanded td[data-mob="qty"] {
        display: flex !important;
        grid-column: 1; grid-row: 3;
        align-items: center; gap: 4px; padding: 3px 10px; font-size: 0.8rem;
        border-top: 1px dashed var(--border-color);
    }
    #rozpocet-table tbody tr.mob-expanded td[data-mob="prodej"] {
        display: flex !important;
        grid-column: 2; grid-row: 3;
        align-items: center; gap: 4px; padding: 3px 8px; font-size: 0.8rem;
        border-top: 1px dashed var(--border-color);
        white-space: nowrap;
    }
    #rozpocet-table tbody tr.mob-expanded td[data-mob="nakup"] {
        display: flex !important;
        grid-column: 1 / -1; grid-row: 4;
        align-items: center; gap: 4px; padding: 3px 10px; font-size: 0.8rem;
        border-top: 1px dashed var(--border-color);
        background: rgba(0,0,0,0.02);
    }
    #rozpocet-table tbody tr.mob-expanded td[data-mob="qty"]::before    { content: 'Mn.';   color: var(--text-muted); font-size: 0.72rem; min-width: 28px; flex-shrink: 0; }
    #rozpocet-table tbody tr.mob-expanded td[data-mob="prodej"]::before { content: 'Cena';  color: var(--text-muted); font-size: 0.72rem; flex-shrink: 0; }
    #rozpocet-table tbody tr.mob-expanded td[data-mob="nakup"]::before  { content: 'Nákup'; color: var(--text-muted); font-size: 0.72rem; min-width: 36px; flex-shrink: 0; }

    .mob-unit { display: none; }

    /* Souhrn pod tabulkou */
    #rozpocet-mobile-summary {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 8px 12px;
        font-size: 0.85rem;
        margin-top: 4px;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }
    #rozpocet-mobile-summary .mob-sum-row { display: flex; justify-content: space-between; }
    #rozpocet-mobile-summary .mob-sum-row.total {
        border-top: 1px solid var(--border-color);
        padding-top: 3px;
        font-weight: bold;
    }
}

/* Data Grid & VizualnĂ­ tabulka */
.data-grid-container {
    background-color: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.data-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-grid th {
    background-color: var(--bg-main);
    color: var(--text-muted);
    padding: 8px 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.data-grid td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-grid tr:last-child td {
    border-bottom: none;
}

.data-grid tbody tr:nth-child(even) {
    background-color: var(--bg-rozpocet1);
}

.data-grid tbody tr:hover {
    background-color: var(--bg-hover);
}

/* Sort links in table headers */
.sort-link {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    opacity: 0.85;
    transition: opacity 0.15s, color 0.15s;
}
.sort-link:hover {
    opacity: 1;
    color: var(--accent, #6ea8fe);
    text-decoration: none;
}
.sort-link.active {
    opacity: 1;
    color: var(--text-main);
    font-weight: 600;
}

/* Flash messages */
.alert-widget-success {
    margin-bottom: 1rem;
    padding: 12px 16px;
    border-radius: 6px;
    color: #fff;
    background-color: #198754;
    border-left: 4px solid #0f5132;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-widget-error {
    margin-bottom: 1rem;
    padding: 12px 16px;
    border-radius: 6px;
    color: #fff;
    background-color: #dc3545;
    border-left: 4px solid #a71d2a;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-widget-warning {
    margin-bottom: 1rem;
    padding: 12px 16px;
    border-radius: 6px;
    color: #000;
    background-color: #ffc107;
    border-left: 4px solid #cc9a06;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-widget-info {
    margin-bottom: 1rem;
    padding: 12px 16px;
    border-radius: 6px;
    color: #fff;
    background-color: #0d6efd;
    border-left: 4px solid #084298;
    display: flex;
    align-items: center;
    gap: 8px;
}


#sklad-table-visual {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 10px;
}

#sklad-table-visual th {
    text-align: left;
    padding: 10px 15px;
    color: var(--text-muted);
    font-weight: normal;
    text-transform: uppercase;
    font-size: 0.85rem;
    border: none;
}

#sklad-table-visual td {
    background-color: var(--bg-input);
    padding: 12px 15px;
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

#sklad-table-visual tr td:first-child {
    border-left: 1px solid #495057;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

#sklad-table-visual tr td:last-child {
    border-right: 1px solid #495057;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

#sklad-table-visual tbody tr:hover td {
    background-color: var(--bg-hover);
    border-color: #6c757d;
}

/* Paginace */
.pagination-row td {
    background-color: var(--bg-body) !important;
    padding: 2px 15px !important;
    border-bottom: 2px solid #495057 !important;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0;
    margin-top: 0;
}

.page-btn {
    text-decoration: none;
    color: var(--text-main);
    background-color: var(--bg-input);
    padding: 0 7px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: background 0.15s;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
}

.page-btn:hover:not(.disabled) {
    background-color: var(--border-color);
    color: var(--text-main);
}

.page-btn.disabled {
    color: var(--text-muted);
    cursor: default;
    opacity: 0.35;
}

.page-btn.active {
    background-color: var(--btn-bg, #0d6efd);
    color: #fff;
    border-color: var(--btn-bg, #0d6efd);
    cursor: default;
}

.page-limit-sep {
    display: inline-block;
    width: 1px;
    height: 14px;
    background: var(--border-color);
    margin: 0 4px;
    vertical-align: middle;
}

.page-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-info strong {
    color: var(--text-main);
}

.page-input {
    width: 30px !important;
    height: 18px !important;
    min-height: 0 !important;
    max-height: 18px !important;
    text-align: center !important;
    padding: 0 !important;
    font-size: 0.75rem !important;
    line-height: 18px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 3px !important;
    background: var(--bg-input) !important;
    color: var(--text-main) !important;
    -moz-appearance: textfield !important;
    box-sizing: border-box !important;
    transition: width 0.2s ease, height 0.2s ease, font-size 0.2s ease, padding 0.2s ease, max-height 0.2s ease !important;
}

.page-input:focus {
    width: 64px !important;
    height: 28px !important;
    max-height: 28px !important;
    font-size: 0.88rem !important;
    padding: 0 4px !important;
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 2px rgba(13,110,253,0.2) !important;
    outline: none !important;
}
.page-input::-webkit-outer-spin-button,
.page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.page-input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13,110,253,0.2);
}


/* =========================================
   4. FORMULĂĹE A TLAÄŚĂŤTKA
   ========================================= */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 5px 5px;
    padding: 5px;
    background-color: var(--bg-card);
    position: sticky;
    top: 70px;
    z-index: 900;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 2rem;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="number"],
input[type="color"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #6c757d;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.95rem;
    background-color: var(--bg-input);
    color: var(--bg-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    height: 35px;
}
select option {
        background-color: var(--bg-main) !important;
        color: var(--text-main) !important;
    }
textarea {
    height: auto;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--bg-input);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(110, 168, 254, .25);
}

button,
.button-like {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--btn-bg, #0d6efd);
    color: white;
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
    vertical-align: middle;
    line-height: 1.5;
}

button:hover,
.button-like:hover {
    background-color: var(--btn-hover, #0b5ed7);
    color: white;
    text-decoration: none;
}

button[disabled] {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* OPRAVA: Toolbar pro filtry (ZakĂˇzky, Sklad) */
.toolbar-container,
.toolbar {
    position: sticky;
    background-color: var(--bg-card);
    padding: 5px;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    flex-wrap: nowrap;
    top: 70px;
    z-index: 901;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.toolbar h1 {
    margin: 0;
    font-size: 1.3rem;
    white-space: normal;
    min-width: 100px;
    margin-right: 10px;
}

@media (max-width: 1025px) {
    /* Nadpis toolbaru — klikatelný přepínač */
    .toolbar-collapsible-heading {
        cursor: pointer;
        user-select: none;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .toolbar-collapsible-heading::after {
        content: ' ▼';
        font-size: 0.65em;
        color: var(--text-muted);
        transition: transform 0.2s;
        display: inline-block;
    }

    .toolbar.toolbar-collapsed .toolbar-collapsible-heading::after {
        transform: rotate(-90deg);
    }

    .toolbar.toolbar-collapsed .toolbar-collapsible {
        display: none !important;
    }

    .toolbar.toolbar-collapsed .mobile-filter-toggle {
        display: none !important;
    }
}

.toolbar-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-grow: 1;
    flex-wrap: nowrap;
    min-width: 0;
}

/* Checkbox + label v toolbaru */
.toolbar-form label,
.toolbar label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .88rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.toolbar-form label:hover,
.toolbar label:hover {
    color: var(--text-main);
}
.toolbar-form input[type="checkbox"],
.toolbar input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    display: inline-block;
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    min-width: 15px;
    max-width: 15px;
    min-height: 15px;
    max-height: 15px;
    box-sizing: border-box;
    border: 1.5px solid var(--border-color);
    border-radius: 3px;
    background: var(--bg-input);
    cursor: pointer;
    align-self: center;
    transition: background .15s, border-color .15s;
    position: relative;
}
.toolbar-form input[type="checkbox"]:checked,
.toolbar input[type="checkbox"]:checked {
    background: #0d6efd;
    border-color: #0d6efd;
}
.toolbar-form input[type="checkbox"]:checked::after,
.toolbar input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}
.toolbar-form input[type="checkbox"]:hover,
.toolbar input[type="checkbox"]:hover {
    border-color: #0d6efd;
}

.toolbar-actions {
    display: flex;
    gap: 8px;
    /* flex-wrap: wrap; */
    white-space: normal;
}

.toolbar-actions button,
.toolbar-actions a,
.toolbar-actions .button-like,
.toolbar-actions span.button-like {
    padding: 6px 10px !important;
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
    white-space: nowrap;
}

/* Kompaktní inputy a tlačítka */
.compact-input,
.compact-select,
.toolbar input,
.toolbar-form select {
    width: 260px;
    max-width: 260px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--bg-input);
    color: var(--text-main);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23888" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding: 6px 32px 6px 12px;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Wrapper pro animaci šířky — nativní <select> max-width transition nefunguje v Chrome */
.select-wrap {
    display: inline-block;
    max-width: 130px;
    overflow: hidden;
    vertical-align: middle;
    transition: max-width 0.25s ease;
}

.select-wrap.expanded {
    max-width: 260px;
}

.select-wrap:has(select[name="limit"]) {
    max-width: 50px;
}

.select-wrap:has(select[name="limit"]).expanded {
    max-width: 80px;
}

.toolbar-form select:hover {
    border-color: #0d6efd;
}

.toolbar-form select:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

    .toolbar-form select option {
        background-color: var(--bg-input) !important;
        color: var(--text-main) !important;
    }

/* color-scheme říká prohlížeči, aby renderoval nativní dropdown (option list) tmavě/světle */
select {
    color-scheme: dark;
}
body.light-mode select {
    color-scheme: light;
}

.compact-input {
    min-width: 200px;
}

.compact-btn {
    padding: 5px 10px;
    font-size: 0.9rem;
    background-color: #198754;
    color: white;
}

.reset-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0 5px;
}

.reset-link:hover {
    color: #dc3545;
}

 /* Přepínač zobrazení (Tabulka / Karty) */
.view-switcher {
    display: inline-flex;
    background: rgba(120, 120, 128, 0.22);
    border-radius: 9px;
    padding: 2px;
    gap: 2px;
    border: none;
}
.view-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 5px 10px;
    text-decoration: none;
    color: var(--text-muted, #888);
    font-size: 1.05em;
    line-height: 1;
    border-radius: 7px;
    border: none;
    background: transparent;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.view-switcher a:hover {
    color: var(--text-main, #eee);
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}
.view-switcher a.active {
    background: rgba(255, 255, 255, 0.18) !important;
    color: var(--text-main, #fff) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35), 0 0 0 0.5px rgba(255,255,255,0.1) !important;
}

/* Select2 Custom Dark Theme */
/* Select2 — sjednoceno s toolbar select stylem */
.select2-container--default .select2-selection--single {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    height: 34px !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25) !important;
    outline: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-main) !important;
    line-height: 32px !important;
    padding-left: 12px !important;
    padding-right: 30px !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted) !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    color: var(--text-muted) !important;
    font-size: 1.1rem !important;
    margin-right: 4px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 32px !important;
    right: 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-muted) transparent transparent transparent !important;
}

.select2-dropdown {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
}

.select2-search--dropdown .select2-search__field {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: 4px !important;
    padding: 6px 10px !important;
}

.select2-search--dropdown .select2-search__field:focus {
    outline: none !important;
    border-color: #0d6efd !important;
}

.select2-results__option {
    color: var(--text-main) !important;
    padding: 7px 12px !important;
}

.select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #0d6efd !important;
    color: white !important;
}

.select2-results__option--selected {
    background-color: var(--bg-body) !important;
    color: var(--text-muted) !important;
}


/* =========================================
   5. OSTATNĂŤ KOMPONENTY
   ========================================= */
.card {
    background-color: var(--bg-card);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    height: 100%;
    box-sizing: border-box;
}

a.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

a.card-link:hover .card {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 200, 250, 0.3);
}

.card h3 {
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.card p {
    font-size: 1.5rem;
    margin: 10px 0 0 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-grid {
    display: grid;
    grid-template-columns: auto 1fr 1fr 1fr;
    gap: 10px 20px;
    align-items: center;
    background-color: var(--bg-card);
    color: var(--bg-main);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    max-width: 65%;
    float: left;
}

.detail-grid.full-width-grid {
    max-width: 100%;
    float: none;
}

.detail-grid dt {
    font-weight: bold;
    text-align: right;
    color: var(--text-muted);
}

.detail-grid dd {
    margin: 0;
}

.detail-grid .full-width {
    grid-column: 1 / -1;
}

.tab-nav {
    background-color: var(--bg-card);
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
    top: 69px;
    position: sticky;
    z-index: 10;
}

.tab-nav button {
    background-color: inherit;
    color: var(--bg-main);
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 5px 8px;
    transition: 0.3s;
    font-size: 1rem;
}

.tab-nav button:hover {
    background-color: var(--bg-hover);
    color: var(--bg-main);
}

.tab-nav button.active {
    background-color: var(--bg-hover);
    color: var(--bg-main);
    border-bottom: 2px solid #0d6efd;
}

.tab-pane {
    display: none;
    padding-top: 10px;
}

.collapsible-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible-section.expanded .collapsible-content {
    max-height: 2000px;
}

.toggle-icon {
    font-size: 2rem;
    font-weight: bold;
    color: #6c757d;
}

.alert-widget-danger {
    border-left: 5px solid #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
}

.profit {
    color: #28a745 !important;
    font-weight: bold;
}

.marze-low {
    color: #fd7e14 !important;
    font-weight: bold;
}

.loss {
    color: #dc3545 !important;
    font-weight: bold;
}

.locked-row {
    background-color: rgba(255, 193, 7, 0.1) !important;
    opacity: 0.8;
}

/* Hlavní kontejner karty detailu zakázky */
.order-header-card {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

/* Skupina informaÄŤnĂ­ch polĂ­ (levĂˇ strana) */
.order-info-group {
    display: flex;
    flex: 1;
    /* Zabere veĹˇkerĂ˝ dostupnĂ˝ prostor pĹ™ed tlaÄŤĂ­tky */
    flex-wrap: wrap;
    gap: 10px;
}

/* JednotlivĂ© sloupce - klĂ­ÄŤ k vaĹˇĂ­ poĹľadavku na stejnou velikost */
.order-info-column {
    flex: 1;
    /* KaĹľdĂ˝ sloupec roste stejnÄ› */
    min-width: 140px;
    /* MinimĂˇlnĂ­ ĹˇĂ­Ĺ™ka, aby se text nemaÄŤkal */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* FormĂˇtovĂˇnĂ­ popiskĹŻ (small) */
.order-info-column small {
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
    /* JemnĂ˝ rozestup od hodnoty */
    font-size: 0.85rem;
}

/* FormĂˇtovĂˇnĂ­ hlavnĂ­ch hodnot (strong) */
.order-info-column strong {
    font-size: 1.2rem;
    line-height: 1.2;
}

/* SpeciĂˇlnĂ­ stylovĂˇnĂ­ stavu (badge) */

/* Skupina tlaÄŤĂ­tek (pravĂˇ strana) */
.order-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ModĂˇlnĂ­ okna */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* TmavĹˇĂ­ prĹŻhlednĂˇ ÄŤernĂˇ + RozmazĂˇnĂ­ (iOS styl) */
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    z-index: 1010;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 16px;
    z-index: 1011;
    width: 95% !important;
    max-width: 600px;
    max-height: 90vh !important;
    display: none;
    overflow-y: auto !important;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-overlay.show,
.modal.show {
    display: block;
    opacity: 1;
    transition: opacity 5s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 10px 0 10px;
    background-color: var(--bg-header);
    color: var(--text-main);
    border-radius: 16px 16px 0 0;
}

.modal-close {
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    padding-right: 10px;
}


/* Sklad Komponenty */
.item-avatar {
    width: 45px;
    height: 45px;
    background-color: var(--bg-body);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
    font-size: 1.5rem;
}

.item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-link {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
    text-decoration: none;
    display: block;
}

.item-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    gap: 10px;
}

.item-code {
    font-family: monospace;
    color: #6ea8fe;
    background: rgba(13, 110, 253, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
}

.category-badge {
    background-color: #495057;
    color: #e9ecef;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    border: 1px solid #6c757d;
}

.stock-visual {
    width: 100%;
    max-width: 250px;
}

.stock-bar {
    height: 8px;
    width: 100%;
    background-color: var(--bg-body);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
    display: flex;
}

.bar-avail {
    background-color: #198754;
    height: 100%;
}

.bar-res {
    background-color: #ffc107;
    height: 100%;
}

.stock-text {
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
}

.stock-text .avail {
    color: #28a745;
}

.stock-text .res {
    color: #ffc107;
    font-size: 0.8em;
}

.stock-text .unit {
    color: #6c757d;
}

.stock-warning {
    font-size: 0.75rem;
    color: #dc3545;
    font-weight: bold;
    margin-top: 2px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    text-decoration: none;
    margin-left: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--border-color);
    border-color: var(--text-muted);
}

.btn-in:hover {
    background: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
    color: #28a745;
}

.btn-out:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    color: #ffc107;
}

.btn-budget:hover {
    background: rgba(13, 202, 240, 0.2);
    border-color: #0dcaf0;
    color: #0dcaf0;
}

.filter-bar {
    background-color: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-grow: 1;
}

.filter-group input,
.filter-group select {
    background-color: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-main);
}

/* =========================================
   6. BOÄŚNĂŤ PANELY (OUĹ KA) - FINĂLNĂŤ OPRAVA
   ========================================= */

/* --- 1. OBSAH PANELĹ® (VYSOUVACĂŤ OKNA) --- */
#history-panel,
#fav-panel,
#notes-panel,
#calc-panel,
#search-panel,
#tasks-panel,
#clip-panel,
#work-panel {
    position: fixed;
    top: 0;
    width: 320px;
    height: 100%;
    background-color: var(--bg-card);
    /* MĂ­sto #2c3034 */
    border: 1px solid var(--border-color);
    /* MĂ­sto #495057 */
    box-shadow: 0 0 20px var(--shadow-color);
    color: var(--text-main);
    /* Aby byl text ÄŤitelnĂ˝ */
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

/* Z-Indexy (aby se pĹ™ekrĂ˝valy sprĂˇvnÄ›) */
#history-panel {
    z-index: 2001;
}

#fav-panel {
    z-index: 2002;
}

#notes-panel {
    z-index: 2003;
}

#calc-panel {
    z-index: 2004;
}

#search-panel {
    z-index: 2005;
}

#tasks-panel {
    z-index: 2006;
}

#clip-panel {
    z-index: 2007;
}

#work-panel {
    z-index: 2008;
}

/* Pozice panelĹŻ (VysouvĂˇnĂ­) */
.position-right[id$="-panel"] {
    right: 0;
    border-left: 1px solid #495057;
    transform: translateX(100%);
}

.position-right[id$="-panel"].open {
    transform: translateX(0);
}

.position-left[id$="-panel"] {
    left: 0;
    border-right: 1px solid #495057;
    transform: translateX(-100%);
}

.position-left[id$="-panel"].open {
    transform: translateX(0);
}

/* HlaviÄŤky panelĹŻ */
.history-header {
    padding: 15px;
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.side-switch-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 8px;
    font-size: 1.2rem;
}

.close-history {
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.history-content {
    flex-grow: 1;
    overflow-y: auto;
}

/* Barvy hlaviÄŤek */
#history-panel .history-header {
    background-color: #ffc107;
    border-bottom: 1px solid #e0a800;
}

#history-panel .history-header h3,
#history-panel .close-history,
#history-panel .side-switch-btn {
    color: #212529;
    border-color: #212529;
}

#work-panel .history-header {
    background-color: #6610f2;
    border-bottom: 1px solid #520dc2;
}

/* --- ROZBALOVACĂŤ NABĂŤDKA NA KLIKNUTĂŤ (JS DROPDOWN) --- */

/* HlavnĂ­ obal pro tlaÄŤĂ­tko a nabĂ­dku - drĹľĂ­ je pohromadÄ› */
.js-dropdown-container {
    position: relative;
    display: inline-block;
}

/* SkrytĂ˝ box s odkazy (samotnĂ© menu) */
.js-dropdown-menu {
    display: none;
    /* Ve vĂ˝chozĂ­m stavu je menu skrytĂ© */
    position: absolute;
    top: 100%;
    right: 0;
    /* ZarovnĂˇnĂ­ k pravĂ©mu okraji (vhodnĂ© pro menu vpravo nahoĹ™e) */
    margin-top: 8px;
    background-color: var(--bg-card);
    min-width: 180px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow: hidden;
}

/* TĹ™Ă­da pro zobrazenĂ­ menu (tuto tĹ™Ă­du pĹ™idĂˇvĂˇ/odebĂ­rĂˇ JavaScript) */
.js-dropdown-menu.show {
    display: block;
}

/* StylovĂˇnĂ­ jednotlivĂ˝ch poloĹľek (odkazĹŻ a tlaÄŤĂ­tek) uvnitĹ™ menu */
.js-dropdown-menu a,
.js-dropdown-menu button.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    color: var(--text-main);
    padding: 10px 15px;
    text-decoration: none;
    font-size: 0.9rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

/* OdstranÄ›nĂ­ spodnĂ­ ÄŤĂˇry u poslednĂ­ poloĹľky v menu */
.js-dropdown-menu a:last-child,
.js-dropdown-menu button.dropdown-item:last-child {
    border-bottom: none;
}

/* Efekt pĹ™i najetĂ­ myĹˇĂ­ na poloĹľku v menu */
.js-dropdown-menu a:hover,
.js-dropdown-menu button.dropdown-item:hover {
    background-color: var(--bg-input);
}

/* --- 2. ĂšCHYTY (HANDLES) A KONTEJNER --- */

/* HlavnĂ­ kontejner pro ouĹˇka - drĹľĂ­ je pohromadÄ› */
#panel-handles-container {
    position: fixed;
    top: 150px;
    /* ZaÄŤĂˇtek sloupce */
    width: 40px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    /* ĹadĂ­ ouĹˇka pod sebe */
    gap: 5px;
    /* Mezera mezi ouĹˇky */
}

/* Pozice kontejneru */
#panel-handles-container.position-right {
    right: 0;
}

#panel-handles-container.position-left {
    left: 0;
}

/* Styl pro jednotlivĂˇ ouĹˇka */
.panel-handle {
    position: relative !important;
    /* DĹŻleĹľitĂ©: MusĂ­ bĂ˝t relative, aby fungovalo Ĺ™azenĂ­ */
    width: 40px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: margin 0.2s ease;
    color: var(--text-main);
    border-radius: 0;
    /* Reset */
}

#history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    /* PouĹľijeme viewport units pro jistotu */
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;

    /* Blur efekt pro vĹˇechny prohlĂ­ĹľeÄŤe */
    -webkit-backdrop-filter: blur(4px);
    /* Safari/iOS */
    backdrop-filter: blur(4px);
    /* Chrome/Firefox */

    cursor: pointer;
    /* Indikuje, Ĺľe se dĂˇ kliknout pro zavĹ™enĂ­ */
}

#history-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* ZajistĂ­, Ĺľe reaguje na kliknutĂ­ */
}

/* Barvy ouĹˇek */
#history-handle {
    background-color: #ffc107;
    color: #000;
}

#fav-handle {
    background-color: #0d6efd;
}

#notes-handle {
    background-color: #198754;
}

#calc-handle {
    background-color: #fd7e14;
    color: #000;
}

#search-handle {
    background-color: #6f42c1;
}

#tasks-handle {
    background-color: #dc3545;
}

#clip-handle {
    background-color: #6c757d;
}

#work-handle {
    background-color: #6610f2;
}

/* Tvar a Hover efekt - ZĂVISLĂ‰ NA STRANÄš KONTEJNERU */
#panel-handles-container.position-right .panel-handle {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

#panel-handles-container.position-right .panel-handle:hover {
    margin-right: 5px;
}

#panel-handles-container.position-left .panel-handle {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

#panel-handles-container.position-left .panel-handle:hover {
    margin-left: 5px;
}

/* --- ZĂˇmeÄŤek pro Ăşpravu poĹ™adĂ­ --- */
#panel-reorder-btn {
    width: 40px;
    height: 15px;
    display: flex;
    justify-content: right;
    align-items: right;
    cursor: pointer;
    color: #6c757d;
    /* Ĺ edĂˇ (zamÄŤeno) */
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.2;
    transition: color 0.2s, transform 0.2s;
    user-select: none;
}

#panel-reorder-btn:hover {
    color: var(--text-muted);
}

/* KdyĹľ je reĹľim Ăşprav AKTIVNĂŤ */
.reorder-active #panel-reorder-btn {
    opacity: 1;
    color: #ffc107;
    /* Ĺ˝lutĂˇ (odemÄŤeno) */
}

/* ReĹľim Ăşprav (aktivnĂ­ zĂˇmek) */
.reorder-active .panel-handle {
    cursor: grab !important;
    border: 1px dashed #ffc107;
    /* Ĺ˝lutĂ˝ rĂˇmeÄŤek */
    opacity: 0.8;
    transform: scale(0.95);
    /* MĂ­rnĂ© zmenĹˇenĂ­ */
}

/* KdyĹľ je zamÄŤeno, tvĂˇĹ™Ă­me se jako normĂˇlnĂ­ tlaÄŤĂ­tka */
.panel-handle {
    cursor: pointer;
    /* VĂ˝chozĂ­ kurzor pro kliknutĂ­ */
}

/* =========================================
   7. RESPONZIVITA A MOBILNĂŤ MENU
   ========================================= */

/* Hamburger Menu */
#hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 3001;
    position: relative;
    width: 45px;
    height: 40px;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #e9ecef;
    transition: all 0.3s ease-in-out;
    transform-origin: left;
    border-radius: 2px;
}

@media (max-width: 1200px) {
    .header-info {
        display: flex;
    }

    .header-left img {
        display: none;
    }

    .header-left .logo {
        background: url(/img/logo192.png);
        background-repeat: no-repeat;
        height: 50px;
        width: 50px;
        background-size: contain;
    }
}

@media (max-width: 1025px) {

    /* MobilnĂ­ navigace */
    header {
        padding: 0 15px;
    }
    .order-header-card {
    display: block;
    }
    
    .order-header-info{
    grid:none;
    gap: 10px;
    }

    #hamburger-btn {
        display: flex;
    }

    /* Animace křížku - správné protnutí linek uprostřed s translate */
    #hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    #hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    #hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    .menu-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 2999;
        backdrop-filter: blur(3px);
        opacity: 0;
        visibility: hidden;
        transition: 2s;
    }

    .menu-backdrop.active {
        opacity: 1;
        visibility: visible;
        transition: opcaity 3;
    }

    .nav-wrapper {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(420px, 100%);
        height: 100vh;
        background-color: #212529;
        color: #ffffff;
        flex-direction: column;
        justify-content: flex-start;
        padding: 20px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
        transition: right 0.3s ease;
        z-index: 3000;
        overflow-y: auto;
        display: flex;
    }

    .nav-wrapper.active {
        right: 0;
    }

    .header-right {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
        margin-top: 0;
        border: none;
        padding: 0;
    }

    .header-info {
        width: 100%;
        border-bottom: 1px solid #495057;
        padding-bottom: 20px;
        margin-bottom: 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        /* Mezera mezi profily a datumem */
    }

    .header-info .user-info {
        font-size: 1.1rem;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .user-nav ul {
        flex-direction: row;
        /* Ikony (zvoneček, profil, zprávy) vedle sebe! */
        width: 100%;
        gap: 20px;
        justify-content: flex-start;
        margin-top: 10px;
    }

    .main-nav li {
        width: 100%;
        margin: 0;
    }

    .main-nav a {
        display: block;
        padding: 14px 15px;
        font-size: 1.15rem;
        border-bottom: 1px solid #343a40;
        width: 100%;
        color: #e9ecef !important;
    }

    .main-nav a:hover {
        background-color: #343a40 !important;
        padding-left: 20px;
    }

    /* --- NOVÝ USER-NAV GRID (IKONY) --- */
    .user-nav ul {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        width: 100%;
        gap: 8px;
        justify-content: flex-start;
        margin-top: 20px;
    }

    /* Zploštění struktury dropdownu, aby položky sdílely jeden row */
    .user-nav>ul>li.dropdown,
    .user-nav>ul>li.dropdown>.dropdown-menu {
        display: contents !important;
    }

    /* Skrýt původní rozbalovací text/ikonu samotného účtu */
    .user-nav>ul>li.dropdown>a[title="Uživatelský účet"] {
        display: none !important;
    }

    /* Sjednocení velikosti všech položek v gridu */
    .user-nav li {
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Společný vzhled pro akční ikony */
    .user-nav a,
    .user-nav button {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        font-size: 1.3rem !important;
        border-radius: 10px !important;
        background-color: #343a40 !important;
        color: #ffffff !important;
        border: none !important;
        text-align: center;
        text-decoration: none !important;
        position: relative;
    }

    .user-nav a:hover,
    .user-nav button:hover {
        background-color: #495057 !important;
        color: #ffffff !important;
    }

    /* Ošetření roletky v notifikacích */
    #notifications-dropdown {
        display: none !important;
    }

    /* Dropdown položky v user-nav — stejný tile styl jako ostatní ikony */
    .user-nav>ul>li.dropdown>.dropdown-menu>li>a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 1.3rem !important;
        border-radius: 10px !important;
        background-color: #343a40 !important;
        color: #ffffff !important;
        border: none !important;
    }

    /* Zakáže hover dropdown v mobilním menu — ovládáno pouze přes show-mobile */
    .main-nav ul li.dropdown:hover .dropdown-menu {
        display: none;
    }
    .main-nav ul li.dropdown.show-mobile .dropdown-menu {
        display: block !important;
    }

    /* Skrýt text v user-nav dropdown ikonách */
    .user-nav .dropdown-menu .nav-text-lbl {
        display: none !important;
    }

    /* Uříznutí přeškrtnutých starých CSS rules pro dropdown na mobilu */
    .nav-text-lbl {
        display: none !important;
    }

    .user-nav .dropdown-menu li[style*="border-top"] {
        border-top: none !important;
        padding-top: 0 !important;
    }

    /* --- OPRAVA DROPDOWNŮ V MOBILNÍM MENU --- */
    .main-nav ul li.dropdown .dropdown-menu {
        display: none;
        position: static;
        /* Zrušení absolutního pozicování */
        width: 100%;
        min-width: 100%;
        background-color: #2b3035;
        border: none;
        border-left: 3px solid #0d6efd;
        box-shadow: none;
        margin-top: 0;
        padding: 0;
        opacity: 1;
        /* Viditelnost řídí display */
        border-radius: 0;
    }

    .main-nav ul li.dropdown.show-mobile .dropdown-menu {
        display: block !important;
    }

    .main-nav ul li.dropdown .dropdown-menu a {
        padding: 12px 30px;
        /* Větší odsazení zleva pro podpoložky */
        font-size: 1rem;
        background: transparent;
        border-bottom: 1px solid #343a40;
    }

    .main-nav ul li.dropdown .dropdown-menu a:hover {
        background-color: #3d444b !important;
    }

    /* Indikátor podmenu (šipka) */
    .main-nav ul li.dropdown>a::after {
        content: ' ▼';
        font-size: 0.7em;
        vertical-align: middle;
        transition: transform 0.3s;
        float: right;
    }

    .main-nav ul li.dropdown.show-mobile>a::after {
        transform: rotate(180deg);
    }




    /* ObecnĂ© zmenĹˇenĂ­ */
    .container {
        padding: 12px 5px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .form-grid,
    .split-layout {
        grid-template-columns: 1fr !important;
        display: flex;
        flex-direction: column;
    }

    .dashboard-grid {
        display: flex;
        flex-direction: column;
    }

    .detail-grid {
        max-width: 100%;
        float: none;
        padding: 10px;
    }

    .form-grid {
        gap: 1px 1px;
        padding-left: 40px;
        padding-right: 40px;
        top: 110px;
    }

    .dashboard-grid {
        display: grid;
        gap: 20px;
        padding-left: 40px;
        padding-right: 40px;
    }


    /* Toolbar a filtry */
    .toolbar,
    .filter-toolbar,
    .header-actions,
    .toolbar-container {
        flex-direction: column;
        align-items: stretch;
        padding-left: 40px;
        padding-right: 40px;
        padding-top: 0px;
        
    }
    .toolbar-nadpis {
     display:flex;
     align-items:center;
      gap:10px;
      justify-content: space-between;
      }
    

    .toolbar-form {
        flex-direction: column;
        width: 100%;
    }

    .select-wrap {
        max-width: 100% !important;
        width: 100% !important;
        display: block;
    }

    .toolbar input,
    .toolbar select,
    .toolbar button,
    .toolbar a.button-like {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 10px;
    }

    .toolbar-actions {
        justify-content: space-between;
        width: 100%;
    }

    .toolbar-actions a.button-like {
        width: 48% !important;
        text-align: center;
    }


    /* SkrytĂ­ data a ÄŤasu na malĂ©m mobilu */
    #datetime-container {
        display: none;
    }

    /* OPRAVA: ResponzivnĂ­ tabulky (karty) */
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {

        margin: 1rem;
        margin-left: 2rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.3);
        overflow: hidden;
    }

    td {
        border: none; 
            border-bottom: 1px solid var(--border-color); 
            position: relative; 
            padding-left: 50% !important; 
            text-align: left; 
            min-height: 15px; 
            display: flex; align-items: center; 
            color: var(--text-main);
    }
.data-grid td {
    padding: 0px 0px;
}
    td:before {
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: right;
        font-weight: bold;
        content: attr(data-label);
        color: var(--text-muted);
        top: 50%;
        transform: translateY(-50%);
    }

    td:last-child {
        border-bottom: none;
    }

    td.actions {
        padding-left: 10px !important;
        text-align: center;
        justify-content: center;
    }

    td.actions:before {
        display: none;
    }
}


/* --- MOBILNÍ FILTRY (Collapsible) --- */

.mobile-filter-toggle {
    display: none;
}

@media (max-width: 768px) {

    .mobile-filter-toggle {
        display: inline-flex;
        align-items: center;
        background: none;
        border: none;
        padding: 0 0 0 6px;
        color: var(--text-muted);
        cursor: pointer;
        font-size: 0.6rem;
        opacity: 0.55;
        vertical-align: middle;
        transition: transform 0.25s ease, opacity 0.2s;
    }

    .mobile-filter-toggle::before {
        content: '▼';
    }

    .mobile-filter-toggle.active {
        opacity: 1;
        color: var(--primary);
        transform: rotate(180deg);
    }

    /* Na mobilu SKRYJEME formulĂˇĹ™e s filtry */
    /* CĂ­lĂ­me na formulĂˇĹ™e uvnitĹ™ toolbarĹŻ a hlavnĂ­ filtrovacĂ­ formulĂˇĹ™e */
    .toolbar form,
    .filter-bar form,
    .toolbar-form,
    .filter-toolbar form,
    .container>form.form-grid {
        /* Pro zakĂˇzky.php */
        display: none !important;
    }

    /* Pokud majĂ­ tĹ™Ă­du .show-mobile, zobrazĂ­me je */
    .toolbar form.show-mobile,
    .filter-bar form.show-mobile,
    .toolbar-form.show-mobile,
    .filter-toolbar form.show-mobile,
    .container>form.form-grid.show-mobile {
        display: grid !important;
        /* Nebo flex, podle pĹŻvodnĂ­ho */
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* --- VYLEPĹ ENĂŤ ZĂLOĹ˝EK PRO MOBIL (iOS Style Scroll) --- */

@media (max-width: 1025px) {

    /* Kontejner záložek */
    .tab-nav {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: sticky;
        top: 69px;
        z-index: 890;
        background-color: var(--bg-card);
        padding: 6px 5px;
        margin: 0px 0px 0px -10px;
        border-bottom: 1px solid var(--border-color);
        scrollbar-width: none;
    }

    .tab-nav::-webkit-scrollbar {
        display: none;
    }

    /* Samotná tlačítka záložek */
    .tab-nav button {
        flex: 0 0 auto;
        float: none;
        margin-right: 6px;
        padding: 6px 14px;
        border-radius: 20px;
        border: 1px solid var(--border-color);
        background-color: var(--bg-input);
        color: var(--text-main);
        font-size: 0.9rem;
        font-weight: 500;
        white-space: nowrap;
        cursor: pointer;
        transition: 0.2s;
    }

    /* Aktivní záložka */
    .tab-nav button.active {
        background-color: var(--primary);
        color: white;
        border-color: var(--primary);
        border-bottom: 1px solid var(--primary);
    }

    .tab-nav button:last-child {
        margin-right: 15px;
    }

    .tab-nav button:first-child {
        margin-left: 5px;
    }
}

/* --- Select2 v boÄŤnĂ­m panelu (TmavĂ˝ reĹľim) --- */
#work-panel .select2-container {
    width: 100% !important;
    margin-bottom: 15px;
}

/* HlavnĂ­ pole vĂ˝bÄ›ru */
#work-panel .select2-container--default .select2-selection--single {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    height: 38px;
    border-radius: 4px;
}

/* Text uvnitĹ™ */
#work-panel .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-main);
    line-height: 36px;
    padding-left: 12px;
}

/* Ĺ ipka */
#work-panel .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

#work-panel .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-main) transparent transparent transparent;
}

/* RozbalovacĂ­ nabĂ­dka (Dropdown) */
#work-panel .select2-dropdown {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    z-index: 9999;
    /* MusĂ­ bĂ˝t vyĹˇĹˇĂ­ neĹľ panel */
}

/* VyhledĂˇvacĂ­ pole v nabĂ­dce */
#work-panel .select2-search--dropdown .select2-search__field {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

/* PoloĹľky v seznamu */
#work-panel .select2-results__option {
    color: #e9ecef;
}

#work-panel .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #6610f2;
    /* FialovĂˇ pro aktivnĂ­ poloĹľku */
    color: white;
}

/* --- STYLY PRO MODĂLNĂŤ OKNO (UNIVERZĂLNĂŤ - DEN/NOC) --- */

/* PozadĂ­ a stĂ­novĂˇnĂ­ - PouĹľĂ­vĂˇme promÄ›nnĂ© */
.modal-content {
    background-color: var(--bg-card);
    /* AutomatickĂˇ zmÄ›na barvy */
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 20px var(--shadow-color);
    border-radius: 8px;
    padding: 25px;
    max-width: 800px;
}

.modal-header h3 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-top: 0;
    color: var(--text-main);
}

/* FormulĂˇĹ™ovĂˇ pole */
.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content select,
.modal-content textarea {
    background-color: var(--bg-input);
    /* AutomatickĂˇ zmÄ›na */
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out;
}

.modal-content input:focus,
.modal-content select:focus {
    border-color: #0d6efd;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.modal-content label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 5px;
    display: block;
}

/* Box pro kalkulaci */
.calculation-box {
    background-color: var(--bg-body);
    /* Ve svÄ›tlĂ©m reĹľimu bude svÄ›tlejĹˇĂ­, v tmavĂ©m tmavĹˇĂ­ */
    border: 1px dashed var(--border-color);
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

.money-input {
    font-family: 'Courier New', monospace;
    text-align: right;
    font-weight: bold;
}

/* Grid systĂ©m pro modal */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-col-2-3 {
    flex: 2;
}

.form-col-1-3 {
    flex: 1;
}

.form-col-1-2 {
    flex: 1;
}

/* TlaÄŤĂ­tka */
.form-actions {
    margin-top: 25px;
    text-align: right;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.btn-primary {
    background-color: #0d6efd;
    border: none;
    padding: 10px 20px;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: #0b5ed7;
}

/* --- OPRAVA SELECT2 (UNIVERZĂLNĂŤ) --- */
/* NynĂ­ vyuĹľĂ­vĂˇme promÄ›nnĂ©, takĹľe se pĹ™izpĹŻsobĂ­ reĹľimu */

.select2-container--classic .select2-selection--single {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    height: 38px !important;
    border-radius: 4px !important;
    background-image: none !important;
}

.select2-container--classic .select2-selection--single .select2-selection__rendered {
    color: var(--text-main) !important;
    line-height: 38px !important;
}

.select2-container--classic .select2-selection--single .select2-selection__arrow {
    background-image: none !important;
    background-color: transparent !important;
    border-left: 1px solid var(--border-color) !important;
    height: 36px !important;
}

.select2-container--classic .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-muted) transparent transparent transparent !important;
}

.select2-dropdown {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

.select2-search--dropdown .select2-search__field {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

.select2-results__option {
    color: var(--text-main) !important;
    background-color: var(--bg-card) !important;
}

/* Hover efekt v selectu */
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
    background-color: #0d6efd !important;
    color: var(--text-main) !important;
}

/* --- PLOVOUCĂŤ LIĹ TA SOUÄŚTĹ® --- */
.floating-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 50px);
    display: flex;
    gap: 20px;
    align-items: center;
    background-color: var(--bg-card);
    color: var(--text-main);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 10px 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-bar.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Když má bar vlastní pozici (po přetažení), ignoruje transform */
.floating-bar.dragged {
    transform: none !important;
    bottom: auto;
    left: auto;
}

.fb-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 0 8px 0 2px;
    user-select: none;
    flex-shrink: 0;
}
.fb-drag-handle:active { cursor: grabbing; }

.fb-body {
    display: flex;
    align-items: center;
    gap: 20px;
    transition: opacity 0.2s;
}

.floating-bar.collapsed .fb-body {
    display: none;
}

.fb-collapsed-preview {
    display: none;
    align-items: center;
}
.floating-bar.collapsed .fb-collapsed-preview {
    display: flex;
}

.fb-sep {
    width: 1px;
    height: 32px;
    background: var(--border-color);
    flex-shrink: 0;
}

.fb-item {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.fb-item small {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: bold;
}

.fb-value {
    font-weight: bold;
    font-size: 1.05rem;
    color: var(--text-main);
    font-family: monospace;
}

.fb-item.highlight .fb-value { color: var(--text-main); }
.fb-item.highlight.profit   .fb-value { color: #28a745; }
.fb-item.highlight.marze-low .fb-value { color: #fd7e14; }
.fb-item.highlight.loss     .fb-value { color: #dc3545; }

.fb-badge {
    font-size: 0.75rem;
    background: #6c757d;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 2px;
    display: inline-block;
}
.fb-badge.profit { background: #28a745; color: #fff !important; }
.fb-badge.marze-low { background: #fd7e14; color: #fff !important; }
.fb-badge.loss { background: #dc3545; color: #fff !important; }

.fb-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.fb-actions .btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.fb-actions .btn-icon:hover {
    background: var(--bg-hover);
}

.fb-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.85rem;
    border-left: 1px solid var(--border-color);
    margin-left: 4px;
    transition: color 0.2s;
    flex-shrink: 0;
}
.fb-toggle-btn:hover { color: var(--text-main); }
.floating-bar.collapsed .fb-toggle-btn { border-left: none; }

/* Mobilní úprava */
@media (max-width: 768px) {
    .floating-bar {
        /* Přemístit do pravého dolního rohu — nepřekrývá obsah */
        left: auto !important;
        right: 16px;
        bottom: 16px;
        transform: translateY(0) !important;
        width: auto;
        max-width: calc(100vw - 32px);
        padding: 8px 10px 8px 14px;
        border-radius: 50px;
        gap: 0;
        flex-wrap: nowrap;
    }

    .floating-bar.visible {
        opacity: 1;
        transform: translateY(0) !important;
    }

    /* Drag handle na mobilu zbytečný */
    .floating-bar .fb-drag-handle {
        display: none;
    }

    /* Rozbalený stav: kompaktní scrollovatelný řádek */
    .floating-bar .fb-body {
        gap: 10px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .floating-bar .fb-body::-webkit-scrollbar { display: none; }

    .floating-bar .fb-item small {
        font-size: 0.6rem;
    }

    .floating-bar .fb-value {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .fb-item {
        border: none;
        padding: 0;
        flex-shrink: 0;
    }

    .fb-actions {
        display: none;
    }
}
/* =====================================================
   BREADCRUMBS
   ===================================================== */
.breadcrumb-nav {
    margin: 0 0 16px 0;
}
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    padding: 7px 14px;
    margin: 0;
    background: var(--bg-highlight, rgba(255,255,255,.04));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    gap: 0;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    padding: 0 8px;
    color: var(--text-muted);
}
.breadcrumb-item a {
    color: var(--link-color, #6ea8fe);
    text-decoration: none;
}
.breadcrumb-item a:hover {
    text-decoration: underline;
}
.breadcrumb-item.active span {
    color: var(--text-muted);
}

/* --- OPRAVA VISIBILITY FOKUSU PRO SELECT2 (UNIVERZÁLNÍ) --- */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--classic.select2-container--focus .select2-selection--single,
.select2-container--classic.select2-container--open .select2-selection--single {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.45) !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.select2-search--dropdown .select2-search__field {
    border-radius: 4px !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.45) !important;
    outline: none !important;
}

/* Zajištění, aby Select2 dropdown byl nad všemi modaly */
.select2-container {
    z-index: 1000000 !important;
}

/* Náhled obrázku v rozpočtu */
.rozpocet-icon-hover {
    cursor: default;
}
#rozpocet-img-preview {
    display: none;
    position: fixed;
    z-index: 99999;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
    pointer-events: none;
    width: fit-content;
}
#rozpocet-img-preview.show {
    display: block;
}
#rozpocet-img-preview img {
    display: block;
    width: auto;
    height: auto;
    max-width: 200px;
    max-height: 200px;
    border-radius: 4px;
}

/* =====================================================
   MOBILNÍ ÚPRAVY — iPhone 13 a podobné (≤ 480 px)
   ===================================================== */

/* Zabrání iOS zoomu při focusu na input (font-size < 16px) */
@media (max-width: 480px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {

    /* === Body — prostor pro fixní patičku + home bar === */
    body {
        padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    }
    main.container {
        padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
    }

    /* === Header — bezpečné zóny pro výřez === */
    header {
        padding-left: max(12px, env(safe-area-inset-left, 12px));
        padding-right: max(12px, env(safe-area-inset-right, 12px));
    }

    /* === Kontejner — zrušení přehnaného paddingu z ≤1000px bloku === */
    .container {
        padding: 10px 10px !important;
    }

    /* === Toolbar a filtry === */
    .toolbar,
    .filter-toolbar,
    .header-actions,
    .toolbar-container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* === Mřížka formuláře === */
    .form-grid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* === Dashboard grid === */
    .dashboard-grid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* === Tabulky (card layout) — symetrické okraje === */
    tr {
        margin: 0.5rem 0.4rem !important;
    }

    td {
        padding-left: 44% !important;
        font-size: 0.85rem;
    }

    td:before {
        width: 42% !important;
        font-size: 0.78rem;
    }

    /* === Modální okna — ukotvit nahoru, ne na střed === */
    .modal {
        top: 3% !important;
        transform: translateX(-50%) !important;
        max-height: 94vh !important;
        width: 97% !important;
        border-radius: 12px !important;
    }

    .modal-content {
        padding: 14px !important;
        max-width: 100% !important;
    }

    .modal-header {
        padding: 10px 10px 0 12px !important;
    }

    /* === OCR faktura modal — 1 sloupec místo 2 === */
    .ocrf-grid {
        grid-template-columns: 1fr !important;
    }

    /* === Ikona tlačítka — větší dotykový cíl === */
    .icon-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.05rem !important;
    }

    /* === Primární tlačítka v modálech — min. 44px dotykový cíl === */
    .modal .button-like,
    .modal button:not(.modal-close):not(.icon-btn) {
        min-height: 44px;
        font-size: 0.95rem;
        padding: 8px 12px;
    }

    /* === Plovoucí lišta — nad patičkou === */
    .floating-bar {
        bottom: calc(36px + env(safe-area-inset-bottom, 0px)) !important;
    }



    /* === Stránkování — větší klikací plocha === */
    .page-btn {
        height: 32px;
        padding: 0 10px;
        font-size: 1rem;
    }

    /* === Toolbar akce — plná šířka === */
    .toolbar-actions a.button-like,
    .toolbar-actions button {
        width: 48% !important;
        min-height: 40px;
    }

    /* === Breadcrumbs — menší na úzkém displeji === */
    .breadcrumb {
        font-size: 0.78rem;
        padding: 5px 10px;
    }
}

/* =====================================================
   BOTTOM SHEET MENU — iPhone 13 a podobné (≤ 480 px)
   ===================================================== */
@media (max-width: 480px) {

    /* === Na malých obrazovkách drawer přes celou šířku === */
    .nav-wrapper {
        width: 100% !important;
        padding: 20px !important;
    }

    /* === Header v draweru — řada s info a utility ikonami === */
    .header-right {
        padding: 4px 14px 0 !important;
    }

    .header-info {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between;
        gap: 8px !important;
        padding-bottom: 10px !important;
        margin-bottom: 0 !important;
        border-bottom: 1px solid var(--border-color) !important;
        flex-wrap: nowrap !important;
    }

    .header-info .user-info {
        font-size: 0.82rem !important;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* === Nav ikony — zobrazit, text skrýt === */
    .nav-icon {
        display: block !important;
        font-size: 1.75rem;
        line-height: 1;
        flex-shrink: 0;
    }

    /* === Hlavní navigace — dlouhá tlačítka s ikonou + textem === */
    .main-nav {
        padding: 10px 14px 8px !important;
    }

    .main-nav > ul {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-nav > ul > li {
        flex: 0 0 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .main-nav > ul > li > a {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        width: 100% !important;
        min-height: 62px !important;
        padding: 14px 16px !important;
        border-radius: 10px !important;
        background: var(--bg-input) !important;
        border: 1px solid var(--border-color) !important;
        color: inherit !important;
        text-decoration: none !important;
        font-size: 0.95rem !important;
        transition: background 0.15s;
        -webkit-tap-highlight-color: transparent;
    }

    .main-nav > ul > li > a:active {
        background: var(--bg-hover) !important;
    }

    /* Zobrazit text u všech položek */
    .nav-label {
        display: inline !important;
        font-size: 0.95rem;
    }

    /* Šipka pro dropdown */
    .main-nav > ul > li.dropdown > a::after {
        content: '▼' !important;
        font-size: 0.65em !important;
        margin-left: auto !important;
        float: none !important;
        transition: transform 0.25s;
        display: inline !important;
    }

    .main-nav > ul > li.dropdown.show-mobile > a {
        border-radius: 10px 10px 0 0 !important;
        background: var(--bg-hover) !important;
    }

    .main-nav > ul > li.dropdown.show-mobile > a::after {
        transform: rotate(180deg) !important;
    }

    .main-nav > ul > li.dropdown.show-mobile > a::after {
        display: inline !important;
        float: none !important;
        margin-left: auto;
        transform: rotate(180deg);
    }

    /* Sub-menu accordion */
    .main-nav ul li.dropdown.show-mobile .dropdown-menu {
        position: static !important;
        display: block !important;
        margin-top: 0 !important;
        border-radius: 0 0 10px 10px !important;
        border-top: none !important;
        border-left: 3px solid var(--border-color) !important;
        background: var(--bg-body) !important;
        padding: 4px 0 8px !important;
        opacity: 1 !important;
    }

    .main-nav ul li.dropdown.show-mobile .dropdown-menu a {
        padding: 10px 20px !important;
        font-size: 0.85rem !important;
        background: transparent !important;
        color: var(--text-muted) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }

    .main-nav ul li.dropdown.show-mobile .dropdown-menu li:last-child a {
        border-bottom: none !important;
    }

    /* === Skrytí selektorů tématu a písma v mobilním menu === */
    .user-nav li:has(#theme-style-select),
    .user-nav li:has(#font-family-select) {
        display: none !important;
    }

    /* === User-nav — spodní lišta utility ikon === */
    .user-nav {
        padding: 10px 14px !important;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        border-top: 1px solid var(--border-color) !important;
        margin-top: 6px;
    }

    .user-nav > ul {
        justify-content: space-around !important;
        gap: 6px !important;
        margin-top: 0 !important;
    }

    .user-nav a,
    .user-nav button {
        width: 48px !important;
        height: 48px !important;
        border-radius: 12px !important;
        font-size: 1.4rem !important;
        -webkit-tap-highlight-color: transparent;
    }

    /* Dropdown položky v user-nav — stejný tile styl jako ostatní ikony */
    .user-nav>ul>li.dropdown>.dropdown-menu>li>a {
        width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 1.4rem !important;
        border-radius: 12px !important;
        border: none !important;
    }
}

/* === UTILITY TŘÍDY === */
.text-left   { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right  { text-align: right !important; }
.text-muted  { color: var(--text-muted) !important; }

.align-middle { vertical-align: middle !important; }
.align-top    { vertical-align: top !important; }
.align-bottom { vertical-align: bottom !important; }

.fw-bold          { font-weight: 700 !important; }
.fw-normal        { font-weight: 400 !important; }
.font-weight-bold { font-weight: 700 !important; }

.d-none    { display: none !important; }
.d-block   { display: block !important; }
.d-flex    { display: flex !important; }
.d-inline  { display: inline !important; }
.d-inline-flex { display: inline-flex !important; }

.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }

.ms-auto { margin-left: auto !important; }
.me-auto { margin-right: auto !important; }

.profit { color: #198754 !important; }
.loss   { color: #dc3545 !important; }

