/* ============================================================
   InvoiceSystem – hlavní styly
   ============================================================ */
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/dist/tabler-icons.min.css');

:root {
    --primary:        #1a56db;
    --primary-hover:  #1345b5;
    --primary-light:  #ebf3ff;
    --danger:         #e02424;
    --success:        #057a55;
    --warning:        #c27803;
    --info:           #1c64f2;

    --bg:             #f8fafc;
    --surface:        #ffffff;
    --border:         #e2e8f0;
    --border-focus:   #1a56db;

    --text:           #1e293b;
    --text-muted:     #64748b;
    --text-light:     #94a3b8;

    --radius:         10px;
    --radius-sm:      6px;
    --shadow:         0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --shadow-md:      0 4px 24px rgba(0,0,0,.10);

    --font:           'Plus Jakarta Sans', system-ui, sans-serif;
    --transition:     0.18s ease;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family:    var(--font);
    background:     var(--bg);
    color:          var(--text);
    line-height:    1.6;
    min-height:     100vh;
    display:        flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
    width:   100%;
    max-width: 1140px;
    margin:  0 auto;
    padding: 0 20px;
}

.site-main {
    flex: 1;
    padding: 40px 0;
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
    background:   var(--surface);
    border-bottom: 1px solid var(--border);
    padding:      14px 0;
    position:     sticky;
    top:          0;
    z-index:      1000; /* nad PDF iframe */
    box-shadow:   0 1px 4px rgba(0,0,0,.05);
}

.header-inner {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             16px;
}

.logo {
    display:     flex;
    align-items: center;
    gap:         10px;
    font-weight: 700;
    font-size:   1.1rem;
    color:       var(--text);
    text-decoration: none;
}

.header-nav {
    display:     flex;
    align-items: center;
    gap:         12px;
}

.nav-link {
    color:       var(--text-muted);
    font-size:   .9rem;
    font-weight: 500;
    padding:     6px 10px;
    border-radius: var(--radius-sm);
    transition:  background var(--transition);
}
.nav-link:hover { background: var(--bg); text-decoration: none; color: var(--text); }

.nav-user {
    color:       var(--text-muted);
    font-size:   .875rem;
    font-weight: 500;
}

/* ============================================================
   LANG SWITCHER
   ============================================================ */

.lang-switcher { position: relative; }

.lang-btn {
    display:       flex;
    align-items:   center;
    gap:           5px;
    background:    none;
    border:        1px solid var(--border);
    border-radius: var(--radius-sm);
    padding:       6px 10px;
    font:          500 .875rem var(--font);
    color:         var(--text);
    cursor:        pointer;
    transition:    border-color var(--transition);
}
.lang-btn:hover { border-color: var(--primary); }

.lang-dropdown {
    position:      absolute;
    right:         0;
    top:           calc(100% + 6px);
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow-md);
    min-width:     140px;
    overflow:      hidden;
    opacity:       0;
    pointer-events: none;
    transform:     translateY(-6px);
    transition:    opacity var(--transition), transform var(--transition);
    z-index:       200;
}
.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.lang-option {
    display:   block;
    padding:   9px 14px;
    color:     var(--text);
    font-size: .875rem;
    transition: background var(--transition);
}
.lang-option:hover  { background: var(--bg); text-decoration: none; }
.lang-option.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display:       inline-flex;
    align-items:   center;
    justify-content: center;
    gap:           8px;
    padding:       10px 20px;
    font:          600 .9rem var(--font);
    border:        1px solid transparent;
    border-radius: var(--radius-sm);
    cursor:        pointer;
    transition:    background var(--transition), box-shadow var(--transition), transform var(--transition);
    text-decoration: none;
    white-space:   nowrap;
    user-select:   none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--primary);
    color:      #fff;
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 2px 8px rgba(26,86,219,.3); }

.btn-outline {
    background:   transparent;
    border-color: var(--border);
    color:        var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-google {
    background: var(--surface);
    border:     1px solid var(--border);
    color:      var(--text);
}
.btn-google:hover { background: var(--bg); box-shadow: var(--shadow); }

.btn-sm  { padding: 6px 14px; font-size: .825rem; }
.btn-full { width: 100%; }

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
    display:       flex;
    align-items:   flex-start;
    justify-content: space-between;
    gap:           12px;
    padding:       14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size:     .9rem;
    font-weight:   500;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.alert-close {
    background: none;
    border:     none;
    font-size:  1.2rem;
    line-height: 1;
    cursor:     pointer;
    color:      inherit;
    opacity:    .6;
    padding:    0;
    flex-shrink: 0;
}
.alert-close:hover { opacity: 1; }

/* ============================================================
   FORMS
   ============================================================ */

.form-group  { margin-bottom: 18px; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group--sm { grid-column: span 1; }

.form-label {
    display:     block;
    font-size:   .875rem;
    font-weight: 600;
    color:       var(--text);
    margin-bottom: 6px;
}
.form-label.required::after {
    content:     ' *';
    color:       var(--danger);
}

.label-row {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    margin-bottom:   6px;
}
.label-row .form-label { margin-bottom: 0; }

.form-input {
    width:         100%;
    padding:       10px 14px;
    border:        1px solid var(--border);
    border-radius: var(--radius-sm);
    font:          .9rem var(--font);
    color:         var(--text);
    background:    var(--surface);
    transition:    border-color var(--transition), box-shadow var(--transition);
    outline:       none;
    appearance:    none;
}
.form-input:focus {
    border-color: var(--border-focus);
    box-shadow:   0 0 0 3px rgba(26,86,219,.12);
}
.form-input.is-invalid { border-color: var(--danger); }
.form-input.is-valid   { border-color: var(--success); }

.form-error {
    display:    block;
    color:      var(--danger);
    font-size:  .8rem;
    margin-top: 4px;
}
.form-hint {
    display:    block;
    color:      var(--text-muted);
    font-size:  .8rem;
    margin-top: 4px;
}
.form-link {
    font-size:   .875rem;
    font-weight: 500;
}

/* Input s tlačítkem */
.input-with-btn {
    display:  flex;
    gap:      8px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.input-with-btn .form-input { flex: 1; min-width: 0; }
.input-with-btn .btn        { flex-shrink: 0; white-space: nowrap; }
.input-with-btn ~ .form-error,
.input-with-btn ~ .form-hint,
.input-with-btn ~ .field-msg {
    flex-basis: 100%;
    width:      100%;
    display:    block;
    margin-top: 4px;
}

/* Input s heslem */
.input-password { position: relative; }
.input-password .form-input { padding-right: 44px; }
.toggle-password {
    position:   absolute;
    right:      12px;
    top:        50%;
    transform:  translateY(-50%);
    background: none;
    border:     none;
    color:      var(--text-muted);
    cursor:     pointer;
    padding:    0;
    display:    flex;
    align-items: center;
}
.toggle-password:hover { color: var(--text); }

/* Checkbox */
.form-checkbox {
    display:     flex;
    align-items: flex-start;
    gap:         10px;
    cursor:      pointer;
    font-size:   .875rem;
    line-height: 1.5;
    color:       var(--text);
}
.form-checkbox input[type="checkbox"] {
    width:         16px;
    height:        16px;
    border:        2px solid var(--border);
    border-radius: 4px;
    appearance:    none;
    cursor:        pointer;
    flex-shrink:   0;
    margin-top:    2px;
    background:    var(--surface);
    transition:    background var(--transition), border-color var(--transition);
}
.form-checkbox input[type="checkbox"]:checked {
    background:   var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 8l3.5 3.5 6.5-7' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
}

/* ============================================================
   PASSWORD STRENGTH
   ============================================================ */

.password-strength {
    margin-top: 8px;
    display:    flex;
    align-items: center;
    gap:        10px;
}
.strength-bar {
    flex:          1;
    height:        4px;
    background:    var(--border);
    border-radius: 2px;
    overflow:      hidden;
}
.strength-fill {
    height:     100%;
    transition: width .3s, background .3s;
    border-radius: 2px;
}
.strength-label { font-size: .8rem; font-weight: 600; white-space: nowrap; }

/* ============================================================
   AUTH LAYOUT
   ============================================================ */

.auth-wrap {
    display:         flex;
    justify-content: center;
    align-items:     flex-start;
    padding:         20px 0 60px;
}

.auth-card {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
    width:         100%;
    max-width:     520px;
    padding:       40px;
}

.auth-header {
    text-align:    center;
    margin-bottom: 30px;
}
.auth-header h1 { font-size: 1.6rem; font-weight: 700; }
.auth-header p  { color: var(--text-muted); margin-top: 6px; }

.auth-footer {
    text-align:  center;
    margin-top:  24px;
    color:       var(--text-muted);
    font-size:   .9rem;
}
.auth-footer a { font-weight: 600; }

.auth-divider {
    display:    flex;
    align-items: center;
    gap:        12px;
    margin:     20px 0;
    color:      var(--text-muted);
    font-size:  .85rem;
}
.auth-divider::before,
.auth-divider::after {
    content:    '';
    flex:       1;
    height:     1px;
    background: var(--border);
}

/* Auth tabs */
.auth-tabs {
    display:       flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    gap:           0;
}
.auth-tab {
    flex:          1;
    background:    none;
    border:        none;
    padding:       10px;
    font:          600 .875rem var(--font);
    color:         var(--text-muted);
    cursor:        pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition:    color var(--transition), border-color var(--transition);
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   USER TYPE SELECTOR
   ============================================================ */

.user-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap:    10px;
}

.type-card {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            6px;
    padding:        14px 10px;
    border:         2px solid var(--border);
    border-radius:  var(--radius);
    cursor:         pointer;
    transition:     border-color var(--transition), background var(--transition);
    text-align:     center;
    position:       relative;
}
.type-card input[type="radio"] {
    position: absolute;
    opacity:  0;
    width:    0;
    height:   0;
}
.type-card:hover   { border-color: var(--primary); background: var(--primary-light); }
.type-card.selected { border-color: var(--primary); background: var(--primary-light); }
.type-icon  { font-size: 1.6rem; }
.type-label { font-size: .78rem; font-weight: 600; color: var(--text); line-height: 1.3; }

/* ============================================================
   CAPTCHA
   ============================================================ */

.captcha-field  { margin-bottom: 18px; }
.captcha-math   { display: flex; align-items: center; gap: 12px; }
.captcha-question {
    font-size:   1.05rem;
    font-weight: 700;
    color:       var(--text);
    background:  var(--bg);
    padding:     10px 16px;
    border-radius: var(--radius-sm);
    border:      1px solid var(--border);
    white-space: nowrap;
}
.captcha-input  { max-width: 100px; }

/* Honeypot – úplně schovaný */
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

/* ============================================================
   SPINNER
   ============================================================ */

.spinner {
    display:    inline-block;
    width:      14px;
    height:     14px;
    border:     2px solid rgba(26,86,219,.3);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation:  spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    background:   var(--surface);
    border-top:   1px solid var(--border);
    padding:      20px 0;
    margin-top:   auto;
}
.footer-inner {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    color:           var(--text-muted);
    font-size:       .875rem;
}
.footer-nav { display: flex; gap: 20px; }
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--text); }

/* ============================================================
   ERROR PAGES
   ============================================================ */
.error-page {
    text-align: center;
    padding:    80px 20px;
}
.error-page h1 { font-size: 5rem; font-weight: 800; color: var(--primary); }
.error-page h2 { font-size: 1.5rem; margin-bottom: 12px; }
.error-page p  { color: var(--text-muted); margin-bottom: 24px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
    .auth-card       { padding: 28px 20px; }
    .form-row        { grid-template-columns: 1fr; }
    .user-type-grid  { grid-template-columns: 1fr 1fr; }
    .header-nav .btn-sm { display: none; }
    .footer-inner    { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 400px) {
    .user-type-grid  { grid-template-columns: 1fr; }
    .input-with-btn  { flex-direction: column; }
}

/* ============================================================
   PROFIL
   ============================================================ */

.profile-wrap {
    max-width:  1000px;
    margin:     0 auto;
    width:      100%;
    box-sizing: border-box;
    padding:    0 16px;
}
@media (min-width: 641px) {
    .profile-wrap { padding: 0; }
}

.profile-hero {
    display:       flex;
    align-items:   center;
    gap:           20px;
    margin-bottom: 28px;
    padding:       24px 28px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
}
.profile-avatar {
    width:           56px;
    height:          56px;
    border-radius:   50%;
    background:      var(--primary);
    color:           #fff;
    font-size:       1.4rem;
    font-weight:     800;
    display:         flex;
    align-items:     center;
    justify-content: center;
    flex-shrink:     0;
}
.profile-hero-info h1 { font-size: 1.4rem; font-weight: 800; font-style: italic; }
.profile-hero-info p  { color: var(--text-muted); font-size: .9rem; margin-top: 4px; }
.hero-sep { margin: 0 6px; }

.profile-grid {
    display:               grid;
    grid-template-columns: 1fr 360px;
    gap:                   24px;
    align-items:           start;
}

.profile-card {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
    padding:       24px 28px;
    margin-bottom: 20px;
}
.profile-card h2 {
    font-size:     1rem;
    font-weight:   700;
    color:         var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}
.profile-card--danger { border-color: #fecaca; }
.profile-card--danger h2 { color: var(--danger); border-bottom-color: #fee2e2; }

.profile-row {
    display:       grid;
    grid-template-columns: 150px 1fr;
    gap:           10px;
    align-items:   center;
    padding:       7px 0;
    border-bottom: 1px solid var(--bg);
}
.profile-row:last-of-type { border-bottom: none; }
.profile-row label {
    font-size:   .875rem;
    color:       var(--text-muted);
    font-weight: 500;
}
.profile-val {
    display:     flex;
    align-items: center;
    gap:         8px;
    flex-wrap:   wrap;
}
.profile-val .form-input { flex: 1; min-width: 0; padding: 7px 10px; font-size: .875rem; }
.profile-val strong      { font-weight: 700; }

.profile-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

.icon-btn {
    background:    none;
    border:        none;
    cursor:        pointer;
    font-size:     1rem;
    padding:       2px 4px;
    border-radius: 4px;
    transition:    background var(--transition);
    flex-shrink:   0;
}
.icon-btn:hover { background: var(--bg); }

.req { color: var(--danger); }

.danger-text {
    color:         var(--danger);
    font-size:     .875rem;
    margin-bottom: 16px;
    line-height:   1.5;
}

.btn-danger {
    background: var(--danger);
    color:      #fff;
    border:     none;
}
.btn-danger:hover { background: #c81e1e; }

/* ============================================================
   MODALY
   ============================================================ */
.modal-backdrop {
    position:        fixed;
    inset:           0;
    background:      rgba(0,0,0,.4);
    display:         flex;
    align-items:     center;
    justify-content: center;
    z-index:         1000;
    opacity:         0;
    pointer-events:  none;
    transition:      opacity .2s;
    padding:         20px;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal {
    background:    var(--surface);
    border-radius: var(--radius);
    box-shadow:    0 8px 40px rgba(0,0,0,.18);
    width:         100%;
    max-width:     460px;
    transform:     translateY(-16px);
    transition:    transform .2s;
}
.modal-backdrop.open .modal { transform: translateY(0); }

.modal-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         18px 24px;
    border-bottom:   1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
    background: none;
    border:     none;
    font-size:  1.4rem;
    cursor:     pointer;
    color:      var(--text-muted);
    line-height: 1;
    padding:    0 4px;
}
.modal-close:hover { color: var(--text); }

.modal-body   { padding: 20px 24px; }
.modal-footer {
    display:         flex;
    justify-content: flex-end;
    gap:             10px;
    padding:         16px 24px;
    border-top:      1px solid var(--border);
    background:      var(--bg);
    border-radius:   0 0 var(--radius) var(--radius);
}

/* ============================================================
   RESPONSIVE – profil
   ============================================================ */
@media (max-width: 768px) {
    .profile-grid { grid-template-columns: 1fr; }
    .profile-row  { grid-template-columns: 1fr; gap: 4px; }
    .profile-row label { color: var(--text); font-size: .8rem; }
}

/* ============================================================
   NAVIGAČNÍ DROPDOWNY
   ============================================================ */
.nav-dropdown { position: relative; }

.nav-link {
    display:       inline-flex;
    align-items:   center;
    gap:           5px;
    padding:       7px 10px;
    font:          600 .875rem var(--font);
    color:         var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition:    background var(--transition);
    white-space:   nowrap;
}
.nav-link:hover,
.nav-link--active { background: var(--bg); }

.nav-dropdown-btn {
    background:    none;
    border:        none;
    padding:       7px 10px;
    font:          600 .875rem var(--font);
    color:         var(--text);
    cursor:        pointer;
    border-radius: var(--radius-sm);
    transition:    background var(--transition);
    white-space:   nowrap;
}
.nav-dropdown-btn:hover { background: var(--bg); }

.nav-dropdown-menu {
    position:      absolute;
    top:           calc(100% + 6px);
    left:          0;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow-md);
    min-width:     220px;
    z-index:       1100; /* nad header */
    opacity:       0;
    pointer-events: none;
    transform:     translateY(-6px);
    transition:    opacity var(--transition), transform var(--transition);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity:       1;
    pointer-events: auto;
    transform:     translateY(0);
}
.nav-dropdown-menu a {
    display:    block;
    padding:    9px 16px;
    color:      var(--text);
    font-size:  .875rem;
    transition: background var(--transition);
    text-decoration: none;
}
.nav-dropdown-menu a:hover { background: var(--bg); }

.dropdown-divider {
    height:     1px;
    background: var(--border);
    margin:     4px 0;
}

/* ============================================================
   STRÁNKOVÉ HLAVIČKY
   ============================================================ */
.page-header {
    display:         flex;
    align-items:     flex-start;
    justify-content: space-between;
    gap:             16px;
    margin-bottom:   24px;
    flex-wrap:       wrap;
}
.page-header h1 {
    font-size:   1.5rem;
    font-weight: 800;
    font-style:  italic;
    color:       var(--primary);
    margin-bottom: 4px;
}
.breadcrumb {
    font-size:  .85rem;
    color:      var(--text-muted);
}
.breadcrumb a { color: var(--primary); }

.page-header-hint {
    max-width: 380px;
    font-size: .875rem;
    color:     var(--text-muted);
    line-height: 1.5;
}

/* ============================================================
   LIST CARD
   ============================================================ */
.list-card {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
    overflow:      visible; /* bylo hidden – blokovalo horizontální scroll tabulky */
}
/* Zachováme rounded corners přes child selektor */
.list-card > .list-toolbar:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.list-toolbar {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         14px 20px;
    border-bottom:   1px solid var(--border);
    gap:             12px;
    flex-wrap:       wrap;
}

.actions-cell { white-space: nowrap; }

.action-btn {
    background:    none;
    border:        none;
    cursor:        pointer;
    font-size:     1rem;
    padding:       3px 5px;
    border-radius: 4px;
    text-decoration: none;
    transition:    background var(--transition);
}
.action-btn:hover { background: var(--bg); }
.action-btn.danger:hover { background: #fee2e2; }

.empty-row { text-align: center; color: var(--text-muted); padding: 32px !important; }

/* ============================================================
   FORMULÁŘOVÉ SEKCE
   ============================================================ */
.form-grid-2col {
    display:               grid;
    grid-template-columns: 1fr 420px;
    gap:                   24px;
    align-items:           start;
}

.section-card {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
    padding:       24px;
    margin-bottom: 20px;
}
.section-card h2 {
    font-size:     1rem;
    font-weight:   700;
    color:         var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.subsection-title {
    font-size:     .9rem;
    font-weight:   700;
    color:         var(--text);
    margin:        20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.form-actions {
    display:    flex;
    gap:        12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.form-input--sm { font-size: .85rem; padding: 7px 10px; }

/* ============================================================
   UPLOAD ZÓNA
   ============================================================ */
.upload-zone {
    border:        2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding:       20px;
    text-align:    center;
    cursor:        pointer;
    transition:    border-color var(--transition), background var(--transition);
}
.upload-zone:hover,
.upload-zone.drag-over { border-color: var(--primary); background: var(--primary-light); }
.upload-icon  { font-size: 1.8rem; margin-bottom: 6px; }
.upload-zone p { font-size: .875rem; color: var(--text-muted); }
.upload-link  { color: var(--primary); font-weight: 600; }
.upload-preview { margin-bottom: 10px; }
.preview-img  { max-height: 80px; border-radius: 4px; border: 1px solid var(--border); }

/* ============================================================
   ČÍSLOVÁNÍ DOKLADŮ
   ============================================================ */
.numbering-card { position: sticky; top: 80px; }

.num-row {
    display:       grid;
    grid-template-columns: 1fr 1fr;
    gap:           8px;
    align-items:   center;
    margin-bottom: 8px;
    font-size:     .875rem;
}
.num-row label { color: var(--text-muted); }

.numbering-help {
    margin-top:    20px;
    padding-top:   16px;
    border-top:    1px solid var(--border);
    font-size:     .8rem;
}
.numbering-help h3 { font-size: .875rem; font-weight: 700; margin-bottom: 10px; color: var(--primary); }

.help-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.help-table td { padding: 4px 8px; }
.help-table td:first-child { font-family: monospace; color: var(--primary); }
.help-table td.example { color: var(--text-muted); font-family: monospace; }

.examples-grid {
    display:               grid;
    grid-template-columns: 1fr 1fr;
    gap:                   6px;
    font-family:           monospace;
    font-size:             .8rem;
    color:                 var(--text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .form-grid-2col { grid-template-columns: 1fr; }
    .numbering-card { position: static; }
}
@media (max-width: 640px) {
    .page-header { flex-direction: column; align-items: flex-start; }
    .num-row { grid-template-columns: 1fr; }
}

/* ============================================================
   FAKTURY – SEZNAM
   ============================================================ */
.inv-stats {
    display:    flex;
    gap:        8px;
    flex-wrap:  wrap;
    margin-bottom: 20px;
}
.stat-pill {
    display:       inline-flex;
    align-items:   center;
    gap:           8px;
    padding:       8px 14px;
    border-radius: 20px;
    font-size:     .875rem;
    font-weight:   600;
    border:        2px solid var(--border);
    background:    var(--surface);
    color:         var(--text-muted);
    text-decoration: none;
    transition:    all var(--transition);
}
.stat-pill:hover, .stat-pill.active { border-color: currentColor; text-decoration: none; }
.stat-pill .stat-num { font-size: 1.1rem; font-weight: 800; }
.stat-pill.stat-success { color: var(--success); }
.stat-pill.stat-info    { color: var(--info); }
.stat-pill.stat-danger  { color: var(--danger); }
.stat-pill.stat-warning { color: var(--warning); }
.stat-pill.active       { background: var(--primary); color: #fff; border-color: var(--primary); }

.inv-number-link { font-weight: 700; color: var(--primary); }
.text-right  { text-align: right; }
.text-danger { color: var(--danger); font-weight: 600; }

/* ============================================================
   FAKTURY – DETAIL
   ============================================================ */
.detail-layout {
    display:               grid;
    grid-template-columns: 180px 1fr;
    gap:                   20px;
    align-items:           start;
}
.detail-sidebar {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    position:       sticky;
    top:            calc(51px + 8px); /* výška headeru + mezera */
    z-index:        50;
}
.detail-btn {
    display:       block;
    width:         100%;
    padding:       10px 14px;
    border-radius: var(--radius-sm);
    font-size:     .875rem;
    font-weight:   600;
    text-align:    center;
    cursor:        pointer;
    border:        none;
    text-decoration: none;
    transition:    background var(--transition);
}
.detail-btn--primary { background: #28a745; color: #fff; }
.detail-btn--primary:hover { background: #218838; }
.detail-btn--blue    { background: #1a56db; color: #fff; }
.detail-btn--blue:hover    { background: #1345b5; }
.detail-btn--danger  { background: var(--danger); color: #fff; width: 100%; }
.detail-btn--danger:hover  { background: #c81e1e; }

.detail-status-block {
    margin-top:    12px;
    padding:       14px;
    background:    var(--bg);
    border-radius: var(--radius-sm);
    border:        1px solid var(--border);
}
.detail-status-label { font-size: .75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-bottom: 6px; }
.badge-lg { font-size: .875rem; padding: 4px 12px; }

.pdf-preview-wrap {
    background:    #525659;
    border-radius: var(--radius);
    overflow:      hidden;
    min-height:    700px;
    position:      relative;
}
.pdf-iframe {
    width:         100%;
    height:        800px;
    border:        none;
    display:       block;
    position:      relative;
    z-index:       1; /* pod header dropdown */
}

/* ============================================================
   FAKTURY – FORMULÁŘ
   ============================================================ */
.inv-form-grid {
    display:               grid;
    grid-template-columns: 1fr 1fr;
    gap:                   20px;
}
.inv-section {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
    overflow:      visible;
}
.inv-section--full { grid-column: 1 / -1; }
.inv-section-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         12px 18px;
    background:      var(--bg);
    border-bottom:   1px solid var(--border);
}
.inv-section-header h2 { font-size: .95rem; font-weight: 700; color: var(--text); }
.inv-section > div:not(.inv-section-header) { padding: 16px 18px; }

.form-row-4 {
    display:               grid;
    grid-template-columns: repeat(4, 1fr);
    gap:                   12px;
}

/* Tabulka položek */
.items-form-wrap { padding: 0 !important; }
.items-form-table {
    width:           100%;
    border-collapse: collapse;
    font-size:       .825rem;
}
.items-form-table th {
    background:    var(--bg);
    padding:       8px 6px;
    font-size:     .75rem;
    font-weight:   700;
    color:         var(--text-muted);
    text-transform: uppercase;
    border-bottom: 2px solid var(--border);
    text-align:    right;
}
.items-form-table th:first-child { text-align: left; padding-left: 12px; }
.items-form-table td {
    padding:       6px 4px;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}
.items-form-table td:first-child { padding-left: 12px; }
.item-desc { font-size: .85rem; resize: vertical; min-height: 40px; }

.items-actions { padding: 10px 12px; border-top: 1px solid var(--border); background: var(--bg); }

.inv-totals { padding: 12px 18px; margin-left: auto; width: 320px; }
.inv-totals-row {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         5px 0;
    font-size:       .9rem;
    color:           var(--text-muted);
    border-bottom:   1px solid var(--border);
}
.inv-totals-total {
    font-size:   1.1rem;
    font-weight: 800;
    color:       var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-top: 8px;
}

.inv-submit-bar {
    display:    flex;
    gap:        12px;
    align-items: center;
    margin-top: 24px;
    padding:    20px;
    background: var(--surface);
    border:     1px solid var(--border);
    border-radius: var(--radius);
    position:   sticky;
    bottom:     0;
    z-index:    10;
    box-shadow: 0 -4px 12px rgba(0,0,0,.06);
}

kbd {
    background: var(--border);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: .8rem;
    font-family: monospace;
}

/* ============================================================
   RESPONSIVE – faktury
   ============================================================ */
@media (max-width: 900px) {
    .inv-form-grid        { grid-template-columns: 1fr; }
    .inv-section--full    { grid-column: 1; }
    .form-row-4           { grid-template-columns: 1fr 1fr; }
    .detail-layout        { grid-template-columns: 1fr; }
    .pdf-iframe           { height: 500px; }
}
@media (max-width: 600px) {
    .form-row-4           { grid-template-columns: 1fr; }
    .items-form-table     { font-size: .75rem; }
}

/* ============================================================
   POKLADNÍ DOKLADY
   ============================================================ */
.cash-grid {
    display:               grid;
    grid-template-columns: 1fr 1fr;
    gap:                   20px;
    align-items:           start;
    margin-bottom:         20px;
}

.cash-total-box {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    background:      var(--primary);
    color:           #fff;
    padding:         10px 16px;
    border-radius:   var(--radius-sm);
    margin-top:      14px;
    font-size:       1rem;
}
.cash-total-box strong {
    font-size: 1.15rem;
    font-weight: 800;
}

@media (max-width: 768px) {
    .cash-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   MOJE SPOLEČNOSTI – karta
   ============================================================ */
.list-count {
    font-size:   .875rem;
    color:       var(--text-muted);
    font-weight: 500;
}

.empty-state {
    text-align:  center;
    padding:     60px 20px;
    color:       var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3   { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p    { margin-bottom: 20px; }

.company-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap:                   20px;
    padding:               20px;
}

.company-card {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
    overflow:      hidden;
    transition:    box-shadow var(--transition), transform var(--transition);
    position:      relative;
    display:       flex;
    flex-direction: column;
}
.company-card:hover {
    box-shadow:  var(--shadow-md);
    transform:   translateY(-2px);
}
.company-card--default {
    border-color: var(--primary);
    box-shadow:   0 0 0 2px rgba(26,86,219,.15), var(--shadow);
}

.company-default-badge {
    position:      absolute;
    top:           10px;
    right:         10px;
    background:    var(--primary);
    color:         #fff;
    font-size:     .7rem;
    font-weight:   700;
    padding:       2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.company-card-header {
    display:     flex;
    align-items: center;
    gap:         14px;
    padding:     18px 18px 12px;
    border-bottom: 1px solid var(--border);
}

.company-logo {
    width:         52px;
    height:        52px;
    border-radius: var(--radius-sm);
    border:        1px solid var(--border);
    overflow:      hidden;
    flex-shrink:   0;
    display:       flex;
    align-items:   center;
    justify-content: center;
    background:    var(--bg);
}
.company-logo img {
    max-width:  100%;
    max-height: 100%;
    object-fit: contain;
}

.company-avatar {
    width:           52px;
    height:          52px;
    border-radius:   var(--radius-sm);
    background:      var(--primary);
    color:           #fff;
    font-size:       1.1rem;
    font-weight:     800;
    display:         flex;
    align-items:     center;
    justify-content: center;
    flex-shrink:     0;
}

.company-card-title { flex: 1; min-width: 0; }
.company-card-title h3 {
    font-size:     .95rem;
    font-weight:   700;
    margin-bottom: 3px;
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
}
.company-card-title h3 a {
    color:  var(--text);
    text-decoration: none;
}
.company-card-title h3 a:hover { color: var(--primary); }

.company-city {
    font-size: .8rem;
    color:     var(--text-muted);
}

.company-card-body {
    padding: 12px 18px;
    flex:    1;
}

.company-detail-row {
    display:       flex;
    gap:           8px;
    align-items:   baseline;
    padding:       4px 0;
    border-bottom: 1px solid var(--bg);
    font-size:     .85rem;
}
.company-detail-row:last-child { border-bottom: none; }

.detail-label {
    color:       var(--text-muted);
    font-size:   .78rem;
    font-weight: 600;
    min-width:   42px;
    flex-shrink: 0;
}
.detail-value {
    color:          var(--text);
    word-break:     break-all;
    font-weight:    500;
}
.detail-value a { color: var(--primary); }

.company-card-footer {
    display:       flex;
    align-items:   center;
    gap:           6px;
    padding:       12px 18px;
    border-top:    1px solid var(--border);
    background:    var(--bg);
    flex-wrap:     wrap;
}

.btn-danger-outline {
    color:        var(--danger);
    border-color: transparent;
}
.btn-danger-outline:hover {
    background:   #fee2e2;
    border-color: var(--danger);
}

@media (max-width: 640px) {
    .company-grid { grid-template-columns: 1fr; padding: 12px; }
}

/* ============================================================
   SPOLU S FAKTUROU VYTVOŘIT I
   ============================================================ */
.also-create-table {
    width:           100%;
    border-collapse: collapse;
    font-size:       .875rem;
}
.also-create-table th {
    color:         var(--text-muted);
    font-size:     .78rem;
    font-weight:   700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding:       6px 10px;
    border-bottom: 2px solid var(--border);
    text-align:    left;
}
.also-create-table .also-row td {
    padding:       10px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.also-create-table .also-row:last-child td { border-bottom: none; }
.also-create-table .also-row:hover td { background: var(--bg); }

.also-field {
    transition: opacity var(--transition);
}

/* ============================================================
   SPOLU S FAKTUROU VYTVOŘIT I
   ============================================================ */
.also-create-table {
    width:           100%;
    border-collapse: collapse;
    font-size:       .875rem;
}
.also-create-table th {
    color:         var(--text-muted);
    font-size:     .75rem;
    font-weight:   700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding:       0 10px 8px;
    text-align:    left;
    border-bottom: 1px solid var(--border);
}
.also-create-table td {
    padding:       10px 10px;
    border-bottom: 1px solid var(--bg);
    vertical-align: middle;
}
.also-create-table tr:last-child td { border-bottom: none; }

.also-create-active td { background: var(--primary-light); }

.also-create-table input[type="checkbox"] {
    width:  18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.also-create-table .form-input--sm:disabled {
    background:  var(--bg);
    color:       var(--text-muted);
    cursor:      not-allowed;
    opacity:     .6;
}
.also-create-table .form-input--sm:not(:disabled) {
    background: var(--surface);
}

/* ============================================================
   SEZNAM FAKTUR – vylepšený
   ============================================================ */
.inv-list-table .inv-party {
    max-width:     200px;
    overflow:      hidden;
    text-overflow: ellipsis;
    white-space:   nowrap;
    color:         var(--text);
    font-weight:   500;
}

.inv-date { color: var(--text-muted); font-size: .875rem; white-space: nowrap; }

.inv-due { font-size: .875rem; white-space: nowrap; }
.inv-due--overdue { color: var(--danger); font-weight: 600; }

.overdue-days {
    display:       inline-block;
    background:    #fee2e2;
    color:         var(--danger);
    font-size:     .7rem;
    font-weight:   700;
    padding:       1px 5px;
    border-radius: 10px;
    margin-left:   4px;
}

.inv-amount { text-align: right; white-space: nowrap; font-size: .95rem; }

/* Řádky podle stavu */
.inv-row--overdue td { background: #fff5f5 !important; }
.inv-row--paid    td { background: #f0fdf4 !important; }

/* Akce */
.inv-actions { text-align: center; white-space: nowrap; }
.inv-action-group { display: inline-flex; gap: 2px; align-items: center; }

.inv-action-btn {
    display:       inline-flex;
    align-items:   center;
    justify-content: center;
    width:         30px;
    height:        30px;
    border-radius: var(--radius-sm);
    font-size:     .9rem;
    text-decoration: none;
    background:    none;
    border:        none;
    cursor:        pointer;
    transition:    background var(--transition);
    color:         var(--text-muted);
}
.inv-action-btn:hover         { background: var(--bg); }
.inv-action-btn--danger:hover { background: #fee2e2; }

/* Součtový panel */
.inv-summary-bar {
    display:         flex;
    gap:             32px;
    padding:         14px 20px;
    border-top:      2px solid var(--border);
    background:      var(--bg);
    border-radius:   0 0 var(--radius) var(--radius);
    flex-wrap:       wrap;
}
.inv-summary-item {
    display:     flex;
    align-items: center;
    gap:         10px;
    font-size:   .9rem;
}
.inv-summary-label { color: var(--text-muted); }
.inv-summary-item strong { font-size: 1rem; font-weight: 700; }
.inv-summary-item--paid   strong { color: var(--success); }
.inv-summary-item--unpaid strong { color: var(--danger); }

@media (max-width: 768px) {
    .inv-action-group { gap: 0; }
    .inv-list-table .inv-party { max-width: 120px; }
    .inv-summary-bar { gap: 16px; }
}

/* ============================================================
   DETAIL FAKTURY – nový layout (action bar nad iframe)
   ============================================================ */
.detail-action-bar {
    display:         flex;
    flex-wrap:       wrap;
    gap:             8px;
    align-items:     center;
    margin-bottom:   16px;
    padding:         14px 18px;
    background:      var(--surface);
    border:          1px solid var(--border);
    border-radius:   var(--radius);
    box-shadow:      var(--shadow);
    position:        relative;
    z-index:         20;
}

.detail-action-bar .detail-btn {
    width:     auto;
    padding:   8px 16px;
    font-size: .875rem;
}

.detail-action-bar .detail-status-block {
    margin-left:  auto;
    display:      flex;
    align-items:  center;
    gap:          10px;
    flex-wrap:    wrap;
}

.detail-action-bar .detail-status-block form {
    display: flex;
    gap:     6px;
    align-items: center;
}

.detail-action-bar .detail-status-label {
    font-size: .8rem;
    color:     var(--text-muted);
    font-weight: 600;
}

/* ============================================================
   STRÁNKOVÁNÍ
   ============================================================ */
.pagination-bar {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         12px 20px;
    border-top:      1px solid var(--border);
    background:      var(--bg);
    flex-wrap:       wrap;
    gap:             10px;
}
.pagination-info {
    font-size:  .875rem;
    color:      var(--text-muted);
}
.pagination {
    display:    flex;
    gap:        3px;
    flex-wrap:  wrap;
}
.page-btn {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    min-width:       32px;
    height:          32px;
    padding:         0 6px;
    border-radius:   var(--radius-sm);
    font-size:       .875rem;
    font-weight:     500;
    color:           var(--text);
    border:          1px solid var(--border);
    text-decoration: none;
    transition:      all var(--transition);
    background:      var(--surface);
}
.page-btn:hover:not(.disabled):not(.active) {
    background:      var(--bg);
    border-color:    var(--primary);
    color:           var(--primary);
    text-decoration: none;
}
.page-btn.active {
    background:   var(--primary);
    color:        #fff;
    border-color: var(--primary);
    font-weight:  700;
}
.page-btn.disabled {
    opacity:        .4;
    pointer-events: none;
}
.page-ellipsis {
    display:     flex;
    align-items: center;
    padding:     0 4px;
    color:       var(--text-muted);
    font-size:   .875rem;
}

/* Tooltip na ikonkách */
.inv-action-btn[title]:hover::after {
    content:       attr(title);
    position:      absolute;
    bottom:        calc(100% + 6px);
    left:          50%;
    transform:     translateX(-50%);
    background:    #1e293b;
    color:         #fff;
    font-size:     .75rem;
    padding:       4px 8px;
    border-radius: 4px;
    white-space:   nowrap;
    pointer-events: none;
    z-index:       100;
}
.inv-action-btn {
    position: relative;
}

/* ============================================================
   SEZNAM FAKTUR – lepší spacing tabulky
   ============================================================ */
.inv-list-table { font-size: .875rem; }

.inv-list-table th {
    padding:        10px 12px;
    white-space:    nowrap;
    font-size:      .78rem;
    letter-spacing: .03em;
}

.inv-list-table td {
    padding:        10px 12px;
    vertical-align: middle;
    border-bottom:  1px solid var(--border);
}

.inv-list-table td:first-child,
.inv-list-table th:first-child {
    width:   36px;
    padding: 10px 8px;
}

.inv-list-table .inv-number-link {
    font-weight:  700;
    font-size:    .9rem;
    white-space:  nowrap;
}

.inv-list-table .inv-party {
    max-width:     180px;
    overflow:      hidden;
    text-overflow: ellipsis;
    white-space:   nowrap;
}

.inv-list-table .inv-amount {
    text-align:  right;
    white-space: nowrap;
    font-size:   .9rem;
}

.inv-list-table .inv-date,
.inv-list-table .inv-due {
    white-space: nowrap;
    font-size:   .85rem;
    color:       var(--text-muted);
}

.inv-list-table .inv-due--overdue {
    color:       var(--danger);
    font-weight: 600;
}

.inv-list-table .overdue-days {
    font-size:  .72rem;
    margin-top: 2px;
}

/* Akce – rovnoměrné rozmístění */
.inv-list-table .inv-actions { white-space: nowrap; }
.inv-list-table .inv-action-group {
    display:     flex;
    gap:         2px;
    align-items: center;
}
.inv-list-table .inv-action-btn {
    width:    28px;
    height:   28px;
    font-size: .85rem;
}

/* Střídání řádků */
.inv-list-table tbody tr:nth-child(even) td { background: #fafbfc; }
.inv-list-table tbody tr:hover td { background: var(--primary-light) !important; }

/* Zvýraznění po splatnosti / uhrazené */
.inv-row--overdue td { background: #fff8f8 !important; }
.inv-row--overdue:hover td { background: #fee2e2 !important; }
.inv-row--paid td { background: #f0fdf4 !important; }
.inv-row--paid:hover td { background: #dcfce7 !important; }

/* ============================================================
   KATALOG FAKTURAČNÍCH POLOŽEK
   ============================================================ */
.catalog-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap:                   16px;
    padding:               20px;
}

.catalog-card {
    background:     var(--surface);
    border:         1px solid var(--border);
    border-radius:  var(--radius);
    box-shadow:     var(--shadow);
    display:        flex;
    flex-direction: column;
    transition:     box-shadow var(--transition), transform var(--transition);
    overflow:       hidden;
}
.catalog-card:hover {
    box-shadow: var(--shadow-md);
    transform:  translateY(-2px);
}
.catalog-card--inactive { opacity: .6; }

.catalog-card-type {
    display:         flex;
    align-items:     center;
    gap:             6px;
    padding:         6px 12px;
    font-size:       .75rem;
    font-weight:     700;
    color:           #fff;
    text-transform:  uppercase;
    letter-spacing:  .05em;
}

.catalog-card-category {
    display:       inline-block;
    margin:        8px 12px 0;
    padding:       2px 8px;
    border:        1px solid;
    border-radius: 20px;
    font-size:     .72rem;
    font-weight:   600;
}

.catalog-card-body {
    padding: 10px 12px;
    flex:    1;
}

.catalog-code {
    font-size:    .75rem;
    color:        var(--text-muted);
    font-family:  monospace;
    margin-bottom: 2px;
}

.catalog-name {
    font-size:     .95rem;
    font-weight:   700;
    margin-bottom: 4px;
}
.catalog-name a {
    color:           var(--text);
    text-decoration: none;
}
.catalog-name a:hover { color: var(--primary); }

.catalog-desc {
    font-size: .8rem;
    color:     var(--text-muted);
    line-height: 1.4;
}

.catalog-card-price {
    padding:     8px 12px;
    background:  var(--bg);
    border-top:  1px solid var(--border);
}

.catalog-price-main {
    font-size:   1.05rem;
    font-weight: 800;
    color:       var(--primary);
}

.catalog-unit {
    font-size:   .8rem;
    font-weight: 400;
    color:       var(--text-muted);
}

.catalog-vat {
    font-size: .75rem;
    color:     var(--text-muted);
    margin-top: 1px;
}

.catalog-card-footer {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         8px 12px;
    border-top:      1px solid var(--border);
}

.catalog-use-count {
    font-size: .78rem;
    color:     var(--text-muted);
}

/* Typ selector ve formuláři */
.type-selector {
    display:   flex;
    gap:       8px;
    flex-wrap: wrap;
}

.type-option {
    display:       flex;
    align-items:   center;
    gap:           6px;
    padding:       8px 14px;
    border:        2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor:        pointer;
    font-size:     .875rem;
    font-weight:   500;
    transition:    all var(--transition);
}
.type-option input { display: none; }
.type-option:hover { border-color: var(--type-color, var(--primary)); }
.type-option.active {
    border-color: var(--type-color, var(--primary));
    background:   color-mix(in srgb, var(--type-color, var(--primary)) 10%, transparent);
    color:        var(--type-color, var(--primary));
}

.type-icon { font-size: 1.1rem; }

/* Unit chips */
.unit-chip {
    display:       flex;
    align-items:   center;
    padding:       4px 10px;
    border:        1px solid var(--border);
    border-radius: 20px;
    cursor:        pointer;
    font-size:     .8rem;
    transition:    all var(--transition);
}
.unit-chip input { display: none; }
.unit-chip:hover  { border-color: var(--primary); color: var(--primary); }
.unit-chip.active {
    background:   var(--primary);
    color:        #fff;
    border-color: var(--primary);
}

/* Náhled ceny */
.catalog-price-preview {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    background:      var(--bg);
    border-radius:   var(--radius-sm);
    padding:         10px 14px;
    margin-top:      16px;
    border:          1px solid var(--border);
}
.price-preview-label { font-size: .85rem; color: var(--text-muted); }
.price-preview-value { font-size: 1.1rem; font-weight: 800; color: var(--primary); }

/* Kategorie modal */
.category-row {
    display:     flex;
    align-items: center;
    gap:         8px;
    padding:     8px 0;
    border-bottom: 1px solid var(--bg);
    font-size:   .875rem;
}
.category-dot {
    width:         12px;
    height:        12px;
    border-radius: 50%;
    flex-shrink:   0;
}
.category-name  { flex: 1; font-weight: 500; }
.category-count { color: var(--text-muted); font-size: .8rem; }

/* Katalog search v faktuře */
.catalog-search-bar {
    position:      relative;
    padding:       12px 16px;
    border-bottom: 1px solid var(--border);
}
.catalog-search-results {
    display:       none;
    position:      absolute;
    top:           100%;
    left:          16px;
    right:         16px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow:    var(--shadow-md);
    z-index:       100;
    max-height:    240px;
    overflow-y:    auto;
}
.catalog-result-item {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         8px 12px;
    cursor:          pointer;
    font-size:       .875rem;
    border-bottom:   1px solid var(--bg);
}
.catalog-result-item:hover  { background: var(--primary-light); }
.catalog-result-name        { font-weight: 500; }
.catalog-result-meta        { font-size: .8rem; color: var(--text-muted); }

/* ============================================================
   SKLAD
   ============================================================ */
.warehouse-stats {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap:                   16px;
    margin-bottom:         24px;
}

.wh-stat-card {
    background:     var(--surface);
    border:         1px solid var(--border);
    border-radius:  var(--radius);
    box-shadow:     var(--shadow);
    padding:        16px 20px;
    display:        flex;
    align-items:    center;
    gap:            14px;
}
.wh-stat-card--warning { border-color: var(--warning); }

.wh-stat-icon  { font-size: 2rem; }
.wh-stat-value { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.wh-stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

.warehouse-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap:                   16px;
    margin-bottom:         24px;
}

.wh-card {
    background:     var(--surface);
    border:         1px solid var(--border);
    border-radius:  var(--radius);
    box-shadow:     var(--shadow);
    display:        flex;
    flex-direction: column;
    transition:     box-shadow var(--transition);
}
.wh-card:hover { box-shadow: var(--shadow-md); }

.wh-card-header {
    display:     flex;
    align-items: center;
    gap:         12px;
    padding:     14px 16px;
    border-bottom: 1px solid var(--border);
}
.wh-card-icon    { font-size: 1.8rem; }
.wh-card-name    { font-weight: 700; font-size: 1rem; }
.wh-card-code    { font-size: .78rem; color: var(--text-muted); }
.wh-card-body    { padding: 10px 16px; flex: 1; }
.wh-detail       { font-size: .85rem; color: var(--text-muted); padding: 3px 0; }
.wh-card-footer  {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         10px 16px;
    border-top:      1px solid var(--border);
    background:      var(--bg);
    border-radius:   0 0 var(--radius) var(--radius);
}
.wh-item-count   { font-size: .8rem; color: var(--text-muted); }

.low-stock-alert {
    margin-top:    20px;
    border:        2px solid var(--warning);
    border-radius: var(--radius);
    overflow:      hidden;
}
.low-stock-header {
    background:  #fef3c7;
    color:       #92400e;
    padding:     10px 16px;
    font-weight: 700;
    font-size:   .9rem;
}

/* Sekce v dropdown menu */
.nav-dropdown-section {
    padding:        4px 16px 2px;
    font-size:      .68rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color:          var(--text-muted);
    margin-top:     4px;
}

/* ============================================================
   ZÁLOŽKY (TABS)
   ============================================================ */
.tabs-bar {
    display:       flex;
    gap:           4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    flex-wrap:     wrap;
}

.tab-btn {
    padding:          10px 18px;
    background:       none;
    border:           none;
    border-bottom:    2px solid transparent;
    margin-bottom:    -2px;
    font-size:        .875rem;
    font-weight:      600;
    color:            var(--text-muted);
    cursor:           pointer;
    transition:       all var(--transition);
    border-radius:    var(--radius-sm) var(--radius-sm) 0 0;
    white-space:      nowrap;
}
.tab-btn:hover  { color: var(--primary); background: var(--bg); }
.tab-btn.active {
    color:        var(--primary);
    border-bottom-color: var(--primary);
    background:   var(--surface);
}

.tab-content        { display: none; }
.tab-content.active { display: block; }

/* Dokumenty zaměstnance */
.file-drop-zone {
    border:          2px dashed var(--border);
    border-radius:   var(--radius);
    padding:         24px;
    text-align:      center;
    color:           var(--text-muted);
    transition:      all var(--transition);
    cursor:          default;
    font-size:       .875rem;
}
.file-drop-zone .file-drop-icon { font-size: 2rem; margin-bottom: 8px; }
.file-drop-zone.drag-over       { border-color: var(--primary); background: var(--primary-light); }

.doc-row {
    display:       flex;
    align-items:   center;
    gap:           10px;
    padding:       10px 0;
    border-bottom: 1px solid var(--bg);
    font-size:     .875rem;
}
.doc-row:last-child { border-bottom: none; }
.doc-icon           { font-size: 1.3rem; flex-shrink: 0; }
.doc-info           { flex: 1; min-width: 0; }
.doc-name           { font-weight: 600; }
.doc-meta           { font-size: .78rem; color: var(--text-muted); }
.doc-actions        { display: flex; gap: 4px; }

/* Toggle switch */
.toggle-switch         { position:relative; display:inline-block; width:44px; height:24px; }
.toggle-switch input   { opacity:0; width:0; height:0; }
.toggle-slider {
    position:          absolute;
    cursor:            pointer;
    inset:             0;
    background:        var(--border);
    border-radius:     24px;
    transition:        var(--transition);
}
.toggle-slider::before {
    content:           '';
    position:          absolute;
    width:             18px; height: 18px;
    left:              3px;  bottom: 3px;
    background:        #fff;
    border-radius:     50%;
    transition:        var(--transition);
}
.toggle-switch input:checked + .toggle-slider            { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before   { transform: translateX(20px); }

.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* ============================================================
   PŘEPÍNAČ FIREM
   ============================================================ */
.company-switcher-btn {
    background:    none;
    border:        1px solid var(--border);
    border-radius: var(--radius-sm);
    padding:       6px 12px;
    cursor:        pointer;
    font-size:     .875rem;
    font-weight:   600;
    color:         var(--text);
    white-space:   nowrap;
    max-width:     200px;
    overflow:      hidden;
    text-overflow: ellipsis;
    transition:    all var(--transition);
}
.company-switcher-btn:hover {
    background:    var(--bg);
    border-color:  var(--primary);
    color:         var(--primary);
}

.company-switcher-menu {
    min-width: 220px;
}

.company-switch-item {
    display:    block;
    width:      100%;
    padding:    8px 16px;
    background: none;
    border:     none;
    text-align: left;
    cursor:     pointer;
    font-size:  .875rem;
    color:      var(--text);
    transition: background var(--transition);
}
.company-switch-item:hover  { background: var(--bg); }
.company-switch-item.active {
    color:       var(--primary);
    font-weight: 700;
    background:  var(--primary-light);
}

/* Typ účtu badge v profilu / admin */
.account-type-badge {
    display:       inline-flex;
    align-items:   center;
    gap:           5px;
    padding:       3px 10px;
    border-radius: 20px;
    font-size:     .78rem;
    font-weight:   600;
    background:    var(--bg);
    border:        1px solid var(--border);
}

/* MeCU OAuth tlačítko */
.btn-mecu {
    display:         flex;
    align-items:     center;
    justify-content: center;
    width:           100%;
    padding:         11px 20px;
    background:      #ff6b00;
    color:           #fff;
    border:          none;
    border-radius:   var(--radius-sm);
    font-size:       .925rem;
    font-weight:     600;
    text-decoration: none;
    cursor:          pointer;
    transition:      all var(--transition);
    margin-bottom:   16px;
}
.btn-mecu:hover { background: #e55f00; color: #fff; }

.auth-divider {
    display:     flex;
    align-items: center;
    gap:         12px;
    margin:      12px 0 16px;
    color:       var(--text-muted);
    font-size:   .825rem;
}
.auth-divider::before,
.auth-divider::after {
    content:    '';
    flex:       1;
    height:     1px;
    background: var(--border);
}

/* ============================================================
   DASHBOARD
   ============================================================ */

.dash-wrap {
    max-width:    1200px;
    margin:       0 auto;
    padding:      1.5rem 1rem 3rem;
}
@media (max-width: 640px) {
    .dash-wrap {
        padding: 1rem 14px 5rem;
    }
}

.dash-header {
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap:           1rem;
    flex-wrap:     wrap;
}
.page-title  { font-size: 1.5rem; font-weight: 600; color: var(--text); margin: 0; }
.page-subtitle { font-size: .85rem; color: var(--text-muted); margin: .15rem 0 0; }

.company-select {
    min-width: 180px;
    padding:   .4rem .75rem;
    border:    1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color:     var(--text);
    font-size: .875rem;
    cursor:    pointer;
}

/* --- Mřížky --- */
.dash-grid4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.dash-grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.dash-grid2 { display: grid; grid-template-columns: 1fr 1fr;       gap: 12px; }
@media (max-width: 900px) {
    .dash-grid4 { grid-template-columns: 1fr 1fr; }
    .dash-grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .dash-grid4, .dash-grid3, .dash-grid2 { grid-template-columns: 1fr; }
}

/* --- Metrika karta --- */
.dash-metric {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       1rem 1.1rem;
}
.dash-metric-label {
    font-size:  .75rem;
    font-weight: 500;
    color:      var(--text-muted);
    margin-bottom: .4rem;
    display:    flex;
    align-items: center;
    gap:        5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.dash-metric-val  { font-size: 1.5rem; font-weight: 600; color: var(--text); }
.dash-metric-sub  { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }

/* --- Karta --- */
.dash-card {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       1rem 1.1rem;
}
.dash-card-title {
    font-size:   .875rem;
    font-weight: 600;
    color:       var(--text);
    margin-bottom: .85rem;
    display:     flex;
    align-items: center;
    gap:         6px;
}

/* --- Cashflow graf --- */
.cashflow-chart {
    display:     flex;
    align-items: flex-end;
    gap:         6px;
    height:      110px;
    padding:     0 0 4px;
}
.cf-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}
.cf-bars {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}
.cf-bar {
    flex:          1;
    border-radius: 3px 3px 0 0;
    min-height:    2px;
    transition:    height .3s;
    cursor:        default;
}
.cf-bar--in  { background: var(--color-success, #1D9E75); }
.cf-bar--out { background: var(--color-danger,  #E24B4A); }
.cf-label    { font-size: .7rem; color: var(--text-muted); margin-top: 4px; }
.cf-legend   { display: flex; gap: 12px; margin-top: .6rem; font-size: .75rem; color: var(--text-muted); }
.cf-dot      { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.cf-dot--in  { background: var(--color-success, #1D9E75); }
.cf-dot--out { background: var(--color-danger,  #E24B4A); }

/* --- Bar řádky --- */
.dash-bar-row   { display: flex; align-items: center; gap: 8px; margin-bottom: .5rem; font-size: .8rem; }
.dash-bar-label { width: 120px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.dash-bar-track { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.dash-bar-fill  { height: 100%; border-radius: 3px; background: var(--primary); transition: width .4s; }
.dash-bar-val   { width: 70px; text-align: right; color: var(--text); font-weight: 500; flex-shrink: 0; }

/* --- Status řádky --- */
.dash-status-row {
    display:       flex;
    justify-content: space-between;
    align-items:   center;
    padding:       .4rem 0;
    border-bottom: 1px solid var(--border);
    font-size:     .85rem;
    color:         var(--text-muted);
}
.dash-status-row:last-child { border-bottom: none; }
.dash-status-row a.badge { text-decoration: none; }

/* --- Cashflow řádky v pokladně --- */
.dash-cashflow-row {
    display:       flex;
    justify-content: space-between;
    align-items:   center;
    padding:       .4rem 0;
    font-size:     .85rem;
}
.dash-cf-label { color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.dash-cf-val   { font-weight: 500; }
.dash-divider  { height: 1px; background: var(--border); margin: .5rem 0; }
.color-success { color: var(--color-success, #1D9E75); }
.color-danger  { color: var(--color-danger,  #E24B4A); }

/* --- Aktivita --- */
.dash-activity-row {
    display:       flex;
    gap:           10px;
    align-items:   center;
    padding:       .5rem 0;
    border-bottom: 1px solid var(--border);
    min-width:     0;
    overflow:      hidden;
}
.dash-activity-row:last-child { border-bottom: none; }
.dash-act-dot {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 13px;
}
.dash-act-dot--success { background: rgba(29,158,117,.15); color: #1D9E75; }
.dash-act-dot--danger  { background: rgba(226,75, 74,.15); color: #E24B4A; }
.dash-act-dot--info    { background: rgba(24, 95,165,.15); color: #185FA5; }
.dash-act-dot--warning { background: rgba(186,117,23,.15); color: #BA7517; }
.dash-act-dot--default { background: var(--bg);            color: var(--text-muted); }
.dash-act-body  { flex: 1; min-width: 0; }
.dash-act-title { font-size: .82rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dash-act-sub   { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.dash-act-amt   { font-size: .82rem; font-weight: 500; white-space: nowrap; flex-shrink: 0; margin-left: auto; padding-left: 6px; }

/* --- Prázdný stav --- */
.dash-empty { font-size: .85rem; color: var(--text-muted); padding: .5rem 0; }

/* --- Badges v dashboardu --- */
.badge-default { background: var(--bg); color: var(--text-muted); }

/* ============================================================
   ADRESÁŘ (Address Book)
   ============================================================ */

/* Stats bar */
.ab-stats { display:flex; gap:8px; margin-bottom:1.25rem; flex-wrap:wrap; }
.ab-stat   {
    display:flex; flex-direction:column; align-items:center;
    padding:.6rem 1rem; background:var(--surface);
    border:1px solid var(--border); border-radius:var(--radius);
    text-decoration:none; color:var(--text); transition:background .15s;
    min-width:80px;
}
.ab-stat:hover, .ab-stat--active { background:var(--bg); border-color:var(--primary); }
.ab-stat-val   { font-size:1.2rem; font-weight:600; }
.ab-stat-label { font-size:.72rem; color:var(--text-muted); margin-top:2px; }

/* Layout */
.ab-layout  { display:grid; grid-template-columns:220px 1fr; gap:1rem; }
@media (max-width:768px) { .ab-layout { grid-template-columns:1fr; } }

/* Sidebar */
.ab-sidebar          { display:flex; flex-direction:column; gap:.75rem; }
.ab-sidebar-section  { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:.75rem; }
.ab-sidebar-title    { font-size:.72rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); margin-bottom:.5rem; }
.ab-group-item       { display:flex; align-items:center; gap:7px; padding:.35rem .5rem; border-radius:var(--radius-sm); font-size:.85rem; color:var(--text); text-decoration:none; transition:background .15s; }
.ab-group-item:hover, .ab-group-item--active { background:var(--bg); }
.ab-system-badge     { font-size:.65rem; background:var(--bg); color:var(--text-muted); border-radius:4px; padding:1px 5px; margin-left:auto; }
.ab-tags-cloud       { display:flex; flex-wrap:wrap; gap:4px; }
.ab-birthday-item    { display:flex; justify-content:space-between; font-size:.8rem; padding:.25rem 0; border-bottom:1px solid var(--border); color:var(--text); text-decoration:none; }
.ab-birthday-item:last-child { border-bottom:none; }
.ab-birthday-date    { color:var(--text-muted); display:flex; gap:4px; align-items:center; }

/* Tags */
.ab-tag        { display:inline-block; padding:2px 8px; border-radius:100px; font-size:.75rem; background:var(--bg); color:var(--text-muted); border:1px solid var(--border); text-decoration:none; transition:background .15s; }
.ab-tag:hover, .ab-tag--active { background:var(--primary); color:#fff; border-color:var(--primary); }
.ab-tag-sm     { font-size:.7rem; padding:1px 6px; }
.ab-tag-cnt    { opacity:.6; font-size:.7em; }
.ab-tag-more   { cursor:default; }

/* Search bar */
.ab-search-bar   { display:flex; gap:.5rem; margin-bottom:1rem; flex-wrap:wrap; align-items:center; }
.ab-search-input { flex:1; min-width:180px; padding:.45rem .75rem; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); color:var(--text); font-size:.875rem; }
.ab-search-input:focus { outline:none; border-color:var(--primary); }

/* Grid karet */
.ab-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:10px; }
.ab-card {
    display:flex; align-items:flex-start; gap:.75rem;
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--radius); padding:.85rem 1rem;
    transition:box-shadow .15s;
}
.ab-card:hover { border-color:var(--primary); }
.ab-card--system { border-left:3px solid var(--primary); }
.ab-avatar {
    width:44px; height:44px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-size:1rem; font-weight:600; flex-shrink:0;
}
.ab-avatar img { width:100%; height:100%; border-radius:50%; object-fit:cover; }
.ab-card-body  { flex:1; min-width:0; }
.ab-card-name  { font-size:.9rem; font-weight:600; }
.ab-card-name a { color:var(--text); text-decoration:none; }
.ab-card-name a:hover { color:var(--primary); }
.ab-fav-star   { font-size:.8rem; }
.ab-card-sub   { font-size:.78rem; color:var(--text-muted); margin-top:1px; }
.ab-card-contacts { margin-top:.4rem; display:flex; flex-direction:column; gap:2px; }
.ab-contact-link  { font-size:.78rem; color:var(--text-muted); text-decoration:none; display:flex; align-items:center; gap:4px; }
.ab-contact-link:hover { color:var(--primary); }
.ab-card-tags  { display:flex; flex-wrap:wrap; gap:3px; margin-top:.4rem; }
.ab-card-actions { display:flex; flex-direction:column; gap:4px; margin-left:auto; }
.ab-action-btn { background:none; border:none; cursor:pointer; color:var(--text-muted); padding:4px; border-radius:4px; transition:color .15s,background .15s; font-size:16px; }
.ab-action-btn:hover { color:var(--primary); background:var(--bg); }
.ab-action-btn--danger:hover { color:var(--color-danger,#E24B4A); background:rgba(226,75,74,.1); }

/* Prázdný stav */
.ab-empty { text-align:center; padding:3rem 1rem; color:var(--text-muted); display:flex; flex-direction:column; align-items:center; gap:1rem; }

/* Detail layout */
.ab-detail-layout { display:grid; grid-template-columns:240px 1fr; gap:1.5rem; }
@media (max-width:768px) { .ab-detail-layout { grid-template-columns:1fr; } }

.ab-detail-aside  { display:flex; flex-direction:column; align-items:center; gap:.75rem; }
.ab-detail-avatar { width:80px; height:80px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:2rem; font-weight:600; }
.ab-detail-group  { font-size:.8rem; display:flex; align-items:center; gap:5px; }
.ab-detail-quick  { width:100%; display:flex; flex-direction:column; gap:4px; }
.ab-quick-btn     { display:flex; align-items:center; gap:7px; padding:.4rem .75rem; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); font-size:.82rem; color:var(--text); text-decoration:none; transition:background .15s; }
.ab-quick-btn:hover { background:var(--surface); border-color:var(--primary); }
.ab-detail-tags   { display:flex; flex-wrap:wrap; gap:4px; justify-content:center; }

.ab-detail-main      { display:flex; flex-direction:column; gap:1rem; }
.ab-detail-section   { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:1rem 1.1rem; }
.ab-detail-section-title { font-size:.8rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); margin-bottom:.75rem; }
.ab-detail-row       { display:flex; gap:1rem; padding:.35rem 0; border-bottom:1px solid var(--border); font-size:.875rem; }
.ab-detail-row:last-child { border-bottom:none; }
.ab-detail-label     { width:160px; flex-shrink:0; color:var(--text-muted); display:flex; align-items:center; gap:5px; }
.ab-detail-value     { color:var(--text); flex:1; }
.ab-detail-meta      { font-size:.75rem; color:var(--text-muted); }

/* Skupiny správa */
.ab-group-manage-row { display:flex; align-items:center; gap:.75rem; padding:.4rem 0; border-bottom:1px solid var(--border); font-size:.875rem; }
.ab-group-manage-row:last-child { border-bottom:none; }

/* Radio cards */
.radio-card { display:inline-flex; align-items:center; gap:.5rem; padding:.5rem 1rem; border:1px solid var(--border); border-radius:var(--radius); cursor:pointer; font-size:.875rem; transition:border-color .15s,background .15s; }
.radio-card input[type=radio] { display:none; }
.radio-card:hover, .radio-card--active { border-color:var(--primary); background:var(--bg); }

/* Form helpers */
.form-subsection-label { font-size:.78rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; margin:.75rem 0 .4rem; }

/* ============================================================
   CONTACT FORM – kompaktní gridy
   ============================================================ */
.cf-top-row      { display:flex; align-items:flex-end; gap:1rem; flex-wrap:wrap; }
.cf-type-btns    { display:flex; gap:.5rem; }
.cf-fav-toggle   { display:inline-flex; align-items:center; gap:.4rem; font-size:.875rem; cursor:pointer; color:var(--text-muted); white-space:nowrap; padding-bottom:.15rem; }
.cf-fav-toggle input { margin:0; }

/* 2 rovné sloupce */
.cf-grid-2       { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
/* 3 rovné sloupce */
.cf-grid-3       { display:grid; grid-template-columns:1fr 1fr 1fr; gap:.75rem; }
/* 5 sloupců pro titul+jméno+příjmení */
.cf-grid-5       { display:grid; grid-template-columns:100px 1fr 1fr 1fr 1fr; gap:.75rem; margin-bottom:.5rem; }
/* Vnitřní 2 sloupce uvnitř buňky */
.cf-grid-2-inner { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; }

/* Nadpis pod-sekce v sloupci */
.cf-col-title    { font-size:.75rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); margin-bottom:.5rem; display:flex; align-items:center; gap:5px; }

@media (max-width:768px) {
    .cf-grid-2, .cf-grid-3, .cf-grid-5, .cf-grid-2-inner { grid-template-columns:1fr; }
    .cf-grid-5 > .form-group[style*="span 2"] { grid-column:span 1; }
    .cf-top-row { flex-direction:column; align-items:flex-start; }
}

/* Tlačítka výběru typu (Osoba / Firma) – styl jako user-type-card */
.inv-type-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    transition: border-color .15s, color .15s, background .15s;
    user-select: none;
}
.inv-type-btn:hover { border-color: var(--primary); color: var(--primary); }
.inv-type-btn--active { border-color: var(--primary); color: var(--primary); background: var(--bg); font-weight: 600; }

/* Podnadpis sekce uvnitř formuláře */
.form-section-subtitle {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin: 0 0 .6rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Otevírací doba */
.ab-opening-hours { display:flex; flex-direction:column; gap:2px; }
.ab-oh-row        { display:flex; gap:.75rem; font-size:.82rem; align-items:baseline; }
.ab-oh-day        { width:30px; font-weight:500; color:var(--text); flex-shrink:0; }
.ab-oh-time       { color:var(--text-muted); white-space:nowrap; }

/* Web tlačítka v postranním panelu */
.ab-quick-btn--web {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}
.ab-quick-btn--web:hover { background: var(--primary); color: #fff; }

/* ============================================================
   KALENDÁŘ
   ============================================================ */

/* Toolbar */
.cal-toolbar {
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    flex-wrap:     wrap;
    gap:           .75rem;
    margin-bottom: .75rem;
}
.cal-nav { display:flex; align-items:center; gap:.5rem; }
.cal-nav-title { font-size: 1rem; font-weight: 600; color: var(--text); min-width: 160px; text-align: center; }
.cal-view-tabs { display:flex; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.cal-view-tab {
    padding: .35rem .85rem;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.cal-view-tab:hover { background: var(--bg); color: var(--text); }
.cal-view-tab--active { background: var(--primary); color: #fff; }

/* Filtry */
.cal-filters { display:flex; flex-wrap:wrap; gap:.4rem; margin-bottom:.85rem; }
.cal-filter-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 100px;
    font-size: .75rem; font-weight: 500; cursor: pointer;
    border: 1.5px solid var(--chip-color, #185FA5);
    color: var(--chip-color, #185FA5);
    background: transparent;
    transition: background .15s;
    user-select: none;
}
.cal-filter-chip:has(.cal-filter-check:checked) {
    background: var(--chip-color, #185FA5);
    color: #fff;
}

/* ── MĚSÍČNÍ POHLED ── */
.cal-month { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-month-header { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day-name {
    text-align: center; padding: .45rem 0;
    font-size: .72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}
.cal-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day {
    min-height: 96px; padding: .35rem .4rem;
    border-right: .5px solid var(--border);
    border-bottom: .5px solid var(--border);
    background: var(--surface);
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day--other { background: var(--bg); }
.cal-day--today { background: #EBF3FF; }
.cal-day-number {
    font-size: .78rem; font-weight: 600; color: var(--text-muted);
    margin-bottom: .2rem;
}
.cal-day--today .cal-day-number {
    background: var(--primary); color: #fff;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.cal-day-events { display: flex; flex-direction: column; gap: 2px; }
.cal-event-pill {
    display: flex; align-items: center; gap: 3px;
    padding: 1px 5px; border-radius: 3px;
    font-size: .68rem; font-weight: 500; color: #fff;
    cursor: pointer; white-space: nowrap; overflow: hidden;
    transition: opacity .15s;
}
.cal-event-pill:hover { opacity: .85; }
.cal-event-more { font-size: .68rem; color: var(--text-muted); padding-left: 2px; }

/* ── TÝDENNÍ POHLED ── */
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-week-day { border-right: .5px solid var(--border); min-height: 300px; }
.cal-week-day:last-child { border-right: none; }
.cal-week-day--today { background: #EBF3FF; }
.cal-week-day-header {
    display: flex; flex-direction: column; align-items: center;
    padding: .5rem .25rem; border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.cal-week-day-name { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.cal-week-day-num  { font-size: .9rem; font-weight: 600; color: var(--text); }
.cal-week-day-events { padding: .4rem .3rem; display: flex; flex-direction: column; gap: 4px; }
.cal-week-event {
    padding: .3rem .4rem; border-radius: var(--radius-sm);
    font-size: .75rem; position: relative;
}
.cal-week-event-title { font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 4px; }
.cal-week-event-desc  { font-size: .7rem; color: var(--text-muted); margin-top: 1px; }
.cal-week-event-edit  { position: absolute; top: 4px; right: 4px; color: var(--text-muted); font-size: 12px; }
.cal-week-empty { font-size: .75rem; color: var(--text-muted); padding: .25rem; }

/* ── AGENDA POHLED ── */
.cal-agenda { display: flex; flex-direction: column; gap: 0; }
.cal-agenda-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.cal-agenda-date {
    display: flex; align-items: center; gap: .75rem;
    padding: .75rem 0 .35rem;
    border-bottom: 2px solid var(--border);
    margin-top: .75rem;
}
.cal-agenda-date:first-child { margin-top: 0; }
.cal-agenda-date--today .cal-agenda-day-num { background: var(--primary); color: #fff; }
.cal-agenda-day-num {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 700; color: var(--text);
    background: var(--bg); flex-shrink: 0;
}
.cal-agenda-day-name { font-size: .875rem; font-weight: 600; color: var(--text); }
.cal-agenda-event {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: .6rem .5rem .6rem .85rem;
    border-bottom: .5px solid var(--border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 2px;
    background: var(--surface);
}
.cal-agenda-event-dot {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 13px; color: #fff;
}
.cal-agenda-event-body  { flex: 1; min-width: 0; }
.cal-agenda-event-title { font-size: .875rem; font-weight: 500; color: var(--text); }
.cal-agenda-event-desc  { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.cal-agenda-event-time  { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.cal-agenda-event-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Legenda */
.cal-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1rem; padding-top: .75rem; border-top: .5px solid var(--border); }
.cal-legend-item { display: flex; align-items: center; gap: 5px; font-size: .75rem; color: var(--text-muted); }
.cal-legend-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Typ tlačítka ve formuláři */
.cal-type-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .9rem; border-radius: 100px;
    border: 1.5px solid var(--type-color, #185FA5);
    color: var(--type-color, #185FA5);
    background: transparent; cursor: pointer;
    font-size: .82rem; font-weight: 500;
    transition: background .15s; user-select: none;
}
.cal-type-btn--active { background: var(--type-color, #185FA5); color: #fff; }

@media (max-width: 768px) {
    .cal-month-grid, .cal-month-header { grid-template-columns: repeat(7, minmax(40px, 1fr)); }
    .cal-week { grid-template-columns: 1fr; }
    .cal-event-pill { font-size: .6rem; }
}

/* ============================================================
   TÝMY
   ============================================================ */
.section-label {
    font-size: .72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted);
    margin-bottom: .6rem;
}
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.team-card {
    display: flex; align-items: center; gap: .85rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .85rem 1rem;
    text-decoration: none; color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.team-card:hover { border-color: var(--primary); }
.team-card--member { opacity: .85; }
.team-card-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0;
}
.team-card-body   { flex: 1; min-width: 0; }
.team-card-name   { font-weight: 600; font-size: .9rem; }
.team-card-desc   { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.team-card-meta   { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; display: flex; align-items: center; gap: 4px; }
.team-card-arrow  { color: var(--text-muted); font-size: 1.1rem; }

/* Členové */
.team-members-list { display: flex; flex-direction: column; gap: 0; }
.team-member-row {
    display: flex; align-items: center; gap: .75rem;
    padding: .5rem 0; border-bottom: .5px solid var(--border);
}
.team-member-row:last-child { border-bottom: none; }
.team-member-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .82rem; font-weight: 600; flex-shrink: 0;
}
.team-member-info  { flex: 1; min-width: 0; }
.team-member-name  { font-size: .875rem; font-weight: 500; display: flex; align-items: center; gap: .4rem; }
.team-member-email { font-size: .75rem; color: var(--text-muted); }
.team-member-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

/* ============================================================
   JEDNOTNÝ STYL SEZNAMŮ DOKLADŮ
   ============================================================ */

/* Statusové filtry */
.inv-status-filter {
    display:     flex;
    flex-wrap:   wrap;
    gap:         6px;
    margin-bottom: 1rem;
}
.inv-status-pill {
    display:       inline-flex;
    align-items:   center;
    gap:           .4rem;
    padding:       .4rem .9rem;
    border:        1.5px solid var(--border);
    border-radius: 100px;
    font-size:     .82rem;
    font-weight:   500;
    color:         var(--text-muted);
    text-decoration: none;
    background:    var(--surface);
    transition:    all .15s;
    white-space:   nowrap;
}
.inv-status-pill:hover { border-color: var(--primary); color: var(--primary); }
.inv-status-pill--active {
    background:   var(--primary);
    border-color: var(--primary);
    color:        #fff;
}
.inv-status-pill--active .inv-status-pill-count { color: #fff; }
.inv-status-pill-count { font-size: .95rem; font-weight: 700; line-height: 1; }

/* Karta seznamu */
.inv-list-card {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    overflow:      hidden;
}

/* Toolbar */
.inv-list-toolbar {
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    flex-wrap:     wrap;
    gap:           .5rem;
    padding:       .85rem 1rem;
    border-bottom: 1px solid var(--border);
}
.inv-search-form  { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; flex: 1; }
.inv-search-input { flex: 1; min-width: 180px; }

/* Footer se součty */
.inv-list-footer {
    display:       flex;
    align-items:   center;
    gap:           1.5rem;
    padding:       .75rem 1rem;
    border-top:    1px solid var(--border);
    font-size:     .875rem;
    color:         var(--text-muted);
    flex-wrap:     wrap;
}

/* Prázdný stav */
.inv-empty-row {
    text-align:  center;
    color:       var(--text-muted);
    padding:     2.5rem 1rem !important;
    font-size:   .875rem;
}

/* ============================================================
   DATA TABLE – základní styly (sdílené front/admin)
   ============================================================ */
.data-table {
    width:           100%;
    border-collapse: collapse;
    font-size:       .875rem;
}
.data-table th {
    text-align:      left;
    padding:         .6rem 1rem;
    font-size:       .72rem;
    font-weight:     600;
    text-transform:  uppercase;
    letter-spacing:  .05em;
    color:           var(--text-muted);
    border-bottom:   2px solid var(--border);
    white-space:     nowrap;
    background:      var(--surface);
}
.data-table td {
    padding:         .7rem 1rem;
    border-bottom:   .5px solid var(--border);
    color:           var(--text);
    vertical-align:  middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg); }

/* ============================================================
   PLAN LIMIT BAR
   ============================================================ */
.plan-limit-bar {
    display:       flex;
    align-items:   center;
    gap:           .5rem;
    padding:       .6rem 1rem;
    border-radius: var(--radius);
    background:    #EBF3FF;
    border:        1px solid #bfdbfe;
    color:         #1e40af;
    font-size:     .82rem;
    margin-bottom: .75rem;
}
.plan-limit-bar a { color: var(--primary); font-weight: 500; }
.plan-limit-bar--blocked {
    background: #FEF2F2;
    border-color: #fecaca;
    color: #991b1b;
}
.plan-limit-bar--blocked a { color: #dc2626; }

/* ============================================================
   MOBILNÍ HAMBURGER – přidáno, původní styly NEZMĚNĚNY
   ============================================================ */

/* Hamburger tlačítko – skryté na desktopu */
.nav-hamburger {
    display:         none;
    flex-direction:  column;
    justify-content: center;
    gap:             5px;
    width:           38px;
    height:          38px;
    padding:         7px;
    background:      none;
    border:          1px solid var(--border, #e2e8f0);
    border-radius:   6px;
    cursor:          pointer;
    flex-shrink:     0;
}
.nav-hamburger span {
    display:          block;
    width:            100%;
    height:           2px;
    background:       var(--text, #1a1a1a);
    border-radius:    2px;
    transition:       transform .25s, opacity .2s;
    transform-origin: center;
}
.nav-hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-active span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobilní panel – body level, nezávislý na headeru */
.mob-nav-panel {
    position:   fixed;
    top:        0;
    left:       0;
    bottom:     0;
    width:      80vw;
    max-width:  300px;
    background: var(--surface, #fff);
    border-right: 1px solid var(--border, #e2e8f0);
    box-shadow: 6px 0 30px rgba(0,0,0,.2);
    z-index:    9999;
    overflow-y: auto;
    padding:    56px 0 24px;
    transform:  translateX(-110%);
    transition: transform .28s ease;
    visibility: hidden;
}
.mob-nav-panel.is-open {
    transform:  translateX(0);
    visibility: visible;
}

/* Overlay */
.mob-nav-overlay {
    display:    none;
    position:   fixed;
    inset:      0;
    background: rgba(0,0,0,.5);
    z-index:    9998;
}
.mob-nav-overlay.is-visible { display: block; }

/* Zavírací × v panelu */
.mob-nav-close {
    position:   absolute;
    top:        12px;
    right:      12px;
    width:      32px;
    height:     32px;
    background: none;
    border:     1px solid var(--border, #e2e8f0);
    border-radius: 50%;
    font-size:  1.1rem;
    line-height: 1;
    cursor:     pointer;
    color:      var(--text, #111);
    display:    flex;
    align-items: center;
    justify-content: center;
}

/* Položky v mobilním panelu */
.mob-nav-panel .nav-dropdown,
.mob-nav-panel .nav-item,
.mob-nav-panel .lang-switcher {
    width: 100%;
}
.mob-nav-panel .nav-dropdown-btn,
.mob-nav-panel .nav-link,
.mob-nav-panel .company-switcher-btn,
.mob-nav-panel .lang-btn {
    width:         100%;
    text-align:    left;
    padding:       13px 20px;
    border-radius: 0;
    font-size:     .9rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    box-sizing:    border-box;
    background:    none;
    cursor:        pointer;
    display:       block;
}
.mob-nav-panel .nav-dropdown-menu {
    display:        none;
    position:       static !important;
    opacity:        1 !important;
    pointer-events: auto !important;
    transform:      none !important;
    box-shadow:     none !important;
    border:         none !important;
    background:     var(--bg, #f8fafc) !important;
    min-width:      unset !important;
    padding:        0;
}
.mob-nav-panel .nav-dropdown.mob-open > .nav-dropdown-menu {
    display: block;
}
.mob-nav-panel .nav-dropdown-menu a,
.mob-nav-panel .company-switch-item {
    display:     block;
    padding:     10px 32px;
    font-size:   .85rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    width:       100%;
    text-align:  left;
    box-sizing:  border-box;
    background:  none;
    cursor:      pointer;
}
.mob-nav-panel .nav-dropdown-section {
    padding:        8px 32px 4px;
    font-size:      .7rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color:          var(--text-muted, #64748b);
}
.mob-nav-panel .lang-dropdown {
    display:        none;
    position:       static !important;
    opacity:        1 !important;
    pointer-events: auto !important;
    transform:      none !important;
    box-shadow:     none;
    border:         1px solid var(--border, #e2e8f0);
    margin:         4px 20px;
    border-radius:  6px;
    overflow:       hidden;
}
.mob-nav-panel .lang-switcher.mob-open .lang-dropdown { display: block; }
.mob-nav-panel .lang-btn {
    border-left:  none;
    border-right: none;
    border-top:   none;
}

/* Na desktopu panel skrytý, hamburger skrytý */
@media (min-width: 961px) {
    body.is-logged-in .nav-hamburger { display: none !important; }
    .mob-nav-panel  { display: none !important; }
    .mob-nav-overlay { display: none !important; }
}

/* Na mobilu hamburger viditelný, původní nav skrytá */
@media (max-width: 960px) {
    .nav-hamburger { display: flex !important; }
    .header-nav    { display: none !important; }
}

/* ── Oprava company switcher a lang v mob panelu ── */
.mob-nav-panel .company-switcher-btn {
    width:         100%;
    text-align:    left;
    padding:       13px 20px;
    border-radius: 0;
    font-size:     .9rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    box-sizing:    border-box;
    background:    none;
    cursor:        pointer;
    display:       block;
}
.mob-nav-panel .nav-item > .nav-dropdown-menu,
.mob-nav-panel .company-switcher-menu {
    display:        none;
    position:       static !important;
    opacity:        1 !important;
    pointer-events: auto !important;
    transform:      none !important;
    box-shadow:     none !important;
    border:         none !important;
    background:     var(--bg, #f8fafc) !important;
    min-width:      unset !important;
    padding:        0;
}
.mob-nav-panel .nav-item.mob-open > .nav-dropdown-menu,
.mob-nav-panel .nav-item.mob-open > .company-switcher-menu {
    display: block;
}
/* Přidat firmu odkaz uvnitř company menu */
.mob-nav-panel .company-switcher-menu a {
    display:     block;
    padding:     10px 32px;
    font-size:   .85rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    color:       var(--primary, #1a56db);
}

/* ============================================================
   MOBILNÍ RESPONSIVITA – globální opravy
   @media max-width: 640px
   ============================================================ */

@media (max-width: 640px) {

    /* ── Kontejner – menší padding ── */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* ── Page header – stack vertikálně ── */
    .page-header {
        flex-direction: column;
        align-items:    flex-start;
        gap:            10px;
    }
    .page-header > div:last-child {
        width:      100%;
        flex-wrap:  wrap;
    }

    /* ── Toolbar s tlačítky (Seznam/Kanban/Kategorie/+) ──
       flex-wrap + overflow-x scrollable jako fallback ── */
    .page-header [style*="display:flex"][style*="gap:.5rem"] {
        flex-wrap:   wrap;
        width:       100%;
        overflow-x:  auto;
    }

    /* ── Tabulka – skrytí méně důležitých sloupců ── */

    /* Todos: skryjeme Kategorii a Přiřazeno na mobilu */
    .data-table th:nth-child(5),
    .data-table td:nth-child(5),
    .data-table th:nth-child(6),
    .data-table td:nth-child(6) {
        display: none;
    }

    /* Faktury: skryjeme Datum vystavení a Forma úhrady */
    .inv-table th:nth-child(3),
    .inv-table td:nth-child(3),
    .inv-table th:nth-child(6),
    .inv-table td:nth-child(6) {
        display: none;
    }

    /* ── Obecné tabulky – horizontální scroll ── */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table {
        min-width: 480px;
    }

    /* ── Filtry – scrollovatelné ── */
    .todo-filters,
    [style*="flex-wrap:wrap"][style*="gap:.5rem"] {
        overflow-x: auto;
        flex-wrap:  nowrap;
        padding-bottom: 4px;
    }

    /* ── Formuláře – plná šířka ── */
    .form-row {
        flex-direction: column;
    }
    .form-group {
        min-width: 0;
    }

    /* ── Karty – menší padding ── */
    .inv-card,
    .section-card,
    .dash-card {
        padding: 12px;
        margin: 0 2px; /* malý okraj aby zaoblení bylo viditelné */
    }
    .dash-wrap {
        padding: 1rem 0 4rem; /* nulový horizontální padding - container ho řeší */
    }
    .dash-grid2,
    .dash-grid3,
    .dash-grid4 {
        padding: 0 2px; /* malý okraj pro zaoblení */
    }

    /* ── Dashboard – metriky pod sebou ── */
    .dash-grid2 {
        grid-template-columns: 1fr;
    }
    .dash-metric {
        min-width: 0;
    }

    /* ── Bulk bar – menší ── */
    #bulk-bar {
        padding: .4rem .6rem;
        font-size: .72rem;
    }
    .bulk-btn {
        padding: .2rem .4rem;
        font-size: .7rem;
    }

    /* ── Stránkování ── */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* ── Detailní stránky – two-col → one-col ── */
    .inv-detail-grid,
    .form-grid-2col {
        grid-template-columns: 1fr !important;
    }

    /* ── Modaly – full width ── */
    .modal-box,
    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 10px auto;
    }
}

/* ── Extra malé telefony (< 400px) ── */
@media (max-width: 400px) {
    .page-title {
        font-size: 1.2rem;
    }
    .btn-sm {
        padding: .25rem .5rem;
        font-size: .75rem;
    }
}

/* ── Utility třídy pro mobilní zobrazení ── */
@media (max-width: 640px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }
}

/* ============================================================
   TODOS – mobilní opravy
   ============================================================ */

/* Kanban – na mobilu vertikálně místo grid */
@media (max-width: 640px) {
    .kanban-board {
        grid-template-columns: 1fr !important;
    }
    .kanban-col {
        min-height: auto !important;
    }

    /* Tabulka todos – skrytí sloupců */
    .hide-mobile-sm {
        display: none !important;
    }

    /* Akce sloupec – menší tlačítka */
    .data-table .btn-sm {
        padding: .2rem .4rem;
        font-size: .72rem;
    }

    /* Toolbar – řádkový wrap, ne oříznutí */
    .page-header > div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: .4rem;
        width: 100%;
    }

    /* Kontejner nepřetéká - ale NEBLOKUJEME overflow na body/main
       aby fungovaly posuvníky uvnitř elementů */
    .container {
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* ============================================================
   KANBAN – scroll wrapper a responzivní grid
   ============================================================ */

.kanban-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 1rem;
    align-items: start;
    min-width: 0;
}

/* Na mobilu – jeden sloupec pod sebou, bez min-width */
@media (max-width: 640px) {
    .kanban-board {
        grid-template-columns: 1fr !important;
        min-width: 0 !important;
    }
    .kanban-scroll-wrap {
        overflow-x: visible;
    }
}

/* ============================================================
   BOTTOM NAVIGATION BAR – mobilní navigace
   Zobrazí se pouze na mobilech (max-width: 960px)
   ============================================================ */

/* ── Bottom nav – desktop: skryto ── */
@media (min-width: 961px) {
    .bottom-nav { display: none !important; }
}

@media (max-width: 960px) {

    /* Spodní prostor aby obsah nebyl za lištou */
    .site-main   { padding-bottom: 72px !important; }
    .site-footer { margin-bottom:  72px !important; }

    /* Hamburger skrýt jen pro přihlášené – nepřihlášení ho potřebují */
    body.is-logged-in #navHamburger,
    body.is-logged-in .nav-hamburger {
        display: none !important;
    }

    /* Bottom nav – zajistíme správný layout */
    .bottom-nav {
        flex-direction: row !important;
        align-items:    center !important;
        height:         60px !important;
        /* iPhone safe area */
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        height:         calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .bn-item {
        flex:            1;
        display:         flex;
        flex-direction:  column;
        align-items:     center;
        justify-content: center;
        gap:             2px;
        color:           #94a3b8;
        text-decoration: none;
        background:      none;
        border:          none;
        cursor:          pointer;
        padding:         6px 4px 4px;
        transition:      color .15s;
        font-family:     inherit;
        min-width:       0;
    }

    .bn-item:hover,
    .bn-item.bn-active {
        color: #1a56db;
    }

    .bn-icon {
        display:         flex;
        align-items:     center;
        justify-content: center;
        width:           28px;
        height:          28px;
    }

    .bn-label {
        font-size:   .65rem;
        font-weight: 500;
        line-height: 1;
        white-space: nowrap;
    }

    /* Centrální tlačítko + */
    .bn-center {
        color: #1a56db;
    }
    .bn-center-icon {
        width:         40px;
        height:        40px;
        background:    #1a56db;
        border-radius: 50%;
        color:         #fff !important;
        margin-top:    -14px;
        box-shadow:    0 4px 12px rgba(26,86,219,.4);
    }
    .bn-center:hover .bn-center-icon {
        background: #1347c0;
    }

    /* Badge na úkolech */
    .bn-badge {
        position:      absolute;
        top:           -4px;
        right:         -6px;
        background:    #dc2626;
        color:         #fff;
        font-size:     .6rem;
        font-weight:   700;
        min-width:     16px;
        height:        16px;
        border-radius: 8px;
        display:       flex;
        align-items:   center;
        justify-content: center;
        padding:       0 3px;
        line-height:   1;
    }

    /* Aktivní stav – podtržení */
    .bn-item.bn-active .bn-icon svg {
        stroke: #1a56db;
    }
    .bn-item.bn-active .bn-label {
        color: #1a56db;
    }
}

/* ============================================================
   DOKLADY – mobilní responsivita
   ============================================================ */

@media (max-width: 640px) {

    /* ── Skrytí sloupců v tabulkách ── */
    .hide-mobile    { display: none !important; }
    .hide-mobile-sm { display: none !important; }

    /* ── Tabulka dokladů – scrollovatelná ── */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
    }
    .data-table {
        min-width: 420px;
    }

    /* ── Toolbar faktur – skládání ── */
    .list-toolbar {
        flex-direction: column !important;
        align-items:    stretch !important;
        gap:            8px !important;
    }
    .list-toolbar .search-form {
        width: 100%;
    }
    .list-toolbar .search-form input[name="q"] {
        flex: 1;
        min-width: 0;
    }

    /* ── Statistiky (pills nad tabulkou) ── */
    .inv-stats {
        overflow-x:  auto;
        flex-wrap:   nowrap !important;
        padding-bottom: 4px;
        gap: 6px;
    }
    .stat-pill {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* ── Detail faktury ── */
    .detail-layout {
        grid-template-columns: 1fr !important;
    }
    .detail-sidebar {
        position: static !important;
        display:  grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }
    .detail-status-block {
        grid-column: 1 / -1;
    }
    .pdf-preview-wrap {
        min-height: 400px !important;
    }
    .pdf-iframe {
        height: 450px !important;
    }

    /* ── Formulář faktur – 1 sloupec ── */
    .inv-form-grid {
        grid-template-columns: 1fr !important;
    }
    .inv-section-header {
        flex-direction: column !important;
        align-items:    flex-start !important;
        gap: 6px;
    }

    /* ── Akční tlačítka v řádcích tabulky ── */
    .inv-actions {
        white-space: nowrap;
    }
    .inv-actions a,
    .inv-actions button {
        padding: 4px 8px !important;
        font-size: .75rem !important;
    }

    /* ── Page header – tlačítko na nový řádek ── */
    .page-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .page-header .btn {
        width: 100%;
        text-align: center;
    }
}

/* Střední mobil (tablet) */
@media (max-width: 900px) and (min-width: 641px) {
    .hide-mobile { display: none !important; }
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ── hide-mobile na table cells – silný selektor ── */
@media (max-width: 640px) {
    table th.hide-mobile,
    table td.hide-mobile,
    table th.hide-mobile-sm,
    table td.hide-mobile-sm {
        display: none !important;
    }
}
@media (max-width: 900px) {
    table th.hide-mobile,
    table td.hide-mobile {
        display: none !important;
    }
}

/* ── Garantovaný horizontální scroll tabulek ──────────────── */
.table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}
.table-wrap table,
.table-wrap .data-table {
    /* Tabulka se nesmí smrštit – jinak scrollbar neexistuje */
    width: max-content;
    min-width: 100%;
}

/* ============================================================
   KRITICKÁ OPRAVA – horizontální scroll tabulek na mobilu
   Problém: tabulka roztahuje stránku místo scrollování
   ============================================================ */

/* Celá stránka nesmí být širší než viewport */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Kontejner musí mít omezenou šířku */
.container {
    max-width: 100%;
    box-sizing: border-box;
}

/* .list-card a .inv-section musí mít omezenou šířku */
.list-card,
.inv-section,
.section-card {
    max-width: 100%;
    box-sizing: border-box;
}

/* Scroll wrapper - kritické nastavení */
@media (max-width: 960px) {
    .table-wrap {
        display: block;
        width: 100%;
        overflow-x: auto !important;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        /* Scrollbar vždy viditelný na touch zařízeních */
        scrollbar-width: thin;
    }

    /* Tabulka uvnitř má pevnou min-width = scrollbar se objeví */
    .table-wrap > table,
    .table-wrap > .data-table {
        min-width: 500px !important;
        width: max-content;
        max-width: none;
    }

    /* Cashflow chart - scrollovatelný */
    .cashflow-chart {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Dashboard bar rows - nepřetékají */
    .dash-bar-row {
        min-width: 0;
    }
    .dash-bar-label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 40%;
    }
    .dash-bar-val {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ── Dashboard – activity a bar row mobilní opravy ── */
@media (max-width: 640px) {
    /* Activity row – částka se nevejde vedle titulku */
    .dash-activity-row {
        flex-wrap: nowrap;
        align-items: center;
    }
    .dash-act-body {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    .dash-act-title {
        font-size: .78rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .dash-act-amt {
        font-size: .78rem;
        flex-shrink: 0;
        margin-left: auto;
        padding-left: 4px;
    }

    /* Bar row – kratší label */
    .dash-bar-row {
        gap: 6px;
    }
    .dash-bar-label {
        width: 90px !important;
        font-size: .72rem;
        flex-shrink: 0;
    }
    .dash-bar-val {
        width: 28px !important;
        font-size: .72rem;
    }
}

/* ── Profil – sekce Předplatné na mobilu ── */
@media (max-width: 640px) {
    .profile-wrap {
        padding: 0 2px;
    }
    .profile-wrap > section,
    .profile-wrap > div {
        border-radius: var(--radius);
    }
}
