/* ===== Inter Variable Font (self-hosted) ===== */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-roman-var.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-italic-var.woff2') format('woff2');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/**
 * Deadline Tracker - Custom Styles
 * Nette 3.3 + PHP 8.5 + Latte 3.x
 * Verze: 5.0 - Sky Blue redesign
 *
 * =============================================================================
 * COMPONENT MAP / TABLE OF CONTENTS
 * =============================================================================
 *
 * POZOR: Nektere sablony (.latte) obsahuji vlastni <style> bloky.
 * Viz sekci "STYLY V SABLONACH" na konci teto mapy.
 *
 * --- ZAKLAD ---
 *   THEME VARIABLES .............. :root tokens (barvy, typografie, zaobleni, spacing)
 *   ZAKLADNI LAYOUT .............. body, .app-layout, .main-content-wrapper
 *   SIDEBAR ...................... .sidebar, .sidebar-nav, .sidebar-link, .company-badge
 *   HLAVNI OBSAH ................. .main-content
 *   SIDEBAR COLLAPSE ............. desktop toggle, .sidebar-collapsed stavy
 *
 * --- DASHBOARD ---
 *   DASHBOARD - Statistiky ....... .stat-card, .stat-number, .stat-icon
 *   DASHBOARD - Panely ........... .dashboard-panel, .dashboard-card, .deadline-mini-*
 *
 * --- SDILENE KOMPONENTY ---
 *   PAGE HEADER .................. .page-header-modern, .page-header-stats
 *   PREPINAC ZOBRAZENI ........... .view-toggle, .view-toggle-btn
 *   FILTRACNI PANEL .............. .filter-bar, .filter-tag, .filter-count
 *   TABULKA - Seznam items ....... .history-table (sdilena tabulka pro vsechny seznamy)
 *   KARTOVY GRID ................. .items-grid, .items-card
 *   BREADCRUMB ................... .breadcrumb-modern
 *   FORMULARE .................... .form-card, input/select/textarea styly
 *   ALERT / FLASH MESSAGES ....... .alert-*, flash message styly
 *   RESPONZIVITA ................. zakladni media queries pro layout
 *
 * --- AUTENTIZACE ---
 *   LOGIN CONTAINER .............. .login-container, .login-card, .login-form
 *   FORM CARD - VARIANTA B ....... .form-card-b (registrace, obnova hesla)
 *
 * --- HLIDACI (TEAL THEME) ---
 *   WATCHER STYLES ............... .watcher-card, .watcher-header, teal utilitky
 *   WATCHER CARD - Varianta B .... .watcher-card-b (seznam hlidacu)
 *   WATCHER DETAIL ............... .info-card-inverted, .info-row-inverted
 *   BAREVNE ODKAZY ............... .text-teal, .link-teal, .link-purple, .btn-teal
 *   MODAL DEAKTIVACE ............. .modal-deactivate, potvrzovaci dialog
 *   FLATPICKR CUSTOMIZACE ........ teal theme pro datepicker
 *   WATCHER DETAIL - INFO KARTA V3 .detail-info-card, .detail-info-row
 *
 * --- TERMINY ---
 *   HISTORIE TABULKA ............. .history-table rozsireni pro deadline radky
 *   ZVYRAZNENI AKTIVNIHO RADKU ... .highlight-row, .claim-highlight
 *   DEADLINE BADGE STYLY ......... .badge-deadline-* (none/pending/confirmed/warning/danger)
 *   DEADLINE TABLE STYLES ........ .deadline-item, btn-action
 *   OVERDUE BADGE ................ .overdue-badge (sdileny indikator po terminu)
 *
 * --- SPECIALNI FORMULARE ---
 *   TEAL FORMULAR + HELP CARD .... .teal-form-*, .help-card
 *   STATUS CHANGE SECTION ........ .status-change-section (v modalech)
 *   AKTIVACNI FORMULAR ........... .activate-card, .activate-label
 *
 * --- KARTY ---
 *   ITEM CARD VARIANTA C ......... .item-card-c (horni barevny pruh)
 *   ITEM LINK CARD - C2 .......... .item-link-card (bila + teal ramecek)
 *   ITEM INFO CARD - INVERTED .... .item-info-card (bile pozadi + fialovy ramecek)
 *   WATCHER STATUS BADGE ......... .watcher-status-badge (tabulka hlidacu)
 *
 * --- KALENDAR ---
 *   KALENDAR ..................... .calendar-container, .calendar-day, .deadline-dot
 *
 * --- PRILOHY ---
 *   PRILOHY / FOTOGRAFIE ......... .photo-grid, .photo-card, .photo-upload-slot
 *
 * --- TLACITKA ---
 *   BUTTON SYSTEM ................ --btn-* variables, .btn-primary/teal/success/danger
 *   BUTTON SIZE OVERRIDES ........ .btn-sm, .btn-lg pro filled buttons
 *   PRIVATE BADGE ................ .private-badge (global)
 *   TYPE FILTER ROW .............. .type-filter-row, .type-filter-btn
 *
 * --- NAPOVEDA ---
 *   HELP SIDEBAR ................. .help-sidebar (dashboard style)
 *   WATCHER EDIT SIDEBAR ......... .sidebar-info-panel
 *
 * --- DARK MODE ---
 *   DARK MODE .................... [data-bs-theme="dark"] kompletni override (~1400 radku)
 *
 * --- SKUPINY ---
 *   MOJE SKUPINY - cards ......... .group-card, .group-stats
 *   MOJE SKUPINY - summary ....... .group-summary-box
 *   FILTR TYPU ITEMU ............. .item-type-filter (pill buttony)
 *   MD-CARD KOMPONENT ............ .md-card sdilene styly karet terminu
 *   STATISTICS PAGE .............. Chart.js grid layout
 *   SECTION HEADERS (shared) ..... .my-section-header, .watcher-group-header
 *   WORKER ADD BUTTON ............ .btn-add-worker
 *   WORKER GROUPS ................ .worker-group, .worker-item
 *   WORKER PICKER MODAL .......... .worker-picker-modal
 *   MANAGER GROUP DETAIL ......... .mgr-detail-header, .manager-filter-*
 *
 * =============================================================================
 * STYLY V SABLONACH (embedded <style> v .latte souborech)
 * =============================================================================
 *
 * Nasledujici sablony obsahuji vlastni <style> bloky s komponentami,
 * ktere NEJSOU v tomto souboru. Pri redesignu je nutne zkontrolovat i je.
 *
 *   Dashboard/default.latte ...... .users-grid, .user-check, .notification-settings-*
 *   Deadline/list.latte .......... .view-*, .slim-row, .grouped-view, .flat-table,
 *                                  .bulk-*, .note-row (6 zobrazeni: flat/grouped/cards/
 *                                  slim/grouped-slim/calendar)
 *   Watcher/detail.latte ........ .detail-*, .note-*, .activate-* (specificke pro detail)
 *   Watcher/list.latte .......... .filter-section, .users-grid, inline tabulka
 *   Item/detail.latte ........... .item-detail-*, .tab-*, prilohy layout
 *   Item/list.latte ............. .items-grid override, .slim-card, inline filtry
 *   ManagerGroup/detail.latte ... .mgr-*, .note-row, .sortable (skupinovy detail)
 *   Calendar/default.latte ...... .calendar-legend, fullcalendar override
 *   Company/list.latte .......... .users-grid, .user-check (duplicita s Dashboard)
 *   User/list.latte ............. .users-grid, .user-check (duplicita s Dashboard)
 *   UserGroup/list.latte ........ .users-grid, .user-check (duplicita s Dashboard)
 *   Notification/settings.latte . .notification-settings-*, .users-grid
 *   ItemType/list.latte ......... .admin-table-card, inline tabulka
 *   ItemStatus/list.latte ....... .admin-table-card, inline tabulka
 *   ItemLocation/list.latte ..... .admin-table-card, inline tabulka
 *   Audit/list.latte ............ .admin-table-card, .json-diff
 *   ManagerGroup/list.latte ..... inline card styly
 *
 *   Tisk (standalone styly, nesdili tento soubor):
 *   Deadline/print.latte, Item/print.latte, Watcher/print.latte
 *
 * =============================================================================
 */


/* =============================================
   THEME VARIABLES — light / dark mode
   Přidat [data-bs-theme="dark"] na <html> tag
   ============================================= */

:root {
    /* Pozadí stránky */
    --c-bg:       #f0f2f5;
    /* Povrchy (karty, panely, sidebar) */
    --c-surface:  #ffffff;
    --c-surface2: #f8fafc;
    --c-surface3: #f1f5f9;
    /* Ohraničení */
    --c-border:   #e5e7eb;
    --c-border2:  #e2e8f0;
    --c-border3:  #cbd5e1;
    /* Texty */
    --c-text:     #1e293b;
    --c-text2:    #334155;
    --c-text3:    #475569;
    --c-text4:    #64748b;
    --c-text5:    #94a3b8;
    /* Akcentove barvy */
    --c-primary:  #3b82f6;
    --c-primary-hover: #2563eb;
    --c-primary-light: #60a5fa;
    --c-teal:     #14b8a6;
    --c-teal-dark: #0d9488;
    /* Vstupy */
    --c-input-bg:  #ffffff;
    --c-input-border: #e2e8f0;
    /* Stínování */
    --c-shadow:   rgba(0,0,0,0.07);
    --c-shadow-lg:rgba(0,0,0,0.12);

    /* Typografie — 8 stupnu, pomer ~1.2 (Minor Third) */
    --fs-2xs:  0.65rem;   /* 10.4px — nav section titles, micro labels */
    --fs-xs:   0.75rem;   /* 12px   — meta, timestamps, badge text */
    --fs-sm:   0.85rem;   /* 13.6px — tabulky, sekundarni text, labels */
    --fs-base: 0.875rem;  /* 14px   — body text, form inputs */
    --fs-md:   1rem;      /* 16px   — card title, nav items */
    --fs-lg:   1.25rem;   /* 20px   — section headers, modal titles */
    --fs-xl:   1.5rem;    /* 24px   — section headers, modal titles */
    --fs-xxl:  1.75rem;   /* 28px   — page titles, large headings */
    --fs-2xl:  2rem;      /* 32px   — stat cisla, velke ikony */
    --fs-3xl:  2.5rem;    /* 40px   — countdown, velke cisla */

    /* Zaobleni — 7 stupnu, ostrejsi styl */
    --radius-xs:   4px;   /* scrollbar, micro prvky */
    --radius-sm:   6px;   /* badges, btn-action, tagy */
    --radius-md:   8px;   /* inputy, toggles, dropdown */
    --radius-base: 10px;  /* karty, alerty, popovers */
    --radius-lg:   12px;  /* panely, containery */
    --radius-xl:   16px;  /* modaly, velke sekce */
    --radius-full: 50%;   /* avatar, kruh, status dot */

    /* Spacing — 6 stupnu */
    --sp-xs:   4px;
    --sp-sm:   8px;
    --sp-md:   12px;
    --sp-base: 16px;
    --sp-lg:   20px;
    --sp-xl:   24px;

    /* Section header — sdilene hodnoty */
    --section-header-py: 0.5rem;
    --section-header-px: 1.25rem;

    /* Button system — sdilene hodnoty */
    --btn-radius: var(--radius-md);        /* 8px — vsechny textove buttony */
    --btn-radius-sm: var(--radius-sm);     /* 6px — male a action buttony */
    --btn-font-weight: 500;
    --btn-transition: all 0.2s ease;

    --btn-padding-sm: 6px 14px;
    --btn-font-size-sm: var(--fs-sm);      /* 13.6px */

    --btn-padding-md: 8px 20px;
    --btn-font-size-md: var(--fs-base);    /* 14px */

    --btn-padding-lg: 10px 28px;
    --btn-font-size-lg: var(--fs-md);      /* 16px */
    --btn-font-weight-lg: 600;

    --btn-shadow-blue: 0 4px 12px rgba(59, 130, 246, 0.3);
    --btn-shadow-blue-hover: 0 6px 16px rgba(59, 130, 246, 0.4);
    --btn-shadow-teal: 0 4px 12px rgba(20, 184, 166, 0.3);
    --btn-shadow-teal-hover: 0 6px 16px rgba(20, 184, 166, 0.4);
    --btn-shadow-green: 0 4px 12px rgba(16, 185, 129, 0.3);
    --btn-shadow-green-hover: 0 6px 16px rgba(16, 185, 129, 0.4);
    --btn-shadow-danger: 0 4px 12px rgba(239, 68, 68, 0.3);
    --btn-shadow-danger-hover: 0 6px 16px rgba(239, 68, 68, 0.4);

    /* Status / urgency colors — sdilene pro badges, days pills, status indicators */
    --status-danger-bg:    #fef2f2;
    --status-danger-text:  #dc2626;
    --status-danger-border: #fca5a5;
    --status-warning-bg:   #fff7ed;
    --status-warning-text: #ea580c;
    --status-warning-border: #fdba74;
    --status-caution-bg:   #fefce8;
    --status-caution-text: #ca8a04;
    --status-caution-border: #fde68a;
    --status-ok-bg:        #f0fdf4;
    --status-ok-text:      #16a34a;
    --status-ok-border:    #86efac;
    --status-pending-bg:   #f5f3ff;
    --status-pending-text: #7c3aed;
    --status-pending-border: #c4b5fd;
    --status-done-bg:      #f0fdf4;
    --status-done-text:    #10b981;
    --status-done-border:  #6ee7b7;
    --status-muted-bg:     #f1f5f9;
    --status-muted-text:   #64748b;
    --status-muted-border: #cbd5e1;
}

/* =============================================
   ZÁKLADNÍ LAYOUT
   ============================================= */

body {
    background-color: var(--c-bg);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevence horizontálního scrollu na mobilu */
}

/* Globalni sjednoceni font-size formularu (Bootstrap default 1rem -> --fs-base) */
.form-control,
.form-select {
    font-size: var(--fs-base);
}
.form-label {
    font-size: var(--fs-sm);
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* =============================================
   SIDEBAR
   ============================================= */

.sidebar {
    width: 240px;
    background: var(--c-surface);
    border-right: 1px solid var(--c-border);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    overflow: hidden;
    transition: width 0.25s ease, padding 0.25s ease;
}
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.sidebar .brand-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}
.sidebar .brand-link:hover { text-decoration: none; color: inherit; opacity: 0.85; }
.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem;
    margin-bottom: 1.25rem;
}

.sidebar .brand-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    border-radius: var(--radius-base);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--fs-lg);
}

.sidebar .brand-name {
    color: var(--c-text);
    font-weight: 700;
    font-size: var(--fs-base);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s;
}

.sidebar .nav-section {
    margin-bottom: 1rem;
}

.sidebar .nav-section-title {
    color: var(--c-text5);
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

/* Zabalovaci sekce */
.nav-section-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.nav-section-toggle:hover {
    color: var(--c-text3);
}
.nav-section-arrow {
    font-size: 0.5rem;
    transition: transform 0.2s;
}
.nav-section-collapsible .nav-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.nav-section-collapsible.open .nav-section-body {
    max-height: 300px;
}
.nav-section-collapsible.open .nav-section-arrow {
    transform: rotate(180deg);
}

.sidebar .nav-item {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--c-text4);
    text-decoration: none;
    margin-bottom: 0.15rem;
    transition: all 0.2s;
    font-weight: 500;
    font-size: var(--fs-sm);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar .nav-item:hover {
    background: var(--c-surface3);
    color: var(--c-primary);
}

.sidebar .nav-item.active {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.sidebar .nav-item i {
    width: 20px;
    min-width: 20px;
    margin-right: 0.65rem;
    font-size: var(--fs-base);
    text-align: center;
}

.sidebar .nav-item .badge {
    margin-left: auto;
    font-size: var(--fs-xs);
    padding: 0.25rem 0.5rem;
    background: #dbeafe;
    color: var(--c-primary);
}

.sidebar .nav-item.active .badge {
    background: rgba(255,255,255,0.25);
    color: white;
}

/* === IMPERSONATION BAR === */
.impersonation-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px;
    margin: 0 4px 6px;
    background: var(--status-warning-bg);
    border: 1px solid var(--status-warning-border);
    border-radius: var(--radius-md);
    font-size: var(--fs-2xs);
    color: var(--status-warning-text);
}
.impersonation-info {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 4px;
}
.impersonation-info i { font-size: var(--fs-xs); }
.impersonation-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.impersonation-back {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--status-warning-text);
    color: white;
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.impersonation-back:hover { opacity: 0.85; text-decoration: none; color: white; }
[data-bs-theme="dark"] .impersonation-bar { background: rgba(217,119,6,0.15); border-color: rgba(217,119,6,0.3); color: #fbbf24; }
[data-bs-theme="dark"] .impersonation-back { background: #d97706; }

/* User settings button */
.user-settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--c-text5);
    cursor: pointer;
    transition: all 0.15s;
    font-size: var(--fs-sm);
}
.user-settings-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }

.sidebar-settings-menu { font-size: var(--fs-sm) !important; }
.sidebar-settings-menu .dropdown-item { font-size: var(--fs-sm); padding: 6px 16px; }
.sidebar-settings-menu .dropdown-item i { color: var(--c-text4); width: 18px; text-align: center; }
.sidebar-settings-menu .dropdown-header { font-size: var(--fs-xs); color: var(--c-text5); padding: 4px 16px; font-weight: 600; }
.sidebar-settings-menu .dropdown-divider { margin: 4px 0; }

.theme-switcher {
    display: flex;
    gap: 2px;
    background: var(--c-surface2);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.theme-opt {
    flex: 1;
    background: none;
    border: none;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: var(--fs-xs);
    color: var(--c-text5);
    cursor: pointer;
    transition: all 0.15s;
}
.theme-opt:hover { color: var(--c-text); }
.theme-opt.active { background: var(--c-surface); color: var(--c-text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
[data-bs-theme="dark"] .theme-opt.active { background: var(--c-surface3); }

/* ========== NOVINKY ========== */
.news-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    position: relative;
    transition: border-color 0.15s;
}
.news-item:hover { border-color: var(--c-primary); }
.news-unread { border-left: 3px solid var(--c-primary); }
.news-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--blue-light, #eff6ff);
    color: var(--c-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--fs-sm);
}
.news-content { flex: 1; min-width: 0; }
.news-title { font-size: var(--fs-sm); font-weight: 700; margin-bottom: 2px; }
.news-desc { font-size: var(--fs-sm); color: var(--c-text4); margin: 0; line-height: 1.5; }
.news-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    background: var(--c-primary);
    color: #fff;
    font-size: var(--fs-2xs);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
}
/* News V2 — dva sloupce */
.news-item-v2 {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--c-surface3);
}
.news-item-v2:last-child { border-bottom: none; }
.news-num {
    font-size: var(--fs-2xs);
    color: var(--c-text5);
    font-weight: 600;
    min-width: 24px;
    text-align: right;
    padding-top: 2px;
}
.news-icon-v2 {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--c-primary-bg, #eff6ff);
    color: var(--c-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--fs-xs);
}
.news-content-v2 { flex: 1; min-width: 0; }
.news-title-v2 { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text); line-height: 1.3; }
.news-desc-v2 { font-size: var(--fs-xs); color: var(--c-text4); margin-top: 2px; line-height: 1.4; }
.news-unread .news-title-v2 { color: var(--c-primary); }
.news-unread .news-icon-v2 { background: var(--c-primary); color: #fff; }
.news-read { opacity: 0.7; }
.news-read:hover { opacity: 1; }

.nav-badge {
    background: var(--c-primary);
    color: #fff;
    font-size: var(--fs-2xs);
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 100px;
    margin-left: 4px;
}
[data-bs-theme="dark"] .news-icon { background: rgba(59,130,246,0.1); }
[data-bs-theme="dark"] .news-unread { border-left-color: var(--c-primary); }

.sidebar .user-section {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--c-border);
    overflow: visible;
    position: relative;
}
.sidebar-dropup-menu {
    max-height: 280px;
    overflow-y: auto;
    position: fixed !important;
    bottom: 65px !important;
    left: 1.25rem !important;
    top: auto !important;
    transform: none !important;
    width: 210px;
    z-index: 1050;
}

.sidebar .user-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem;
    background: var(--c-surface2);
    border-radius: var(--radius-base);
    overflow: hidden;
}

.sidebar .user-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--fs-sm);
}

.sidebar .user-info {
    flex: 1;
}

.sidebar .user-name {
    color: var(--c-text);
    font-weight: 600;
    font-size: var(--fs-sm);
}

.sidebar .user-role {
    color: var(--c-text5);
    font-size: var(--fs-xs);
}

.sidebar .logout-btn {
    color: var(--c-text5);
    transition: color 0.2s;
}

.sidebar .logout-btn:hover {
    color: var(--status-danger-text);
}

/* =============================================
   HLAVNÍ OBSAH
   ============================================= */

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 2rem;
    background: var(--c-surface2);
    min-height: 100vh;
    overflow-x: hidden;
    transition: margin-left 0.25s ease;
}

.main-content.no-sidebar {
    margin-left: 0;
}

/* =============================================
   SIDEBAR COLLAPSE (desktop toggle)
   ============================================= */

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-xs);
    background: var(--c-surface);
    color: var(--c-text4);
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    transition: all 0.2s;
    font-size: var(--fs-2xs);
}
.sidebar-collapse-btn:hover {
    background: var(--c-surface3);
    color: var(--c-text2);
}
[data-bs-theme="dark"] .sidebar-collapse-btn {
    border-color: rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--c-text5);
}
[data-bs-theme="dark"] .sidebar-collapse-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
}

/* Collapsed sidebar */
.sidebar.collapsed {
    width: 56px;
    padding: 1.25rem 0.6rem;
}
.sidebar.collapsed .brand-name {
    opacity: 0;
    width: 0;
    overflow: hidden;
}
.sidebar.collapsed .brand {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.sidebar.collapsed .sidebar-collapse-btn {
    margin-left: 0;
}
.sidebar.collapsed .nav-section-title {
    font-size: 0;
    padding: 0;
    margin-bottom: 0.4rem;
    margin-top: 0.4rem;
    height: 1px;
    overflow: hidden;
    background: var(--c-border);
}
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.55rem;
}
.sidebar.collapsed .nav-item i {
    margin-right: 0;
}
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-item .nav-label {
    display: none;
}
.sidebar.collapsed .nav-item .badge {
    display: none;
}
.sidebar.collapsed .user-card {
    flex-direction: column;
    padding: 0.4rem;
    gap: 0;
}
.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn,
.sidebar.collapsed .theme-toggle {
    display: none;
}
.sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}
/* Collapsed nav-section-collapsible: hide body, show only icons */
.sidebar.collapsed .nav-section-collapsible .nav-section-body {
    max-height: none;
}
.sidebar.collapsed .nav-section-collapsible .nav-section-arrow {
    display: none;
}
.app-layout.sidebar-is-collapsed .main-content {
    margin-left: 56px;
}

.page-title {
    font-size: var(--fs-xxl);
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 1.5rem;
}

/* =============================================
   DASHBOARD — Hub / Rozcestník
   ============================================= */

.dash-hub {
    max-width: 900px;
    margin: 0 auto;
}
.dash-hub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.dash-hub-header h1 {
    font-size: var(--fs-xl);
    font-weight: 700;
    margin: 0;
}
.dash-hub-nav {
    display: flex;
    gap: 8px;
}

/* Onboarding panel */
.dash-onboarding {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 1.5rem;
    color: #fff;
}
.dash-onboarding-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.dash-onboarding-header > i {
    font-size: 2rem;
    opacity: 0.8;
}
.dash-onboarding-header h3 {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin: 0;
}
.dash-onboarding-header p {
    font-size: var(--fs-sm);
    margin: 2px 0 0;
    opacity: 0.8;
}
.dash-onboarding-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.dash-onboarding-step {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    text-decoration: none;
    color: #fff;
    transition: all 0.15s;
}
a.dash-onboarding-step:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}
.dash-onboarding-step-disabled {
    opacity: 0.5;
    cursor: default;
}
.dash-onboarding-num {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--fs-sm);
    flex-shrink: 0;
}
.dash-onboarding-step-content {
    flex: 1;
    min-width: 0;
}
.dash-onboarding-step-content strong {
    display: block;
    font-size: var(--fs-sm);
}
.dash-onboarding-step-content span {
    font-size: var(--fs-xs);
    opacity: 0.8;
}
.dash-onboarding-step > .fas.fa-chevron-right {
    opacity: 0.5;
    font-size: var(--fs-xs);
}
@media (max-width: 768px) {
    .dash-onboarding-steps { grid-template-columns: 1fr; }
}
[data-bs-theme="dark"] .dash-onboarding {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
}

/* Sekce */
.dash-section {
    margin-bottom: 2rem;
}
.dash-section-title {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-text4);
    margin-bottom: 0.75rem;
}

/* Tile grid */
.dash-tiles {
    display: grid;
    gap: 1rem;
}
.dash-tiles-4 { grid-template-columns: repeat(4, 1fr); }
.dash-tiles-3 { grid-template-columns: repeat(3, 1fr); }
.dash-tiles-auto { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

/* Tile */
.dash-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    text-decoration: none;
    color: var(--c-text);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    min-height: 130px;
}
.dash-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    text-decoration: none;
    color: var(--c-text);
}
.dash-tile-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}
.dash-tile-num {
    font-size: var(--fs-2xl);
    font-weight: 700;
    line-height: 1;
}
.dash-tile-label {
    font-size: var(--fs-xs);
    color: var(--c-text4);
    margin-top: 0.25rem;
    text-align: center;
}

/* Badge problémů v rohu tile */
.dash-tile-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}
.dash-tile-badge-danger {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}

/* Stavové varianty */
.dash-tile-danger {
    border-color: var(--status-danger-text);
    background: var(--status-danger-bg);
}
.dash-tile-danger .dash-tile-icon,
.dash-tile-danger .dash-tile-num { color: var(--status-danger-text); }

.dash-tile-warning {
    border-color: var(--status-warning-text);
    background: var(--status-warning-bg);
}
.dash-tile-warning .dash-tile-icon,
.dash-tile-warning .dash-tile-num { color: var(--status-warning-text); }

.dash-tile-muted {
    border-color: var(--c-border2);
    background: var(--c-surface2);
}
.dash-tile-muted .dash-tile-icon,
.dash-tile-muted .dash-tile-num { color: var(--c-text4); }

.dash-tile-ok .dash-tile-icon { color: var(--status-ok-text); }
.dash-tile-ok .dash-tile-num { color: var(--status-ok-text); }

.dash-tile-blue .dash-tile-icon,
.dash-tile-blue .dash-tile-num { color: var(--c-primary); }
.dash-tile-blue { border-color: rgba(59,130,246,0.2); background: rgba(59,130,246,0.04); }

.dash-tile-teal .dash-tile-icon,
.dash-tile-teal .dash-tile-num { color: var(--c-teal); }
.dash-tile-teal { border-color: rgba(20,184,166,0.2); background: rgba(20,184,166,0.04); }

.dash-tile-purple .dash-tile-icon,
.dash-tile-purple .dash-tile-num { color: #8b5cf6; }
.dash-tile-purple { border-color: rgba(139,92,246,0.2); background: rgba(139,92,246,0.04); }

.dash-tile-entity {
    min-height: 120px;
}

/* Nejbližší termín — highlight bar */
.dash-next-deadline {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-left: 4px solid var(--c-primary);
    border-radius: var(--radius-md);
}
a.dash-next-deadline {
    text-decoration: none;
    color: inherit;
}
a.dash-next-deadline:hover {
    text-decoration: none;
    color: inherit;
    border-color: var(--c-primary);
    box-shadow: 0 2px 8px rgba(59,130,246,0.1);
}
.dash-next-icon {
    font-size: 1.25rem;
    color: var(--c-primary);
    opacity: 0.6;
}
.dash-next-info { flex: 1; min-width: 0; }
.dash-next-label {
    font-size: var(--fs-xs);
    color: var(--c-text4);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.dash-next-detail {
    font-size: var(--fs-sm);
    color: var(--c-text);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-next-days {
    text-align: right;
    flex-shrink: 0;
}
.dash-next-days-num {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--c-primary);
    line-height: 1;
}
.dash-next-days-unit {
    font-size: var(--fs-xs);
    color: var(--c-text4);
}
.dash-next-today {
    font-size: var(--fs-lg);
    color: var(--status-danger-text);
}

/* Dark mode */
[data-bs-theme="dark"] .dash-tile {
    background: var(--c-surface);
    border-color: var(--c-border);
}
[data-bs-theme="dark"] .dash-tile:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
[data-bs-theme="dark"] .dash-next-deadline {
    background: var(--c-surface);
    border-color: var(--c-border);
}

/* Responsive */
@media (max-width: 768px) {
    .dash-hub { max-width: 100%; }
    .dash-hub-header { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
    .dash-tiles-4 { grid-template-columns: repeat(2, 1fr); }
    .dash-tiles-3 { grid-template-columns: repeat(3, 1fr); }
    .dash-tiles-auto { grid-template-columns: repeat(2, 1fr); }
    .dash-tile { min-height: 110px; padding: 1rem 0.75rem; }
    .dash-next-deadline { flex-wrap: wrap; }
}
@media (max-width: 480px) {
    .dash-tiles-3 { grid-template-columns: repeat(2, 1fr); }
}

/* === LEGACY (zachováno pro kompatibilitu) === */
/* === WRAPPER === */
.dash-wrapper {
    /* plna sirka */
}

/* === STAT KARTY === */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 18px 16px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    border-left: 3px solid var(--c-border);
}
.stat-card.danger { border-left-color: var(--status-danger-text); }
.stat-card.warning { border-left-color: var(--status-warning-text); }
.stat-card.blue { border-left-color: var(--c-primary); }
.stat-card.success { border-left-color: var(--status-done-text); }
.stat-number {
    font-size: var(--fs-xl);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    color: var(--c-border3);
}
.stat-card.danger .stat-number { color: var(--status-danger-text); }
.stat-card.warning .stat-number { color: var(--status-warning-text); }
.stat-card.blue .stat-number { color: var(--c-primary); }
.stat-card.success .stat-number { color: var(--status-done-text); }
.stat-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--c-text5);
}

/* === LAYOUT PLNA SIRKA === */
.dash-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
@media (max-width: 992px) {
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

/* === PREHLED DRUHU — inline === */
.type-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 18px;
}
.type-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--c-text2);
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s;
}
.type-chip:hover { background: var(--c-surface2); border-color: var(--c-border3); text-decoration: none; color: var(--c-text); }
.type-chip-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
}
.type-chip-count { color: var(--c-text5); font-weight: 400; }
.type-chip-warn { color: var(--status-warning-text); font-weight: 600; margin-left: 2px; }
.type-chip-ok { color: var(--c-border3); margin-left: 2px; }
[data-bs-theme="dark"] .type-chip { background: #161b22; border-color: #30363d; color: #e2e8f0; }
[data-bs-theme="dark"] .type-chip:hover { background: #1c2333; }
@media (max-width: 420px) {
    .dash-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-number { font-size: var(--fs-xl); }
}

/* === MOBILE DASHBOARD === */
@media (max-width: 767px) {
    .stat-chips {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-left: 0;
        margin-top: 10px;
    }
    .stat-chip {
        padding: 8px 10px;
        justify-content: center;
        min-height: 36px;
    }
    .stat-chip-num { font-size: var(--fs-sm); }
    .stat-chip-sep { display: none; }
    .group-item-boxes { grid-template-columns: 1fr; }
    .att-item { gap: 10px; padding: 12px 8px; }
    .att-icon { width: 24px; height: 24px; font-size: var(--fs-2xs); }
    .att-right { font-size: var(--fs-xs); }
    .panel-header-icon-inline { font-size: var(--fs-xs); }
    .type-chips { padding: 10px 12px; gap: 6px; }
    .up-item { gap: 10px; padding: 10px 8px; }
}
@media (max-width: 575px) {
    .gi-box-header { padding: 10px 12px 6px; }
    .gi-box-stats { padding: 2px 12px 10px; }
    .att-detail { padding-left: 34px; }
}

/* === STAT CHIP SEPARATOR === */
.stat-chip-sep {
    border-left: 1px solid var(--c-border);
    height: 16px;
    margin: 0 2px;
    flex-shrink: 0;
}
.stat-chip.pending .stat-chip-num { color: var(--status-pending-text); }

/* === STAT CHIPS (header) === */
.stat-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-left: 16px;
}
.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    text-decoration: none;
    color: var(--c-text4);
    font-size: var(--fs-xs);
    font-weight: 500;
    transition: background 0.15s;
    white-space: nowrap;
}
.stat-chip:hover { background: var(--c-surface3); text-decoration: none; color: var(--c-text2); }
.stat-chip-num {
    font-weight: 800;
    font-size: var(--fs-sm);
}
.stat-chip.danger { color: var(--status-danger-text); border-color: #fecaca; background: #fef2f2; }
.stat-chip.warning { color: var(--status-warning-text); border-color: #fde68a; background: var(--status-caution-bg); }
.stat-chip.success { color: var(--status-done-text); border-color: #a7f3d0; background: #ecfdf5; }
[data-bs-theme="dark"] .stat-chip { background: #161b22; border-color: #30363d; color: var(--c-text4); }
[data-bs-theme="dark"] .stat-chip.danger { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); }
[data-bs-theme="dark"] .stat-chip.warning { background: rgba(217,119,6,0.1); border-color: rgba(217,119,6,0.3); }
[data-bs-theme="dark"] .stat-chip.success { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); }

/* === GROUP ITEM BOXES === */
.group-item-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.gi-box {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    border-top: 4px solid var(--gi-color, #3b82f6);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: box-shadow 0.15s;
}
.gi-box:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); text-decoration: none; color: inherit; }
.gi-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 8px;
}
.gi-box-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    color: white;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    flex-shrink: 0;
}
.gi-box-title {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--c-text);
    line-height: 1.2;
}
.gi-box-sub {
    font-size: var(--fs-xs);
    color: var(--c-text5);
}
.gi-box-stats {
    display: flex;
    padding: 4px 16px 12px;
}
.gi-box-stat {
    flex: 1;
    text-align: center;
    padding: 4px 2px;
    border-right: 1px solid #f1f5f9;
}
.gi-box-stat:last-child { border-right: none; }
.gi-box-stat-num {
    font-size: var(--fs-md);
    font-weight: 800;
    line-height: 1;
    color: var(--c-border3);
}
.gi-box-stat-num.danger { color: var(--status-danger-text); }
.gi-box-stat-num.warning { color: var(--status-warning-text); }
.gi-box-stat-num.success { color: var(--status-done-text); }
.gi-box-stat-label {
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--c-text5);
    margin-top: 2px;
}
[data-bs-theme="dark"] .gi-box { background: #161b22; }
[data-bs-theme="dark"] .gi-box-title { color: #e2e8f0; }
[data-bs-theme="dark"] .gi-box-stat { border-right-color: #30363d; }

/* === URGENT PANEL (tento tyden) === */
.urgent-panel { border-left: 3px solid var(--status-danger-text); }
.urgent-panel .panel-header { background: #fef2f2; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.urgent-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-bottom: 1px solid #fee2e2;
    text-decoration: none; color: inherit;
    transition: background 0.15s;
    cursor: pointer;
}
.urgent-days-box { text-align: center; min-width: 42px; }
.att-detail-urgent { padding-left: 62px; }
.urgent-item:last-child { border-bottom: none; }
.urgent-item:hover { background: #fef2f2; }
.urgent-days {
    min-width: 42px; text-align: center;
    font-size: var(--fs-lg); font-weight: 700; color: var(--status-danger-text); line-height: 1;
}
.urgent-days-label { font-size: var(--fs-2xs); color: var(--status-danger-text); text-transform: uppercase; letter-spacing: 0.5px; }
.urgent-today { font-size: var(--fs-lg); font-weight: 700; color: var(--status-danger-text); }

/* === DASHBOARD PANELY === */
.dash-panel {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    margin-bottom: 18px;
    overflow: hidden;
}
.dash-panel .panel-header {
    gap: 8px;
    padding: 14px 18px 10px;
}
.panel-header-icon-inline {
    font-size: var(--fs-sm);
}
.panel-header-icon-inline.danger { color: var(--status-danger-text); }
.panel-header-icon-inline.muted { color: #94a3b8; }
.dash-panel .panel-title {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--c-text);
}
.panel-title.danger { color: var(--status-danger-text); }
.dash-panel .panel-badge {
    font-size: var(--fs-xs);
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--radius-base);
    background: var(--c-surface3);
    color: var(--c-text4);
    margin-left: auto;
}
.panel-badge.danger { background: var(--status-danger-bg); color: var(--status-danger-text); }
.panel-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #cbd5e1;
    padding: 4px;
    font-size: var(--fs-xs);
    transition: transform 0.2s;
}

/* === ATTENTION RADKY === */
.attention-list, .upcoming-list {
    padding: 2px 14px 14px;
}
.att-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--c-border2);
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
    cursor: pointer;
}
.att-wrapper:last-child .att-item { border-bottom: none; }
.att-item:hover { background: var(--c-surface2); text-decoration: none; color: inherit; }
.att-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--fs-2xs);
    flex-shrink: 0;
}
.att-info { flex: 1; min-width: 0; }
.att-name {
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.att-name-secondary { color: var(--c-text4); font-weight: 400; }
.att-meta {
    font-size: var(--fs-xs);
    color: var(--c-text5);
}
.att-right {
    font-size: var(--fs-sm);
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}
.att-right.text-danger { color: var(--status-danger-text); }
.att-right.text-teal { color: var(--c-text4); }
.att-right.text-green { color: var(--status-ok-text); }
.att-right.text-orange { color: var(--status-warning-text); }
.att-right.text-muted { color: var(--c-text5); }

/* === UPCOMING RADKY === */
.up-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--c-surface3);
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
    cursor: pointer;
}
.up-item:last-child { border-bottom: none; }
.up-item:hover { background: var(--c-surface2); text-decoration: none; color: inherit; }
.up-right {
    text-align: right;
    flex-shrink: 0;
    margin-left: auto;
}
.up-date {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-text3);
}
.up-days {
    font-size: var(--fs-xs);
    font-weight: 500;
}
.up-days.orange { color: var(--status-warning-text); }
.up-days.blue { color: var(--c-text4); }
.up-days.muted { color: var(--c-text5); }

/* === PANEL FOOTER === */
.panel-footer {
    text-align: center;
    padding: 10px 18px 13px;
    border-top: 1px solid #f1f5f9;
}
.panel-footer a {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--c-primary);
    text-decoration: none;
}
.panel-footer a:hover { text-decoration: underline; }

/* === SECTION LABELS (dashboard) === */
.section-label-dash {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--c-text5);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-label-dash i { font-size: var(--fs-2xs); }

/* === SETUP ALERT === */
.alert-setup { border-left: 4px solid var(--status-warning-text); }
.alert-setup-icon { color: var(--status-warning-text); }

/* === EMPTY STATE === */
.empty-panel {
    text-align: center;
    padding: 24px 18px;
    color: var(--c-text5);
    font-size: var(--fs-sm);
}
.empty-panel i {
    font-size: var(--fs-lg);
    margin-bottom: 8px;
    display: block;
    color: #e2e8f0;
}
.empty-panel i.done { color: var(--status-done-text); }

/* === ACCORDION === */
.att-wrapper { margin-bottom: 1px; border-radius: var(--radius-md); overflow: hidden; }
.att-chevron { color: #cbd5e1; font-size: var(--fs-2xs); transition: transform 0.2s; flex-shrink: 0; }
.att-chevron.open { transform: rotate(90deg); }
.att-detail {
    display: none; padding: 0 10px 10px 46px;
    font-size: var(--fs-sm); color: var(--c-text3);
}
.att-detail.open { display: block; }
.att-detail-row { display: flex; gap: 6px; padding: 3px 0; }
.att-detail-label { color: var(--c-text5); min-width: 80px; flex-shrink: 0; }
.att-detail-value { color: var(--c-text); }
.att-detail-links { margin-top: 6px; display: flex; gap: 10px; }
.att-detail-links a {
    font-size: var(--fs-xs); color: var(--c-primary); text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
}
.att-detail-links a:hover { text-decoration: underline; }
.att-desc {
    font-size: var(--fs-xs); color: var(--c-text4);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.att-desc.task-desc {
    font-size: var(--fs-base); font-weight: 500; color: var(--c-text);
    white-space: normal;
    margin-top: 2px;
}

/* === DASHBOARD HEADER BUTTONS === */
.btn-dash-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    text-decoration: none;
}
.btn-dash-action i.arrow {
    transition: transform 0.2s;
}
.btn-dash-action:hover i.arrow {
    transform: translateX(3px);
}
.btn-calendar-outline {
    background: white;
    color: var(--c-primary);
    border: 1.5px solid #bfdbfe;
    box-shadow: 0 1px 4px rgba(59,130,246,0.1);
}
.btn-calendar-outline:hover {
    background: var(--c-primary-bg, #eff6ff);
    color: var(--c-primary-hover);
    border-color: #93c5fd;
    box-shadow: 0 3px 10px rgba(59,130,246,0.2);
}
.dash-page-header-actions { gap: 8px; }

/* === DASHBOARD DARK MODE === */
[data-bs-theme="dark"] .stat-card { background: #161b22; }
[data-bs-theme="dark"] .stat-card .stat-label { color: var(--c-text4); }
[data-bs-theme="dark"] .stat-card .stat-number { color: var(--c-border3); }
[data-bs-theme="dark"] .stat-card.blue .stat-number { color: var(--c-primary-light); }
[data-bs-theme="dark"] .stat-card.success .stat-number { color: #34d399; }
[data-bs-theme="dark"] .stat-card.danger .stat-number { color: #f87171; }
[data-bs-theme="dark"] .stat-card.warning .stat-number { color: #fbbf24; }
[data-bs-theme="dark"] .dash-panel { background: #161b22; }
[data-bs-theme="dark"] .dash-panel .panel-header { border-bottom-color: rgba(255,255,255,0.07); }
[data-bs-theme="dark"] .urgent-panel .panel-header { background: rgba(239,68,68,0.12); }
[data-bs-theme="dark"] .urgent-item:hover { background: rgba(239,68,68,0.08); }
[data-bs-theme="dark"] .att-item { background: transparent; color: #e2e8f0; }
[data-bs-theme="dark"] .att-item:hover { background: rgba(255,255,255,0.04); }
[data-bs-theme="dark"] .att-detail { color: var(--c-text5); }
[data-bs-theme="dark"] .att-detail-label { color: var(--c-text4); }
[data-bs-theme="dark"] .att-detail-value { color: #e2e8f0; }
[data-bs-theme="dark"] .att-detail-links a { color: var(--c-primary-light); }
[data-bs-theme="dark"] .att-desc { color: var(--c-text5); }
[data-bs-theme="dark"] .att-desc.task-desc { color: #e2e8f0; }
[data-bs-theme="dark"] .up-item { color: #e2e8f0; }
[data-bs-theme="dark"] .up-item:hover { background: rgba(255,255,255,0.04); }
[data-bs-theme="dark"] .section-label-dash { color: var(--c-text3); }
[data-bs-theme="dark"] .panel-header-icon-inline { opacity: 0.85; }
[data-bs-theme="dark"] .stat-chip-sep { border-color: #30363d; }
[data-bs-theme="dark"] .stat-chip.pending .stat-chip-num { color: #a78bfa; }
[data-bs-theme="dark"] .att-name-secondary { color: var(--c-text3); }
[data-bs-theme="dark"] .alert-setup { border-left-color: #fbbf24; }
[data-bs-theme="dark"] .alert-setup-icon { color: #fbbf24; }
[data-bs-theme="dark"] .empty-panel i.done { color: #34d399; }
[data-bs-theme="dark"] .att-name { color: #e2e8f0; }
[data-bs-theme="dark"] .att-meta { color: var(--c-text4); }
[data-bs-theme="dark"] .up-date { color: var(--c-text5); }
[data-bs-theme="dark"] .up-days { color: #cbd5e1; }
[data-bs-theme="dark"] .btn-calendar-outline {
    background: rgba(59,130,246,0.08);
    color: var(--c-primary-light);
    border-color: rgba(59,130,246,0.25);
}
[data-bs-theme="dark"] .btn-calendar-outline:hover {
    background: rgba(59,130,246,0.15);
    color: #93c5fd;
}

/* =============================================
   DASHBOARD - Statistiky (legacy)
   ============================================= */

.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    flex: 1;
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border-left: 4px solid;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.stat-card.warning { border-color: #f59e0b; }
.stat-card.danger { border-color: #ef4444; }
.stat-card.info { border-color: #3b82f6; }
.stat-card.success { border-color: #10b981; }

.stat-card .stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: var(--fs-sm);
    color: var(--c-text4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-icon {
    font-size: var(--fs-md);
    opacity: 0.5;
}

.stat-card.warning .stat-icon { color: #f59e0b; }
.stat-card.danger .stat-icon { color: #ef4444; }
.stat-card.info .stat-icon { color: #3b82f6; }
.stat-card.success .stat-icon { color: #10b981; }

.stat-card .stat-value {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--c-text);
}

/* =============================================
   DASHBOARD - Panely
   ============================================= */

.dashboard-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.panel .panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--c-surface3);
    font-weight: 600;
    color: var(--c-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel .panel-header .panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel .panel-header .panel-title i {
    color: var(--c-primary);
}

.panel .panel-body {
    padding: 1rem 1.25rem;
}

/* Seznam položek v panelu */
.list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.list-item:hover {
    background: var(--c-surface2);
}

.list-item:last-child {
    margin-bottom: 0;
}

.list-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-base);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: var(--fs-md);
}

.list-item-icon.danger { background: #fee2e2; color: #ef4444; }
.list-item-icon.warning { background: #fef3c7; color: #f59e0b; }
.list-item-icon.success { background: #d1fae5; color: #10b981; }
.list-item-icon.info { background: #dbeafe; color: #3b82f6; }

.list-item .item-info {
    flex: 1;
}

.list-item .item-name {
    font-weight: 500;
    color: var(--c-text);
    font-size: var(--fs-base);
}

.list-item .item-meta {
    font-size: var(--fs-xs);
    color: var(--c-text4);
}

.list-item .item-date {
    font-size: var(--fs-sm);
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
}

.list-item .item-date.danger { background: #fee2e2; color: #ef4444; }
.list-item .item-date.warning { background: #fef3c7; color: #f59e0b; }
.list-item .item-date.success { background: #d1fae5; color: #10b981; }

/* Rychlé akce */
.quick-action {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-base);
    background: var(--c-surface2);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.quick-action:hover {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    color: white;
}

.quick-action:hover i {
    background: rgba(255,255,255,0.2);
    color: white;
}

.quick-action:last-child {
    margin-bottom: 0;
}

.quick-action i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--c-surface);
    color: var(--c-primary);
    margin-right: 0.75rem;
    font-size: var(--fs-md);
    transition: all 0.2s;
}

.quick-action span {
    font-weight: 500;
    font-size: var(--fs-base);
}

/* =============================================
   PAGE HEADER (pro seznamy)
   ============================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--c-text);
}

.page-header h1 i {
    color: var(--c-primary);
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* =============================================
   PŘEPÍNAČ ZOBRAZENÍ
   ============================================= */

.view-switcher {
    display: flex;
    background: var(--c-surface);
    border-radius: var(--radius-base);
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.view-switcher .btn {
    border: none;
    color: #6c757d;
    background: transparent;
}

.view-switcher .btn:hover {
    color: var(--c-primary);
}

.view-switcher .btn.active {
    background: var(--c-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* =============================================
   SLIM VIEW (sdílený Items / Watchers / Deadlines)
   ============================================= */
.slim-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.slim-row {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--c-surface, #fff);
    border-radius: var(--radius-md);
    border: 1px solid var(--c-border, #e5e7eb);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    text-decoration: none;
    color: inherit;
    font-size: var(--fs-sm);
}
.slim-row:hover {
    background: #f0f7ff;
    border-color: #bfdbfe;
    color: inherit;
    text-decoration: none;
}
.slim-dot {
    width: 9px;
    height: 9px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    margin-right: 10px;
}
.slim-dot-ok      { background: #10b981; }
.slim-dot-soon    { background: #f59e0b; }
.slim-dot-warning { background: #ef4444; }
.slim-dot-overdue { background: var(--status-danger-text); }
.slim-dot-pending { background: var(--c-text5); }
.slim-dot-muted   { background: var(--c-border3); }
.slim-days {
    font-size: var(--fs-sm);
    font-weight: 700;
    min-width: 56px;
    flex-shrink: 0;
    color: var(--c-text);
    margin-right: 8px;
}
.slim-days.days-overdue { color: var(--status-danger-text); }
.slim-days.days-warning { color: #ef4444; }
.slim-days.days-soon    { color: #d97706; }
.slim-days.days-pending { color: var(--status-muted-text); font-weight: 400; }
.slim-days.days-muted   { color: var(--status-muted-border); font-weight: 400; }
.slim-item {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.slim-sep {
    color: var(--c-border3);
    margin: 0 8px;
    flex-shrink: 0;
}
.slim-watcher,
.slim-meta {
    font-size: var(--fs-xs);
    color: var(--c-text4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    flex-shrink: 0;
}
.slim-lock {
    font-size: var(--fs-xs);
    color: var(--c-text5);
    margin-left: 4px;
    flex-shrink: 0;
}
@media (max-width: 767px) {
    .slim-watcher, .slim-meta { max-width: 110px; }
    .slim-days { min-width: 44px; }
}
[data-bs-theme="dark"] .slim-row { background: #1c2333; border-color: rgba(255,255,255,0.08); color: #e2e8f0; }
[data-bs-theme="dark"] .slim-row:hover { background: #1e3a5f; border-color: rgba(59,130,246,0.3); }
[data-bs-theme="dark"] .slim-item { color: #e2e8f0; }
[data-bs-theme="dark"] .slim-days { color: #e2e8f0; }
[data-bs-theme="dark"] .slim-sep { color: #334155; }
[data-bs-theme="dark"] .slim-watcher,
[data-bs-theme="dark"] .slim-meta { color: #64748b; }

/* =============================================
   FILTRAČNÍ PANEL
   ============================================= */

.filter-bar {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    padding: 8px 0;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-bar .filter-label {
    font-weight: 600;
    color: #6c757d;
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-bar .form-select,
.filter-bar .form-control {
    width: auto;
    min-width: 180px;
    border-radius: var(--radius-md);
    border: 1px solid #e0e0e0;
    font-size: var(--fs-base);
}

.filter-bar .btn-reset {
    color: #6c757d;
    font-size: var(--fs-sm);
}

.filter-bar .btn-reset:hover {
    color: #dc3545;
}

.filter-results {
    margin-left: auto;
    font-size: var(--fs-sm);
    color: #6c757d;
}

/* =============================================
   PILL-BTN — sjednocena velikost vsech pill tlacitek
   Jediny zdroj pravdy pro sizing pills v cele aplikaci.
   Komponentni CSS (item-filter-btn, type-filter-btn, ...)
   resi JEN barvy/bordery/stavy — sizing dedi z pill-btn.
   ============================================= */
.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: var(--fs-xs);
    font-weight: 500;
    border-radius: var(--radius-sm);
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border: none;
    background: transparent;
    color: var(--c-text4);
}
.pill-btn:hover { text-decoration: none; }
/* Override Bootstrap .btn / .btn-sm sizing kdyz je pill-btn pouzit spolecne */
.pill-btn.btn,
.pill-btn.btn-sm,
.pill-btn.btn.btn-sm {
    padding: 4px 10px;
    font-size: var(--fs-xs);
    font-weight: 500;
    line-height: 1.3;
    border-radius: var(--radius-sm);
}


/* =============================================
   BADGE SYSTEM — sjednoceny sizing pro vsechny badges
   Pouzij .badge-base + velikostni modifikator.
   Barvy/stavy resi komponenty (badge-deadline-*, watcher-status-badge, ...).
   ============================================= */
.badge-base {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-xs);
    font-weight: 600;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    line-height: 1.4;
    vertical-align: middle;
}
.badge-base.badge-lg {
    padding: 6px 12px;
    font-size: var(--fs-sm);
}
.badge-base.badge-md {
    padding: 4px 10px;
    font-size: var(--fs-xs);
}
.badge-base.badge-sm {
    padding: 2px 8px;
    font-size: var(--fs-xs);
}
.badge-base.badge-xs {
    padding: 2px 6px;
    font-size: var(--fs-2xs);
}

/* =============================================
   PREPINAC ZOBRAZENI — .view-toggle
   ============================================= */
.view-toggle {
    display: inline-flex;
    background: var(--c-surface3);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 3px;
}
.view-toggle .btn {
    border: none;
    background: transparent;
    color: var(--c-text4);
}
.view-toggle .btn:hover {
    background: rgba(255,255,255,0.5);
}
.view-toggle .btn.active {
    background: white;
    color: var(--c-teal-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.view-toggle .btn.active[data-mode="task"] {
    color: var(--c-primary);
}
.view-toggle .btn.active[data-mode="all"] {
    color: var(--c-text4);
}
.view-toggle .btn i {
    margin-right: 4px;
}

/* =============================================
   TABULKA - Seznam items
   ============================================= */

.items-table-card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid var(--c-border2);
}

.items-table {
    margin-bottom: 0;
    font-variant-numeric: tabular-nums;
    --bs-table-striped-bg: #f8fafb;
    --bs-table-hover-bg: #f0f4f8;
}

.items-table th {
    font-weight: 600;
    color: var(--c-text3);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--c-border2);
    padding: 10px 12px;
    background: #eef2f7;
    user-select: none;
    white-space: nowrap;
    vertical-align: middle;
}
.items-table th:hover {
    background: var(--c-surface3);
}

.items-table th.no-sort {
    cursor: default;
}

.items-table th.no-sort:hover {
    background: var(--c-surface2);
}

.items-table th .sort-icon {
    margin-left: 6px;
    opacity: 0.3;
    font-size: 0.7em;
}

.items-table th.sorted-asc .sort-icon,
.items-table th.sorted-desc .sort-icon {
    opacity: 1;
    color: var(--c-primary);
}

/* Dual sort arrows */
.sort-arrows {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    margin-left: 4px;
    line-height: 1;
    gap: 0;
}
.sort-arrows i {
    font-size: var(--fs-2xs);
    color: #bbb;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.12s;
}
.sort-arrows i:hover {
    color: var(--c-primary);
}
.sort-arrows i.active {
    color: var(--c-primary);
}
.sort-arrows .fa-sort-up {
    margin-bottom: -3px;
}
.sort-arrows .fa-sort-down {
    margin-top: -3px;
}

.items-table td {
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--c-surface3);
    border-top: none;
    font-size: var(--fs-sm);
}

/* hover handled by Bootstrap table-hover */

.items-table tbody tr:last-child td {
    border-bottom: none;
}

.items-table tbody tr:hover {
    background: var(--c-surface2);
}

.item-name {
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

.item-name:hover {
    color: var(--c-primary);
}

.item-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-xl);
    font-size: var(--fs-sm);
    font-weight: 500;
}

.badge-stats {
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 500;
}

/* =============================================
   KARTOVÝ GRID - Seznam items
   ============================================= */

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

/* Přepínání pohledů */
/* view-table/view-grid/view-slim prepinani je v sekci "Prepinac zobrazeni" nize */

/* Skryté řádky při filtrování */
.items-table tbody tr.hidden,
.items-grid .item-card.hidden {
    display: none;
}

/* =============================================
   ITEM DETAIL - Dvousloupcový layout
   ============================================= */

.item-detail-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Grid fix: přímé děti dostanou min-width: 0, aby table-responsive fungovalo */
.item-detail-layout > div {
    min-width: 0;
}

.item-info-card {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    color: white;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.3);
}

.item-info-card .item-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-2xl);
    backdrop-filter: blur(10px);
    margin-bottom: 1rem;
}

.item-info-card .item-title {
    font-size: var(--fs-xxl);
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.item-info-card .item-type {
    font-size: var(--fs-md);
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.item-info-card .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.item-info-card .info-row:last-of-type {
    border-bottom: none;
}

.item-info-card .info-label {
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.item-info-card .info-value {
    font-weight: 600;
    text-align: right;
}

.item-info-card .info-description {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.item-info-card .info-description p {
    opacity: 0.95;
    font-size: var(--fs-md);
    line-height: 1.5;
}

.item-info-card .action-buttons {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.item-info-card .btn-outline-light {
    border-width: 2px;
}

.item-info-card .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* =============================================
   CONTENT CARD (pravý panel v detailu)
   ============================================= */

.content-card {
    background: var(--c-surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: none;
}

/* Section header — sdileny styl pro vsechny hlavicky sekci v systemu */
.section-header,
.content-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--section-header-py, 0.5rem) var(--section-header-px, 1.25rem);
    font-weight: 600;
    font-size: var(--fs-sm);
    background: transparent;
    border-bottom: 1px solid var(--c-border2);
}
.content-card .card-header {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.content-card .card-body {
    padding: 1.5rem;
}

/* Tabulka hlídačů */
.watchers-table th {
    font-weight: 600;
    color: #6c757d;
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e9ecef;
    padding: 1rem;
}

.watchers-table td {
    vertical-align: middle;
    padding: 1rem;
    border-bottom: 1px solid #f1f3f4;
}

.watchers-table tbody tr td {
    background: var(--c-teal-bg, #f0fdfa);
}

.watchers-table tbody tr:last-child td {
    border-bottom: none;
}

.watchers-table tbody tr:hover td {
    background-color: #e6f9f5;
}

/* Badge pro termíny */
/* .badge-deadline removed — replaced by .table-validity */

/* Akční tlačítka — jednotný styl pro celý systém */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-text5);
    font-size: var(--fs-xs);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.btn-action-muted {
    opacity: 0.35;
}
.btn-action-muted:hover {
    opacity: 0.7;
}
.btn-action-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.6rem;
    background: var(--c-primary);
    color: #fff;
    border-radius: var(--radius-full);
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: var(--c-text5);
    font-size: var(--fs-xs);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-action:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    background: var(--c-primary-bg, #eff6ff);
    text-decoration: none;
}
.btn-action.danger { color: var(--c-text5); }
.btn-action.danger:hover {
    border-color: var(--status-danger-text);
    color: var(--status-danger-text);
    background: var(--status-danger-bg);
}
.btn-action.success { color: var(--c-text5); }
.btn-action.success:hover {
    border-color: #22c55e;
    color: #22c55e;
    background: var(--status-ok-bg);
}
.btn-action.warning { color: var(--c-text5); }
.btn-action.warning:hover {
    border-color: var(--status-warning-text);
    color: var(--status-warning-text);
    background: var(--status-caution-bg);
}
.btn-action.btn-claim {
    background: #0ea5e9;
    color: #fff;
    border-color: #0ea5e9;
}
.btn-action.btn-claim:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #fff;
}
.btn-action.btn-release {
    color: var(--c-text5);
    border-color: var(--c-border2);
}
.btn-action.btn-release:hover {
    color: var(--c-text4);
    border-color: var(--c-border3);
    background: var(--c-surface2);
}
.btn-action.info { color: #0ea5e9; }
.btn-action.info:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
    background: #f0f9ff;
}
.btn-action.blue { color: var(--c-text5); }
.btn-action.blue:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    background: var(--c-primary-bg, #eff6ff);
}
.btn-action.teal { color: var(--c-text5); }
.btn-action.teal:hover {
    border-color: var(--c-teal);
    color: var(--c-teal);
    background: var(--c-teal-bg, #f0fdfa);
}
[data-bs-theme="dark"] .btn-action {
    border-color: rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--c-text5);
}
[data-bs-theme="dark"] .btn-action:hover {
    border-color: var(--c-primary-light);
    color: var(--c-primary-light);
    background: rgba(59,130,246,0.1);
}
[data-bs-theme="dark"] .btn-action.danger:hover {
    border-color: #f87171;
    color: #f87171;
    background: rgba(239,68,68,0.1);
}
[data-bs-theme="dark"] .btn-action.success:hover {
    border-color: #4ade80;
    color: #4ade80;
    background: rgba(34,197,94,0.1);
}
[data-bs-theme="dark"] .btn-action.warning:hover {
    border-color: #fbbf24;
    color: #fbbf24;
    background: rgba(245,158,11,0.1);
}
[data-bs-theme="dark"] .btn-action.btn-claim {
    background: #0ea5e9;
    color: #fff;
    border-color: #0ea5e9;
}
[data-bs-theme="dark"] .btn-action.btn-claim:hover {
    background: #38bdf8;
    border-color: #38bdf8;
}
[data-bs-theme="dark"] .btn-action.btn-release {
    color: var(--c-text4);
    border-color: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] .btn-action.btn-release:hover {
    color: var(--c-text5);
    border-color: rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
}
[data-bs-theme="dark"] .btn-action.info { color: #38bdf8; }
[data-bs-theme="dark"] .btn-action.info:hover {
    border-color: #38bdf8;
    color: #38bdf8;
    background: rgba(14,165,233,0.1);
}
[data-bs-theme="dark"] .btn-action.blue:hover {
    border-color: var(--c-primary-light);
    color: var(--c-primary-light);
    background: rgba(59,130,246,0.1);
}
[data-bs-theme="dark"] .btn-action.teal:hover {
    border-color: #2dd4bf;
    color: #2dd4bf;
    background: rgba(20,184,166,0.1);
}
.btn-action.impersonate { color: var(--c-text5); }
.btn-action.impersonate:hover {
    border-color: var(--status-warning-text);
    color: var(--status-warning-text);
    background: var(--status-caution-bg);
}
[data-bs-theme="dark"] .btn-action.impersonate:hover {
    border-color: #fbbf24;
    color: #fbbf24;
    background: rgba(217,119,6,0.1);
}

/* =============================================
   BREADCRUMB
   ============================================= */

.breadcrumb-custom {
    background: transparent;
    padding: 0;
    font-size: var(--fs-sm);
}

.breadcrumb-custom a {
    color: var(--c-primary);
    text-decoration: none;
}

.breadcrumb-custom a:hover {
    text-decoration: underline;
}

.breadcrumb-custom .separator {
    color: #adb5bd;
    margin: 0 0.5rem;
}

/* =============================================
   FORMULÁŘE
   ============================================= */

.form-control:focus,
.form-select:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

/* =============================================
   ALERT / FLASH MESSAGES
   ============================================= */

.alert {
    border-radius: var(--radius-base);
    border: none;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   RESPONZIVITA
   ============================================= */

@media (max-width: 1200px) {
    .dashboard-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .item-detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .stats-row {
        flex-wrap: wrap;
    }
    
    .stat-card {
        min-width: calc(50% - 0.5rem);
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
}

/* Pozn: .sidebar transform pro mobil je v bloku @media (max-width: 767px) níže,
   kde je správně kombinován s hamburger togglem a top: 52px pozicí */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }
    
    .stat-card {
        min-width: calc(50% - 0.5rem);
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-header-actions {
        justify-content: space-between;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar .form-select,
    .filter-bar .form-control {
        width: 100%;
    }
    
    .filter-results {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .items-table th,
    .items-table td {
        padding: 10px 12px;
        font-size: var(--fs-sm);
    }

    .item-info-card {
        padding: 1.25rem;
    }
    
    .item-info-card .item-icon {
        width: 60px;
        height: 60px;
        font-size: var(--fs-xl);
    }
    
    .item-info-card .item-title {
        font-size: var(--fs-xl);
    }
}

/* =============================================
   LOGIN CONTAINER
   ============================================= */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    padding: 2rem;
}

.login-card {
    background: var(--c-surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-card .brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .brand-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    border-radius: var(--radius-xl);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--fs-xxl);
    margin-bottom: 1rem;
}

.login-card .brand-name {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--c-text);
}

.login-card h2 {
    text-align: center;
    color: var(--c-text4);
    font-size: var(--fs-md);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.login-card .form-control {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-base);
    border: 1px solid var(--c-border2);
}

.login-card .form-control:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-card .btn-primary {
    padding: var(--btn-padding-lg);
    border-radius: var(--btn-radius);
    font-weight: var(--btn-font-weight-lg);
    width: 100%;
}

.login-card .btn-primary:hover {
    opacity: 0.95;
}

/* Grid pro karty — viz centralni .items-grid (radek ~831) */

/* Responzivita */
@media (max-width: 768px) {
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .item-card-b-info {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   FORM CARD - VARIANTA B
   ======================================== */

.form-card-b {
    background: var(--c-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 4px 25px rgba(0,0,0,0.08);
    max-width: 1200px;
}

.form-card-b-header {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    padding: 1.5rem 2rem;
    color: white;
}

.form-card-b-header h3 {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-card-b-header h3 i {
    opacity: 0.8;
}

.form-card-b-body {
    padding: 2rem;
}

/* Dvousloupcový layout */
.form-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
}
/* Page-level grid: formulář + šablony hlídačů */
.add-item-page-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.add-item-templates-panel {
    min-width: 0;
}
.add-item-templates-sticky {
    position: sticky;
    top: 1rem;
}
.add-item-templates-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 8px 0;
}
@media (max-width: 1200px) {
    .add-item-page-grid { grid-template-columns: 1fr; }
}

/* Název itemu — na celou šířku nad form-layout */
.form-name-row {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--c-border);
}
.form-name-row label {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-text2);
    margin-bottom: 4px;
    display: block;
}
.form-name-row input {
    font-size: var(--fs-md);
}

/* Povinné pole — jemné zvýraznění */
.form-field-required {
    background-color: #fffbeb;
    border-color: #f59e0b;
}
.form-field-required:focus {
    background-color: #fff;
    border-color: var(--c-primary);
}
.form-field-required-hint {
    font-size: var(--fs-2xs);
    color: #b45309;
}

/* Třísloupcové řádky v add formuláři */
.floating-row-3col {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Soukromý item — checkbox inline */
.form-private-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--fs-sm);
    padding-top: 1.5rem;
}
.form-private-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--c-primary);
}

/* Kompaktní panel (pracovní režim) */
.form-panel-compact { margin-top: 12px; }
.form-panel-compact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-sidebar-pair {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.form-sidebar-pair > .location-panel {
    width: 280px;
    flex-shrink: 0;
    height: auto;
}

.form-main {
    /* Hlavní formulářová část */
}

.form-sidebar {
    /* Pravý panel s lokací */
}

/* Floating groups */
.floating-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.floating-group .form-control,
.floating-group .form-select {
    padding: 1rem 1rem 0.4rem;
    height: auto;
    border: 2px solid var(--c-border2);
    border-radius: var(--radius-lg);
    font-size: var(--fs-base);
    transition: all 0.2s;
    background: var(--c-surface);
}

.floating-group .form-control:focus,
.floating-group .form-select:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.floating-group > label {
    position: absolute;
    top: 0.4rem;
    left: 1rem;
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--c-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

.floating-group .form-hint {
    font-size: var(--fs-xs);
    color: var(--c-text5);
    margin-top: 0.4rem;
    padding-left: 0.25rem;
}

.floating-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Sidebar - Lokace panel */
.location-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    padding: 1rem;
    border: 2px solid var(--c-border2);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.location-panel-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--c-border2);
}

.location-panel-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    border-radius: var(--radius-base);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--fs-base);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.location-panel-title {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--c-text);
}

.location-panel-subtitle {
    font-size: var(--fs-2xs);
    color: var(--c-text4);
}

.location-select-wrapper {
    margin-bottom: 0.6rem;
}

.location-select-wrapper label {
    display: block;
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--c-text4);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-select-wrapper .form-select {
    border: 2px solid var(--c-border2);
    border-radius: var(--radius-base);
    padding: 0.5rem 0.75rem;
    font-size: var(--fs-base);
    background: var(--c-surface);
    transition: all 0.2s;
}

.location-select-wrapper .form-select:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.location-info {
    background: var(--c-surface);
    border-radius: var(--radius-base);
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

.location-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-xs);
    color: var(--c-text4);
    padding: 0.2rem 0;
}

.location-info-item i {
    width: 14px;
    color: var(--c-text5);
    font-size: var(--fs-2xs);
}

.location-info-item strong {
    color: var(--c-text);
}

/* Popis - spodní část */
.form-description {
    margin-top: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--c-border);
}

.form-description-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.form-description-header i {
    color: var(--c-primary);
}

.form-description-header span {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-text4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-description textarea.form-control {
    border: 2px solid var(--c-border2);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    font-size: var(--fs-base);
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s;
}

.form-description textarea.form-control:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Footer */
.form-card-b-footer {
    padding: 1.5rem 2rem;
    background: var(--c-surface2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--c-border);
}

.form-card-b-footer .btn-save {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-hover) 100%);
    border: none;
    padding: var(--btn-padding-lg);
    border-radius: var(--btn-radius);
    font-weight: var(--btn-font-weight-lg);
    color: #fff;
    font-size: var(--btn-font-size-lg);
    box-shadow: var(--btn-shadow-blue);
    transition: var(--btn-transition);
}

.form-card-b-footer .btn-save:hover {
    transform: translateY(-1px);
    box-shadow: var(--btn-shadow-blue-hover);
}

.form-card-b-footer .btn-cancel {
    color: var(--c-text4);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.form-card-b-footer .btn-cancel:hover {
    color: var(--c-text);
}

/* Responzivita */
@media (max-width: 768px) {
    .form-layout {
        grid-template-columns: 1fr;
    }
    
    .floating-row {
        grid-template-columns: 1fr;
    }
    
    .location-panel {
        position: static;
    }
    
    .form-card-b-body {
        padding: 1.25rem;
    }
    
    .form-card-b-footer {
        flex-direction: column-reverse;
        gap: 1rem;
    }
    
    .form-card-b-footer .btn-save {
        width: 100%;
    }
}

/* ========================================
   WATCHER STYLES - TEAL THEME
   ======================================== */

/* Teal barvy pro hlídače */
.text-teal {
    color: var(--c-teal);
}

.bg-teal {
    background-color: #14b8a6;
}

.btn-teal {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
    border: none;
    color: #fff;
    padding: var(--btn-padding-md);
    border-radius: var(--btn-radius);
    font-weight: var(--btn-font-weight);
    font-size: var(--btn-font-size-md);
    box-shadow: var(--btn-shadow-teal);
    transition: var(--btn-transition);
}

.btn-teal:hover {
    background: linear-gradient(135deg, var(--c-teal-dark) 0%, #0f766e 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--btn-shadow-teal-hover);
}

/* Outline secondary — konzistentni radius */
.btn-outline-secondary {
    border-radius: var(--btn-radius);
    transition: var(--btn-transition);
}

.btn-outline-teal {
    border: 1.5px solid #14b8a6;
    color: var(--c-teal);
    background: transparent;
    padding: var(--btn-padding-md);
    border-radius: var(--btn-radius);
    font-weight: var(--btn-font-weight);
    font-size: var(--btn-font-size-md);
    transition: var(--btn-transition);
}

.btn-outline-teal:hover {
    background: rgba(20, 184, 166, 0.1);
    color: var(--c-teal-dark);
    border-color: var(--c-teal-dark);
}

.btn-outline-primary {
    border: 1.5px solid #3b82f6;
    color: var(--c-primary);
    background: transparent;
    padding: var(--btn-padding-md);
    border-radius: var(--btn-radius);
    font-weight: var(--btn-font-weight);
    font-size: var(--btn-font-size-md);
    transition: var(--btn-transition);
}

.btn-outline-primary:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--c-primary-hover);
    border-color: var(--c-primary-hover);
}

.btn-outline-danger {
    border: 1.5px solid #ef4444;
    color: var(--status-danger-text);
    background: transparent;
    padding: var(--btn-padding-md);
    border-radius: var(--btn-radius);
    font-weight: var(--btn-font-weight);
    font-size: var(--btn-font-size-md);
    transition: var(--btn-transition);
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-danger-text);
    border-color: #dc2626;
}

/* Watcher Detail Layout */
.watcher-detail-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Levý panel - Info karta hlídače */
.watcher-info-card {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 2rem;
    color: white;
    position: sticky;
    top: 2rem;
}

.watcher-icon {
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xxl);
    margin-bottom: 1.25rem;
    backdrop-filter: blur(10px);
}

.watcher-title {
    font-size: var(--fs-xl);
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.watcher-item-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: var(--fs-md);
    padding: 0.4rem 0.75rem;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    transition: all 0.2s;
}

.watcher-item-link:hover {
    background: rgba(255,255,255,0.25);
    color: white;
}

.watcher-info-card .info-divider {
    height: 1px;
    background: rgba(255,255,255,0.2);
    margin: 1rem 0;
}

.watcher-info-card .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.watcher-info-card .info-row:last-child {
    border-bottom: none;
}

.watcher-info-card .info-label {
    color: rgba(255,255,255,0.7);
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
}

.watcher-info-card .info-value {
    font-weight: 600;
    font-size: var(--fs-md);
}

.watcher-description {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.watcher-description p {
    margin: 0;
    opacity: 0.9;
    font-size: var(--fs-base);
    line-height: 1.5;
}

/* Next Deadline Box */
.next-deadline-box {
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
    backdrop-filter: blur(10px);
}

.next-deadline-box.overdue {
    background: rgba(239, 68, 68, 0.3);
}

.next-deadline-box.warning {
    background: rgba(245, 158, 11, 0.3);
}

.next-deadline-label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    margin-bottom: 0.4rem;
}

.next-deadline-date {
    font-size: var(--fs-xl);
    font-weight: 800;
}

.next-deadline-days {
    font-size: var(--fs-sm);
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Action buttons v hlídači */
.watcher-info-card .action-buttons {
    margin-top: 1.5rem;
}

.watcher-info-card .action-buttons .btn {
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    transition: all 0.2s;
}

.watcher-info-card .action-buttons .btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    color: white;
}

/* Filter bar v detailu hlidace */
.deadline-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #eef2f7;
    border-bottom: 1px solid var(--c-border2);
    font-size: var(--fs-xs);
}

.deadline-filter-bar .form-select-sm {
    font-size: var(--fs-sm);
    padding: 3px 28px 3px 8px;
}

/* Bulk bar v detailu hlidace */
.deadline-bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--c-primary-bg, #eff6ff);
    border-bottom: 1px solid #bfdbfe;
    font-size: var(--fs-sm);
}

/* Akční tlačítka v tabulce termínů — shodný styl s kartami hlídačů */
.history-table .btn-sm {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    border-radius: var(--radius-sm);
}

/* Historie terminu — viz centralni definice (~3046) */

.history-table thead th {
    background: var(--c-surface2);
    padding: 1rem 1.25rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--c-text4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--c-border);
}

.history-table .col-name { min-width: 200px; }

.history-table tbody td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--c-surface3);
    vertical-align: middle;
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

.history-table tbody tr:hover {
    background: var(--c-surface2);
}

.date-cell {
    font-weight: 700;
    color: var(--c-text);
}

.date-muted {
    color: var(--c-text5);
    font-size: var(--fs-base);
}

/* Zbývá — kontextové barvy */
.days-starts-in {
    font-size: var(--fs-2xs);
    color: var(--c-primary);
    font-weight: 400;
}
.days-pending-num {
    color: var(--c-text5);
    font-weight: 600;
}

/* Status badges — jedina centralni definice */

/* Overdue badge — centralni definice (drive v 3 sablon zvlast) */
.validity-overdue {
    color: var(--status-danger-text);
    font-weight: 600;
}
.overdue-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: var(--status-danger-bg);
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    font-size: var(--fs-2xs);
    font-weight: 500;
    color: var(--status-danger-text);
    white-space: nowrap;
}

/* ========================================
   MODE PILL — work_mode (deadline/task)
   ======================================== */
/* Mode pill — sjednoceny styl pro Ukol/Termin (karta i detail) */
.mode-pill,
.wi-mode-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-2xs);
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
    vertical-align: middle;
    letter-spacing: 0.3px;
}
.mode-pill-deadline,
.wi-mode-deadline {
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    color: var(--c-teal-dark);
    border: 1px solid #5eead4;
}
.mode-pill-task,
.wi-mode-task {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e40af;
    border: 1px solid #93c5fd;
}
.mode-pill-both,
.wi-mode-both {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #6d28d9;
    border: 1px solid #c4b5fd;
}
.mode-pill i,
.wi-mode-pill i { font-size: var(--fs-2xs); }
[data-bs-theme="dark"] .mode-pill-deadline,
[data-bs-theme="dark"] .wi-mode-deadline { background: rgba(20,184,166,0.1); color: #5eead4; border-color: rgba(20,184,166,0.25); }
[data-bs-theme="dark"] .mode-pill-task,
[data-bs-theme="dark"] .wi-mode-task { background: rgba(59,130,246,0.1); color: #93c5fd; border-color: rgba(59,130,246,0.25); }
[data-bs-theme="dark"] .mode-pill-both,
[data-bs-theme="dark"] .wi-mode-both { background: rgba(109,40,217,0.1); color: #c4b5fd; border-color: rgba(109,40,217,0.25); }

/* ========================================
   TYPE DOT — barevny ctverecek pro type_color
   ======================================== */
.type-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Responzivita */
@media (max-width: 1024px) {
    .watcher-detail-layout {
        grid-template-columns: 1fr;
    }
    
    .watcher-info-card {
        position: static;
    }
}

/* ========================================
   WATCHER CARD - Varianta B (pro seznam)
   ======================================== */

.watcher-card-b {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: row;
    transition: box-shadow 0.2s, border-color 0.2s;
    border: 1px solid var(--c-border);
}

.watcher-card-b:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.09);
    border-color: var(--c-teal);
}

.watcher-card-b.hidden {
    display: none;
}

.watcher-card-b-accent {
    width: 4px;
    background: var(--c-primary);
    flex-shrink: 0;
}

.watcher-card-b-content {
    flex: 1;
    padding: 0.85rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.watcher-card-b-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: space-between;
    background: var(--c-surface3);
    margin: -0.85rem -0.85rem 0.7rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--c-border2);
}

.watcher-card-b-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: var(--fs-xs);
    flex-shrink: 0;
}

.watcher-card-b-header-text {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.watcher-card-b-title {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-text);
    margin-bottom: 0;
    letter-spacing: -0.01em;
    text-decoration: none;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.watcher-card-b-title:hover {
    color: var(--c-teal);
}

.watcher-card-b-item {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
}

.watcher-card-b-item .item-link {
    background: var(--c-teal-bg, #f0fdfa);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: var(--fs-sm);
    color: var(--c-teal-dark);
    border: 1px solid #99f6e4;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.watcher-card-b-item .item-link:hover {
    background: #ccfbf1;
    color: var(--c-teal-dark);
    border-color: var(--c-teal-dark);
}

[data-bs-theme="dark"] .watcher-card-b {
    background: #1c2333;
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .watcher-card-b-header {
    background: rgba(255,255,255,0.04);
    border-bottom-color: rgba(255,255,255,0.06);
}
[data-bs-theme="dark"] .watcher-card-b-item .item-link {
    background: rgba(20,184,166,0.12);
    border-color: rgba(20,184,166,0.25);
    color: #2dd4bf;
}
[data-bs-theme="dark"] .watcher-card-b-item .item-link:hover {
    background: var(--c-teal);
    color: white;
    border-color: var(--c-teal);
}
[data-bs-theme="dark"] .watcher-card-b-item-name a {
    color: #9ca3af;
}
[data-bs-theme="dark"] .watcher-card-b-item-name a:hover {
    color: #2dd4bf;
}
[data-bs-theme="dark"] .watcher-card-b-urgency.urgency-overdue {
    background: rgba(220,38,38,0.2);
    color: #fca5a5;
}
[data-bs-theme="dark"] .watcher-card-b-urgency.urgency-warning {
    background: rgba(217,119,6,0.2);
    color: #fcd34d;
}
[data-bs-theme="dark"] .watcher-card-b-urgency.urgency-ok {
    background: rgba(5,150,105,0.2);
    color: #6ee7b7;
}
[data-bs-theme="dark"] .watcher-card-b-urgency.urgency-none {
    background: rgba(255,255,255,0.08);
    color: #9ca3af;
}

.watcher-card-b-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: var(--c-surface2);
    border-radius: var(--radius-md);
}

.watcher-card-b-info-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--fs-xs);
    overflow: hidden;
    white-space: nowrap;
}

.watcher-card-b-info-full {
    grid-column: 1 / -1;
}

.watcher-card-b-info-item i {
    color: var(--c-text5);
    width: 16px;
    flex-shrink: 0;
}

.watcher-card-b-info-item strong {
    color: var(--c-text);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.watcher-card-b-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.watcher-card-b-footer-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.watcher-card-b-stats {
    display: flex;
    gap: 0.5rem;
}

.watcher-card-b-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--fs-xs);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.watcher-card-b-stats .stat.teal {
    background: #ccfbf1;
    color: var(--c-teal-dark);
}

.watcher-card-b-stats .stat.success {
    background: var(--status-ok-bg);
    color: var(--status-ok-text);
}

.watcher-card-b-stats .stat.warning {
    background: var(--status-caution-bg);
    color: var(--status-warning-text);
}

.watcher-card-b-stats .stat.danger {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}

.watcher-card-b-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.watcher-card-b-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text4);
    transition: background 0.13s, color 0.13s, border-color 0.13s;
}

.watcher-card-b-actions .btn:hover {
    background: var(--c-teal-bg, #f0fdfa);
    border-color: var(--c-teal-dark);
    color: var(--c-teal-dark);
}

.watcher-card-b-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.watcher-card-b-title-row .watcher-card-b-title {
    flex: 1;
    min-width: 0;
}

.watcher-card-b-item-name {
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.watcher-card-b-item-name a {
    color: var(--c-text4);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.watcher-card-b-item-name a:hover {
    color: var(--c-teal-dark);
}

.watcher-card-b-wtype {
    font-size: var(--fs-xs);
    color: var(--c-text5);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 1px;
}

.watcher-card-b-urgency {
    font-size: var(--fs-xs);
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-start;
    line-height: 1.4;
}

.watcher-card-b-urgency.urgency-overdue {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}

.watcher-card-b-urgency.urgency-warning {
    background: var(--status-caution-bg);
    color: var(--status-warning-text);
}

.watcher-card-b-urgency.urgency-ok {
    background: var(--status-ok-bg);
    color: var(--status-ok-text);
}

.watcher-card-b-urgency.urgency-none {
    background: #f3f4f6;
    color: #6b7280;
}

/* Item link in table - teal style */
.item-link-teal {
    color: var(--c-teal);
    text-decoration: none;
    font-weight: 500;
}

.item-link-teal:hover {
    color: var(--c-teal-dark);
    text-decoration: underline;
}

/* Watcher name — barva ho odlisi, neni treba tucne */
.watcher-name {
    color: var(--c-text);
    text-decoration: none;
    font-weight: 400;
}

.watcher-name:hover {
    color: var(--c-teal);
}

.task-count {
    font-size: var(--fs-xs);
    color: var(--c-text5);
    margin-left: 4px;
}

/* =====================================================
   WATCHER DETAIL - INVERTOVANÝ DESIGN (bílé pozadí, teal písmo)
   ===================================================== */

/* Invertovaný info panel hlídače */
/* prvni definice — preruseno V3 blokem nize */

.watcher-icon-inverted {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--c-teal), var(--c-teal-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.watcher-icon-inverted i {
    font-size: 24px;
    color: white;
}

.watcher-title-inverted {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--c-teal-dark);
    margin-bottom: 12px;
}

/* Badge pro item - výrazný */
.watcher-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.watcher-item-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    color: white;
}

/* Badge pro lokaci */
.watcher-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--c-surface3);
    color: var(--c-text4);
    padding: 6px 12px;
    border-radius: var(--radius-xl);
    font-size: var(--fs-base);
    margin-bottom: 16px;
}

.watcher-location-badge i {
    color: var(--c-teal);
}


/* Info-inverted — viz centralni definice (radek ~3020) */

.watcher-description-inverted p {
    color: var(--c-text3);
    margin: 0;
    font-size: var(--fs-base);
}

/* Akční tlačítka — toolbar (shodný pattern s watcher detail) */
.action-buttons-inverted {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--c-border2);
    flex-wrap: wrap;
}
.action-buttons-inverted .btn {
    font-size: var(--fs-sm);
    padding: 5px 12px;
}

/* Teal tlacitka — viz centralni definice (radek ~1662) */

/* =====================================================
   BAREVNÉ ODKAZY
   ===================================================== */

/* Teal odkaz - pro hlídače */
.link-teal {
    color: var(--c-teal);
    text-decoration: none;
    transition: color 0.2s;
}

.link-teal:hover {
    color: var(--c-teal-dark);
    text-decoration: underline;
}

/* Fialový odkaz - pro items */
.link-purple {
    color: var(--c-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.link-purple:hover {
    color: var(--c-primary-light);
    text-decoration: underline;
}

/* Text barvy — viz centralni .text-teal (radek ~1654) */

.text-purple {
    color: var(--c-primary);
}

/* =====================================================
   MODAL DEAKTIVACE - VYLEPŠENÝ DESIGN
   ===================================================== */

/* Modal container */
.deactivate-modal {
    border: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Header s gradientem */
.deactivate-modal-header {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.deactivate-modal-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.deactivate-modal-icon i {
    font-size: 20px;
    color: white;
}

.deactivate-modal-title {
    color: white;
    font-size: var(--fs-lg);
    font-weight: 600;
    margin: 0;
}

.deactivate-modal-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--fs-base);
    margin: 4px 0 0 0;
}

/* Karta aktuálního termínu */
.deactivate-current-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.deactivate-current-label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--c-text4);
    font-weight: 600;
    margin-bottom: 8px;
}

.deactivate-current-date {
    font-size: var(--fs-xxl);
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 8px;
}

.deactivate-current-info {
    font-size: var(--fs-base);
    color: var(--c-text4);
}

.deactivate-current-info strong {
    color: var(--c-text2);
}

/* Sekce nového termínu */
.deactivate-new-section {
    border-top: 1px solid var(--c-border2);
    padding-top: 20px;
}

.deactivate-checkbox {
    padding: 12px 16px;
    background: var(--c-surface2);
    border-radius: var(--radius-base);
    margin-bottom: 16px;
}

.deactivate-checkbox .form-check-input {
    width: 20px;
    height: 20px;
    margin-top: 0;
}

.deactivate-checkbox .form-check-input:checked {
    background-color: #14b8a6;
    border-color: var(--c-teal);
}

.deactivate-checkbox .form-check-label {
    font-size: var(--fs-base);
    padding-left: 8px;
    display: flex;
    align-items: center;
}

/* Formulář nového termínu */
.deactivate-new-form {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.deactivate-new-card {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border: 2px solid #5eead4;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
}

.deactivate-new-label {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--c-teal-dark);
    margin-bottom: 10px;
    display: block;
}

.deactivate-date-input {
    font-size: var(--fs-lg);
    font-weight: 600;
    padding: 12px 16px;
    border: 2px solid #99f6e4;
    border-radius: var(--radius-md);
    background: var(--c-surface);
}

.deactivate-date-input:focus {
    border-color: var(--c-teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.deactivate-new-hint {
    margin-top: 10px;
    font-size: var(--fs-sm);
    color: var(--c-teal-dark);
}

.deactivate-new-hint i {
    color: var(--c-teal);
}

/* Footer */
.deactivate-modal-footer {
    background: var(--c-surface2);
    border-top: 1px solid var(--c-border2);
    padding: 16px 24px;
    gap: 12px;
}

.deactivate-modal-footer .btn {
    padding: 10px 20px;
    font-weight: 500;
    border-radius: var(--radius-md);
}

.deactivate-modal-footer .btn-light {
    background: var(--c-surface);
    border: 1px solid var(--c-border2);
    color: var(--c-text4);
}

.deactivate-modal-footer .btn-light:hover {
    background: var(--c-surface3);
    color: var(--c-text2);
}

/* =====================================================
   FLATPICKR CUSTOMIZACE - TEAL THEME
   ===================================================== */

/* Základní styly inputu */
.flatpickr-input {
    background: var(--c-surface) !important;
}

/* Kalendář - hlavička */
.flatpickr-calendar {
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: none;
    font-family: inherit;
}

.flatpickr-months {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 8px 0;
}

.flatpickr-months .flatpickr-month {
    color: white;
    fill: white;
}

.flatpickr-current-month {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: white;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent;
    color: white;
    font-weight: 600;
}

.flatpickr-current-month input.cur-year {
    color: white;
    font-weight: 600;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: white;
    fill: white;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: white;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: white;
}

/* Dny v týdnu */
.flatpickr-weekdays {
    background: var(--c-teal-bg, #f0fdfa);
}

.flatpickr-weekday {
    color: var(--c-teal-dark);
    font-weight: 600;
    font-size: var(--fs-sm);
}

/* Jednotlivé dny */
.flatpickr-day {
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.15s ease;
}

.flatpickr-day:hover {
    background: #ccfbf1;
    border-color: #ccfbf1;
}

.flatpickr-day.today {
    border-color: var(--c-teal);
    background: var(--c-teal-bg, #f0fdfa);
}

.flatpickr-day.today:hover {
    background: #ccfbf1;
    border-color: var(--c-teal);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
    border-color: var(--c-teal);
    color: white;
}

.flatpickr-day.selected.today {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
}

/* Dny mimo měsíc */
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--c-border3);
}

.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: var(--c-surface3);
    border-color: var(--c-surface3);
}

/* Disabled dny */
.flatpickr-day.flatpickr-disabled {
    color: #e2e8f0;
}

/* Inner container */
.flatpickr-innerContainer {
    padding: 8px;
}

/* Animace */
.flatpickr-calendar.animate.open {
    animation: flatpickrFadeIn 0.2s ease;
}

@keyframes flatpickrFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input s ikonou */
.datepicker-wrapper {
    position: relative;
}

.datepicker-wrapper .datepicker-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-teal);
    pointer-events: none;
}

/* Flatpickr v modalu - větší z-index */
.flatpickr-calendar {
    z-index: 9999 !important;
}

/* =====================================================
   WATCHER DETAIL - INFO KARTA V3
   ===================================================== */

.watcher-info-card-inverted {
    background: var(--c-surface);
    border: 1px solid var(--c-border2);
    border-top: 4px solid #14b8a6;
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    padding: 0;
    color: var(--c-text);
}

/* Detail toolbar — breadcrumb + akce na jednom radku */
.detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.detail-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Hlavicka karty — Variant C (bily podklad, barevny nazev) */
.wi-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--c-surface3);
}
.wi-header h3 {
    margin: 0 0 4px;
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--accent, #14b8a6);
    line-height: 1.3;
}
.wi-header a {
    color: var(--c-text4);
    text-decoration: none;
    font-size: var(--fs-sm);
}
.wi-header a:hover {
    color: var(--accent, #14b8a6);
}
.wi-entity-context {
    font-size: var(--fs-xs);
    color: var(--c-text5);
    margin-top: 2px;
    background: #eef2f7;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}
.wi-entity-type {
    color: var(--c-text5);
}
[data-bs-theme="dark"] .wi-entity-context { background: #161b22; }
.wi-entity-context i {
    font-size: var(--fs-xs);
    margin-right: 3px;
}
.wi-entity-context a {
    color: var(--c-text4);
    text-decoration: none;
}
.wi-entity-context a:hover {
    color: var(--accent, #14b8a6);
}
.wi-header .wi-status-badge {
    /* sizing: badge-base badge-xs */
}

/* Typ banner (Ukol) — subtilni radek pod hlavickou */
/* wi-mode-pill styly jsou sjednoceny s .mode-pill vyse */

/* Telo karty */
.wi-body {
    padding: 0 16px 12px;
    text-align: left;
}

/* Meta info blok — pouzivany v Item detail */
.wi-meta {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0 -16px 10px;
    background: #e6ebf0;
    border-radius: 0;
    padding: 6px 16px;
}
[data-bs-theme="dark"] .wi-meta { background: #161b22; }
.wi-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #d5dbe2;
    font-size: var(--fs-sm);
}
[data-bs-theme="dark"] .wi-meta-row { border-bottom-color: rgba(255,255,255,0.08); }
.wi-meta-row:last-child { border-bottom: none; }
.wi-meta-label {
    color: var(--c-text4);
    display: flex;
    align-items: center;
    gap: 5px;
}
.wi-meta-label i {
    width: 14px;
    text-align: center;
    font-size: var(--fs-xs);
}
.wi-meta-value {
    font-weight: 600;
    color: var(--c-text);
}

/* Popis — pouzivany v Item detail */
.wi-description {
    background: var(--c-surface2);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    margin-top: 10px;
    font-size: var(--fs-sm);
    color: #475569;
    line-height: 1.5;
}
.wi-description p { margin: 0; }
[data-bs-theme="dark"] .wi-description { color: var(--c-text4); }

/* Footer info karty — pouzivany v Item detail */
.wi-footer {
    border-top: 1px solid var(--c-border2);
    margin: 10px -16px -12px;
    padding: 10px 16px 12px;
}
[data-bs-theme="dark"] .wi-footer { border-top-color: rgba(255,255,255,0.08); }

/* Sekce pracovniku — sdilena mezi Item a Watcher detail */
.wi-workers { margin-top: 10px; }
.wi-workers:first-child { margin-top: 0; }
.wi-workers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    background: var(--c-surface3);
    margin-left: -16px;
    margin-right: -16px;
    padding: 5px 16px;
}
.wi-workers-title {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--c-text4);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}
.wi-workers-title i { color: var(--c-teal-dark); }

/* Alert bar — varovani v karte */
.wi-alert-bar {
    font-size: var(--fs-xs);
    color: var(--status-warning-text);
    background: var(--status-warning-bg);
    padding: 6px 16px;
    border-bottom: 1px solid var(--status-warning-border);
}

/* Sekce v info karte */
.wi-section {
    padding: 10px 0;
    border-bottom: 1px solid var(--c-surface3);
}
.wi-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.wi-section-title {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--c-text4);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}
.wi-section-title i {
    color: var(--c-teal-dark);
    font-size: var(--fs-2xs);
}

/* Info radky */
.wi-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--c-surface3);
    color: var(--c-text);
    font-size: var(--fs-sm);
}
.wi-row:last-child {
    border-bottom: none;
}
.wi-row-label {
    color: var(--c-text4);
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fs-sm);
}
.wi-row-label i {
    color: var(--c-teal);
    width: 14px;
    text-align: center;
    font-size: var(--fs-xs);
}
.wi-row-value {
    font-weight: 600;
    color: var(--c-text);
    font-size: var(--fs-sm);
}
.wi-empty-value {
    color: var(--c-text5);
    font-weight: 400;
    font-size: var(--fs-sm);
    padding: 2px 0;
}

/* Nejblizsi termin — kompaktni radek */
.wi-next-deadline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.wi-next-days {
    font-weight: 700;
    font-size: var(--fs-sm);
}
.wi-days-danger { color: var(--status-danger-text); }
.wi-days-warning { color: var(--status-warning-text); }
.wi-days-ok { color: var(--status-ok-text); }
.wi-days-safe { color: var(--c-teal-dark); }
.wi-next-date {
    font-size: var(--fs-xs);
    color: var(--c-text5);
}
.wi-next-title {
    font-size: var(--fs-xs);
    color: var(--c-text4);
    font-style: italic;
}
.wi-next-empty {
    color: var(--c-text5);
    font-size: var(--fs-sm);
}

/* Tym blok */
.wi-team-block {
    margin-top: 6px;
}
.wi-team-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 0;
}
.wi-remove-link {
    color: var(--status-danger-text);
    text-decoration: none;
    font-size: var(--fs-2xs);
}
.wi-remove-link:hover {
    color: var(--status-danger-text);
    opacity: 0.7;
}
.wi-group-count {
    font-weight: 400;
    color: var(--c-text4);
    font-size: var(--fs-2xs);
}
.wi-chevron {
    font-size: var(--fs-2xs);
    margin-left: 3px;
    transition: transform 0.2s;
}
.wi-group-toggle[aria-expanded="true"] .wi-chevron {
    transform: rotate(180deg);
}

/* Popis sekce */
.wi-description-text {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--c-text3);
    line-height: 1.5;
}

/* Sekce pracovniku */
.wi-worker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: var(--fs-sm);
    color: var(--c-text);
}
.wi-worker-item i.fa-user {
    font-size: var(--fs-xs);
    color: var(--c-text5);
    width: 14px;
    text-align: center;
}
.wi-worker-name {
    font-weight: 500;
    color: var(--c-text);
}
.wi-worker-item-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-sm);
    color: var(--c-text);
    margin-right: 8px;
}
.wi-worker-item-inline i.fa-user {
    font-size: var(--fs-xs);
    color: var(--c-text5);
}
.wi-worker-item-inline .wi-remove-link {
    margin-left: 2px;
}
.wi-group-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-xs);
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: var(--radius-base);
    font-weight: 500;
    margin: 4px 0 2px;
}
.wi-worker-source {
    font-size: var(--fs-xs);
    color: var(--c-text5);
    margin-top: 4px;
}

/* Legacy — ponechano pro kompatibilitu s item detail */
.wi-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--c-border2);
    flex-wrap: wrap;
}

/* Dropdown pro prirazeni osob/tymu — systemovy styl */
.panel-info-row .dropdown-menu,
.wi-workers .dropdown-menu {
    z-index: 1060;
    font-size: var(--fs-sm);
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid var(--c-border);
    padding: 4px 0;
}
.panel-info-row .dropdown-item,
.wi-workers .dropdown-item {
    font-size: var(--fs-sm);
    padding: 6px 12px;
    color: var(--c-text);
}
.panel-info-row .dropdown-item:hover,
.wi-workers .dropdown-item:hover {
    background: var(--c-surface2);
    color: var(--c-primary);
}

/* Oddělovač */
/* Compact countdown strip */
.watcher-compact-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 0 0 4px;
    background: var(--c-surface2);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    color: #475569;
    flex-wrap: wrap;
}
.watcher-compact-days {
    font-weight: 700;
    font-size: var(--fs-md);
}
[data-bs-theme="dark"] .watcher-compact-strip {
    background: #0f172a;
    color: var(--c-text5);
}

.info-divider-inverted {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 20px 0;
}

/* Info řádky — kompaktnější */
.info-row-inverted {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--c-surface3);
}

.info-row-inverted:last-of-type {
    border-bottom: none;
}

.info-label-inverted {
    color: var(--c-text4);
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
}

.info-label-inverted i {
    color: var(--c-teal);
    width: 18px;
    font-size: var(--fs-xs);
}

.info-value-inverted {
    font-weight: 600;
    color: var(--c-text);
    font-size: var(--fs-sm);
}

/* Popis */
.watcher-description-inverted {
    background: var(--c-surface2);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin: 12px 0 0;
    text-align: left;
}

.watcher-description-inverted p {
    margin: 0;
    color: var(--c-text3);
    font-size: var(--fs-sm);
    line-height: 1.5;
}

/* =====================================================
   HISTORIE TABULKA - VYLEPŠENÍ
   ===================================================== */

.history-table {
    width: 100%;
    margin: 0;
}

.history-table thead th {
    background: var(--c-surface2);
    color: var(--c-text4);
    font-weight: 600;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 2px solid var(--c-border2);
}

.history-table tbody td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--c-surface3);
    font-size: var(--fs-sm);
}

/* Item link v tabulce */
.history-table .item-link {
    font-weight: 600;
    text-decoration: none;
}

/* Watcher link v tabulce */
.watcher-link {
    text-decoration: none;
}
.watcher-link-box {
    text-decoration: none;
    font-weight: 600;
}
.watcher-link-box.mode-deadline {
    color: var(--c-teal-dark);
}
.watcher-link-box.mode-deadline:hover {
    color: var(--c-teal-dark);
}
.watcher-link-box.mode-task {
    color: #1e40af;
}
.watcher-link-box.mode-task:hover {
    color: var(--c-primary-hover);
}
.watcher-link-box .mode-icon {
    margin-right: 5px;
    font-size: var(--fs-sm);
    opacity: 0.7;
}
.watcher-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    margin-right: 5px;
    opacity: 0.85;
    vertical-align: middle;
}
.watcher-link-name {
    text-decoration: none;
    font-weight: 400;
    color: var(--c-text);
    vertical-align: middle;
}
.watcher-link-name:hover {
    color: var(--c-teal-dark);
}
/* Watcher name jako pill — barva podle mode */
.watcher-name-pill {
    display: inline-block;
    text-decoration: none;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    vertical-align: middle;
    font-size: var(--fs-sm);
}
.watcher-pill-task {
    background: var(--c-primary-bg, #eff6ff);
    color: var(--c-text);
    border: 1px solid #bfdbfe;
}
.watcher-pill-task:hover { background: #dbeafe; text-decoration: none; }
.watcher-pill-deadline {
    background: var(--c-teal-bg, #f0fdfa);
    color: var(--c-text);
    border: 1px solid #99f6e4;
}
.watcher-pill-deadline:hover { background: #ccfbf1; text-decoration: none; }
[data-bs-theme="dark"] .watcher-link-name { color: #e2e8f0; }
[data-bs-theme="dark"] .watcher-link-name:hover { color: #5eead4; }
[data-bs-theme="dark"] .watcher-pill-task { background: rgba(30,64,175,0.15); color: #e2e8f0; border-color: rgba(59,130,246,0.3); }
[data-bs-theme="dark"] .watcher-pill-task:hover { background: rgba(30,64,175,0.25); }
[data-bs-theme="dark"] .watcher-pill-deadline { background: rgba(13,148,136,0.15); color: #e2e8f0; border-color: rgba(20,184,166,0.3); }
[data-bs-theme="dark"] .watcher-pill-deadline:hover { background: rgba(13,148,136,0.25); }

.history-table tbody tr:last-child td {
    border-bottom: none;
}

.history-table tbody tr:hover {
    background: var(--c-surface2);
}

/* date-cell, date-muted — viz centralni definice (radek ~1887) */

/* Status badges — viz centralni definice vyse (radek ~1924) */

/* Card header s tlačítkem */
.content-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #eef2f7;
    border-bottom: 2px solid #e2e8f0;
    padding: 10px 16px;
    font-weight: 500;
    font-size: var(--fs-base);
    color: var(--c-text);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--c-text5);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--c-border3);
}

.empty-state p {
    font-size: var(--fs-md);
    margin-bottom: 0;
}
/* Tlacitko uspech */
.btn-success {
    background: linear-gradient(135deg, var(--status-done-text) 0%, #059669 100%);
    border: none;
    color: #fff;
    padding: var(--btn-padding-md);
    border-radius: var(--btn-radius);
    font-weight: var(--btn-font-weight);
    font-size: var(--btn-font-size-md);
    box-shadow: var(--btn-shadow-green);
    transition: var(--btn-transition);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--btn-shadow-green-hover);
}

/* Tlacitko nebezpeci */
.btn-danger {
    background: linear-gradient(135deg, var(--status-danger-text) 0%, var(--status-danger-text) 100%);
    border: none;
    color: #fff;
    padding: var(--btn-padding-md);
    border-radius: var(--btn-radius);
    font-weight: var(--btn-font-weight);
    font-size: var(--btn-font-size-md);
    box-shadow: var(--btn-shadow-danger);
    transition: var(--btn-transition);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--status-danger-text) 0%, #b91c1c 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--btn-shadow-danger-hover);
}

/* =====================================================
   ZVÝRAZNĚNÍ AKTIVNÍHO ŘÁDKU V TABULCE
   ===================================================== */

/* Aktivní řádek - výrazné zvýraznění */
.history-table tbody tr.row-active,
.items-table tbody tr.row-active {
    background: linear-gradient(90deg, #ecfdf5 0%, #f0fdf4 100%);
}

.history-table tbody tr.row-active:hover,
.items-table tbody tr.row-active:hover {
    background: linear-gradient(90deg, #d1fae5 0%, #dcfce7 100%);
}

/* Pending řádek - jemné zvýraznění */
.history-table tbody tr.row-pending,
.items-table tbody tr.row-pending {
    background: var(--status-caution-bg);
}

.history-table tbody tr.row-pending:hover,
.items-table tbody tr.row-pending:hover {
    background: var(--status-caution-bg);
}

/* Completed řádky - zašedlé */
.history-table tbody tr.row-completed,
.items-table tbody tr.row-completed {
    opacity: 0.7;
}

.history-table tbody tr.row-completed:hover,
.items-table tbody tr.row-completed:hover {
    opacity: 1;
}
/* =====================================================
   TEAL FORMULÁŘ + HELP CARD
   ===================================================== */

/* Teal varianta formuláře */
.form-card-teal .form-card-b-header {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
}

.form-card-teal .btn-teal {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
    border: none;
    color: #fff;
}

.form-card-teal .btn-teal:hover {
    background: linear-gradient(135deg, var(--c-teal-dark) 0%, #0f766e 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--btn-shadow-teal-hover);
}

/* Mode picker — vyber rezimu hlidace */
.mode-picker-header {
    background: var(--c-surface3);
    padding: 1rem 2rem;
    border-bottom: 2px solid #cbd5e1;
}
[data-bs-theme="dark"] .mode-picker-header {
    background: #1c2333;
    border-bottom-color: rgba(255,255,255,0.1);
}
.mode-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0;
}
.mode-picker-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--c-border2);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--c-surface);
}
.mode-picker-card:hover {
    border-color: #94a3b8;
    background: var(--c-surface2);
}
.mode-picker-card.active {
    border-color: var(--c-teal);
    background: rgba(20, 184, 166, 0.06);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}
.mode-picker-card.active .mode-picker-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.mode-picker.has-selection .mode-picker-card:not(.active) {
    opacity: 0.5;
}
.mode-picker-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.mode-picker-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-base);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--fs-base);
    color: white;
}
.mode-picker-icon.icon-deadline {
    background: linear-gradient(135deg, #22c55e, var(--status-ok-text));
}
.mode-picker-icon.icon-task {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-hover));
}
.mode-picker-icon.icon-both {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}
.mode-picker-text {
    flex: 1;
    min-width: 0;
}
.mode-picker-title {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--c-text);
    line-height: 1.2;
}
.mode-picker-desc {
    font-size: var(--fs-xs);
    color: var(--c-text4);
    margin-top: 2px;
    line-height: 1.3;
}
.mode-picker-card.active .mode-picker-title {
    color: var(--c-teal-dark);
}
[data-bs-theme="dark"] .mode-picker-card:hover {
    background: #1c2333;
    border-color: #475569;
}
[data-bs-theme="dark"] .mode-picker-card.active {
    background: rgba(20, 184, 166, 0.08);
    border-color: var(--c-teal);
}

/* Zvyraznene pole (napr. nazev hlidace) */
.floating-group.fg-highlight .form-control,
.floating-group.fg-highlight .form-select {
    background: var(--status-ok-bg);
    border-color: var(--status-ok-border);
}
.floating-group.fg-highlight .form-control:focus,
.floating-group.fg-highlight .form-select:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}
.floating-group.fg-highlight > label {
    color: var(--status-ok-text);
}
[data-bs-theme="dark"] .floating-group.fg-highlight .form-control,
[data-bs-theme="dark"] .floating-group.fg-highlight .form-select {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.3);
}

/* Formularovy separator */
.form-separator {
    border: none;
    border-top: 2px solid #cbd5e1;
    margin: 0.5rem 0 1.25rem;
}
[data-bs-theme="dark"] .form-separator {
    border-top-color: rgba(255,255,255,0.15);
}

/* Help card */
.help-card {
    background: var(--c-surface2);
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.help-card-header {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 14px 20px;
    font-weight: 600;
    font-size: var(--fs-md);
}

.help-card-header i {
    margin-right: 8px;
}

.help-card-body {
    padding: 20px;
}

.help-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--c-border2);
    font-size: var(--fs-base);
    color: var(--c-text3);
    line-height: 1.5;
}

.help-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.help-item strong {
    color: var(--c-text);
}

/* Floating group s input-group fix */
.floating-group .input-group {
    position: relative;
}

.floating-group .input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.floating-group .input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    height: 100%;
}

.floating-group .input-group + label {
    position: absolute;
    top: -10px;
    left: 12px;
    background: var(--c-surface);
    padding: 0 6px;
    font-size: var(--fs-xs);
    color: var(--c-text4);
    z-index: 5;
}

/* Floating group small text pod inputem */
.floating-group .form-text {
    display: block;
    margin-top: 6px;
    font-size: var(--fs-sm);
}

/* Link teal — viz centralni definice (radek ~2365) */

/* Panel pro Termíny */
.panel {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-border2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
/* Dashboard panely — title vlevo, badge/toggle doprava pres margin-left:auto */
.dash-panel .panel-header {
    justify-content: flex-start;
}

.panel-header.bg-danger {
    background: linear-gradient(135deg, var(--status-danger-text) 0%, var(--status-danger-text) 100%);
    border-bottom: none;
}

.panel-title {
    font-weight: 600;
    font-size: var(--fs-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    font-size: var(--fs-lg);
}

.panel-body {
    padding: 20px;
}

/* Text blue — viz centralni .text-purple (radek ~2390) */

/* Hidden row při filtrování */
.items-table tbody tr.hidden {
    display: none;
}
/* =====================================================
   STATUS CHANGE SECTION v MODÁLECH
   ===================================================== */

/* Status badge v info panelu */
.item-status-badge {
    /* sizing: badge-base badge-lg */
    margin-top: 8px;
}

/* Status change section */
.status-change-section {
    border-top: 1px solid var(--c-border2);
    padding-top: 16px;
    margin-top: 16px;
}

.status-change-checkbox {
    padding: 12px 16px;
    background: var(--c-surface2);
    border-radius: var(--radius-md);
    margin-bottom: 0;
}

.status-change-checkbox .form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.15em;
}

.status-change-checkbox .form-check-label {
    font-size: var(--fs-base);
    display: flex;
    align-items: center;
}

.status-change-form {
    margin-top: 12px;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-change-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #86efac;
    border-radius: var(--radius-base);
    padding: 16px;
}

.status-change-label {
    display: block;
    font-weight: 600;
    color: #166534;
    margin-bottom: 10px;
    font-size: var(--fs-base);
}

.status-change-card .form-select {
    border: 2px solid #86efac;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: var(--fs-base);
    background-color: var(--c-surface);
}

.status-change-card .form-select:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.status-change-hint {
    margin-top: 10px;
    font-size: var(--fs-sm);
    color: #166534;
}

.status-change-hint strong {
    color: #15803d;
}

/* Aktivační modal - zelená verze status change */
#activateModal .status-change-card {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #6ee7b7;
}

#activateModal .status-change-label {
    color: #047857;
}

#activateModal .status-change-card .form-select {
    border-color: #6ee7b7;
}

#activateModal .status-change-card .form-select:focus {
    border-color: var(--status-done-text);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

#activateModal .status-change-hint {
    color: #047857;
}

/* Deaktivační modal - teal verze status change */
#deactivateModal .status-change-card {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border-color: #5eead4;
}

#deactivateModal .status-change-label {
    color: var(--c-teal-dark);
}

#deactivateModal .status-change-card .form-select {
    border-color: #5eead4;
}

#deactivateModal .status-change-card .form-select:focus {
    border-color: var(--c-teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

#deactivateModal .status-change-hint {
    color: var(--c-teal-dark);
}

/* Aktivační modal - zelený design */
.activate-card {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    border-radius: var(--radius-base);
    padding: 16px;
}

.activate-label {
    display: block;
    font-weight: 600;
    color: #047857;
    margin-bottom: 10px;
    font-size: var(--fs-base);
}

.activate-date-input {
    border: 2px solid #6ee7b7;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: var(--fs-md);
}

.activate-date-input:focus {
    border-color: var(--status-done-text);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.activate-hint {
    margin-top: 10px;
    font-size: var(--fs-sm);
    color: #047857;
}
/* =====================================================
   ITEM CARD VARIANTA C - Horní barevný pruh
   ===================================================== */

/* Grid layout pro karty — viz centralni .items-grid (radek ~831) */

/* Základní karta */
.item-card-c {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.item-card-c:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.item-card-c.hidden {
    display: none;
}

/* Horní gradient pruh */
.item-card-c-accent {
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, var(--c-primary-light) 100%);
}

/* Body karty */
.item-card-c-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Header */
.item-card-c-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #eef2f7;
    margin: -14px -14px 0;
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-border2);
}

.item-card-c-icon {
    width: 36px;
    height: 36px;
    background: #f0f0f5;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: var(--fs-base);
    flex-shrink: 0;
}

.item-card-c-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.item-card-c-link:hover {
    color: inherit;
}
.item-card-c-link:hover .item-card-c-title {
    color: var(--c-primary);
}

.item-card-c-title-block {
    flex: 1;
    min-width: 0;
}

.item-card-c-title {
    font-size: var(--fs-md);
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
    line-height: 1.3;
    text-decoration: none;
    display: block;
    transition: color 0.12s;
}

.item-card-c-subtitle {
    font-size: var(--fs-sm);
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
}

.item-card-c-type {
    color: var(--c-primary);
    font-weight: 600;
    font-size: var(--fs-xs);
}

/* Divider */
.item-card-c-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 16px 0;
}

/* Info sekce — inline meta chipy */
.item-card-c-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    padding-top: 10px;
    font-size: var(--fs-xs);
    color: var(--c-text4);
}
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.meta-chip + .meta-chip::before {
    content: "\00b7";
    color: var(--c-border3);
    margin-right: 4px;
}
.meta-chip-status {
    margin-left: auto;
}
.meta-chip-status::before {
    content: none !important;
}

/* Firma — samostatny radek s podbarvenim */
.item-card-c-company {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 5px 10px;
    background: var(--c-surface3);
    border-radius: 6px;
    font-size: var(--fs-xs);
    color: #475569;
    font-weight: 500;
}
.item-card-c-company i {
    color: var(--c-text5);
    font-size: var(--fs-xs);
}

/* Status tečka */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    display: inline-block;
}
.status-dot-only {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    display: inline-block;
    cursor: help;
}

/* Statistiky */
.item-card-c-stats {
    display: flex;
    gap: 24px;
    padding: 16px 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
}

.item-card-c-stat {
    text-align: left;
}

.item-card-c-stat-number {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.item-card-c-stat-label {
    font-size: var(--fs-xs);
    color: #888;
    margin-top: 2px;
}

/* Akce */
.item-card-c-actions {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.item-card-c-btn {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-md);
    background: var(--c-surface);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.item-card-c-btn:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    text-decoration: none;
}

.item-card-c-btn.primary {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: white;
}

.item-card-c-btn.primary:hover {
    background: var(--c-primary-hover);
    color: white;
}

/* Prepinac zobrazeni — 3 rezimy: grid (default), table, slim */
body:not(.table-view):not(.show-slim) .view-grid { display: grid; }
body:not(.table-view):not(.show-slim) .view-table { display: none; }
body:not(.table-view):not(.show-slim) .view-slim { display: none; }

body.table-view .view-grid { display: none; }
body.table-view .view-table { display: block; }
body.table-view .view-slim { display: none; }

body.show-slim .view-grid { display: none; }
body.show-slim .view-table { display: none; }
body.show-slim .view-slim { display: block; }

/* btn-purple — alias pro btn-primary (zachovano pro zpetnou kompatibilitu) */
.btn-purple {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    border: none;
    color: #fff;
    padding: var(--btn-padding-md);
    border-radius: var(--btn-radius);
    font-weight: var(--btn-font-weight);
    font-size: var(--btn-font-size-md);
    box-shadow: var(--btn-shadow-blue);
    transition: var(--btn-transition);
}

.btn-purple:hover {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--btn-shadow-blue-hover);
}

.btn-outline-purple {
    border: 1.5px solid #3b82f6;
    color: var(--c-primary);
    background: transparent;
    padding: var(--btn-padding-md);
    border-radius: var(--btn-radius);
    font-weight: var(--btn-font-weight);
    font-size: var(--btn-font-size-md);
    transition: var(--btn-transition);
}

.btn-outline-purple:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--c-primary-hover);
    border-color: var(--c-primary-hover);
}

/* Teal badge light */
.bg-teal-light {
    background-color: #ccfbf1;
}

/* Table hidden row */
#itemsTable tbody tr.hidden {
    display: none;
}
/* =====================================================
   DEADLINE BADGE STYLY (pro Watcher karty)
   ===================================================== */

.badge-deadline-none,
.badge-deadline-pending,
.badge-deadline-confirmed,
.badge-deadline-warning,
.badge-deadline-danger {
    /* sizing: badge-base badge-lg */
}

.badge-deadline-none i,
.badge-deadline-pending i,
.badge-deadline-confirmed i,
.badge-deadline-warning i,
.badge-deadline-danger i {
    font-size: var(--fs-xs);
}

/* Bez termínu - teal */
.badge-deadline-none {
    background: var(--c-teal-bg, #f0fdfa);
    color: var(--c-teal-dark);
}

/* Čeká na aktivaci - oranžový s čárkovaným rámečkem */
.badge-deadline-pending {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
    border: 1px dashed var(--status-warning-border);
}

/* Aktivováno - zelený */
.badge-deadline-confirmed {
    background: var(--status-ok-bg);
    color: var(--status-ok-text);
}

/* Blíží se termín - žlutý */
.badge-deadline-warning {
    background: var(--status-caution-bg);
    color: var(--status-warning-text);
}

/* Po termínu - červený */
.badge-deadline-danger {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}

/* =====================================================
   DEADLINE TABLE STYLES
   ===================================================== */

/* Legenda */
.deadline-legend {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    font-size: var(--fs-sm);
    color: #666;
}

.deadline-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.deadline-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-xs);
}

.deadline-legend-dot.pending {
    background: var(--status-warning-bg);
    border: 1px dashed #fdba74;
}

.deadline-legend-dot.confirmed {
    background: var(--c-surface);
    border: 1px solid #e0e0e0;
}

/* Řádek čekající na aktivaci */
#deadlinesTable tbody tr.row-pending {
    background: #fffbf5;
}

#deadlinesTable tbody tr.row-pending:hover {
    background: var(--status-warning-bg);
}

/* Days value - jen barevný text */
.days-value {
    font-weight: 600;
    font-size: var(--fs-base);
}

.days-value.ok {
    color: var(--status-ok-text);
}

.days-value.warning {
    color: var(--status-warning-text);
}

.days-value.danger {
    color: var(--status-danger-text);
}

.days-value.muted {
    color: #999;
}

/* Menší tlačítka */
.btn-sm {
    padding: 6px 12px;
    font-size: var(--fs-sm);
}

/* Hidden rows */
#deadlinesTable tbody tr.hidden,
#watchersTable tbody tr.hidden {
    display: none;
}
/* =====================================================
   KALENDÁŘ - Calendar Styles

   ===================================================== */

/* Stránka kalendáře */
.calendar-page {
    max-width: 1400px;
}

/* Kalendářová karta */
.calendar-card {
    background: var(--c-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Hlavička kalendáře */
.calendar-header {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-base);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}

.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.calendar-title {
    text-align: center;
    color: white;
}

.calendar-month {
    font-size: var(--fs-xl);
    font-weight: 700;
    display: block;
}

.calendar-year {
    font-size: var(--fs-base);
    opacity: 0.85;
}

.calendar-today-btn-wrapper {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
    padding: 0 1.5rem 1rem;
    text-align: center;
}

/* Kalendářní tabulka */
.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-table th {
    padding: 14px 8px;
    text-align: center;
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--c-text4);
    background: var(--c-surface2);
    border-bottom: 1px solid var(--c-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-table th.weekend {
    color: var(--c-text5);
}

.calendar-table td.calendar-day {
    padding: 8px;
    text-align: center;
    vertical-align: top;
    height: 85px;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    position: relative;
    cursor: default;
}

.calendar-table td.calendar-day.empty {
    background: #fafafa;
}

.calendar-table td.calendar-day.has-deadlines {
    cursor: pointer;
}

.calendar-table td.calendar-day:hover:not(.empty) {
    background: var(--c-teal-bg, #f0fdfa);
}

.calendar-table td.calendar-day.selected {
    background: #ccfbf1 !important;
    box-shadow: inset 0 0 0 2px #14b8a6;
}

/* Den - číslo */
.day-number {
    font-weight: 500;
    font-size: var(--fs-md);
    color: #374151;
    margin-bottom: 6px;
}

.calendar-table td.calendar-day.today .day-number {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
    color: white;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: var(--radius-full);
    display: inline-block;
    font-weight: 600;
}

.calendar-table td.calendar-day.today {
    background: var(--c-teal-bg, #f0fdfa);
}

/* Indikátory termínů */
.day-indicators {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.indicator-success {
    background: var(--status-done-text);
}

.indicator-warning {
    background: var(--status-warning-text);
}

.indicator-danger {
    background: var(--status-danger-text);
}

.deadline-count {
    font-size: var(--fs-2xs);
    font-weight: 700;
    color: var(--c-text4);
    background: #e5e7eb;
    padding: 1px 6px;
    border-radius: var(--radius-base);
    line-height: 1.5;
}

/* Dny s termíny - barvy pozadí */
.calendar-table td.calendar-day.has-deadlines {
    background: #fefce8;
}

.calendar-table td.calendar-day.has-deadlines:hover {
    background: #fef9c3;
}

.calendar-table td.calendar-day.has-overdue {
    background: var(--status-danger-bg);
}

.calendar-table td.calendar-day.has-overdue:hover {
    background: var(--status-danger-bg);
}

.calendar-table td.calendar-day.only-pending {
    background: var(--status-caution-bg);
}

/* Legenda */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 16px;
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    margin-top: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    color: var(--c-text4);
}

.today-marker {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
    border-radius: var(--radius-full);
}

/* Detail dne - boční panel */
.calendar-detail-card {
    background: var(--c-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.calendar-detail-header {
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
    color: white;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: var(--fs-md);
}

.calendar-detail-body {
    padding: 1.25rem;
}

/* Seznam termínů v detailu */
.deadline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.deadline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-base);
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.deadline-item:hover {
    border-color: var(--c-teal);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.12);
    text-decoration: none;
    color: inherit;
}

.deadline-item.pending {
    border-left: 3px solid #f59e0b;
}

.deadline-item.confirmed {
    border-left: 3px solid #10b981;
}

.deadline-item-status {
    flex-shrink: 0;
}

.deadline-item-content {
    flex: 1;
    min-width: 0;
}

.deadline-item-name {
    font-weight: 600;
    color: var(--c-text);
    font-size: var(--fs-md);
    margin-bottom: 4px;
}

.deadline-item-meta {
    font-size: var(--fs-sm);
    color: var(--c-text4);
    display: flex;
    align-items: center;
    gap: 6px;
}

.deadline-item-meta i {
    font-size: var(--fs-xs);
    opacity: 0.7;
}

.deadline-item-link {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--c-teal-bg, #f0fdfa);
    color: var(--c-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.deadline-item-link:hover {
    background: var(--c-teal);
    color: white;
}

/* Status badge — viz centralni definice vyse (radek ~1924) */

/* Prázdný stav kalendáře */
.calendar-empty {
    text-align: center;
    padding: 2rem;
    color: var(--c-text5);
}

.calendar-empty i {
    font-size: var(--fs-3xl);
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

.calendar-empty p {
    margin: 0;
    font-size: var(--fs-base);
}

.calendar-empty.small {
    padding: 1.5rem;
}

.calendar-empty.small i {
    font-size: var(--fs-xl);
    margin-bottom: 8px;
}

.calendar-empty.small p {
    font-size: var(--fs-sm);
}

/* Nadcházející termíny */
.calendar-upcoming-card {
    background: var(--c-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.calendar-upcoming-header {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: var(--fs-md);
    color: var(--c-text);
    border-bottom: 1px solid var(--c-surface3);
}

.calendar-upcoming-body {
    padding: 0;
}

.upcoming-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.upcoming-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 1.25rem;
    border-bottom: 1px solid #f8fafc;
}

.upcoming-item:last-child {
    border-bottom: none;
}

.upcoming-info {
    min-width: 0;
    flex: 1;
}

.upcoming-name {
    font-weight: 500;
    font-size: var(--fs-sm);
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upcoming-meta {
    font-size: var(--fs-xs);
    color: var(--c-text5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upcoming-date {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 12px;
}

.upcoming-date.pending {
    background: var(--status-caution-bg);
    color: #92400e;
}

.upcoming-date.confirmed {
    background: var(--status-ok-bg);
    color: #065f46;
}

/* Responzivita */
@media (max-width: 991px) {
    .calendar-table td.calendar-day {
        height: 65px;
        padding: 6px;
    }
    
    .day-number {
        font-size: var(--fs-sm);
    }
    
    .calendar-table td.calendar-day.today .day-number {
        width: 26px;
        height: 26px;
        line-height: 26px;
    }
    
    .calendar-legend {
        gap: 12px;
    }
}

@media (max-width: 576px) {
    .calendar-table th {
        padding: 10px 4px;
        font-size: var(--fs-xs);
    }
    
    .calendar-table td.calendar-day {
        height: 55px;
        padding: 4px;
    }
    
    .day-number {
        font-size: var(--fs-sm);
    }
    
    .indicator {
        width: 7px;
        height: 7px;
    }
    
    .deadline-count {
        display: none;
    }
    
    .calendar-month {
        font-size: var(--fs-lg);
    }
}
/* =====================================================
   ITEM LINK CARD - Varianta C2 (bílá + teal rámeček)
   ===================================================== */

/* Label HLÍDAČ nad názvem */
.watcher-type-label {
    display: inline-block;
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-xl);
    font-size: var(--fs-2xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

/* Hlavní kontejner odkazu na položku */
.item-link-card {
    display: block;
    background: var(--c-surface2);
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--c-text);
    transition: all 0.2s ease;
    margin-bottom: 16px;
    overflow: hidden;
}

.item-link-card:hover {
    border-color: var(--c-teal);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.15);
    transform: translateY(-2px);
    color: var(--c-text);
    text-decoration: none;
}

/* Banner s názvem položky */
.item-link-banner {
    background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--c-border2);
}

/* Ikona typu položky */
.item-link-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-lg);
    flex-shrink: 0;
    color: white;
}

/* Info o položce */
.item-link-info {
    flex: 1;
    min-width: 0;
}

.item-link-name {
    font-weight: 800;
    font-size: var(--fs-lg);
    margin-bottom: 2px;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-link-type {
    font-size: var(--fs-sm);
    color: var(--c-text4);
}

.item-link-type i {
    color: var(--c-primary);
}

/* Šipka */
.item-link-arrow {
    width: 28px;
    height: 28px;
    background: var(--c-surface);
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-sm);
    color: var(--c-text5);
    flex-shrink: 0;
    transition: all 0.2s;
}

.item-link-card:hover .item-link-arrow {
    background: var(--c-teal);
    border-color: var(--c-teal);
    color: white;
}

/* Pruh s detaily (umístění + stav) */
.item-details-strip {
    display: flex;
    background: var(--c-surface);
}

.item-detail-cell {
    flex: 1;
    padding: 10px 14px;
    border-right: 1px solid var(--c-border2);
    text-align: center;
}

.item-detail-cell:last-child {
    border-right: none;
}

.item-detail-cell .detail-label {
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--c-text5);
    margin-bottom: 4px;
}

.item-detail-cell .detail-value {
    font-size: var(--fs-sm);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--c-text2);
}

.item-detail-cell .detail-value i {
    color: var(--c-teal);
    font-size: var(--fs-xs);
}

/* Responzivita */
@media (max-width: 576px) {
    .item-link-banner {
        padding: 12px;
    }
    
    .item-link-icon {
        width: 40px;
        height: 40px;
        font-size: var(--fs-md);
    }
    
    .item-link-name {
        font-size: var(--fs-md);
    }
    
    .item-detail-cell {
        padding: 8px 10px;
    }
    
    .item-detail-cell .detail-value {
        font-size: var(--fs-xs);
    }
}
/* =====================================================
   ITEM INFO CARD - INVERTED (bílé pozadí + fialový rámeček)
   Jednotný styl s Watcher detail
   ===================================================== */

.item-info-card-inverted {
    background: var(--c-surface);
    border: 1px solid var(--c-border2);
    border-top: 4px solid #3b82f6;
    border-radius: var(--radius-xl);
    padding: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    color: var(--c-text);
}

/* Label ITEM — kompaktni pill vedle nazvu */
.item-type-label {
    display: inline-block;
    background: var(--c-primary-bg, #eff6ff);
    color: var(--c-primary);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-2xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.item-title-inverted {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: 4px;
}

/* Editovatelna zona — svetlejsi pozadi, affordance editace */
.wi-edit-zone {
    background: var(--c-surface2);
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid var(--c-surface3);
    padding: 10px 20px;
}
.wi-edit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}
.wi-edit-row:not(:last-child) {
    border-bottom: 1px solid #e8ecf0;
}
.wi-edit-label {
    color: var(--c-text4);
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.wi-edit-label i {
    width: 14px;
    text-align: center;
    font-size: var(--fs-xs);
}
.wi-edit-select {
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: var(--fs-sm);
    font-family: inherit;
    font-weight: 400;
    color: var(--c-text);
    background: white;
    cursor: pointer;
    transition: border-color 0.15s;
    min-width: 120px;
    max-width: 100%;
    width: auto;
}
.wi-edit-select:hover {
    border-color: var(--accent, #3b82f6);
}
.wi-edit-select:focus {
    outline: none;
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

/* Karta hlídače - odkaz */
.watcher-link-card {
    display: block;
    background: var(--c-surface2);
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--c-text);
    transition: all 0.2s ease;
    margin-bottom: 12px;
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
}

.watcher-link-card:hover {
    border-color: var(--c-teal);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.15);
    transform: translateY(-2px);
    color: var(--c-text);
    text-decoration: none;
}

.watcher-link-banner {
    background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--c-border2);
}

.watcher-link-info {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.watcher-link-banner .watcher-link-name {
    font-weight: 800;
    font-size: var(--fs-lg);
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.watcher-link-meta {
    font-size: var(--fs-sm);
    color: var(--c-text4);
}

.watcher-link-meta i {
    color: var(--c-teal);
}

.watcher-link-arrow {
    width: 28px;
    height: 28px;
    background: var(--c-surface);
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-sm);
    color: var(--c-text5);
    flex-shrink: 0;
    transition: all 0.2s;
}

.watcher-link-card:hover .watcher-link-arrow {
    background: var(--c-teal);
    border-color: var(--c-teal);
    color: white;
}

.watcher-details-strip {
    display: flex;
    background: var(--c-surface);
}

.watcher-detail-cell {
    flex: 1;
    padding: 10px 14px;
    border-right: 1px solid var(--c-border2);
    text-align: center;
}

.watcher-detail-cell:last-child {
    border-right: none;
}

.watcher-detail-cell .detail-label {
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--c-text5);
    margin-bottom: 4px;
}

.watcher-detail-cell .detail-value {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--c-text2);
}

/* Barevné hodnoty dní */
.days-ok {
    color: var(--status-ok-text);
}

.days-warning {
    color: var(--status-warning-text);
}

.days-danger {
    color: var(--status-danger-text);
}

/* Poznámka o dalších hlídačích */
.more-watchers-note {
    font-size: var(--fs-xs);
    color: var(--c-text4);
    margin-bottom: 8px;
}

/* Prázdný stav - žádní hlídači */
.no-watchers-box {
    background: var(--c-surface2);
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    text-align: center;
}

.no-watchers-icon {
    font-size: var(--fs-xl);
    color: var(--c-border3);
    margin-bottom: 8px;
}

.no-watchers-text {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-text5);
}

/* (Item info radky a oddelovac nahrazeny sdilenym wi-meta/wi-footer systemem) */

/* Popis */
.item-description-inverted {
    background: var(--c-surface2);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 16px;
    text-align: left;
}

.item-description-inverted p {
    color: var(--c-text3);
    margin: 0;
    font-size: var(--fs-base);
}

/* (btn-action styly presunute do centralni sekce) */

/* Status indikátor s dynamickou barvou */

/* Responzivita */
@media (max-width: 576px) {
    .watcher-link-banner {
        padding: 12px;
    }
    
    .watcher-link-banner .watcher-link-name {
        font-size: var(--fs-md);
    }

    .watcher-detail-cell {
        padding: 8px 10px;
    }
}
/* =====================================================
   WATCHER STATUS BADGE - pro tabulku hlídačů
   ===================================================== */

.watcher-status-badge {
    /* sizing: badge-base badge-lg */
}

.watcher-status-badge.pending {
    background: var(--status-warning-bg);
    color: #c2410c;
    border: 1px dashed var(--status-warning-border);
}

.watcher-status-badge.success {
    background: var(--status-ok-bg);
    color: #166534;
}

.watcher-status-badge.warning {
    background: var(--status-caution-bg);
    color: #92400e;
}

.watcher-status-badge.danger {
    background: var(--status-danger-bg);
    color: #991b1b;
}

/* === WATCHER CARD-B filter highlight (item detail click-to-filter) === */
.watcher-card-b.filter-active {
    border-color: var(--c-teal);
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}
.watcher-card-b.filter-active-task {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Collapse chevron rotation */
.collapsed #watchersCollapseIcon,
[aria-expanded="false"] #watchersCollapseIcon {
    transform: rotate(-90deg);
}

/* Odpovědná osoba v kartě hlídače (Varianta B) */
.watcher-card-b-responsible {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: var(--fs-sm);
    color: var(--c-text4);
    border-top: 1px dashed var(--c-border2);
    margin-top: 0.5rem;
}

.watcher-card-b-responsible i {
    color: var(--c-teal);
    font-size: var(--fs-base);
}

.watcher-card-b-responsible span {
    color: var(--c-text3);
}

/* =====================================================
   RESPONSIVE FIX - Komplexní mobilní úpravy
   Verze: 1.0 (2026-02-07)
   Breakpointy: 768px (tablet), 576px (mobil/iPhone)
   ===================================================== */

/* === HAMBURGER TOGGLE BUTTON === */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 300;
    width: 100%;
    height: 52px;
    border: none;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-primary);
    font-size: var(--fs-lg);
    cursor: pointer;
    align-items: center;
    justify-content: flex-start;
    padding: 0 16px;
    gap: 12px;
    transition: all 0.2s;
}

.sidebar-toggle::after {
    content: 'Deadline Tracker';
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--c-text);
}

.sidebar-toggle:active {
    background: var(--c-surface2);
}

/* Overlay pro zavření sidebaru */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 240;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* ===========================================
   TABLET (< 768px) — sidebar skrytý, layout
   =========================================== */
@media (max-width: 767px) {
    /* Hamburger viditelný */
    .sidebar-toggle {
        display: flex;
    }

    /* Skrýt desktop collapse tlačítko na mobilu */
    .sidebar-collapse-btn {
        display: none;
    }

    /* Na mobilu ignorovat collapsed stav */
    .sidebar.collapsed {
        width: 240px;
        padding: 1.25rem;
    }
    .sidebar.collapsed .brand-name { opacity: 1; width: auto; }
    .sidebar.collapsed .nav-section-title { font-size: var(--fs-2xs); padding: 0 0.75rem; margin-bottom: 0.5rem; height: auto; }
    .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 0.55rem 0.75rem; }
    .sidebar.collapsed .nav-item i { margin-right: 0.65rem; }
    .sidebar.collapsed .nav-item span { display: inline; }
    .sidebar.collapsed .user-card { flex-direction: row; padding: 0.6rem; gap: 0.6rem; }
    .sidebar.collapsed .user-info,
    .sidebar.collapsed .logout-btn,
    .sidebar.collapsed .theme-toggle { display: flex; }

    /* Sidebar - skrytý vlevo */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: none;
        z-index: 250;
        top: 52px;
        height: calc(100vh - 52px);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(0,0,0,0.15);
    }

    .sidebar-overlay.active,
    .sidebar.open ~ .sidebar-overlay {
        display: block;
    }

    /* Main content — full width */
    .main-content,
    .app-layout.sidebar-is-collapsed .main-content {
        margin-left: 0;
        padding: 1.25rem;
        padding-top: 64px; /* prostor pro mobile header bar */
    }

    /* Page title */
    .page-title {
        font-size: var(--fs-xl);
        margin-bottom: 1rem;
    }

    /* Page header — stack */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .page-header h1 {
        font-size: var(--fs-lg);
    }
    
    .page-header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Filter bar — vertikální */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    /* Selects ve 2 sloupcích na mobilu */
    .filter-bar .form-select {
        width: 100%;
        min-width: 0;
    }
    
    .filter-bar .form-control {
        width: 100%;
        min-width: 0;
    }

    /* Filter selects grid 2-sloupcový */
    .filter-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        align-items: center;
    }
    .filter-bar .filter-label { grid-column: 1 / -1; }
    .filter-bar .form-control { grid-column: 1 / -1; }
    .filter-bar .btn-reset    { grid-column: 1 / -1; }
    
    .filter-results {
        margin-left: 0;
    }

    /* Stats row */
    .stats-row {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .stat-card {
        min-width: calc(50% - 0.5rem);
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: var(--fs-xl);
    }
    
    .stat-card .stat-label {
        font-size: var(--fs-xs);
    }

    /* Dashboard columns */
    .dashboard-cols {
        grid-template-columns: 1fr;
    }

    /* Dashboard REDESIGN (dash-*) classes */
    .dash-wrapper {
        max-width: 100%;
    }
    
    .dash-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .dash-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .dash-panel {
        padding: 14px !important;
    }
    
    .att-item {
        padding: 10px 12px !important;
    }
    
    .att-item .att-right {
        font-size: var(--fs-xs);
    }
    
    .up-item {
        padding: 10px 12px !important;
    }
    
    .type-row {
        padding: 8px 12px !important;
    }
    
    .quick-link {
        padding: 10px 12px !important;
        font-size: var(--fs-sm) !important;
    }

    /* Tabulky — horizontální scroll */
    .items-table-card {
        border-radius: var(--radius-base);
    }
    
    .items-table-card,
    .content-card,
    .panel {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .items-table th,
    .items-table td {
        padding: 6px 8px;
        font-size: var(--fs-sm);
    }

    .watchers-table th,
    .watchers-table td {
        padding: 6px 8px;
        font-size: var(--fs-sm);
    }
    
    .history-table thead th,
    .history-table tbody td {
        padding: 10px 12px;
        font-size: var(--fs-sm);
    }

    /* Karty - items grid */
    .items-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Item detail — single column */
    .item-detail-layout {
        grid-template-columns: 1fr;
    }

    /* Watcher detail — single column */
    .watcher-detail-layout {
        grid-template-columns: 1fr;
    }
    
    .watcher-info-card,
    .watcher-info-card-inverted {
        position: static;
    }

    /* Formuláře */
    .form-layout {
        grid-template-columns: 1fr;
    }
    
    .floating-row {
        grid-template-columns: 1fr;
    }
    
    .form-card-b-body {
        padding: 1.25rem;
    }
    
    .form-card-b-footer {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }
    
    .form-card-b-footer .btn-save {
        width: 100%;
    }

    /* Content card */
    .content-card .card-header {
        padding: 12px 16px;
        font-size: var(--fs-base);
    }
    
    .content-card .card-body {
        padding: 1rem;
    }

    /* Panely */
    .panel-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .panel-body {
        padding: 14px 16px;
    }

    /* Dashboard Stream — pills */
    .pills-bar {
        gap: 6px;
        margin-bottom: 16px;
    }
    
    .pill {
        padding: 5px 10px;
        font-size: var(--fs-xs);
        gap: 4px;
    }

    /* Dashboard Stream — panel */
    .dash-panel {
        padding: 12px 14px;
        border-radius: var(--radius-base);
    }
    
    .tl-card {
        gap: 10px;
        padding: 10px 12px;
    }
    
    .tl-card-date {
        min-width: 38px;
    }
    
    .tl-card-date .day {
        font-size: var(--fs-md);
    }
    
    .tl-card-date .month {
        font-size: var(--fs-2xs);
    }
    
    .tl-card-icon {
        width: 26px;
        height: 26px;
        font-size: var(--fs-2xs);
    }
    
    .tl-card-name {
        font-size: var(--fs-sm);
    }
    
    .tl-card-meta {
        font-size: var(--fs-2xs);
    }
    
    .tl-card-right {
        font-size: var(--fs-xs);
    }

    /* Modály — full width */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    /* Watcher card B — karty hlídačů */
    .watcher-card-b {
        flex-direction: column;
    }
    
    .watcher-card-b-accent {
        width: 100%;
        height: 4px;
    }

    /* Watcher detail strip — stack */
    .watcher-details-strip {
        flex-wrap: wrap;
    }
    
    .watcher-detail-cell {
        min-width: 50%;
        flex: 0 0 50%;
        border-bottom: 1px solid var(--c-border2);
    }
    
    .watcher-detail-cell:nth-child(2n) {
        border-right: none;
    }

    /* Warning section */
    .warning-section {
        border-radius: var(--radius-base);
    }

    /* Breadcrumb */
    .breadcrumb-custom {
        font-size: var(--fs-sm);
        flex-wrap: wrap;
    }

    /* Notification tabs */
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: var(--fs-sm);
    }

    /* Login */
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        max-width: 100%;
    }

    /* Item card C */
    .item-card-c-body {
        padding: 12px;
    }

    .item-card-c-stats {
        gap: 16px;
    }

    /* Item card V3 */
    .item-card-v3 {
        padding: 16px;
    }
    
    .item-card-v3-stats {
        gap: 20px;
    }

    .item-title-inverted {
        font-size: var(--fs-lg);
    }

    /* Calendar */
    .calendar-table td.calendar-day {
        height: 65px;
        padding: 6px;
    }
}

/* ===========================================
   MOBIL / IPHONE (< 576px) — maximální kompakt
   =========================================== */
@media (max-width: 575px) {
    /* Main content — minimální padding */
    .main-content {
        padding: 0.75rem;
        padding-top: 60px;
    }

    /* Page title */
    .page-title {
        font-size: var(--fs-lg);
        margin-bottom: 0.75rem;
    }
    
    .page-header h1 {
        font-size: var(--fs-lg);
        gap: 0.5rem;
    }
    
    .page-header h1 i {
        font-size: var(--fs-md);
    }

    /* Stats — single column */
    .stat-card {
        min-width: 100%;
        padding: 0.75rem;
    }
    
    .stat-card .stat-value {
        font-size: var(--fs-lg);
    }

    /* Dashboard REDESIGN — mobile compact */
    .dash-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .dash-stats .stat-card {
        min-width: 0 !important;
        padding: 12px 10px !important;
    }
    
    .dash-stats .stat-card .stat-value,
    .dash-stats .stat-card span[style*="font-size: 2"] {
        font-size: var(--fs-xl) !important;
    }
    
    .dash-stats .stat-card .stat-label,
    .dash-stats .stat-card div[style*="text-transform"] {
        font-size: var(--fs-xs) !important;
    }
    
    .dash-grid {
        gap: 12px !important;
    }
    
    .dash-panel {
        padding: 12px !important;
        border-radius: var(--radius-base) !important;
    }
    
    .att-item {
        flex-wrap: wrap;
        gap: 6px !important;
        padding: 10px !important;
    }
    
    .up-item {
        padding: 8px 10px !important;
    }
    
    .section-label {
        font-size: var(--fs-xs) !important;
    }
    
    .panel-icon {
        width: 6px !important;
        height: 6px !important;
    }

    /* Dashboard stream pills — horizontální scroll */
    .pills-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 4px;
        margin-bottom: 12px;
        padding-bottom: 4px;
    }
    
    .pills-bar::-webkit-scrollbar {
        display: none;
    }
    
    .pill {
        padding: 4px 8px;
        font-size: var(--fs-2xs);
        gap: 3px;
        border-radius: var(--radius-lg);
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Dashboard stream panel */
    .dash-panel {
        padding: 10px;
        border-radius: var(--radius-md);
    }
    
    .timeline-section {
        margin-bottom: 14px;
    }
    
    .timeline-header {
        gap: 6px;
        margin-bottom: 6px;
        padding-bottom: 5px;
    }
    
    .timeline-label {
        font-size: var(--fs-xs);
    }
    
    .timeline-count {
        font-size: var(--fs-2xs);
    }
    
    .tl-list {
        gap: 3px;
    }
    
    .tl-card {
        gap: 8px;
        padding: 8px 10px;
        border-radius: var(--radius-sm);
    }
    
    .tl-card-date {
        min-width: 32px;
    }
    
    .tl-card-date .day {
        font-size: var(--fs-base);
    }
    
    .tl-card-date .month {
        font-size: var(--fs-2xs);
    }

    .tl-card-icon {
        width: 24px;
        height: 24px;
        font-size: var(--fs-2xs);
        border-radius: var(--radius-xs);
    }

    .tl-card-name {
        font-size: var(--fs-xs);
    }

    .tl-card-meta {
        font-size: var(--fs-2xs);
    }

    .tl-card-right {
        font-size: var(--fs-xs);
        max-width: 65px;
        text-align: right;
    }
    
    .later-toggle {
        font-size: var(--fs-xs);
        padding: 8px 0;
    }
    
    .all-good {
        padding: 16px 10px;
    }
    
    .all-good i {
        font-size: var(--fs-lg);
    }
    
    .all-good p {
        font-size: var(--fs-sm);
    }
    
    .dash-footer {
        padding-top: 10px;
        margin-top: 12px;
    }
    
    .dash-link {
        font-size: var(--fs-xs);
    }

    /* Tabulky — ještě kompaktnější */
    .items-table th,
    .items-table td {
        padding: 0.5rem 0.6rem;
        font-size: var(--fs-xs);
    }
    
    .watchers-table th,
    .watchers-table td {
        padding: 0.5rem 0.6rem;
        font-size: var(--fs-xs);
    }
    
    .history-table thead th,
    .history-table tbody td {
        padding: 8px 10px;
        font-size: var(--fs-xs);
    }

    /* Item card V3 */
    .item-card-v3 {
        padding: 14px;
    }
    
    .item-card-v3-header {
        gap: 12px;
        margin-bottom: 14px;
    }
    
    .item-card-v3-icon {
        width: 36px;
        height: 36px;
        font-size: var(--fs-base);
    }
    
    .item-card-v3-title {
        font-size: var(--fs-md);
    }
    
    .item-card-v3-info {
        padding: 12px;
    }
    
    .item-card-v3-stats {
        gap: 16px;
        margin-bottom: 14px;
    }
    
    .item-card-v3-stat-number {
        font-size: var(--fs-lg);
    }

    /* Item card C */
    .item-card-c-body {
        padding: 10px;
    }

    .item-card-c-header {
        gap: 8px;
        margin: -10px -10px 0;
        padding: 8px 10px;
    }

    .item-card-c-icon {
        width: 30px;
        height: 30px;
        font-size: var(--fs-sm);
    }

    /* Filter bar */
    .filter-bar {
        padding: 0.6rem;
        gap: 0.5rem;
    }
    
    .filter-bar .filter-label {
        font-size: var(--fs-xs);
    }

    /* Pill buttons — zmensi na malych obrazovkach */
    .pill-btn {
        padding: 4px 8px;
        font-size: var(--fs-xs);
    }

    /* Item info card (detail) */
    .item-info-card {
        padding: 1.25rem;
    }
    
    .item-info-card .item-icon {
        width: 56px;
        height: 56px;
        font-size: var(--fs-xl);
    }
    
    .item-info-card .item-title {
        font-size: var(--fs-lg);
    }
    
    .item-info-card .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .item-info-card .info-value {
        text-align: left;
    }

    .item-title-inverted {
        font-size: var(--fs-lg);
    }

    /* Watcher detail responsive */
    .detail-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .detail-toolbar-actions {
        gap: 3px;
    }
    .wi-header {
        padding: 12px 14px 8px;
    }
    .wi-body {
        padding: 0 14px 10px;
    }

    /* Watcher detail strip — single column */
    .watcher-details-strip {
        flex-direction: column;
    }
    
    .watcher-detail-cell {
        min-width: 100%;
        flex: 0 0 100%;
        border-right: none;
        border-bottom: 1px solid var(--c-border2);
        padding: 8px 12px;
    }
    
    .watcher-detail-cell:last-child {
        border-bottom: none;
    }

    /* Watcher link banner */
    .watcher-link-banner {
        padding: 10px 12px;
        gap: 8px;
    }

    .watcher-link-banner .watcher-link-name {
        font-size: var(--fs-md);
    }

    .watcher-link-meta {
        font-size: var(--fs-xs);
    }

    /* Content card */
    .content-card .card-header {
        padding: 10px 14px;
        font-size: var(--fs-sm);
    }
    
    .content-card .card-body {
        padding: 0.75rem;
    }

    /* Formuláře */
    .form-card-b-header {
        padding: 1rem 1.25rem;
    }
    
    .form-card-b-header h3 {
        font-size: var(--fs-md);
    }
    
    .form-card-b-body {
        padding: 1rem;
    }
    
    .floating-group .form-control,
    .floating-group .form-select {
        font-size: var(--fs-base);
        padding: 1.1rem 0.85rem 0.4rem;
    }

    /* Modály */
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .deactivate-modal-header {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .deactivate-modal-icon {
        width: 40px;
        height: 40px;
    }
    
    .deactivate-modal-title {
        font-size: var(--fs-md);
    }
    
    .deactivate-current-date {
        font-size: var(--fs-xl);
    }

    /* Notification tabs */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .nav-tabs .nav-link {
        padding: 0.4rem 0.65rem;
        font-size: var(--fs-xs);
        white-space: nowrap;
    }

    /* Notification numbered sections */
    .numbered-section {
        padding: 14px;
    }

    /* Calendar */
    .calendar-table th {
        padding: 8px 4px;
        font-size: var(--fs-2xs);
    }
    
    .calendar-table td.calendar-day {
        height: 50px;
        padding: 3px;
    }
    
    .day-number {
        font-size: var(--fs-xs);
    }
    
    .indicator {
        width: 6px;
        height: 6px;
    }
    
    .deadline-count {
        display: none;
    }
    
    .calendar-month {
        font-size: var(--fs-lg);
    }
    
    .calendar-legend {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .calendar-legend span {
        font-size: var(--fs-xs);
    }

    
    .item-type-badge {
        padding: 0.25rem 0.6rem;
        font-size: var(--fs-xs);
    }
    
    .watcher-status-badge {
        /* responsive sizing handled by badge-base badge-md on mobile */
    }

    /* Akční tlačítka */
    .btn-action {
        width: 30px;
        height: 30px;
    }
    
    .item-card-v3-btn {
        padding: 8px 12px;
        font-size: var(--fs-xs);
    }
    
    .item-card-c-actions .btn {
        padding: 6px 10px;
        font-size: var(--fs-xs);
    }

    /* Quick actions */
    .quick-action {
        padding: 0.65rem 0.75rem;
    }
    
    .quick-action i {
        width: 30px;
        height: 30px;
        font-size: var(--fs-sm);
    }
    
    .quick-action span {
        font-size: var(--fs-sm);
    }

    /* Empty state */
    .empty-state {
        padding: 24px 16px;
    }
    
    .empty-state i {
        font-size: var(--fs-2xl);
    }
    
    .empty-state p {
        font-size: var(--fs-sm);
    }

    /* Breadcrumb */
    .breadcrumb-custom {
        font-size: var(--fs-xs);
    }

    /* Warning section (items bez termínu) */
    .warning-section-header {
        padding: 10px 14px;
        font-size: var(--fs-sm);
    }
    
    .warning-section-body {
        padding: 10px 14px;
    }

    /* Highlight edit box (item detail) */
    .highlight-edit-box {
        padding: 10px 12px;
    }

    /* Sidebar brand */
    .sidebar .brand {
        margin-bottom: 1.25rem;
    }
    
    .sidebar .brand-icon {
        width: 36px;
        height: 36px;
        font-size: var(--fs-md);
    }
    
    .sidebar .brand-name {
        font-size: var(--fs-md);
    }
}

/* ===========================================
   ITEM DETAIL — tabulky na mobilu
   history-table: skrýt méně důležité sloupce
   =========================================== */
@media (max-width: 767px) {
    /* Zmenšit padding buněk */
    .history-table thead th,
    .history-table tbody td {
        padding: 0.6rem 0.5rem;
        font-size: var(--fs-xs);
    }
    .watchers-table th,
    .watchers-table td {
        padding: 0.6rem 0.5rem;
        font-size: var(--fs-xs);
    }
    /* Skrýt: Deaktivace (6.), Dnů (7.), Přílohy (8.) */
    .history-table th:nth-child(6),
    .history-table td:nth-child(6),
    .history-table th:nth-child(7),
    .history-table td:nth-child(7),
    .history-table th:nth-child(8),
    .history-table td:nth-child(8) {
        display: none;
    }
}

/* --- Watcher karty, toolbar, deadline badge — mobilni kompakt --- */
@media (max-width: 575px) {
    .watcher-card-b-content { padding: 0.6rem; }
    .watcher-card-b-header { gap: 0.4rem; margin: -0.6rem -0.6rem 0.5rem; padding: 0.5rem 0.6rem; }
    .watcher-card-b-info { gap: 0.25rem; padding: 0.25rem 0.4rem; }
    .wi-actions { gap: 4px; margin-top: 10px; padding-top: 8px; }
}

/* ===========================================
   EXTRA SMALL (< 380px) — iPhone SE, mini
   =========================================== */
@media (max-width: 379px) {
    .main-content {
        padding: 0.5rem;
        padding-top: 56px;
    }
    
    /* Dashboard redesign — extra small */
    .dash-stats {
        gap: 6px !important;
    }
    
    .dash-stats .stat-card span[style*="font-size: 2"] {
        font-size: var(--fs-lg) !important;
    }
    
    .pills-bar .pill {
        padding: 3px 6px;
        font-size: var(--fs-2xs);
    }

    .tl-card {
        gap: 6px;
        padding: 7px 8px;
    }

    .tl-card-date {
        min-width: 28px;
    }

    .tl-card-date .day {
        font-size: var(--fs-sm);
    }

    .tl-card-icon {
        width: 22px;
        height: 22px;
        font-size: var(--fs-2xs);
    }

    .tl-card-name {
        font-size: var(--fs-xs);
    }

    .tl-card-right {
        font-size: var(--fs-2xs);
        max-width: 55px;
    }
    
    .page-title {
        font-size: var(--fs-md);
    }
    
    .item-card-v3,
    .item-card-c-body {
        padding: 12px;
    }

    /* Tabulky — extra compact */
    .table th,
    .table td {
        font-size: var(--fs-xs);
        padding: 0.25rem 0.35rem;
    }

    /* Karty — menší padding */
    .content-card .card-body {
        padding: 0.5rem;
    }

    /* Filter bar — kompaktní */
    .filter-bar .btn {
        font-size: var(--fs-xs);
        padding: 0.2rem 0.45rem;
    }

    /* Page header actions — menší tlačítka */
    .page-header-actions .btn {
        font-size: var(--fs-xs);
        padding: 0.25rem 0.5rem;
    }
    .page-header-actions .btn i {
        font-size: var(--fs-2xs);
    }

    /* Badges — menší */
    .badge {
        font-size: var(--fs-2xs);
        padding: 0.15rem 0.35rem;
    }

    /* Action buttons v tabulkách */
    .btn-action {
        width: 28px;
        height: 28px;
        font-size: var(--fs-xs);
    }
}

/* ===========================================
   LANDSCAPE na malých zařízeních
   =========================================== */
@media (orientation: landscape) and (max-height: 500px) {
    .main-content {
        padding-top: 48px;
        padding-bottom: 0.5rem;
    }

    .page-header {
        padding: 0.4rem 0;
        margin-bottom: 0.5rem;
    }

    .page-title {
        font-size: var(--fs-md);
    }

    .sidebar-toggle {
        height: 42px;
    }

    .modal-dialog {
        max-height: 85vh;
        margin: 0.5rem auto;
    }
    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* ============================================
   PŘÍLOHY / FOTOGRAFIE
   ============================================ */

/* --- Sekce fotografií itemu --- */
.photos-section {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border2);
    overflow: hidden;
}

.photos-section .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--c-surface2);
    border-bottom: 1px solid var(--c-border2);
    font-weight: 600;
    font-size: var(--fs-base);
    color: var(--c-text2);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    padding: 16px;
}

.photo-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--c-border2);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--c-surface2);
}
.photo-thumb:hover {
    border-color: var(--c-primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}
.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
[data-lightbox], [data-open-url] { cursor: pointer; }

/* PDF placeholder */
.photo-thumb .pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--c-text5);
    font-size: var(--fs-xs);
    gap: 6px;
}
.photo-thumb .pdf-placeholder i {
    font-size: var(--fs-xl);
    color: var(--status-danger-text);
}

/* Overlay na hoveru */
.photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}
.photo-thumb:hover .photo-overlay {
    opacity: 1;
}
.photo-overlay .btn-photo {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.photo-overlay .btn-photo-view {
    background: var(--c-surface);
    color: var(--c-text2);
}
.photo-overlay .btn-photo-delete {
    background: #fecaca;
    color: var(--status-danger-text);
}
.photo-overlay .btn-photo-delete:hover {
    background: #fca5a5;
}

/* Popis fotografie */
.photo-desc {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 8px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: var(--fs-2xs);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Upload slot v gridu */
.photo-upload-slot {
    aspect-ratio: 1;
    border: 2px dashed var(--c-border3);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--c-text5);
    font-size: var(--fs-xs);
    gap: 6px;
    background: var(--c-primary-bg, #eff6ff);
}
.photo-upload-slot:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    background: var(--c-primary-bg, #eff6ff);
}
.photo-upload-slot i {
    font-size: var(--fs-xl);
}

/* --- Přílohy u termínů (Deadline) --- */

/* Sloupec sponky v tabulce */
.attach-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.attach-icon.has-files {
    background: var(--c-teal-bg, #f0fdfa);
    color: var(--c-teal);
    border: 1px solid #99f6e4;
}
.attach-icon.has-files:hover {
    background: #ccfbf1;
    border-color: #5eead4;
}
.attach-icon.no-files {
    background: transparent;
    color: var(--c-border3);
    border: 1px dashed var(--c-border2);
}
.attach-icon.no-files:hover {
    color: var(--c-teal);
    border-color: var(--c-teal);
    border-style: solid;
    background: var(--c-teal-bg, #f0fdfa);
}
.attach-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--c-teal);
    color: white;
    font-size: var(--fs-2xs);
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Rozbalitelný řádek s přílohami termínu */
.history-table .deadline-attachments-row td,
.items-table .deadline-attachments-row td {
    padding: 10px 16px;
    background: #f8fffe;
    border-top: none;
}
.deadline-attachments-row.collapsed {
    display: none;
}
.history-table .deadline-notes-row td,
.items-table .deadline-notes-row td {
    padding: 10px 16px;
    background: #f8f9ff;
    border-top: none;
}
.deadline-notes-row.collapsed {
    display: none;
}
.deadline-attach-grid {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.deadline-attach-thumb {
    width: 88px;
    height: 88px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--c-border2);
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.deadline-attach-thumb:hover {
    border-color: var(--c-teal);
    box-shadow: 0 2px 6px rgba(20,184,166,0.15);
}
.deadline-attach-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.deadline-attach-thumb .pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--c-text5);
    font-size: var(--fs-2xs);
    gap: 4px;
    background: var(--c-surface2);
}
.deadline-attach-thumb .pdf-placeholder i {
    font-size: var(--fs-lg);
    color: var(--status-danger-text);
}

/* Overlay pro smazání u deadline thumb */
.deadline-attach-thumb .photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}
.deadline-attach-thumb:hover .photo-overlay {
    opacity: 1;
}

/* Upload mini-tlačítko u termínů */
.deadline-upload-btn {
    width: 88px;
    height: 88px;
    border: 2px dashed var(--c-border3);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--c-text5);
    font-size: var(--fs-2xs);
    gap: 4px;
    flex-shrink: 0;
    background: var(--c-teal-bg, #f0fdfa);
}
.deadline-upload-btn:hover {
    border-color: var(--c-teal);
    color: var(--c-teal);
    background: #ccfbf1;
}
.deadline-upload-btn i {
    font-size: var(--fs-lg);
}

/* Edit modal — inline upload buttons */
.edit-modal-upload {
    display: flex;
    gap: 6px;
}
.edit-modal-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--c-teal);
    background: var(--c-surface);
    border: 1px dashed var(--c-teal);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-style 0.15s;
}
.edit-modal-upload-btn:hover {
    background: var(--c-teal-bg, #f0fdfa);
    border-style: solid;
}
/* Edit modal — attachment thumbnails */
.edit-modal-attach-thumb {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--c-border);
    flex-shrink: 0;
}
.edit-modal-attach-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.edit-modal-attach-thumb .edit-attach-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #fef2f2;
    color: #dc2626;
    font-size: var(--fs-sm);
}
.edit-modal-attach-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

/* --- Lightbox --- */
.lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox-backdrop img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    font-size: var(--fs-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

/* --- Upload modal --- */
.upload-modal-body {
    padding: 24px;
}
.upload-dropzone {
    border: 2px dashed var(--c-border3);
    border-radius: var(--radius-base);
    padding: 30px;
    text-align: center;
    transition: all 0.2s;
    margin-bottom: 16px;
    background: var(--c-primary-bg, #eff6ff);
}
.upload-dropzone.dragover {
    border-color: var(--c-primary);
    background: var(--c-primary-bg, #eff6ff);
}
.upload-dropzone i {
    font-size: var(--fs-2xl);
    color: var(--c-text5);
    margin-bottom: 8px;
}
.upload-dropzone p {
    margin: 0;
    color: var(--c-text4);
    font-size: var(--fs-sm);
}
.upload-dropzone .btn-browse {
    margin-top: 10px;
    display: inline-block;
    padding: 6px 16px;
    background: var(--c-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    cursor: pointer;
    border: none;
}
.upload-dropzone .btn-browse:hover {
    background: var(--c-primary-hover);
}
.upload-dropzone.teal {
    background: var(--c-teal-bg, #f0fdfa);
}
.upload-dropzone.teal .btn-browse {
    background: var(--c-teal);
}
.upload-dropzone.teal .btn-browse:hover {
    background: var(--c-teal-dark);
}
.upload-dropzone .btn-browse-camera {
    background: #64748b;
}
.upload-dropzone .btn-browse-camera:hover {
    background: #475569;
}
.upload-dropzone.teal .btn-browse-camera {
    background: #64748b;
}
.upload-dropzone.teal .btn-browse-camera:hover {
    background: #475569;
}

/* Responsive */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    .deadline-attach-thumb,
    .deadline-upload-btn {
        width: 72px;
        height: 72px;
    }
}
/* filter-bar .btn-sm sizing resen pres .pill-btn tridu */

.filter-bar .dropdown-toggle::after {
    margin-left: 6px;
}

.filter-bar .dropdown-menu {
    min-width: 180px;
    font-size: var(--fs-sm);
}

.filter-bar .dropdown-item.active {
    background-color: var(--c-primary);
}

/* btn-info — removed, use .btn-primary instead */

/* ========================================
   BTN-PRIMARY — Bright Blue filled
   ======================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    border: none;
    color: #fff;
    padding: var(--btn-padding-md);
    border-radius: var(--btn-radius);
    font-weight: var(--btn-font-weight);
    font-size: var(--btn-font-size-md);
    box-shadow: var(--btn-shadow-blue);
    transition: var(--btn-transition);
}
.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--btn-shadow-blue-hover);
    border: none;
}
.btn-primary:active,
.btn-primary.active {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #fff;
    transform: none;
    border: none;
}

/* ========================================
   BUTTON SIZE OVERRIDES — sm / lg
   ======================================== */
.btn-primary.btn-sm,
.btn-teal.btn-sm,
.btn-success.btn-sm,
.btn-danger.btn-sm,
.btn-purple.btn-sm {
    padding: var(--btn-padding-sm);
    font-size: var(--btn-font-size-sm);
    border-radius: var(--btn-radius-sm);
}

.btn-primary.btn-lg,
.btn-teal.btn-lg,
.btn-success.btn-lg,
.btn-danger.btn-lg,
.btn-purple.btn-lg {
    padding: var(--btn-padding-lg);
    font-size: var(--btn-font-size-lg);
    font-weight: var(--btn-font-weight-lg);
}

/* ========================= */
/* Private badge (global)    */
/* ========================= */
.private-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-base);
    font-size: var(--fs-xs);
    font-weight: 500;
    background: var(--c-surface3);
    color: var(--c-text4);
    border: 1px solid var(--c-border2);
}

/* ========================================
   TYPE FILTER ROW + BUTTONS (V8)
   ======================================== */
.type-filter-row,
.filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 0;
}
.type-filter-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.type-filter-btn {
    border: 1px solid var(--c-border2);
    background: var(--c-surface);
    color: var(--c-text4);
}
.type-filter-btn:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    background: var(--c-primary-bg, #eff6ff);
}
.type-filter-btn.active {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}
.type-filter-btn.active:hover {
    background: var(--c-primary-hover);
    border-color: var(--c-primary-hover);
}
.type-filter-row .btn-outline-secondary,
.type-filter-row .btn-outline-warning {
    transition: all 0.15s ease;
}
/* Neaktivní stav — Soukromé/Archiv */
.type-filter-row .btn-outline-secondary {
    border-color: var(--c-border2);
    color: var(--c-text4);
    background: var(--c-surface);
}
.type-filter-row .btn-outline-secondary:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    background: var(--c-primary-bg, #eff6ff);
}
/* Aktivní stav — Soukromé/Archiv zapnuto */
.type-filter-row .btn-outline-warning {
    border-color: var(--status-warning-text);
    color: #ffffff;
    background: var(--status-warning-text);
}
.type-filter-row .btn-outline-warning:hover {
    border-color: var(--status-warning-text);
    background: #d97706;
    color: #ffffff;
}
/* Dark mode */
[data-bs-theme="dark"] .type-filter-row .btn-outline-secondary {
    border-color: rgba(255,255,255,0.15);
    color: var(--c-text5);
    background: transparent;
}
[data-bs-theme="dark"] .type-filter-row .btn-outline-secondary:hover {
    border-color: var(--c-primary);
    color: #93c5fd;
    background: rgba(59,130,246,0.1);
}
[data-bs-theme="dark"] .type-filter-row .btn-outline-warning {
    border-color: var(--status-warning-text);
    color: var(--c-text);
    background: var(--status-warning-text);
}
[data-bs-theme="dark"] .type-filter-row .btn-outline-warning:hover {
    border-color: var(--status-warning-text);
    background: #d97706;
    color: var(--c-text);
}
@media (max-width: 768px) {
    .type-filter-row {
        flex-wrap: wrap;
    }
    .type-filter-buttons {
        width: 100%;
        overflow-x: visible;
        flex-wrap: wrap;
        padding-bottom: 4px;
        gap: 6px;
    }
    .type-filter-row .ms-auto {
        margin-left: 0 !important;
    }
}

/* =============================================
   ITEM FILTER PILLS — barevne, s ikonou, vizualne odlisne od type pills
   ============================================= */
.item-filter-btn {
    position: relative;
    border: 1px solid var(--item-color, #3b82f6);
    background: white;
    color: var(--item-color, #3b82f6);
}
.item-filter-btn:hover {
    background: color-mix(in srgb, var(--item-color, #3b82f6) 12%, white);
}
.item-filter-btn.active {
    background: var(--item-color, #3b82f6);
    color: #fff;
    border-color: var(--item-color, #3b82f6);
}
.item-filter-btn.active:hover {
    filter: brightness(0.9);
}
.item-filter-btn[data-item-filter=""] {
    --item-color: #64748b;
    border-style: dashed;
}
.item-filter-btn[data-item-filter=""].active {
    border-style: solid;
}
[data-bs-theme="dark"] .item-filter-btn {
    background: transparent;
    color: var(--item-color, var(--c-primary-light));
}
[data-bs-theme="dark"] .item-filter-btn.active {
    background: var(--item-color, #3b82f6);
    color: #fff;
}

/* =============================================
   MODE SWITCH PRIMARY — prepinac rezimu (Vse/Terminy/Ukoly)
   ============================================= */
.mode-switch-primary {
    display: inline-flex;
    background: var(--c-surface3);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
}
.mode-switch-primary .mode-switch-btn {
    border: none;
    background: transparent;
    color: var(--c-text4);
    text-decoration: none;
}
.mode-switch-primary .mode-switch-btn:hover {
    background: rgba(255,255,255,0.6);
    color: #475569;
}
.mode-switch-primary .mode-switch-btn.active {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.mode-switch-primary .mode-switch-btn.active[data-mode="all"] { background: white; color: #475569; }
.mode-switch-primary .mode-switch-btn.active[data-mode="deadline"] { background: linear-gradient(135deg, #f0fdfa, #ccfbf1); color: #0d9488; border: 1px solid #5eead4; }
.mode-switch-primary .mode-switch-btn.active[data-mode="task"] { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #1e40af; border: 1px solid #93c5fd; }
.mode-switch-primary .mode-switch-btn i {
    margin-right: 5px;
}
.mode-count {
    font-size: var(--fs-xs);
    font-weight: 600;
    opacity: 0.6;
    margin-left: 2px;
}
.mode-count::before { content: '('; }
.mode-count::after { content: ')'; }
.mode-switch-btn.active .mode-count { opacity: 0.8; }
[data-bs-theme="dark"] .mode-switch-primary {
    background: #252f3e;
}
[data-bs-theme="dark"] .mode-switch-primary .mode-switch-btn { color: #94a3b8; }
[data-bs-theme="dark"] .mode-switch-primary .mode-switch-btn:hover { background: rgba(255,255,255,0.06); color: #cbd5e1; }
[data-bs-theme="dark"] .mode-switch-primary .mode-switch-btn.active { background: #1c2333; }
[data-bs-theme="dark"] .mode-switch-primary .mode-switch-btn.active[data-mode="all"] { color: #cbd5e1; }
[data-bs-theme="dark"] .mode-switch-primary .mode-switch-btn.active[data-mode="deadline"] { color: #2dd4bf; }
[data-bs-theme="dark"] .mode-switch-primary .mode-switch-btn.active[data-mode="task"] { color: var(--c-primary-light); }

/* ===== Watcher Table Redesign ===== */
/* Platnost do — plain text instead of badge */
.table-validity {
    color: var(--c-text3);
    font-size: var(--fs-sm);
}
.table-validity.overdue {
    color: var(--status-danger-text);
    font-weight: 500;
}
.table-validity.warning {
    color: var(--status-warning-text);
}
/* Zbývá — separate column */
.table-days-left {
    font-size: var(--fs-sm);
    color: var(--c-text4);
    white-space: nowrap;
}
.table-days-left.overdue {
    color: var(--status-danger-text);
    font-weight: 500;
}
.table-days-left.warning {
    color: var(--status-warning-text);
    font-weight: 500;
}
/* Item link — neutral, blue on hover */
.table-item-link {
    color: var(--c-text2);
    text-decoration: none;
    font-weight: 400;
}
.table-item-link:hover {
    color: var(--c-primary);
}
.table-item-icon {
    color: var(--c-text5);
    margin-right: 6px;
    font-size: var(--fs-xs);
}
/* Filter separator + work mode buttons */
.filter-separator {
    width: 1px;
    height: 20px;
    background: var(--c-border);
    flex-shrink: 0;
}
.work-mode-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
/* Search input in filter row */
.table-search-input {
    padding: 5px 12px;
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    color: var(--c-text2);
    background: var(--c-surface);
    width: 160px;
    transition: all 0.15s;
}
.table-search-input:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
    width: 200px;
}
/* Dark mode */
[data-bs-theme="dark"] .table-validity { color: #94a3b8; }
[data-bs-theme="dark"] .table-validity.overdue { color: #f87171; }
[data-bs-theme="dark"] .table-validity.warning { color: #fbbf24; }
[data-bs-theme="dark"] .table-days-left { color: #94a3b8; }
[data-bs-theme="dark"] .table-days-left.overdue { color: #f87171; }
[data-bs-theme="dark"] .table-days-left.warning { color: #fbbf24; }
[data-bs-theme="dark"] .table-item-link { color: #cbd5e1; }
[data-bs-theme="dark"] .table-item-link:hover { color: #93c5fd; }
[data-bs-theme="dark"] .watcher-link-box.mode-deadline { color: #5eead4; }
[data-bs-theme="dark"] .watcher-link-box.mode-deadline:hover { color: #99f6e4; }
[data-bs-theme="dark"] .watcher-link-box.mode-task { color: #93c5fd; }
[data-bs-theme="dark"] .watcher-link-box.mode-task:hover { color: #bfdbfe; }
[data-bs-theme="dark"] .table-item-icon { color: #64748b; }
[data-bs-theme="dark"] .table-search-input {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .table-search-input:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-xs);
    color: var(--c-text3);
    cursor: pointer;
    white-space: nowrap;
}
.filter-checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--c-primary);
}
[data-bs-theme="dark"] .filter-separator { background: rgba(255,255,255,0.1); }

/* ===== Help Sidebar - Dashboard style (2026-02-18) ===== */
.help-sidebar {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 0;
    position: sticky;
    top: 20px;
    overflow: visible;
}
.help-sidebar-header {
    padding: 14px 20px;
    font-size: var(--fs-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    border-bottom: 1px solid #f3f4f6;
}
.help-sidebar-header i {
    color: var(--c-teal);
    margin-right: 6px;
}
.help-sidebar-body {
    padding: 16px 20px;
}
.help-sidebar-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.help-sidebar-item:last-child {
    margin-bottom: 0;
}
.help-sidebar-item strong {
    display: block;
    font-size: var(--fs-sm);
    color: #1f2937;
    margin-bottom: 2px;
}
.help-sidebar-item p {
    margin: 0;
    font-size: var(--fs-sm);
    color: #6b7280;
    line-height: 1.4;
}
.help-sidebar-step {
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: var(--c-teal-bg, #f0fdfa);
    color: var(--c-teal);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    margin-top: 1px;
}
.help-sidebar-tip {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 12px;
    font-size: var(--fs-sm);
    color: #4b5563;
    line-height: 1.5;
}
.help-sidebar-tip:last-child {
    margin-bottom: 0;
}
.help-sidebar-tip i {
    min-width: 20px;
    margin-top: 3px;
    font-size: var(--fs-xs);
}
.help-sidebar-tip strong {
    color: #1f2937;
}
@media (max-width: 991.98px) {
    .help-sidebar {
        position: static;
        margin-top: 20px;
    }
}
/* ============================================
   WATCHER EDIT/ADD SIDEBAR — Info panels
   ============================================ */

/* --- Deadline box v sidebaru --- */
.edit-deadline-box {
    padding: 16px;
    text-align: center;
}
.edit-deadline-box.ok { background: #f0fdf4; }
.edit-deadline-box.warning { background: #fffbeb; }
.edit-deadline-box.danger { background: #fef2f2; }
.edit-deadline-box.overdue { background: #fef2f2; }
.edit-deadline-box.empty { background: #f9fafb; }

.edit-deadline-days {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.ed-number {
    font-size: var(--fs-2xl);
    font-weight: 700;
    line-height: 1;
}
.edit-deadline-box.ok .ed-number { color: #10b981; }
.edit-deadline-box.warning .ed-number { color: #d97706; }
.edit-deadline-box.danger .ed-number { color: #ef4444; }
.edit-deadline-box.overdue .ed-number { color: #dc2626; }

.ed-label {
    font-size: var(--fs-xs);
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.edit-deadline-meta {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: var(--fs-xs);
    color: #4b5563;
}

/* Status badge v deadline boxu */
.ed-status-badge {
    /* sizing: badge-base badge-sm */
    margin-top: 4px;
}
.ed-status-confirmed {
    background: var(--status-ok-bg);
    color: var(--status-ok-text);
}
.ed-status-pending {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
    border: 1px dashed #fdba74;
}

/* --- Item link v sidebaru --- */
.edit-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 4px 0;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.edit-item-link:hover {
    background: #f9fafb;
    color: inherit;
}
.edit-item-name {
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--c-text);
    margin-bottom: 4px;
}
.edit-item-details {
    font-size: var(--fs-xs);
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}
.status-dot-mini {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    margin-right: 4px;
    vertical-align: middle;
}

/* --- Stat rows v sidebaru --- */
.edit-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: var(--fs-sm);
    border-bottom: 1px solid #f3f4f6;
}
.edit-stat-row:last-child {
    border-bottom: none;
}
.edit-stat-label {
    color: #6b7280;
}
.edit-stat-label i {
    width: 16px;
    text-align: center;
}
.edit-stat-value {
    font-weight: 600;
    color: var(--c-text);
}

/* Edit assign sections (tymy/pracovnici v edit sidebar) */
.edit-assign-section {
    padding: 6px 0 2px;
}
.edit-assign-section + .edit-assign-section {
    border-top: 1px solid var(--c-border);
}
.edit-assign-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.edit-assign-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--c-text3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.edit-assign-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border2);
    background: var(--c-surface);
    color: var(--c-text3);
    font-size: var(--fs-2xs);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.edit-assign-add:hover {
    color: var(--c-primary);
    border-color: var(--c-primary);
    background: var(--c-surface2);
}
.edit-assign-section .dropdown-menu {
    font-size: var(--fs-sm);
    min-width: 180px;
    max-height: 250px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid var(--c-border);
    padding: 4px 0;
    z-index: 1060;
    position: absolute;
}
.edit-assign-section .dropdown-item {
    font-size: var(--fs-sm);
    padding: 6px 12px;
    color: var(--c-text);
}
.edit-assign-section .dropdown-item:hover {
    background: var(--c-surface2);
    color: var(--c-primary);
}
.edit-assign-section .form-select {
    font-size: var(--fs-sm);
    border-color: var(--c-border);
}
.edit-assign-section .form-select:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.edit-assign-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: var(--fs-sm);
}
.edit-assign-name {
    color: var(--c-text);
}
.edit-assign-remove {
    color: var(--c-text4);
    font-size: var(--fs-xs);
    padding: 2px 4px;
    border-radius: var(--radius-xs);
    transition: color 0.15s, background 0.15s;
}
.edit-assign-remove:hover {
    color: var(--status-danger-text);
    background: var(--status-danger-surface);
}


/* =============================================
   SECTION DIVIDER -- shared across admin forms
   (Company, User, UserGroup add/edit)
   ============================================= */

.section-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--c-text5);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 8px 0;
}
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-border);
}


/* =============================================
   USERS GRID -- shared across admin forms
   (Company, UserGroup add/edit)
   ============================================= */

.users-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.user-check {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.user-check:hover {
    border-color: var(--c-primary);
    background: var(--status-pending-bg);
}
.user-check label {
    cursor: pointer;
    margin: 0;
    font-size: var(--fs-base);
    color: var(--c-text3);
}


/* =============================================
   ADMIN TABLE CARD -- shared across admin lists
   (Company, User, UserGroup list)
   ============================================= */

.admin-table-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--c-border);
    overflow: hidden;
}
.admin-table-card .table {
    margin-bottom: 0;
}
.admin-table-card .table thead th {
    background: var(--c-surface2);
    border-bottom: 2px solid var(--c-border);
    color: var(--c-text4);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 11px 16px;
    white-space: nowrap;
}
.admin-table-card .table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--c-surface3);
    color: var(--c-text2);
    font-size: var(--fs-base);
}
.admin-table-card .table tbody tr:last-child td {
    border-bottom: none;
}
.admin-table-card .table tbody tr:hover {
    background: var(--c-surface2);
}
.admin-name {
    font-weight: 600;
    color: var(--c-text);
}
.admin-desc {
    color: var(--c-text5);
    font-size: var(--fs-base);
}
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--c-surface3);
    color: var(--c-text3);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: var(--fs-sm);
    font-weight: 500;
    margin: 2px 3px 2px 0;
}
.user-chip i {
    font-size: var(--fs-xs);
    color: var(--c-text5);
}
.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-title-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-base);
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: var(--fs-md);
}
.page-title h1 {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--c-text);
    margin: 0;
}
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-xl);
    background: var(--c-surface3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xl);
    color: var(--c-text5);
    margin-bottom: 16px;
}
.sort-arrows {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    margin-left: 4px;
    line-height: 0;
    gap: 0;
}
.sort-arrow {
    display: block;
    font-size: var(--fs-xs);
    line-height: 0.55;
    color: var(--c-border3);
    text-decoration: none;
    transition: color 0.15s;
}
.sort-arrow:hover {
    color: var(--c-primary);
}
.sort-arrow.active {
    color: var(--c-primary);
}


/* =============================================
   COLLAPSIBLE FILTER BAR -- shared across lists
   (Deadline, Item, Watcher list)
   ============================================= */

.btn-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--c-surface2);
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--c-text4);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-filter-toggle:hover {
    background: var(--c-surface3);
    border-color: var(--c-border3);
    color: var(--c-text3);
}
.btn-filter-toggle.active {
    background: var(--c-primary-bg, #eff6ff);
    border-color: #93c5fd;
    color: var(--c-primary-hover);
}
.filter-active-badge {
    display: none;
    position: absolute;
    top: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    background: var(--status-danger-text);
    border-radius: var(--radius-full);
    border: 2px solid white;
}
.btn-filter-toggle.has-active-filter .filter-active-badge {
    display: block;
}
.filter-bar-collapsible {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--c-surface2);
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-base);
    margin-bottom: 12px;
    animation: filterSlideDown 0.15s ease;
}
.filter-bar-collapsible .pill-btn {
    padding: 3px 10px;
    font-size: var(--fs-xs);
}
.filter-bar-collapsible.open {
    display: flex;
}
@keyframes filterSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.filter-bar-collapsible .form-select,
.filter-bar-collapsible .form-control {
    font-size: var(--fs-sm);
}
@media (max-width: 767px) {
    .filter-bar-collapsible .form-select,
    .filter-bar-collapsible .form-control {
        width: 100%;
        min-width: 0;
    }
    .filter-bar-collapsible {
        display: none;
    }
    .filter-bar-collapsible.open { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .filter-bar-collapsible .form-control,
    .filter-bar-collapsible .btn-reset,
    .filter-bar-collapsible .filter-checkboxes { grid-column: 1 / -1; }
}


/* =============================================
   DARK MODE — [data-bs-theme="dark"] na <html>
   Aktivuje se: ručně přepínačem (localStorage)
   nebo automaticky dle prefers-color-scheme
   ============================================= */

[data-bs-theme="dark"] {
    /* Přepis CSS proměnných */
    --c-bg:       #0d1117;
    --c-surface:  #161b22;
    --c-surface2: #1c2333;
    --c-surface3: #1c2333;
    --c-border:   rgba(255,255,255,0.09);
    --c-border2:  rgba(255,255,255,0.08);
    --c-border3:  rgba(255,255,255,0.06);
    --c-text:     #e2e8f0;
    --c-text2:    #cbd5e1;
    --c-text3:    #94a3b8;
    --c-text4:    #64748b;
    --c-text5:    #475569;
    --c-input-bg:     #1c2333;
    --c-input-border: rgba(255,255,255,0.12);
    --c-shadow:    rgba(0,0,0,0.35);
    --c-shadow-lg: rgba(0,0,0,0.5);

    /* Dark mode — opakujici se barvy centralne */
    --c-dm-danger:    #f87171;
    --c-dm-warning:   #fbbf24;
    --c-dm-ok:        #34d399;
    --c-dm-done:      #6ee7b7;
    --c-dm-blue:      #93c5fd;
    --c-dm-blue-bright: #38bdf8;
    --c-dm-teal:      #5eead4;
    --c-dm-teal-bright: #2dd4bf;
    --c-dm-text:      #e2e8f0;
    --c-dm-text2:     #cbd5e1;
    --c-dm-text3:     #9ca3af;
    --c-dm-surface-dark: #111827;
    --c-dm-hover:     rgba(255,255,255,0.04);
    --c-dm-hover2:    rgba(255,255,255,0.06);
}

/* ── PAGE ─────────────────────────────────── */
[data-bs-theme="dark"] body {
    color: #e2e8f0;
}

/* ── SIDEBAR ─────────────────────────────── */
[data-bs-theme="dark"] .sidebar {
    background: #161b22;
    border-right: 1px solid rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .sidebar .nav-item {
    color: var(--c-text5);
}
[data-bs-theme="dark"] .sidebar .nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .sidebar .nav-item.active {
    background: linear-gradient(135deg, #1e40af 0%, var(--c-primary) 100%);
    color: white;
}
[data-bs-theme="dark"] .sidebar .user-section {
    border-top-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .sidebar .user-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
}
[data-bs-theme="dark"] .sidebar .nav-section-title { color: #475569; }
[data-bs-theme="dark"] .sidebar .brand-name { color: #e2e8f0; }

/* ── MAIN CONTENT ────────────────────────── */
[data-bs-theme="dark"] .main-content {
    background: #0d1117;
}

/* ── PAGE HEADER ─────────────────────────── */
[data-bs-theme="dark"] .page-header h1,
[data-bs-theme="dark"] .page-title { color: #e2e8f0; }
[data-bs-theme="dark"] .page-header {
    border-bottom-color: rgba(255,255,255,0.08);
}

/* ── KARTY & PANELY ──────────────────────── */
[data-bs-theme="dark"] .dash-panel,
[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .item-card-c,
[data-bs-theme="dark"] .watcher-card-c,
[data-bs-theme="dark"] .form-card-b,
[data-bs-theme="dark"] .month-card,
[data-bs-theme="dark"] .warning-section,
[data-bs-theme="dark"] .month-bar-wrap,
[data-bs-theme="dark"] .filter-bar-wrapper,
[data-bs-theme="dark"] .cal-timeline,
[data-bs-theme="dark"] .view-toggle,
[data-bs-theme="dark"] .view-switcher,
[data-bs-theme="dark"] .legend-wrap {
    background: #161b22 !important;
    border-color: rgba(255,255,255,0.09) !important;
}
[data-bs-theme="dark"] .view-switcher .btn { color: #94a3b8; }
[data-bs-theme="dark"] .view-switcher .btn:hover { color: var(--c-primary-light); }
[data-bs-theme="dark"] .view-switcher .btn.active { background: #2563eb; color: white; box-shadow: 0 2px 8px rgba(59,130,246,0.3); }

[data-bs-theme="dark"] .dash-panel,
[data-bs-theme="dark"] .stat-card {
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* Stat karty — čísla a bordery */
[data-bs-theme="dark"] .stat-card { border-left-color: inherit; }

/* ── FORM CARD HEADER ────────────────────── */
[data-bs-theme="dark"] .form-card-b .card-header-gradient {
    opacity: 0.85;
}

/* ── TABULKY ─────────────────────────────── */
[data-bs-theme="dark"] table.table,
[data-bs-theme="dark"] .table {
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table > thead > tr > th {
    background: #1c2333;
    color: var(--c-text5);
    border-bottom-color: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] .table tbody tr {
    background: #161b22;
    border-bottom-color: rgba(255,255,255,0.05);
}
[data-bs-theme="dark"] .table tbody tr:hover {
    background: #1c2333 !important;
}
[data-bs-theme="dark"] .table td,
[data-bs-theme="dark"] .table th {
    border-color: rgba(255,255,255,0.06);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background: rgba(255,255,255,0.02);
    color: #e2e8f0;
}

/* Deadline tabulka — stavy řádků */
[data-bs-theme="dark"] .row-pending {
    background: rgba(251,191,36,0.07) !important;
}
[data-bs-theme="dark"] .row-completed {
    background: rgba(255,255,255,0.02) !important;
    color: var(--c-text4);
}

/* ── FORMULÁŘE ───────────────────────────── */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] input[type="text"],
[data-bs-theme="dark"] input[type="email"],
[data-bs-theme="dark"] input[type="password"],
[data-bs-theme="dark"] input[type="number"],
[data-bs-theme="dark"] input[type="date"],
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] select {
    background: #1c2333;
    border-color: rgba(255,255,255,0.12);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background: #1c2333;
    border-color: var(--c-primary);
    color: #e2e8f0;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}
[data-bs-theme="dark"] .form-control::placeholder { color: #475569; }
[data-bs-theme="dark"] label,
[data-bs-theme="dark"] .form-label { color: #94a3b8; }
[data-bs-theme="dark"] .floating-label { color: #64748b; }

/* ── BUTTONS ─────────────────────────────── */
/* Filled buttons — gradient zustava, jen zmirni shadow */
[data-bs-theme="dark"] .btn-primary {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}
[data-bs-theme="dark"] .btn-primary:hover {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}
[data-bs-theme="dark"] .btn-teal {
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.2);
}
[data-bs-theme="dark"] .btn-teal:hover {
    box-shadow: 0 6px 16px rgba(20, 184, 166, 0.3);
}
[data-bs-theme="dark"] .btn-success {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
[data-bs-theme="dark"] .btn-success:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}
[data-bs-theme="dark"] .btn-danger {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}
[data-bs-theme="dark"] .btn-danger:hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}
/* Outline buttons */
[data-bs-theme="dark"] .btn-outline-secondary {
    border-color: rgba(255,255,255,0.2);
    color: var(--c-text5);
}
[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background: rgba(255,255,255,0.07);
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.3);
}
[data-bs-theme="dark"] .btn-outline-primary {
    border-color: rgba(59,130,246,0.4);
    color: var(--c-primary-light);
}
[data-bs-theme="dark"] .btn-outline-primary:hover {
    background: rgba(59,130,246,0.1);
    color: #93c5fd;
    border-color: rgba(59,130,246,0.6);
}
[data-bs-theme="dark"] .btn-outline-teal {
    border-color: rgba(20,184,166,0.4);
    color: #2dd4bf;
}
[data-bs-theme="dark"] .btn-outline-teal:hover {
    background: rgba(20,184,166,0.1);
    color: #5eead4;
    border-color: rgba(20,184,166,0.6);
}
[data-bs-theme="dark"] .btn-outline-danger {
    border-color: rgba(239,68,68,0.4);
    color: #f87171;
}
[data-bs-theme="dark"] .btn-outline-danger:hover {
    background: rgba(239,68,68,0.1);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.6);
}
/* Utility buttons */
[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .btn-outline-light {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.15);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .btn-light:hover {
    background: rgba(255,255,255,0.12);
}
/* Form save button */
[data-bs-theme="dark"] .form-card-b-footer .btn-save {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
[data-bs-theme="dark"] .form-card-b-footer .btn-save:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

/* ── MODALY ──────────────────────────────── */
[data-bs-theme="dark"] .modal-content {
    background: #161b22;
    border-color: rgba(255,255,255,0.1);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .modal-header {
    border-bottom-color: rgba(255,255,255,0.09);
    background: #1c2333;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .modal-footer {
    border-top-color: rgba(255,255,255,0.09);
    background: #161b22;
}
[data-bs-theme="dark"] .modal-title { color: #e2e8f0; }

/* ── BADGES & STATUSY ────────────────────── */
[data-bs-theme="dark"] .badge.bg-light { background: rgba(255,255,255,0.1) !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .badge.bg-secondary { background: #334155 !important; }

/* ── DB BARVY v dark mode — brightness boost pro inline styly ── */
[data-bs-theme="dark"] .status-dot[style*="background"],
[data-bs-theme="dark"] .dc-status-dot[style*="background"],
[data-bs-theme="dark"] .status-dot-mini[style*="background"] {
    filter: brightness(1.3);
}
[data-bs-theme="dark"] .badge[style*="background-color"] {
    filter: brightness(1.2) saturate(1.1);
}
[data-bs-theme="dark"] .items-table i[style*="color:"],
[data-bs-theme="dark"] .history-table i[style*="color:"] {
    filter: brightness(1.15);
}

/* ── DROPDOWN ────────────────────────────── */
[data-bs-theme="dark"] .dropdown-menu {
    background: #1c2333;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
[data-bs-theme="dark"] .dropdown-item {
    color: var(--c-text5);
}
[data-bs-theme="dark"] .dropdown-item:hover {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .dropdown-divider { border-color: rgba(255,255,255,0.08); }

/* ── ALERTS & INFO BOXY ──────────────────── */
[data-bs-theme="dark"] .alert-info {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.25);
    color: #93c5fd;
}
[data-bs-theme="dark"] .alert-warning {
    background: rgba(251,191,36,0.1);
    border-color: rgba(251,191,36,0.25);
    color: #fde68a;
}
[data-bs-theme="dark"] .alert-danger {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.25);
    color: #fca5a5;
}
[data-bs-theme="dark"] .alert-success {
    background: rgba(16,185,129,0.1);
    border-color: rgba(16,185,129,0.25);
    color: #6ee7b7;
}

/* ── INFO PANEL (notifikace "Kdo dostane") ── */
[data-bs-theme="dark"] .info-box-blue {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.2);
    color: #93c5fd;
}

/* ── ITEM / WATCHER DETAIL ───────────────── */
[data-bs-theme="dark"] .item-info-card,
[data-bs-theme="dark"] .watcher-info-card {
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
[data-bs-theme="dark"] .detail-label { color: #64748b !important; }
[data-bs-theme="dark"] .detail-value { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .highlight-edit-box {
    background: #1c2333;
    border-color: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] .highlight-edit-box:hover {
    border-color: var(--c-teal);
    background: rgba(20,184,166,0.07);
}
/* ── DASHBOARD ───────────────────────────── */
[data-bs-theme="dark"] .att-item {
    border-bottom-color: rgba(255,255,255,0.05);
}
[data-bs-theme="dark"] .att-item:hover { background: rgba(255,255,255,0.03); }
[data-bs-theme="dark"] .up-item { border-bottom-color: rgba(255,255,255,0.05); }
[data-bs-theme="dark"] .type-row { border-bottom-color: rgba(255,255,255,0.04); }
[data-bs-theme="dark"] .quick-link { color: #64748b; }
[data-bs-theme="dark"] .quick-link:hover { color: #94a3b8; background: rgba(255,255,255,0.04); }
[data-bs-theme="dark"] .section-label { color: #475569; }
[data-bs-theme="dark"] .empty-panel { color: #475569; }

/* ── KALENDÁŘ ────────────────────────────── */
[data-bs-theme="dark"] .calendar-table-new th {
    background: #1c2333;
    color: #475569;
    border-bottom-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .calendar-table-new td {
    border-color: rgba(255,255,255,0.04);
    background: #161b22;
}
[data-bs-theme="dark"] .calendar-table-new td.empty { background: #0d1117; }
[data-bs-theme="dark"] .calendar-table-new td:hover:not(.empty) { background: #1c2333; }
[data-bs-theme="dark"] .month-header {
    /* teal gradient zůstává — pouze ztmaví pomocí overlay */
}

/* ── MONTH BAR ───────────────────────────── */
[data-bs-theme="dark"] .month-bar-wrap {
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
[data-bs-theme="dark"] .month-bar-year-btn {
    background: rgba(255,255,255,0.06);
    color: var(--c-text4);
}
[data-bs-theme="dark"] .month-bar-year-btn:hover {
    background: var(--c-teal);
    color: white;
}
[data-bs-theme="dark"] .month-bar-item { color: #475569; }
[data-bs-theme="dark"] .month-bar-item:hover { background: rgba(20,184,166,0.1); color: #14b8a6; }

/* ── FILTER BAR ──────────────────────────── */
[data-bs-theme="dark"] .filter-bar {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.07);
}
[data-bs-theme="dark"] .filter-btn,
[data-bs-theme="dark"] .type-filter-btn {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
    color: var(--c-text4);
}
[data-bs-theme="dark"] .filter-btn:hover,
[data-bs-theme="dark"] .type-filter-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--c-text5);
}
[data-bs-theme="dark"] .type-filter-btn.active {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}
[data-bs-theme="dark"] .type-filter-btn.active:hover {
    background: var(--c-primary-hover);
    border-color: var(--c-primary-hover);
    color: #fff;
}

/* ── WATCHER/ITEM LINK BANNER - dark mode ── */
[data-bs-theme="dark"] .item-link-banner,
[data-bs-theme="dark"] .watcher-link-banner {
    background: linear-gradient(135deg, rgba(20,184,166,0.08) 0%, rgba(13,148,136,0.06) 100%) !important;
}
/* Dark mode pro item/watcher link banner — pokryto přes [data-bs-theme="dark"] selektory */
[data-bs-theme="dark"] .item-details-strip,
[data-bs-theme="dark"] .watcher-details-strip {
    background: #1c2333;
}
[data-bs-theme="dark"] .overdue-badge {
    background: rgba(220,38,38,0.15);
    border-color: rgba(220,38,38,0.3);
    color: #f87171;
}

/* ── PŘÍLOHY & LIGHTBOX ──────────────────── */
[data-bs-theme="dark"] .attachment-grid-item {
    background: #1c2333;
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .lightbox-overlay { background: rgba(0,0,0,0.95); }

/* ── LOGIN PAGE ──────────────────────────── */
[data-bs-theme="dark"] .login-card {
    background: #161b22;
    border-color: rgba(255,255,255,0.09);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* ── VAROVNÁ SEKCE (bez termínu) ─────────── */
[data-bs-theme="dark"] .warning-section {
    background: rgba(245,158,11,0.08) !important;
    border-color: rgba(245,158,11,0.2) !important;
}
[data-bs-theme="dark"] .warning-section-header { color: #fde68a; }

/* ── HELP SIDEBAR ────────────────────────── */
[data-bs-theme="dark"] .help-sidebar-panel {
    background: #161b22;
    border-color: rgba(255,255,255,0.09);
}

/* ── AUDIT LOG ───────────────────────────── */
[data-bs-theme="dark"] .audit-row:hover { background: rgba(255,255,255,0.03); }
[data-bs-theme="dark"] .audit-row:hover { background: rgba(255,255,255,0.03) !important; }

/* ── SCROLLBAR (webkit) ──────────────────── */
[data-bs-theme="dark"] ::-webkit-scrollbar-track { background: #0d1117; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; border-radius: var(--radius-xs); }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── THEME TOGGLE BUTTON ─────────────────── */
.theme-toggle {
    width: 34px; height: 34px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--c-border);
    color: var(--c-text4);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: var(--fs-base);
}
.theme-toggle:hover {
    background: var(--c-surface3);
    color: var(--c-text3);
    border-color: var(--c-border2);
}
[data-bs-theme="dark"] .theme-toggle {
    color: #fbbf24;
    border-color: rgba(251,191,36,0.3);
}
[data-bs-theme="dark"] .theme-toggle:hover {
    background: rgba(251,191,36,0.1);
    border-color: rgba(251,191,36,0.5);
}

/* ── OPRAVY dark mode — přidáno po vizuální kontrole ─────────────────────── */

/* content-card (používá se na stránkách Firmy, Lokace, Druhy, Statusy atd.) */
[data-bs-theme="dark"] .content-card {
    background: #161b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4) !important;
}
[data-bs-theme="dark"] .content-card .card-header {
    background: transparent !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .content-card .card-body {
    background: transparent !important;
}

/* empty-state (prázdné panely — žádné firmy, lokace, atd.) */
[data-bs-theme="dark"] .empty-state {
    color: #475569;
}
[data-bs-theme="dark"] .empty-state i {
    color: #334155;
}
[data-bs-theme="dark"] .empty-state p {
    color: #475569;
}

/* deadlinesTable — confirmed řádky mají background: white */
[data-bs-theme="dark"] #deadlinesTable tbody tr {
    background: #161b22 !important;
    color: #e2e8f0;
}
[data-bs-theme="dark"] #deadlinesTable tbody tr:hover {
    background: #1c2333 !important;
}
[data-bs-theme="dark"] #deadlinesTable tbody tr.row-pending {
    background: rgba(251,191,36,0.07) !important;
}
[data-bs-theme="dark"] #deadlinesTable tbody tr.row-pending:hover {
    background: rgba(251,191,36,0.12) !important;
}
[data-bs-theme="dark"] #deadlinesTable tbody tr.row-completed {
    background: rgba(255,255,255,0.02) !important;
    opacity: 0.6;
}

/* history-table — aktivní (confirmed) řádky mají světle zelený gradient */
[data-bs-theme="dark"] .history-table tbody tr {
    background: #161b22;
}
[data-bs-theme="dark"] .history-table tbody tr:hover {
    background: #1c2333 !important;
}
[data-bs-theme="dark"] .history-table tbody tr.row-active,
[data-bs-theme="dark"] .items-table tbody tr.row-active {
    background: rgba(16,185,129,0.08) !important;
}
[data-bs-theme="dark"] .history-table tbody tr.row-active:hover,
[data-bs-theme="dark"] .items-table tbody tr.row-active:hover {
    background: rgba(16,185,129,0.13) !important;
}
[data-bs-theme="dark"] .history-table tbody tr.row-active .date-cell {
    color: #34d399;
}
[data-bs-theme="dark"] .history-table tbody tr.row-pending,
[data-bs-theme="dark"] .items-table tbody tr.row-pending {
    background: rgba(245,158,11,0.08) !important;
}
[data-bs-theme="dark"] .history-table tbody tr.row-pending:hover {
    background: rgba(245,158,11,0.13) !important;
}
[data-bs-theme="dark"] .history-table tbody tr.row-completed {
    background: transparent !important;
    opacity: 0.5;
}
[data-bs-theme="dark"] .history-table tbody td {
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.05);
}

/* Tabulka items a watchers tbody */
[data-bs-theme="dark"] .items-table tbody tr,
[data-bs-theme="dark"] .watchers-table tbody tr {
    background: #161b22;
    border-bottom-color: rgba(255,255,255,0.05);
}
[data-bs-theme="dark"] .items-table tbody tr:hover,
[data-bs-theme="dark"] .watchers-table tbody tr:hover td {
    background: #1c2333 !important;
}
[data-bs-theme="dark"] .items-table td,
[data-bs-theme="dark"] .watchers-table td {
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.05);
}

/* edit-deadline-box.ok */
[data-bs-theme="dark"] .edit-deadline-box.ok {
    background: rgba(16,185,129,0.08) !important;
}

/* Stat cards — bílé pozadí při hodnotě 0 */
[data-bs-theme="dark"] .stat-card {
    background: #161b22 !important;
    color: #e2e8f0;
}

/* page-header — bílá linie pod nadpisem */
[data-bs-theme="dark"] hr {
    border-color: rgba(255,255,255,0.08);
}

/* input-group */
[data-bs-theme="dark"] .input-group-text {
    background: #1c2333;
    border-color: rgba(255,255,255,0.12);
    color: var(--c-text4);
}

/* nav-tabs */
[data-bs-theme="dark"] .nav-tabs {
    border-bottom-color: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: var(--c-text4);
}
[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
    color: var(--c-text5);
    border-color: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background: #161b22;
    border-color: rgba(255,255,255,0.1) rgba(255,255,255,0.1) #161b22;
    color: #e2e8f0;
}

/* Flatpickr dark override */
[data-bs-theme="dark"] .flatpickr-calendar {
    background: #1c2333;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
[data-bs-theme="dark"] .flatpickr-months,
[data-bs-theme="dark"] .flatpickr-weekdays,
[data-bs-theme="dark"] .flatpickr-innerContainer {
    background: #1c2333;
}
[data-bs-theme="dark"] .flatpickr-current-month,
[data-bs-theme="dark"] .flatpickr-monthDropdown-months {
    color: #e2e8f0;
    background: transparent;
}
[data-bs-theme="dark"] span.flatpickr-weekday {
    background: #1c2333;
    color: var(--c-text4);
}
[data-bs-theme="dark"] .flatpickr-day {
    color: var(--c-text5);
}
[data-bs-theme="dark"] .flatpickr-day:hover {
    background: #334155;
    border-color: #334155;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .flatpickr-day.selected,
[data-bs-theme="dark"] .flatpickr-day.selected:hover {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: white;
}
[data-bs-theme="dark"] .flatpickr-day.today {
    border-color: var(--c-primary);
    color: var(--c-primary);
}
[data-bs-theme="dark"] .flatpickr-prev-month,
[data-bs-theme="dark"] .flatpickr-next-month {
    color: var(--c-text4);
    fill: #64748b;
}

/* ═══════════════════════════════════════════════════════════════════════
   DARK MODE KOMPLETNÍ OPRAVY — křížový audit 2026-02-18
   Pokrývá VŠECHNA světlá pozadí která nebyla v původním dark bloku
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Shared components: users-grid, admin-table-card, filter-bar, section-divider ── */
[data-bs-theme="dark"] .user-check label {
    background: #1c2333 !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] .user-check:hover label {
    background: #252f3e !important;
    border-color: rgba(59,130,246,0.3) !important;
}
[data-bs-theme="dark"] .user-check input:checked + label {
    background: rgba(59,130,246,0.1) !important;
    border-color: var(--c-primary) !important;
    color: #93c5fd !important;
}
[data-bs-theme="dark"] .admin-table-card {
    background: #161b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35) !important;
}
[data-bs-theme="dark"] .admin-table-card .table thead th {
    background: #1c2333 !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
    color: #64748b !important;
}
[data-bs-theme="dark"] .admin-table-card .table tbody td {
    border-bottom-color: rgba(255,255,255,0.05) !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .admin-table-card .table tbody tr:hover {
    background: rgba(255,255,255,0.04) !important;
}
[data-bs-theme="dark"] .admin-name {
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .admin-desc {
    color: #64748b !important;
}
[data-bs-theme="dark"] .user-chip {
    background: rgba(255,255,255,0.08) !important;
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] .user-chip i {
    color: #64748b !important;
}
[data-bs-theme="dark"] .admin-table-card .empty-state {
    background: transparent !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .admin-table-card .empty-state .empty-state-icon i {
    color: #334155 !important;
}
[data-bs-theme="dark"] .admin-table-card .empty-state p {
    color: #475569 !important;
}
[data-bs-theme="dark"] .btn-filter-toggle {
    background: #1c2333;
    border-color: rgba(255,255,255,0.1);
    color: var(--c-text5);
}
[data-bs-theme="dark"] .btn-filter-toggle:hover {
    background: #252f3e;
    border-color: rgba(255,255,255,0.2);
}
[data-bs-theme="dark"] .btn-filter-toggle.active {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.3);
    color: #93c5fd;
}
[data-bs-theme="dark"] .filter-active-badge {
    border-color: #1c2333;
}
[data-bs-theme="dark"] .filter-bar-collapsible {
    background: #1c2333;
    border-color: rgba(255,255,255,0.08);
}

/* ── Bootstrap .card (Diagnostika, Audit log, admin stránky) ─────────── */
[data-bs-theme="dark"] .card {
    background: #161b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
}
[data-bs-theme="dark"] .card-body {
    background: #161b22 !important;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .card-header {
    background: #1c2333 !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .card-footer {
    background: #1c2333 !important;
    border-top-color: rgba(255,255,255,0.08) !important;
}

/* ── Items tabulka — hlavičky a hover ────────────────────────────────── */
[data-bs-theme="dark"] .items-table th {
    background: #1c2333 !important;
    color: var(--c-text4);
    border-bottom-color: rgba(255,255,255,0.08) !important;
}
[data-bs-theme="dark"] .items-table th:hover,
[data-bs-theme="dark"] .items-table th.no-sort:hover {
    background: #243044 !important;
}
[data-bs-theme="dark"] .sort-arrows i {
    color: #475569;
}
[data-bs-theme="dark"] .sort-arrows i:hover,
[data-bs-theme="dark"] .sort-arrows i.active {
    color: #93c5fd;
}
[data-bs-theme="dark"] .items-table tbody tr:hover {
    background-color: #1c2333 !important;
}
[data-bs-theme="dark"] .items-table tbody tr:hover td {
    background-color: #1c2333 !important;
}

/* ── Watchers tabulka — řádky mají hardcoded teal pozadí ────────────── */
[data-bs-theme="dark"] .watchers-table tbody tr td {
    background: #161b22 !important;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .watchers-table tbody tr:hover td {
    background: #1c2333 !important;
}

/* ── Item karty — ikona a oddělovač ─────────────────────────────────── */
[data-bs-theme="dark"] .item-card-c-icon {
    background: #1c2333 !important;
}
[data-bs-theme="dark"] .item-card-c-divider {
    background: rgba(255,255,255,0.07) !important;
}
[data-bs-theme="dark"] .item-card-c-title {
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .item-card-c-link:hover .item-card-c-title {
    color: #93c5fd !important;
}
[data-bs-theme="dark"] .item-card-c-subtitle {
    color: #64748b !important;
}
[data-bs-theme="dark"] .item-card-c-header {
    background: #1a2235 !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
}
[data-bs-theme="dark"] .item-card-c-meta {
    color: var(--c-text5);
}
[data-bs-theme="dark"] .meta-chip + .meta-chip::before {
    color: #475569;
}
[data-bs-theme="dark"] .item-card-c-company {
    background: rgba(255,255,255,0.06);
    color: var(--c-text5);
}
[data-bs-theme="dark"] .item-card-c-company i {
    color: var(--c-text4);
}

/* ── Location panel (Item/detail sidebar) ────────────────────────────── */
[data-bs-theme="dark"] .location-panel {
    background: #1c2333 !important;
    border-color: rgba(255,255,255,0.08) !important;
}

/* ── Deaktivační modál — karty termínů ──────────────────────────────── */
[data-bs-theme="dark"] .deactivate-current-card {
    background: #1c2333 !important;
    border-color: rgba(255,255,255,0.1) !important;
}
[data-bs-theme="dark"] .deactivate-new-card {
    background: rgba(20, 184, 166, 0.08) !important;
    border-color: rgba(20, 184, 166, 0.3) !important;
}
[data-bs-theme="dark"] .deactivate-new-label {
    color: #2dd4bf !important;
}

/* ── Status change modál ─────────────────────────────────────────────── */
[data-bs-theme="dark"] .status-change-card {
    background: #1c2333 !important;
    border-color: rgba(255,255,255,0.1) !important;
}
[data-bs-theme="dark"] #deactivateModal .status-change-card {
    background: rgba(20, 184, 166, 0.08) !important;
    border-color: rgba(20, 184, 166, 0.3) !important;
}

/* ── Kalendář — prázdné dny a hover ─────────────────────────────────── */
[data-bs-theme="dark"] .calendar-table td.calendar-day.empty {
    background: rgba(255,255,255,0.01) !important;
}
[data-bs-theme="dark"] .calendar-table td.calendar-day:hover:not(.empty) {
    background: rgba(20, 184, 166, 0.1) !important;
}
[data-bs-theme="dark"] .calendar-table td.calendar-day {
    border-color: rgba(255,255,255,0.05) !important;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .calendar-table td.calendar-day .day-number {
    color: var(--c-text5);
}
[data-bs-theme="dark"] .calendar-table td.calendar-day.today .day-number {
    background: var(--c-primary) !important;
    color: white !important;
}

/* ── Edit deadline box (Item/detail sidebar — status) ───────────────── */
[data-bs-theme="dark"] .edit-deadline-box.ok {
    background: rgba(16, 185, 129, 0.1) !important;
}
[data-bs-theme="dark"] .edit-deadline-box.warning {
    background: rgba(245, 158, 11, 0.1) !important;
}
[data-bs-theme="dark"] .edit-deadline-box.danger {
    background: rgba(239, 68, 68, 0.1) !important;
}
[data-bs-theme="dark"] .edit-deadline-box.overdue {
    background: rgba(220, 38, 38, 0.1) !important;
}
[data-bs-theme="dark"] .edit-deadline-box.empty {
    background: #1c2333 !important;
}
[data-bs-theme="dark"] .ed-label {
    color: #475569 !important;
}
[data-bs-theme="dark"] .edit-deadline-meta {
    color: #64748b !important;
}

/* ── Ed-status badge ─────────────────────────────────────────────────── */
[data-bs-theme="dark"] .ed-status-confirmed {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
}
[data-bs-theme="dark"] .ed-status-pending {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
}

/* ── Edit item link hover ─────────────────────────────────────────────── */
[data-bs-theme="dark"] .edit-item-link:hover {
    background: rgba(255,255,255,0.04) !important;
}

/* ── Notification — info boxy a karty ───────────────────────────────── */
[data-bs-theme="dark"] .notif-section-card,
[data-bs-theme="dark"] .notif-alert-card,
[data-bs-theme="dark"] .notif-summary-card {
    background: #161b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
}
[data-bs-theme="dark"] .notif-info-text {
    color: #94a3b8 !important;
}

/* ── Warning section (hlídači bez termínu) ──────────────────────────── */
[data-bs-theme="dark"] .warning-section-item {
    background: rgba(245, 158, 11, 0.05) !important;
}
[data-bs-theme="dark"] .warning-section-item:hover {
    background: rgba(245, 158, 11, 0.1) !important;
}

/* ── Stat box — audit log, notification log ─────────────────────────── */
[data-bs-theme="dark"] .stat-box,
[data-bs-theme="dark"] .log-stat-box,
[data-bs-theme="dark"] .notif-stat {
    background: #161b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: #e2e8f0;
}

/* ── Alert boxy se statusy (zelené/žluté/červené infoboxes) ─────────── */
[data-bs-theme="dark"] .status-info-ok,
[data-bs-theme="dark"] .info-ok {
    background: rgba(16, 185, 129, 0.08) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}
[data-bs-theme="dark"] .status-info-warning,
[data-bs-theme="dark"] .info-warning {
    background: rgba(245, 158, 11, 0.08) !important;
    border-color: rgba(245, 158, 11, 0.2) !important;
}
[data-bs-theme="dark"] .status-info-danger,
[data-bs-theme="dark"] .info-danger {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

/* ── Bootstrap list-group (admin stránky) ───────────────────────────── */
[data-bs-theme="dark"] .list-group-item {
    background: #161b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .list-group-item:hover {
    background: #1c2333 !important;
}

/* ── Bootstrap table fallback ───────────────────────────────────────── */
[data-bs-theme="dark"] table th {
    background: #1c2333 !important;
    color: var(--c-text4);
    border-color: rgba(255,255,255,0.08) !important;
}
[data-bs-theme="dark"] table td {
    border-color: rgba(255,255,255,0.05) !important;
    color: #e2e8f0;
}
[data-bs-theme="dark"] table tbody tr:hover td {
    background: #1c2333 !important;
}

/* ── Tmavé texty (#1a1a1a, #374151) na kartách ──────────────────────── */
[data-bs-theme="dark"] .item-card-c-title,
[data-bs-theme="dark"] .watcher-card-c-title {
    color: #e2e8f0 !important;
}

/* ── Badge varianty pro status termínů ───────────────────────────────── */
[data-bs-theme="dark"] .badge-deadline-confirmed {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
}
[data-bs-theme="dark"] .badge-deadline-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
}
[data-bs-theme="dark"] .badge-deadline-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
}
[data-bs-theme="dark"] .badge-deadline-pending {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
}
[data-bs-theme="dark"] .badge-deadline-none {
    background: rgba(20, 184, 166, 0.15) !important;
    color: #2dd4bf !important;
}

/* ── Form card (formuláře add/edit) ─────────────────────────────────── */
[data-bs-theme="dark"] .form-card-b .card-header-custom {
    background: linear-gradient(135deg, #1e40af 0%, var(--c-primary) 100%) !important;
}

/* ── Modál dialogy — vnitřní prvky ──────────────────────────────────── */
[data-bs-theme="dark"] .modal-body {
    background: #161b22 !important;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .modal-body .form-text {
    color: #475569 !important;
}

/* ── Pagination ───────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .page-item .page-link {
    background: #1c2333 !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: var(--c-text5);
}
[data-bs-theme="dark"] .page-item.active .page-link {
    background: var(--c-primary) !important;
    border-color: var(--c-primary) !important;
    color: white;
}
[data-bs-theme="dark"] .page-item.disabled .page-link {
    background: #161b22 !important;
    color: #334155;
}

/* ── Tooltip / Popover ───────────────────────────────────────────────── */
[data-bs-theme="dark"] .tooltip-inner {
    background: #334155;
    color: #e2e8f0;
}

/* ── Pre / Code bloky (diagnostika) ─────────────────────────────────── */
[data-bs-theme="dark"] pre,
[data-bs-theme="dark"] code {
    background: #0d1117 !important;
    color: #e2e8f0 !important;
    border-color: rgba(255,255,255,0.08) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   BOOTSTRAP CSS VARIABLES OVERRIDE pro dark mode
   Bootstrap 5.3 používá vlastní --bs-* variables které ignorují var(--c-surface)
   ═══════════════════════════════════════════════════════════════════════ */

[data-bs-theme="dark"] {
    /* Bootstrap 5.3 card variables */
    --bs-card-bg: #161b22;
    --bs-card-border-color: rgba(255,255,255,0.08);
    --bs-card-cap-bg: #1c2333;
    --bs-card-color: #e2e8f0;
    /* Bootstrap body */
    --bs-body-bg: #0d1117;
    --bs-body-color: #e2e8f0;
    /* Bootstrap border */
    --bs-border-color: rgba(255,255,255,0.1);
    --bs-border-color-translucent: rgba(255,255,255,0.1);
    /* Bootstrap secondary/light */
    --bs-secondary-bg: #1c2333;
    --bs-tertiary-bg: #1c2333;
    /* Bootstrap table */
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255,255,255,0.02);
    --bs-table-hover-bg: rgba(255,255,255,0.04);
    --bs-table-border-color: rgba(255,255,255,0.06);
    /* Bootstrap form */
    --bs-form-control-bg: #1c2333;
    /* Bootstrap input group */
    --bs-input-group-addon-bg: #1c2333;
    --bs-input-group-addon-border-color: rgba(255,255,255,0.12);
    --bs-input-group-addon-color: #64748b;
}

/* Přímý override .panel (vlastní třída) — var(--c-surface) nestačí pokud není html tag správně nastaven */
[data-bs-theme="dark"] .panel {
    background: #161b22 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}
[data-bs-theme="dark"] .panel .panel-header,
[data-bs-theme="dark"] .panel-header {
    border-bottom-color: rgba(255,255,255,0.08) !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .panel .panel-body,
[data-bs-theme="dark"] .panel-body {
    background: transparent !important;
    color: #e2e8f0;
}

/* Audit log stat boxy (Bootstrap .card nebo vlastní) */
[data-bs-theme="dark"] .audit-stat-card,
[data-bs-theme="dark"] .log-stat,
[data-bs-theme="dark"] .stat-mini-card {
    background: #161b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: #e2e8f0;
}

/* Bootstrap list-group override */
[data-bs-theme="dark"] {
    --bs-list-group-bg: #161b22;
    --bs-list-group-border-color: rgba(255,255,255,0.08);
    --bs-list-group-color: #e2e8f0;
    --bs-list-group-action-hover-bg: #1c2333;
    --bs-list-group-action-hover-color: #e2e8f0;
}

/* Bootstrap modal backdrop/dialog */
[data-bs-theme="dark"] {
    --bs-modal-bg: #161b22;
    --bs-modal-border-color: rgba(255,255,255,0.1);
    --bs-modal-header-border-color: rgba(255,255,255,0.08);
    --bs-modal-footer-border-color: rgba(255,255,255,0.08);
}

/* Bootstrap dropdown */
[data-bs-theme="dark"] {
    --bs-dropdown-bg: #1c2333;
    --bs-dropdown-border-color: rgba(255,255,255,0.1);
    --bs-dropdown-link-color: #e2e8f0;
    --bs-dropdown-link-hover-bg: #243044;
    --bs-dropdown-link-hover-color: #e2e8f0;
    --bs-dropdown-divider-bg: rgba(255,255,255,0.08);
    --bs-dropdown-header-color: #64748b;
}

/* Bootstrap nav-tabs */
[data-bs-theme="dark"] {
    --bs-nav-tabs-border-color: rgba(255,255,255,0.1);
    --bs-nav-tabs-link-hover-border-color: rgba(255,255,255,0.1) rgba(255,255,255,0.1) transparent;
    --bs-nav-tabs-link-active-bg: #161b22;
    --bs-nav-tabs-link-active-border-color: rgba(255,255,255,0.1) rgba(255,255,255,0.1) #161b22;
    --bs-nav-tabs-link-active-color: #e2e8f0;
}

/* Bootstrap badge bg-light / bg-secondary fix */
[data-bs-theme="dark"] .bg-light {
    background-color: #1c2333 !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .bg-white {
    background-color: #161b22 !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .text-dark {
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .text-muted {
    color: #475569 !important;
}
[data-bs-theme="dark"] .border {
    border-color: rgba(255,255,255,0.08) !important;
}
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
    border-color: rgba(255,255,255,0.08) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   BOOTSTRAP 5.3 DIRECT OVERRIDE — přímé !important pro spolehlivost
   CSS variables nestačí pokud Bootstrap načten před naším CSS
   ═══════════════════════════════════════════════════════════════════════ */

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card-body,
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer,
[data-bs-theme="dark"] .card-img-overlay {
    background-color: #161b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .card-header {
    background-color: #1c2333 !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
}

[data-bs-theme="dark"] .card-footer {
    background-color: #1c2333 !important;
    border-top-color: rgba(255,255,255,0.08) !important;
}

/* Panel (vlastní třída aplikace) */
[data-bs-theme="dark"] .panel,
[data-bs-theme="dark"] .panel .panel-body,
[data-bs-theme="dark"] .panel-body {
    background: #161b22 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .panel .panel-header,
[data-bs-theme="dark"] .panel-header:not(.bg-danger):not(.bg-warning):not(.bg-success) {
    background-color: #1c2333 !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
    color: #e2e8f0 !important;
}

/* Bootstrap form controls uvnitř karet */
[data-bs-theme="dark"] .card .form-control,
[data-bs-theme="dark"] .card .form-select,
[data-bs-theme="dark"] .panel .form-control,
[data-bs-theme="dark"] .panel .form-select {
    background-color: #1c2333 !important;
    border-color: rgba(255,255,255,0.12) !important;
    color: #e2e8f0 !important;
}

/* Bootstrap table uvnitř karet */
[data-bs-theme="dark"] .card .table,
[data-bs-theme="dark"] .panel .table {
    --bs-table-bg: transparent;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .card .table th,
[data-bs-theme="dark"] .panel .table th {
    background-color: #1c2333 !important;
    color: #64748b !important;
    border-color: rgba(255,255,255,0.08) !important;
}

[data-bs-theme="dark"] .card .table td,
[data-bs-theme="dark"] .panel .table td {
    border-color: rgba(255,255,255,0.05) !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .card .table tbody tr:hover td,
[data-bs-theme="dark"] .panel .table tbody tr:hover td {
    background-color: rgba(255,255,255,0.04) !important;
}

/* Badge bg-light v tabulkách */
[data-bs-theme="dark"] .card .badge.bg-light,
[data-bs-theme="dark"] .panel .badge.bg-light,
[data-bs-theme="dark"] .table .badge.bg-light {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* Text muted v kartách */
[data-bs-theme="dark"] .card .text-muted,
[data-bs-theme="dark"] .panel .text-muted,
[data-bs-theme="dark"] .card small,
[data-bs-theme="dark"] .panel small {
    color: #64748b !important;
}

/* Hover na řádcích audit logu */
[data-bs-theme="dark"] .audit-row {
    border-bottom-color: rgba(255,255,255,0.04) !important;
}

/* Stat boxy v audit logu (Bootstrap karty s čísly 22, 8, 2, 12) */
[data-bs-theme="dark"] .card.border-0,
[data-bs-theme="dark"] .card.shadow-sm {
    background-color: #161b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
}

/* Link v tmavém pozadí */
[data-bs-theme="dark"] .card a:not(.btn),
[data-bs-theme="dark"] .panel a:not(.btn) {
    color: var(--c-primary-light);
}

[data-bs-theme="dark"] .card a:not(.btn):hover,
[data-bs-theme="dark"] .panel a:not(.btn):hover {
    color: #93c5fd;
}

/* Input placeholder v dark kartách */
[data-bs-theme="dark"] .card .form-control::placeholder,
[data-bs-theme="dark"] .panel .form-control::placeholder {
    color: #475569 !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   FINÁLNÍ OPRAVY — !important pro přepsání Bootstrap specificity
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. Kalendář — td buňky (bez třídy = plain weekday/weekend) ──────── */
[data-bs-theme="dark"] .calendar-table-new td {
    background: #161b22 !important;
    border-color: rgba(255,255,255,0.04) !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .calendar-table-new td.empty {
    background: #0d1117 !important;
}
[data-bs-theme="dark"] .calendar-table-new td:hover:not(.empty) {
    background: #1c2333 !important;
}
/* Day cell uvnitř td */
[data-bs-theme="dark"] .day-cell {
    color: #e2e8f0;
}
[data-bs-theme="dark"] .day-number-new {
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] .day-cell.today .day-number-new {
    background: var(--c-primary) !important;
    color: white !important;
}

/* ── 2. Firmy empty state — .content-card !important ────────────────── */
[data-bs-theme="dark"] .content-card {
    background: #161b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
}
[data-bs-theme="dark"] .content-card .card-body,
[data-bs-theme="dark"] .content-card > div,
[data-bs-theme="dark"] .content-card .empty-state {
    background: transparent !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .content-card .empty-state i {
    color: #334155 !important;
}
[data-bs-theme="dark"] .content-card .empty-state p,
[data-bs-theme="dark"] .content-card .empty-state h5,
[data-bs-theme="dark"] .content-card .empty-state h6 {
    color: #475569 !important;
}

/* ── 3. Notifikace — info-box-blue (Kdo dostane) ──────────────────────── */
[data-bs-theme="dark"] .info-box-blue {
    background: rgba(59,130,246,0.08) !important;
    border-color: rgba(59,130,246,0.2) !important;
    color: #93c5fd !important;
}
[data-bs-theme="dark"] .info-box-blue * {
    color: #93c5fd;
}
[data-bs-theme="dark"] .info-box-blue a {
    color: var(--c-primary-light) !important;
}
[data-bs-theme="dark"] .info-box-blue .form-check-label {
    color: #93c5fd !important;
}

/* ── 4. Audit log filter panel ──────────────────────────────────────── */
[data-bs-theme="dark"] .panel {
    background: #161b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
}
[data-bs-theme="dark"] .panel .panel-header {
    background: #1c2333 !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .panel .panel-body {
    background: #161b22 !important;
    color: #e2e8f0 !important;
}

/* Audit log stat boxy (22 / 8 / 2 / 12) — pravděpodobně .stat-card */
[data-bs-theme="dark"] .stat-card {
    background: #161b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
}
[data-bs-theme="dark"] .stat-card .stat-label {
    color: #64748b !important;
}
[data-bs-theme="dark"] .stat-card .stat-value {
    color: #e2e8f0 !important;
}

/* ── 5. Diagnostika — SMTP info box (Bootstrap .alert-info) ──────────── */
[data-bs-theme="dark"] .alert {
    border-color: rgba(255,255,255,0.1) !important;
}
[data-bs-theme="dark"] .alert-info {
    background: rgba(59,130,246,0.1) !important;
    border-color: rgba(59,130,246,0.25) !important;
    color: #93c5fd !important;
}
[data-bs-theme="dark"] .alert-warning {
    background: rgba(245,158,11,0.1) !important;
    border-color: rgba(245,158,11,0.25) !important;
    color: #fbbf24 !important;
}
[data-bs-theme="dark"] .alert-danger {
    background: rgba(239,68,68,0.1) !important;
    border-color: rgba(239,68,68,0.25) !important;
    color: #f87171 !important;
}
[data-bs-theme="dark"] .alert-success {
    background: rgba(16,185,129,0.1) !important;
    border-color: rgba(16,185,129,0.25) !important;
    color: #34d399 !important;
}

/* ── 6. Bootstrap .table thead (bílé hlavičky tabulek) ──────────────── */
[data-bs-theme="dark"] .table > thead > tr > th,
[data-bs-theme="dark"] .table thead th {
    background-color: #1c2333 !important;
    color: #64748b !important;
    border-color: rgba(255,255,255,0.08) !important;
}
[data-bs-theme="dark"] .table > tbody > tr > td,
[data-bs-theme="dark"] .table tbody td {
    border-color: rgba(255,255,255,0.05) !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .table > tbody > tr:hover > td,
[data-bs-theme="dark"] .table tbody tr:hover td {
    background-color: rgba(255,255,255,0.03) !important;
}
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(255,255,255,0.02) !important;
}

/* ── 7. Notifikace info-box (šedý info box - alert-like) ────────────── */
[data-bs-theme="dark"] .alert.alert-secondary,
.notif-info-box {
    background: var(--c-primary-bg, #eff6ff);
    border: 1px solid #93c5fd;
    font-size: var(--fs-sm);
}

[data-bs-theme="dark"] .notif-info-box,
[data-bs-theme="dark"] .info-note {
    background: rgba(100,116,139,0.1) !important;
    border-color: rgba(100,116,139,0.2) !important;
    color: #94a3b8 !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   TABULKA — Bootstrap 5.3 td background override (audit log, všechny tabulky)
   Problem: Bootstrap nastavuje --bs-table-bg přímo na .table → kaskáda nefunguje
   Fix: přímý background-color: transparent !important na td/tr/tbody
   ═══════════════════════════════════════════════════════════════════════ */

/* Wrapper tabulky — žádný glow */
[data-bs-theme="dark"] .items-table-card,
[data-bs-theme="dark"] .panel,
[data-bs-theme="dark"] .content-card {
    box-shadow: 0 1px 4px rgba(0,0,0,0.35) !important;
}

/* Bootstrap .table — přepsat CSS variable přímo na elementu */
[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(255,255,255,0.04);
    --bs-table-striped-bg: rgba(255,255,255,0.02);
    --bs-table-border-color: rgba(255,255,255,0.05);
    background-color: transparent !important;
}

/* Tbody — zcela průhledný, dědí barvu z panelu */
[data-bs-theme="dark"] .table tbody,
[data-bs-theme="dark"] .table > tbody {
    background-color: transparent !important;
}

/* TR — průhledný */
[data-bs-theme="dark"] .table tbody tr,
[data-bs-theme="dark"] .table > tbody > tr {
    background-color: transparent !important;
    border-color: rgba(255,255,255,0.05) !important;
}

/* TD — průhledný (bere barvu z panelu/containeru) */
[data-bs-theme="dark"] .table tbody td,
[data-bs-theme="dark"] .table > tbody > tr > td {
    background-color: transparent !important;
    border-color: rgba(255,255,255,0.05) !important;
    color: #e2e8f0 !important;
}

/* TH — jemně tmavší než panel */
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table > thead > tr > th {
    background-color: rgba(255,255,255,0.03) !important;
    border-color: rgba(255,255,255,0.07) !important;
    color: #64748b !important;
}

/* Hover řádek — lehké zvýraznění */
[data-bs-theme="dark"] .table tbody tr:hover td,
[data-bs-theme="dark"] .table > tbody > tr:hover > td {
    background-color: rgba(255,255,255,0.04) !important;
}

/* Totéž pro .items-table a .watchers-table */
[data-bs-theme="dark"] .items-table tbody tr,
[data-bs-theme="dark"] .watchers-table tbody tr {
    background-color: transparent !important;
}
[data-bs-theme="dark"] .items-table tbody td,
[data-bs-theme="dark"] .watchers-table tbody td {
    background-color: transparent !important;
}
[data-bs-theme="dark"] .items-table tbody tr:hover,
[data-bs-theme="dark"] .items-table tbody tr:hover td,
[data-bs-theme="dark"] .watchers-table tbody tr:hover td {
    background-color: rgba(255,255,255,0.04) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   BOOTSTRAP TABLE — přesný selektor .table > :not(caption) > * > *
   Toto je JEDINÝ způsob jak přepsat Bootstrap 5.3 table cell background
   ═══════════════════════════════════════════════════════════════════════ */

[data-bs-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent !important;
    color: #e2e8f0 !important;
    border-color: rgba(255,255,255,0.05) !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .table > thead > * > * {
    background-color: rgba(255,255,255,0.03) !important;
    color: #64748b !important;
}

[data-bs-theme="dark"] .table > tbody > tr:hover > * {
    background-color: rgba(255,255,255,0.05) !important;
    color: #e2e8f0 !important;
}

/* Wrapper kontejner tabulky — žádný bílý podklad */
[data-bs-theme="dark"] .panel,
[data-bs-theme="dark"] .items-table-card {
    background-color: #161b22 !important;
}

/* === Dark mode: upload sloty a photo section header === */
[data-bs-theme="dark"] .photo-upload-slot {
    background: #1c2333 !important;
    border-color: rgba(255,255,255,0.12) !important;
    color: #475569 !important;
}
[data-bs-theme="dark"] .photo-upload-slot:hover {
    background: #252f3e !important;
    border-color: var(--c-primary) !important;
    color: #3b82f6 !important;
}
[data-bs-theme="dark"] .items-table .deadline-attachments-row td,
[data-bs-theme="dark"] .history-table .deadline-attachments-row td {
    background: #1a2332;
}
[data-bs-theme="dark"] .items-table .deadline-notes-row td,
[data-bs-theme="dark"] .history-table .deadline-notes-row td {
    background: #1c2035;
}
[data-bs-theme="dark"] .deadline-upload-btn {
    background: #1c2333 !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: #475569 !important;
}
[data-bs-theme="dark"] .deadline-upload-btn:hover {
    background: rgba(20,184,166,0.08) !important;
    border-color: #14b8a6 !important;
    color: #14b8a6 !important;
}
[data-bs-theme="dark"] .photos-section-header {
    background: #1c2333 !important;
    border-color: rgba(255,255,255,0.08) !important;
}

/* (deadline-action-btn nahrazeno centralnim .btn-action) */

/* =============================================
   MOJE SKUPINY — group cards (default page)
   ============================================= */
.my-group-card {
    background: white;
    border: 1px solid var(--c-border2);
    border-top: 4px solid #8b5cf6;
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: box-shadow 0.15s, transform 0.15s;
    height: 100%;
}
.my-group-card:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.12);
    transform: translateY(-2px);
}
.my-group-card-header {
    margin-bottom: 8px;
}
.my-group-card-title {
    font-weight: 700;
    font-size: var(--fs-md);
    color: var(--c-text);
}
.my-group-card-company {
    font-size: var(--fs-sm);
    color: var(--c-text4);
    margin-top: 2px;
}
.my-group-card-desc {
    font-size: var(--fs-sm);
    color: var(--c-text5);
    margin-bottom: 10px;
}
.my-group-card-members {
    font-size: var(--fs-sm);
    color: var(--c-text4);
    margin-bottom: 12px;
}
.my-group-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
[data-bs-theme="dark"] .my-group-card {
    background: #1e293b;
    border-color: #334155;
    border-top-color: #8b5cf6;
}
[data-bs-theme="dark"] .my-group-card:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.2);
}
[data-bs-theme="dark"] .my-group-card-title { color: #e2e8f0; }
[data-bs-theme="dark"] .my-group-card-company { color: #94a3b8; }
[data-bs-theme="dark"] .my-group-card-desc { color: #64748b; }
[data-bs-theme="dark"] .my-group-card-members { color: #94a3b8; }

/* =============================================
   MOJE SKUPINY — summary boxy v Moje terminy
   ============================================= */
.my-group-summaries-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}
.my-group-summaries-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.my-group-box {
    display: block;
    background: white;
    border: 1px solid var(--c-border2);
    border-left: 4px solid #8b5cf6;
    border-radius: var(--radius-base);
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
    min-width: 140px;
}
.my-group-box:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.12);
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}
.my-group-box-name {
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--c-text);
    margin-bottom: 4px;
}
.my-group-box-stats {
    font-size: var(--fs-xs);
    color: var(--c-text4);
    display: flex;
    gap: 8px;
}
[data-bs-theme="dark"] .my-group-box {
    background: #1e293b;
    border-color: #334155;
    border-left-color: #8b5cf6;
}
[data-bs-theme="dark"] .my-group-box:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
    color: inherit;
}
[data-bs-theme="dark"] .my-group-box-name { color: #e2e8f0; }
[data-bs-theme="dark"] .my-group-box-stats { color: #94a3b8; }

/* =============================================
   MOJE SKUPINY — redesign (mg-group-*, mg-item-*, mg-section-*)
   ============================================= */
/* Group section — jedna sekce per skupina */
.mg-group-section {
    margin-bottom: var(--sp-xl);
}
.mg-group-section:last-child { margin-bottom: 0; }

/* Group banner — hlavicka skupiny */
.mg-group-banner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    padding: 14px 18px; margin-bottom: var(--sp-md);
    background: #eef2f7; border-radius: var(--radius-lg);
}
.mg-group-banner-left { display: flex; align-items: center; gap: 12px; }
.mg-group-banner-icon {
    width: 40px; height: 40px; border-radius: var(--radius-lg);
    background: #8b5cf6; color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-base); flex-shrink: 0;
}
.mg-group-banner-name { font-size: var(--fs-lg); font-weight: 700; color: var(--c-text); }
.mg-group-banner-meta { font-size: var(--fs-sm); color: var(--c-text4); margin-top: 4px; line-height: 1.6; }
.mg-group-banner-stats { display: flex; gap: 6px; flex-wrap: wrap; }

/* Item boxy — ala Dashboard gi-box */
.mg-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 12px;
}
.mg-item-box {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border2);
    border-top: 4px solid var(--gi-color, #3b82f6);
    overflow: hidden;
    text-decoration: none; color: inherit;
    display: flex; flex-direction: column;
    transition: box-shadow 0.15s, transform 0.15s;
    min-height: 100%;
}
/* Hlidaci rostou, statistiky + link vzdy dole */
.mg-watcher-rows { flex: 1; }
.mg-item-box:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-1px); text-decoration: none; color: inherit; }
.mg-item-box-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px 8px;
}
.mg-item-box-icon {
    width: 32px; height: 32px; border-radius: var(--radius-base);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-sm); flex-shrink: 0;
}
.mg-item-box-title { font-size: var(--fs-base); font-weight: 700; color: var(--c-text); }
.mg-item-box-sub { font-size: var(--fs-xs); color: var(--c-text5); display: flex; align-items: center; gap: 4px; }

/* Hlidaci — radky s pocty */
.mg-watcher-rows { padding: 0 14px 8px; display: flex; flex-direction: column; gap: 4px; }
.mg-watcher-row {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0; font-size: var(--fs-sm);
    border-bottom: 1px solid var(--c-border);
}
.mg-watcher-row:last-child { border-bottom: none; }
.mg-watcher-info { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.mg-responsible { font-size: var(--fs-xs); color: var(--c-text5); }
/* Mini statistiky na radku hlidace — se sloupci zarovnanymi pod celkove */
.mg-watcher-mini-stats {
    display: flex; gap: 0; flex-shrink: 0;
}
.mg-watcher-stats-header {
    display: flex; gap: 0; flex-shrink: 0;
    padding: 0 14px 4px; margin-bottom: 2px;
}
.mg-watcher-stats-header .mg-msh {
    width: 56px; text-align: center;
    font-size: var(--fs-2xs); font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.3px; color: var(--c-text5);
}
.mg-ms {
    width: 56px; text-align: center;
    font-size: var(--fs-base); font-weight: 800; color: #d1d5db;
}
.mg-ms.danger { color: #ef4444; }
.mg-ms.success { color: #10b981; }

/* Statistiky — 3 sloupce jako na Dashboardu */
.mg-item-box-stats {
    display: flex; border-top: 1px solid var(--c-border);
    margin-top: auto;
}
.mg-item-box-stat {
    flex: 1; text-align: center; padding: 8px 4px;
    border-right: 1px solid var(--c-border);
}
.mg-item-box-stat:last-child { border-right: none; }
.mg-item-box-stat-num {
    font-size: var(--fs-base); font-weight: 800; line-height: 1; color: #d1d5db;
}
.mg-item-box-stat-num.danger { color: #ef4444; }
.mg-item-box-stat-num.success { color: #10b981; }
.mg-item-box-stat-label {
    font-size: var(--fs-2xs); font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.3px; color: var(--c-text5); margin-top: 2px;
}

/* Link na Moje prace */
.mg-item-box-link {
    padding: 6px 14px; font-size: var(--fs-xs); color: #3b82f6;
    border-top: 1px solid var(--c-border);
}

/* Dark mode */
[data-bs-theme="dark"] .mg-group-banner { background: #161b22; }
[data-bs-theme="dark"] .mg-item-box { background: #1c2333; border-color: rgba(255,255,255,0.08); }
[data-bs-theme="dark"] .mg-item-box-stat-num { color: #475569; }
[data-bs-theme="dark"] .mg-item-box-link { color: var(--c-primary-light); }

/* =============================================
   FILTR TYPU ITEMU — pill buttony v Moje terminy
   ============================================= */
/* .my-type-filter removed — work mode merged into .type-filter-row */

/* =============================================
   DEADLINE CARD (dc-*) — sdilena karta terminu/ukolu
   (Terminy karty, Moje prace)
   ============================================= */
.deadline-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    align-items: start;
}
@media (max-width: 768px) {
    .deadline-cards-grid { grid-template-columns: 1fr; }
}
.deadline-card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border2);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
}
.deadline-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-1px); }
.deadline-card.dc-hidden { display: none !important; }
.deadline-card.dc-urgence-danger  { border-left: 3px solid #ef4444; }
.deadline-card.dc-urgence-warning { border-left: 3px solid #f59e0b; }
.deadline-card.dc-urgence-pending { border-left: 3px solid #8b5cf6; }
.deadline-card.dc-urgence-neutral { border-left: 3px solid var(--c-border2); }
.deadline-card.dc-urgence-ok      { border-left: 3px solid var(--status-ok-text); }
.deadline-card.dc-available       { border-style: dashed; border-left: 3px dashed #0ea5e9; }
.deadline-card.dc-draft           { border-left: 3px dashed #8b5cf6; opacity: 0.75; }
.dc-status-draft { background: #ede9fe !important; color: #6d28d9 !important; }
[data-bs-theme="dark"] .dc-status-draft { background: rgba(139,92,246,0.15) !important; color: #a78bfa !important; }
[data-bs-theme="dark"] .deadline-card.dc-draft { opacity: 0.7; }
.deadline-card.completed {
    border-left-color: var(--status-ok-text);
    background: var(--status-ok-bg);
}
.deadline-card.completed .dc-header {
    background: var(--status-ok-bg);
}
.deadline-card.completed .dc-desc {
    color: var(--c-text4);
}
[data-bs-theme="dark"] .deadline-card.completed {
    background: rgba(16,185,129,0.05);
}
[data-bs-theme="dark"] .deadline-card.completed .dc-header {
    background: rgba(16,185,129,0.1);
}
.dc-header {
    padding: 8px 14px;
    display: flex; flex-direction: column; gap: 4px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.dc-body { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.dc-pills-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dc-days-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: var(--radius-sm);
    font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
}
.dc-days-danger  { background: var(--status-danger-bg); color: var(--status-danger-text); border: 1px solid var(--status-danger-border); }
.dc-days-warning { background: #fffbeb; color: #d97706; border: 1px solid var(--status-caution-border); }
.dc-days-soon    { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.dc-days-ok      { background: var(--status-ok-bg); color: var(--status-ok-text); border: 1px solid #bbf7d0; }
.dc-days-pending { background: var(--status-pending-bg); color: var(--status-pending-text); border: 1px solid #ddd6fe; }
.dc-days-muted   { background: var(--c-surface2); color: var(--c-text5); border: 1px solid var(--c-border2); }
.dc-status-pill {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: var(--radius-sm);
    font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
}
.dc-status-overdue   { background: var(--status-danger-bg); color: var(--status-danger-text); }
.dc-status-confirmed { background: var(--status-ok-bg); color: var(--status-ok-text); }
.dc-status-pending   { background: var(--status-pending-bg); color: var(--status-pending-text); }
.dc-status-completed { background: var(--c-surface2); color: var(--c-text5); }
.dc-name-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.dc-item-name { font-size: var(--fs-base); font-weight: 500; color: var(--c-text4); line-height: 1.3; display: flex; align-items: center; gap: 5px; }
.dc-item-name a { color: inherit; text-decoration: none; }
.dc-item-name a:hover { color: #3b82f6; }
.dc-watcher-name { font-size: var(--fs-sm); color: #0d9488; font-weight: 600; display: flex; align-items: center; gap: 4px; white-space: nowrap; flex-shrink: 0; }
.dc-watcher-name a { color: inherit; text-decoration: none; }
.dc-watcher-name a:hover { color: #0f766e; }
.dc-desc { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text); line-height: 1.4; }
.dc-meta { display: flex; align-items: center; gap: 10px; font-size: var(--fs-xs); color: var(--c-text4); flex-wrap: wrap; }
.dc-meta-item { display: flex; align-items: center; gap: 3px; }
.dc-status-dot { width: 7px; height: 7px; border-radius: var(--radius-full); display: inline-block; flex-shrink: 0; }
.dc-info-section {
    padding: 6px 14px 4px;
    margin-top: auto;
    border-top: 1px solid var(--c-border);
}
.dc-dates-row {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 8px; font-size: var(--fs-sm); color: var(--c-text4);
}
.dc-date-item { white-space: nowrap; }
.dc-date-label { display: block; font-size: var(--fs-2xs); color: var(--c-text5); font-weight: 500; line-height: 1.2; margin-bottom: 1px; }
.dc-date-sep { color: var(--c-text5); font-size: var(--fs-xs); }
.dc-date-primary { color: var(--c-text); }
.dc-dates-secondary { font-size: var(--fs-xs); color: var(--c-text5); margin-top: 2px; }
.dc-desc-primary { font-size: var(--fs-sm); font-weight: 700; color: var(--c-text); line-height: 1.4; }

/* Action grid — ikony v mřížce 3×N */
.action-grid {
    display: inline-grid;
    grid-template-columns: repeat(3, auto);
    gap: 3px;
    justify-items: center;
}
.dc-date-primary.overdue { color: #dc2626; }
.dc-date-primary strong { font-size: var(--fs-base); }
.dc-persons-row {
    display: flex; justify-content: space-between; gap: 8px;
    font-size: var(--fs-xs); color: var(--c-text5); padding: 4px 0;
}
.dc-person-item strong { color: var(--c-text3); }
.dc-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 14px; border-top: 1px solid var(--c-border); }
.dc-indicators { display: flex; gap: 8px; align-items: center; }
.dc-actions { display: flex; gap: 6px; align-items: center; }
.dc-actions .btn-action { flex: 0 0 auto; }
.dc-expand-section {
    padding: 8px 14px;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface-subtle, #fafbfc);
    font-size: var(--fs-sm);
}
/* DC dark mode */
[data-bs-theme="dark"] .deadline-card { background: #1c2333; border-color: rgba(255,255,255,0.08); }
[data-bs-theme="dark"] .deadline-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
[data-bs-theme="dark"] .dc-header { border-bottom-color: rgba(255,255,255,0.06); }
[data-bs-theme="dark"] .dc-item-name { color: #94a3b8; }
[data-bs-theme="dark"] .dc-item-name a:hover { color: #93c5fd; }
[data-bs-theme="dark"] .dc-desc { color: #e2e8f0; }
[data-bs-theme="dark"] .dc-meta { color: #94a3b8; }
[data-bs-theme="dark"] .dc-info-section { border-top-color: rgba(255,255,255,0.06); }
[data-bs-theme="dark"] .dc-persons-row { color: #64748b; }
[data-bs-theme="dark"] .dc-person-item strong { color: #94a3b8; }
[data-bs-theme="dark"] .dc-date-primary { color: #e2e8f0; }
[data-bs-theme="dark"] .dc-footer { border-top-color: rgba(255,255,255,0.06); }
[data-bs-theme="dark"] .dc-expand-section { background: #111827; border-top-color: #30363d; }

/* =============================================
   MD-CARD — sdileny komponent karet terminu
   (Moje terminy, Moje skupiny detail)
   ============================================= */

/* Grid layout pro karty */
.mp-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: var(--sp-md);
}
@media (max-width: 768px) {
    .mp-card-grid { grid-template-columns: 1fr; }
}

.md-card {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border2);
    margin-bottom: var(--sp-md);
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.md-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--card-type-color, var(--c-border2));
}
.md-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.md-card.completed { opacity: 0.65; }
.md-card-header {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    padding: var(--sp-base);
}

/* Days indicator — default (56x56 box, used by MyGroup) */
.md-card-days {
    min-width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-base);
    flex-shrink: 0;
}
.md-card-days .days-num {
    font-size: var(--fs-lg);
    font-weight: 700;
    line-height: 1;
    display: block;
}
.md-card-days .days-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-top: 2px;
}
.md-card-days.overdue { background: var(--status-danger-bg); color: var(--status-danger-text); }
.md-card-days.danger { background: var(--status-warning-bg); color: var(--status-warning-text); }
.md-card-days.warning { background: var(--status-caution-bg); color: var(--status-caution-text); }
.md-card-days.ok { background: var(--status-ok-bg); color: var(--status-ok-text); }
.md-card-days.pending { background: var(--status-pending-bg); color: var(--status-pending-text); }
.md-card-days.done { background: var(--status-done-bg); color: var(--status-done-text); }

.md-card-body { flex: 1; min-width: 0; }

/* === Moje prace card overrides (scoped to .mp-card-grid) === */
.mp-card-grid .md-card {
    margin-bottom: 0;
    border-left: 3px solid var(--card-urgency-color, var(--c-border2));
    display: flex;
    flex-direction: column;
}
.mp-card-grid .md-card::before { display: none; }
.mp-card-grid .md-card.completed { border-left-color: var(--status-ok-text); }
.mp-card-grid .md-card.mp-card-available {
    border-style: dashed;
    border-left-width: 3px;
    border-left-color: #0ea5e9;
    background: #fafcff;
}
.mp-card-grid .md-card-header {
    display: flex;
    flex-direction: column;
    gap: var(--sp-xs);
    padding: var(--sp-base);
    flex: 1;
    align-items: stretch;
}
/* Days pill — kompaktni inline (v mp-card-grid) */
.mp-card-grid .md-card-days {
    min-width: auto;
    height: auto;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
    font-weight: 700;
    white-space: nowrap;
}
.mp-card-grid .md-card-days .days-num {
    font-size: var(--fs-base);
    font-weight: 800;
    margin-top: 0;
}
.mp-card-grid .md-card-days .days-label {
    font-size: var(--fs-sm);
    font-weight: 600;
    margin-top: 0;
}

/* Item row — type icon + item name + role badge + days pill */
.md-card-item-row {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    margin-bottom: var(--sp-xs);
}
.md-card-type-icon {
    width: 22px;
    height: 22px;
    border-radius: var(--sp-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
}
.md-card-item-name {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Moje prace: item name sekundarni, hlavni nazev prominentni */
.mp-card-grid .md-card-item-name {
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--c-text3);
}
.md-card-item-name a { color: inherit; text-decoration: none; }
.md-card-item-name a:hover { color: #3b82f6; }
.md-card-watcher-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fs-base);
    color: var(--c-text4);
    margin-bottom: var(--sp-xs);
}
.md-card-watcher-row a { color: inherit; text-decoration: none; }
.md-card-watcher-row a:hover { color: #0d9488; }
/* Moje prace: watcher row = HLAVNI nazev (title nebo watcher name) */
.mp-card-grid .md-card-watcher-row {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--c-text);
    line-height: 1.3;
    display: block;
}
/* Subtitle — sekundarni info pod hlavnim nazvem (vzor: 👁 Hlidac · Item (Lokace)) */
.md-card-subtitle {
    font-size: var(--fs-base);
    color: var(--c-text4);
}
.md-card-subtitle a { color: inherit; text-decoration: none; }
.md-card-subtitle a:hover { color: #0d9488; }

/* Notes indicator — ve footeru karty */
.mp-notes-chevron { font-size: var(--fs-2xs); transition: transform 0.2s; margin-left: 2px; }
.md-card-note-btn.open .mp-notes-chevron { transform: rotate(180deg); }

/* Notes body — rozbaleny obsah */
.md-card-notes-body {
    padding: 0 var(--sp-base) var(--sp-sm);
    font-size: var(--fs-base);
    border-top: 1px solid var(--c-border);
    background: var(--c-surface-subtle, #fafbfc);
}
.md-card-notes-body .mp-note-item {
    padding: 6px 0;
    border-bottom: 1px solid var(--c-border);
}
.md-card-notes-body .mp-note-item:last-child { border-bottom: none; }
.md-card-notes-body .mp-note-text { color: var(--c-text2); }
.md-card-notes-body .mp-note-meta { font-size: var(--fs-xs); color: var(--c-text5); margin-top: 2px; }
.md-card-notes-body .mp-note-delete { color: #dc2626; margin-left: 6px; }
.md-card-notes-body .mp-note-delete:hover { color: #b91c1c; }
.mp-note-add-form {
    display: flex;
    gap: 6px;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid var(--c-border);
}
.mp-note-add-form input { flex: 1; }

[data-bs-theme="dark"] .md-card-notes-body { background: #111827; border-top-color: #30363d; }
[data-bs-theme="dark"] .md-card-subtitle { color: #64748b; }
.md-card-title {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--c-text2);
    margin-bottom: var(--sp-xs);
}
.md-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: var(--fs-base);
    color: var(--c-text4);
    margin-top: var(--sp-xs);
}
.md-card-meta span { display: inline-flex; align-items: center; gap: 3px; }
.md-card-meta i { font-size: var(--fs-xs); }

/* Card footer — poznamky vlevo, akce vpravo */
.md-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-sm);
    padding: var(--sp-sm) var(--sp-base);
    border-top: 1px solid var(--c-border);
    background: var(--c-surface-subtle, #fafbfc);
}
.md-card-footer .md-card-note-btn { margin-right: auto; }
.md-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    align-items: flex-end;
}
/* Moje prace: actions v footeru, horizontalni */
.mp-card-grid .md-card-actions {
    flex-direction: row;
    align-items: center;
}
/* Sirsi btn-action pro Moje prace karty */
.mp-action-wide {
    width: 38px;
    height: 38px;
    font-size: var(--fs-base);
}
/* Poznamky ve footeru */
.mp-note-footer {
    font-size: var(--fs-base);
    padding: 4px 8px;
}

/* Role badge */
.md-role-badge {
    /* sizing: badge-base badge-xs */
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.md-role-badge.worker { background: #f0fdfa; color: #0d9488; }
.md-role-badge.responsible { background: #eff6ff; color: #2563eb; }
.md-role-badge.group { background: #f5f3ff; color: #7c3aed; }
.md-role-badge.available { background: #fffbeb; color: #d97706; }

/* Note button */
.md-card-note-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--fs-xs);
    color: var(--c-text5);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    border: none;
    background: none;
}
.md-card-note-btn:hover { color: #3b82f6; background: #eff6ff; }
.md-card-note-btn.has-notes { color: #3b82f6; font-weight: 600; }

/* Completed info */
.md-completed-info {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--fs-xs);
    color: var(--c-teal-dark);
}

/* Claimed badge */
.md-claimed-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--fs-xs);
    color: var(--status-pending-text);
    font-weight: 500;
}

/* Days color utility classes */
.days-overdue { color: var(--status-danger-text); }
.days-warning { color: var(--status-warning-text); }
.days-soon { color: var(--status-caution-text); }
.days-ok { color: var(--status-ok-text); }
.days-pending { color: var(--status-pending-text); font-size: var(--fs-xs); }

/* MD-CARD dark mode */
[data-bs-theme="dark"] .md-card { background: #161b22; border-color: #30363d; }
[data-bs-theme="dark"] .mp-card-grid .md-card.mp-card-available { background: #161b22; border-color: rgba(14,165,233,0.3); }
[data-bs-theme="dark"] .md-card-item-name { color: #e2e8f0; }
[data-bs-theme="dark"] .mp-card-grid .md-card-item-name { color: #94a3b8; }
[data-bs-theme="dark"] .md-card-watcher-row { color: #94a3b8; }
[data-bs-theme="dark"] .mp-card-grid .md-card-watcher-row { color: #e2e8f0; }
[data-bs-theme="dark"] .md-card-meta { color: #64748b; }
[data-bs-theme="dark"] .md-card-title { color: #cbd5e1; }
[data-bs-theme="dark"] .md-card-footer { background: #111827; border-top-color: #30363d; }
[data-bs-theme="dark"] .md-card-footer-date { color: #64748b; }
[data-bs-theme="dark"] .md-card-footer-date strong { color: #94a3b8; }
[data-bs-theme="dark"] .md-card-note-btn { color: #64748b; }
[data-bs-theme="dark"] .md-card-note-btn:hover { color: var(--c-primary-light); background: rgba(96,165,250,0.1); }
[data-bs-theme="dark"] .md-card-note-btn.has-notes { color: var(--c-primary-light); }

/* MD-CARD responsive */
@media (max-width: 768px) {
    .md-card-header { flex-wrap: wrap; }
    .md-card-actions { width: 100%; flex-direction: row; justify-content: flex-end; }
    .md-card-footer { flex-wrap: wrap; }
}

/* =============================================
   MOJE PRACE — stat pills + filter row
   ============================================= */
.mp-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: var(--sp-md);
}
.mp-filter-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.mp-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.mp-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    color: var(--c-text4);
    border: 1px solid var(--c-border2);
    background: transparent;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.mp-stat-pill:hover {
    background: var(--c-surface3);
    text-decoration: none;
    color: var(--c-text2);
}
.mp-stat-num {
    font-weight: 800;
    font-size: var(--fs-sm);
}
/* Barevne varianty — jen u nenulovych */
.mp-stat-pill.danger { color: #ef4444; border-color: #fecaca; background: #fef2f2; }
.mp-stat-pill.danger:hover { background: #fee2e2; }
.mp-stat-pill.warning { color: #d97706; border-color: #fde68a; background: #fffbeb; }
.mp-stat-pill.warning:hover { background: #fef3c7; }
.mp-stat-pill.info { color: #0ea5e9; border-color: #bae6fd; background: #f0f9ff; }
.mp-stat-pill.info:hover { background: #e0f2fe; }
/* Aktivni stat filtr */
.mp-stat-pill.active {
    font-weight: 600;
    border-width: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.mp-stat-pill.active:not(.danger):not(.warning):not(.info) {
    color: var(--c-text);
    background: var(--c-surface2);
    border-color: var(--c-text3);
}
.mp-stat-pill.active.danger { color: #ef4444; background: #fee2e2; border-color: #f87171; }
.mp-stat-pill.active.warning { color: #d97706; background: #fef3c7; border-color: #f59e0b; }
.mp-stat-pill.active.info { color: #0ea5e9; background: #e0f2fe; border-color: #38bdf8; }

/* Item detail link */
.mp-item-link {
    font-size: var(--fs-xs);
    color: var(--c-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}
.mp-item-link:hover { text-decoration: underline; }

/* Dark mode */
[data-bs-theme="dark"] .mp-stat-pill {
    background: #161b22;
    border-color: #30363d;
    color: var(--c-text4);
}
[data-bs-theme="dark"] .mp-stat-pill:hover { background: #1c2333; }
[data-bs-theme="dark"] .mp-stat-pill.danger { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #f87171; }
[data-bs-theme="dark"] .mp-stat-pill.warning { background: rgba(217,119,6,0.1); border-color: rgba(217,119,6,0.3); color: #fbbf24; }
[data-bs-theme="dark"] .mp-stat-pill.info { background: rgba(14,165,233,0.1); border-color: rgba(14,165,233,0.3); color: #38bdf8; }
[data-bs-theme="dark"] .mp-stat-pill.active:not(.danger):not(.warning):not(.info) {
    color: #e2e8f0;
    background: #1e293b;
    border-color: #475569;
}
[data-bs-theme="dark"] .mp-stat-pill.active.danger { color: #f87171; background: rgba(239,68,68,0.15); border-color: #f87171; }
[data-bs-theme="dark"] .mp-stat-pill.active.warning { color: #fbbf24; background: rgba(217,119,6,0.15); border-color: #fbbf24; }
[data-bs-theme="dark"] .mp-stat-pill.active.info { color: #38bdf8; background: rgba(14,165,233,0.15); border-color: #38bdf8; }
[data-bs-theme="dark"] .mp-item-link { color: var(--c-primary-light); }

@media (max-width: 768px) {
    .mp-filter-row { flex-direction: column; align-items: flex-start; }
    .mp-stats { gap: 4px; }
    .mp-stat-pill { padding: 3px 7px; font-size: var(--fs-xs); }
}

/* -- Section header base (shared by .my-section-header + .watcher-group-header) -- */
.my-section-header,
.watcher-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}
.my-section-header {
    margin: 28px 0 16px;
}
.my-section-header:first-of-type {
    margin-top: 0;
}
.my-section-header h3 {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--c-text);
}
.my-section-header .section-count {
    background: var(--c-surface3);
    color: var(--c-text4);
    font-size: var(--fs-xs);
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-base);
}
.my-section-header.worker { border-color: #14b8a6; }
.my-section-header.worker h3 { color: #0d9488; }
.my-section-header.responsible { border-color: #3b82f6; }
.my-section-header.responsible h3 { color: #1d4ed8; }
.my-deadline-notes {
    padding: 0 16px 12px;
}
.my-deadline-notes .note-item {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    font-size: var(--fs-sm);
    border-bottom: 1px solid #f8fafc;
}
.my-deadline-notes .note-item:last-child {
    border-bottom: none;
}
.my-deadline-notes .note-meta {
    color: var(--c-text5);
    font-size: var(--fs-xs);
    white-space: nowrap;
}
.my-deadline-notes .note-text {
    color: #475569;
    flex: 1;
}
.note-form {
    display: flex;
    gap: 8px;
    padding: 8px 16px 12px;
}
.note-form input {
    flex: 1;
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    font-size: var(--fs-sm);
}
.note-form input:focus {
    outline: none;
    border-color: var(--c-teal);
    box-shadow: 0 0 0 2px rgba(20,184,166,0.15);
}
.my-deadline-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.my-deadline-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-base);
    font-size: var(--fs-sm);
    color: #475569;
}
.my-deadline-stat .stat-num {
    font-weight: 700;
    font-size: var(--fs-lg);
}
.my-deadline-stat .stat-num.text-danger { color: #dc2626; }
.my-deadline-stat .stat-num.text-warning { color: #ca8a04; }
.my-deadline-stat .stat-num.text-success { color: #16a34a; }
a.my-deadline-stat:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}
a.my-deadline-stat { transition: box-shadow 0.15s, transform 0.15s; }
.my-deadline-stat.stat-active {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}
.work-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    border-radius: var(--radius-md);
    font-size: var(--fs-2xs);
    font-weight: 600;
}
.work-mode-badge.task {
    background: #e0f2fe;
    color: #0284c7;
}
.completed-info {
    font-size: var(--fs-xs);
    color: var(--status-done-text);
    display: flex;
    align-items: center;
    gap: 4px;
}
.claimed-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 8px;
    border-radius: var(--radius-md);
    font-size: var(--fs-xs);
    font-weight: 600;
    background: #faf5ff;
    color: var(--status-pending-text);
}
[data-bs-theme="dark"] .claimed-badge {
    background: #2e1065;
    color: #c4b5fd;
}
/* my-deadline-card removed — replaced by .md-card component above */
[data-bs-theme="dark"] .my-deadline-stat {
    background: #1e293b;
    border-color: #334155;
    color: var(--c-text5);
}
[data-bs-theme="dark"] .my-deadline-stat.stat-active {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35);
}
[data-bs-theme="dark"] .note-form input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .my-deadline-notes .note-text { color: #cbd5e1; }
[data-bs-theme="dark"] .my-section-header,
[data-bs-theme="dark"] .watcher-group-header { border-color: #334155; }
[data-bs-theme="dark"] .my-section-header h3 { color: #e2e8f0; }
[data-bs-theme="dark"] .my-section-header.worker h3 { color: #14b8a6; }
[data-bs-theme="dark"] .my-section-header.responsible h3 { color: var(--c-primary-light); }
@media (max-width: 768px) {
    .my-deadline-stats { gap: 8px; }
    .my-deadline-stat { padding: 8px 12px; font-size: var(--fs-sm); }
}

/* =============================================
   STATISTICS PAGE — Chart.js grid
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 18px;
}
.stats-grid .chart-container {
    padding: 12px 18px 18px;
    position: relative;
    height: 280px;
}
@media (max-width: 992px) {
    .stats-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .stats-grid .chart-container { height: 240px; }
}

/* ========== WATCHER GROUP HEADERS (card view) ========== */
.watcher-group {
    margin-bottom: 1.5rem;
}
.watcher-group.hidden {
    display: none;
}
.watcher-group-header {
    /* base flex/gap/border inherited from shared section-header rule above */
    margin-bottom: 0.75rem;
    font-size: var(--fs-md);
}
.watcher-group-name {
    font-weight: 600;
    color: var(--c-text);
    text-decoration: none;
}
.watcher-group-name:hover {
    color: var(--c-primary);
}
.watcher-group-location {
    color: var(--c-text5);
    font-size: var(--fs-sm);
}
/* dark border-color now in shared rule above with .my-section-header */
[data-bs-theme="dark"] .watcher-group-name {
    color: #e2e8f0;
}

/* ========== WORKER ADD BUTTON (detail card) ========== */
.wi-add-btn.btn-action {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: 11px;
}

/* ========== WORKER GROUPS (detail card) ========== */
.wi-group-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}
.wi-group-toggle {
    cursor: pointer;
    user-select: none;
}
/* chevron rotace v wi-group-toggle — viz .wi-chevron vyse */
.wi-group-members {
    padding: 4px 0 6px 18px;
    border-left: 2px solid #e2e8f0;
    margin-left: 8px;
    margin-bottom: 4px;
}
.wi-group-member {
    font-size: var(--fs-sm);
    color: #475569;
    padding: 1px 0;
}
.wi-group-member .fa-user {
    font-size: var(--fs-2xs);
    margin-right: 4px;
    color: var(--c-text5);
}
[data-bs-theme="dark"] .wi-group-members {
    border-color: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] .wi-group-member {
    color: var(--c-text5);
}
[data-bs-theme="dark"] .wi-alert-bar {
    background: rgba(217,119,6,0.15);
    color: #fbbf24;
    border-bottom-color: rgba(217,119,6,0.3);
}
[data-bs-theme="dark"] .wi-section {
    border-bottom-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .wi-section-title {
    color: var(--c-text5);
}
[data-bs-theme="dark"] .wi-description-text {
    color: var(--c-text4);
}

/* ========== WORKER PICKER MODAL ========== */
.worker-picker-table {
    font-size: var(--fs-sm);
}
.worker-picker-table thead th {
    position: sticky;
    top: 0;
    background: var(--c-surface2);
    z-index: 2;
    border-bottom: 2px solid #e2e8f0;
    padding: 6px 10px;
    font-weight: 600;
    font-size: var(--fs-sm);
    color: #475569;
}
.worker-picker-table td {
    padding: 6px 10px;
    vertical-align: middle;
}
.worker-picker-table tr.already-assigned {
    opacity: 0.5;
    background: var(--c-surface3);
}
.worker-picker-table tr.already-assigned td {
    text-decoration: line-through;
    color: var(--c-text5);
}
.worker-picker-table tr.already-assigned td:first-child {
    text-decoration: none;
}
.worker-picker-search {
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-md);
    padding: 6px 12px 6px 34px;
    font-size: var(--fs-sm);
    width: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.442.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 10px center;
}
.worker-picker-search:focus {
    outline: none;
    border-color: var(--c-teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
[data-bs-theme="dark"] .worker-picker-table thead th {
    background: #1e293b;
    border-color: rgba(255,255,255,0.1);
    color: var(--c-text5);
}
[data-bs-theme="dark"] .worker-picker-table tr.already-assigned {
    background: rgba(255,255,255,0.03) !important;
}
[data-bs-theme="dark"] .worker-picker-search {
    background-color: var(--c-input-bg);
    border-color: var(--c-input-border);
    color: var(--c-text);
}

/* =============================================
   MANAGER GROUP — detail header + filter buttons
   ============================================= */
.mgr-detail-header {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-base);
    padding: 16px 20px;
    margin-bottom: 16px;
}
.mgr-detail-header h2 {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin: 0;
    color: var(--c-text);
}
.mgr-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
    font-size: var(--fs-sm);
    color: var(--c-text4);
}
.mgr-detail-desc {
    margin: 8px 0 0;
    font-size: var(--fs-base);
    color: var(--c-text4);
}
.mgr-members {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.mgr-chip {
    display: inline-block;
    background: var(--c-surface3);
    color: var(--c-text3);
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: var(--fs-sm);
    font-weight: 500;
}
[data-bs-theme="dark"] .mgr-detail-header {
    background: var(--c-surface);
    border-color: var(--c-border);
}

.manager-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
}
.manager-filter-btn {
    font-size: var(--fs-sm);
    border-radius: var(--radius-xs);
    padding: 3px 12px;
}
.manager-filter-btn.active {
    background-color: #334155;
    border-color: #334155;
    color: #fff;
}
.manager-filter-btn.active:hover {
    background-color: #1e293b;
    border-color: #1e293b;
    color: #fff;
}
[data-bs-theme="dark"] .manager-filter-btn.active {
    background-color: #475569;
    border-color: #475569;
}

/* ── Item Type visual pickers ── */
.color-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.color-picker-grouped {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.color-group {
    display: flex;
    align-items: center;
    gap: 5px;
}
.color-group-label {
    font-size: var(--fs-2xs);
    color: var(--c-text5);
    width: 64px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 4px;
}
.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}
.color-swatch:hover {
    transform: scale(1.15);
}
.color-swatch.active {
    border-color: #1e293b;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #1e293b;
}

.icon-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.icon-swatch {
    width: 56px;
    padding: 8px 4px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 1.1rem;
    color: #475569;
    transition: border-color 0.15s, background 0.15s;
}
.icon-swatch span {
    font-size: var(--fs-2xs);
    color: var(--c-text5);
    line-height: 1;
    text-align: center;
}
.icon-swatch:hover {
    border-color: #93c5fd;
    background: var(--c-primary-bg, #eff6ff);
}
.icon-swatch.active {
    border-color: var(--c-primary);
    background: var(--c-primary-bg, #eff6ff);
    color: var(--c-primary);
}

[data-bs-theme="dark"] .color-swatch.active {
    border-color: var(--c-border2);
    box-shadow: 0 0 0 2px #1e293b, 0 0 0 4px #e2e8f0;
}
[data-bs-theme="dark"] .icon-swatch {
    border-color: #475569;
    background: #1e293b;
    color: var(--c-text5);
}
[data-bs-theme="dark"] .icon-swatch span {
    color: var(--c-text4);
}
[data-bs-theme="dark"] .icon-swatch:hover {
    border-color: var(--c-primary-light);
    background: #1e3a5f;
}
[data-bs-theme="dark"] .icon-swatch.active {
    border-color: var(--c-primary);
    background: #1e3a5f;
    color: var(--c-primary-light);
}

/* ========== APP SETTINGS — rezim systemu ========== */
.app-mode-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.app-mode-option {
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    transition: all 0.15s;
}
.app-mode-option:hover {
    border-color: var(--c-primary);
}
.app-mode-active {
    border-color: var(--status-ok-text);
    background: var(--status-ok-bg);
}
.app-mode-option-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: var(--fs-sm);
}
.app-mode-option-desc {
    margin: 4px 0 0 26px;
    font-size: var(--fs-xs);
    color: var(--c-text4);
}
.app-mode-summary {
    background: var(--c-surface2);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: var(--fs-sm);
    margin-bottom: 12px;
}
.app-mode-summary-title {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--c-text4);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}
.app-mode-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}
.app-mode-impact {
    border-top: 2px solid var(--status-warning-border);
    padding-top: 14px;
    margin-top: 4px;
}
.app-mode-impact-title {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--status-warning-text);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}
.app-mode-impact-text {
    font-size: var(--fs-sm);
    color: var(--c-text3);
    margin-bottom: 10px;
}
.app-mode-impact {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.app-mode-impact-title,
.app-mode-impact-text {
    align-self: stretch;
}
[data-bs-theme="dark"] .app-mode-option { border-color: rgba(255,255,255,0.1); }
[data-bs-theme="dark"] .app-mode-active { background: rgba(22,163,74,0.1); border-color: rgba(22,163,74,0.3); }
[data-bs-theme="dark"] .app-mode-impact { border-top-color: rgba(217,119,6,0.4); }
[data-bs-theme="dark"] .app-mode-impact-title { color: #fbbf24; }
[data-bs-theme="dark"] .app-mode-impact-text { color: var(--c-text4); }

/* ========== MESSENGER KANALY ========== */
.messenger-channel {
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    overflow: hidden;
}
.messenger-channel:last-child { margin-bottom: 0; }
.messenger-channel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    font-size: var(--fs-sm);
}
.messenger-channel-body {
    padding: 10px 14px;
    border-top: 1px solid var(--c-surface3);
    background: var(--c-surface2);
}
.messenger-channel-disabled {
    opacity: 0.55;
}
.messenger-bot-info {
    font-size: var(--fs-xs);
    color: var(--status-ok-text);
    background: var(--status-ok-bg);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    margin-bottom: 8px;
}
.messenger-test {
    padding: 10px 14px;
    border-top: 1px solid var(--c-surface3);
    background: var(--c-surface);
}
.messenger-test-title {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--c-text4);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}
[data-bs-theme="dark"] .messenger-channel { border-color: rgba(255,255,255,0.1); }
[data-bs-theme="dark"] .messenger-channel-body { background: rgba(255,255,255,0.03); }
[data-bs-theme="dark"] .messenger-bot-info { background: rgba(22,163,74,0.1); color: #4ade80; }

/* Messenger setup kroky */
.messenger-step {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.messenger-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--c-primary);
    color: white;
    font-size: var(--fs-2xs);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.messenger-step-done {
    background: var(--status-ok-text);
}
.messenger-step-content {
    flex: 1;
    min-width: 0;
}
.messenger-step-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    margin-bottom: 4px;
}
[data-bs-theme="dark"] .messenger-step-num { opacity: 0.9; }

/* ========== PROFIL — dvousloupcovy grid ========== */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}
@media (max-width: 991px) {
    .profile-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════
   Toast notifikace
   ══════════════════════════════════════════════════════════════════════ */

#toastContainer {
    z-index: 1090;
    max-width: 380px;
    pointer-events: none;
}

#toastContainer .toast {
    pointer-events: auto;
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateX(0);
}

#toastContainer .toast.toast-hiding {
    opacity: 0;
    transform: translateX(20px);
}

#toastContainer .toast-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1.4;
}

#toastContainer .toast-icon {
    flex-shrink: 0;
    font-size: var(--fs-base);
}

#toastContainer .toast-message {
    flex: 1;
}

#toastContainer .toast .btn-close {
    flex-shrink: 0;
    opacity: 0.6;
}

#toastContainer .toast .btn-close:hover {
    opacity: 1;
}

/* Toast varianty */
.toast-success {
    background: var(--status-ok-bg);
    color: var(--status-ok-text);
    border-left: 4px solid var(--status-ok-text) !important;
}

.toast-danger {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
    border-left: 4px solid var(--status-danger-text) !important;
}

.toast-warning {
    background: var(--status-caution-bg);
    color: var(--status-warning-text);
    border-left: 4px solid var(--status-warning-text) !important;
}

.toast-info {
    background: var(--c-primary-bg, #eff6ff);
    color: var(--c-primary-hover, #1e40af);
    border-left: 4px solid var(--c-primary-hover, #1e40af) !important;
}

/* Dark mode */
[data-bs-theme="dark"] .toast-success {
    background: var(--c-dm-ok-bg, #064e3b);
    color: var(--c-dm-ok-text, #6ee7b7);
    border-left-color: var(--c-dm-ok-text, #6ee7b7) !important;
}

[data-bs-theme="dark"] .toast-danger {
    background: var(--c-dm-danger-bg, #7f1d1d);
    color: var(--c-dm-danger-text, #fca5a5);
    border-left-color: var(--c-dm-danger-text, #fca5a5) !important;
}

[data-bs-theme="dark"] .toast-warning {
    background: var(--c-dm-warning-bg, #78350f);
    color: var(--c-dm-warning-text, #fbbf24);
    border-left-color: var(--c-dm-warning-text, #fbbf24) !important;
}

[data-bs-theme="dark"] .toast-info {
    background: var(--c-dm-blue-bg, #1e3a5f);
    color: var(--c-dm-blue-text, #93c5fd);
    border-left-color: var(--c-dm-blue-text, #93c5fd) !important;
}

/* ══════════════════════════════════════════════════════════════════════
   Layout V2 — Item + Watcher detail (panely nahoře, tabulka full-width)
   ══════════════════════════════════════════════════════════════════════ */

/* Společné */
.detail-layout-v2 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-top-panels {
    display: grid;
    gap: 1rem;
    align-items: stretch;
}

.detail-top-panel {
    background: var(--c-surface);
    border: 1px solid var(--c-border2);
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.detail-top-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 8px;
    border-bottom: 1px solid var(--c-surface3);
}

.detail-top-panel-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: var(--fs-xs);
}

.detail-top-panel-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.detail-top-panel-body {
    padding: 8px 16px 12px;
}

/* Item detail — 2 panely: info (užší) + watchers (širší) */
.item-top-panels {
    grid-template-columns: minmax(220px, 280px) 1fr;
}

/* Watcher detail — 3 panely */
.watcher-top-panels {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Watcher karty — horizontální scroll */
.watcher-cards-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.75rem;
    padding: 12px 16px;
}

.watcher-cards-scroll .watcher-card-b {
    cursor: pointer;
    transition: border-color 0.2s;
}

.watcher-cards-scroll .watcher-card-b.active-filter {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 2px var(--c-primary-bg, #eff6ff);
}

/* Panel s tečkou top border */
.detail-top-panel.panel-accent { border-top: 4px solid var(--accent, #3b82f6); }
.detail-top-panel.panel-neutral { border-top: 4px solid var(--c-border2); }

/* Info řádky v panelu (kompaktní) */
.panel-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: var(--fs-sm);
    border-bottom: 1px solid var(--c-surface3);
}

.panel-info-row:last-child { border-bottom: none; }

.panel-info-label {
    color: var(--c-text4);
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-info-label i { width: 14px; text-align: center; font-size: var(--fs-xs); }

.panel-info-value {
    font-weight: 600;
    color: var(--c-text);
    text-align: right;
}

/* Další termín box v panelu */
.panel-next-deadline {
    text-align: center;
    padding: 16px 12px;
}

.panel-next-deadline .days-big {
    font-size: var(--fs-xl);
    font-weight: 800;
    line-height: 1.2;
}

.panel-next-deadline .days-big.days-danger { color: var(--status-danger-text); }
.panel-next-deadline .days-big.days-warning { color: var(--status-warning-text); }
.panel-next-deadline .days-big.days-ok { color: var(--status-ok-text); }
.panel-next-deadline .days-big.days-safe { color: var(--c-teal-dark); }

.panel-next-deadline .days-label {
    font-size: var(--fs-xs);
    color: var(--c-text4);
    margin-top: 2px;
}

.panel-next-deadline .days-date {
    font-size: var(--fs-sm);
    color: var(--c-text3);
    margin-top: 4px;
}

/* Nadpis sekce v panelu — jednotný styl */
.panel-section-title {
    text-align: center;
    margin-bottom: 6px;
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--c-text4);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Tým kompaktní v panelu */
.panel-team-list {
    font-size: var(--fs-sm);
}

.panel-team-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.panel-team-item i { width: 14px; text-align: center; color: var(--c-text5); font-size: var(--fs-xs); }

/* Team section — collapsible in panel */
.panel-team-section {
    margin-top: 8px;
    border-top: 1px solid var(--c-surface3);
    padding-top: 6px;
}

.panel-team-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-text3);
    cursor: pointer;
    padding: 2px 0;
}

.panel-team-toggle:hover { color: var(--c-text); }

.panel-team-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 6px;
}

.panel-team-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.panel-team-list-title {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    color: var(--c-text4);
    letter-spacing: 0.3px;
}

.panel-team-hint {
    font-size: 0.68rem;
    color: var(--c-text5);
    margin-top: 4px;
}

.panel-team-empty {
    color: var(--c-text5);
    font-size: var(--fs-sm);
    padding: 4px 0;
}

/* Alert rules kompaktní */
.panel-alert-compact {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: var(--fs-xs);
}

.panel-alert-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--c-surface2);
    border-radius: var(--radius-sm);
    color: var(--c-text3);
}

/* Responsive */
@media (max-width: 1200px) {
    .watcher-top-panels { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
    .item-top-panels { grid-template-columns: 1fr; }
    .watcher-top-panels { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .detail-top-panel-header {
        padding: 8px 12px 6px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .detail-top-panel-body { padding: 6px 12px 10px; }
    .panel-info-row {
        padding: 2px 0;
        font-size: var(--fs-xs);
    }
    .watcher-cards-scroll {
        padding: 10px 12px;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    .panel-next-deadline { padding: 12px 8px; }
    .panel-next-deadline .days-big { font-size: var(--fs-lg); }
}

/* ============================================================
   Šablony hlídačů — admin správa
   ============================================================ */

/* Seznam šablon — karty */
.wt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}
.wt-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.wt-card-archived { opacity: 0.6; }
.wt-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-border);
}
.wt-card-icon { font-size: var(--fs-lg); flex-shrink: 0; }
.wt-card-title-wrap { flex: 1; min-width: 0; }
.wt-card-title { font-weight: 600; font-size: var(--fs-sm); color: var(--c-text); }
.wt-card-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.wt-card-meta .badge { font-size: var(--fs-2xs); }
.wt-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.wt-card-items { padding: 8px 16px; }
.wt-card-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: var(--fs-sm);
}
.wt-card-item-name { color: var(--c-text2); }
.wt-card-item-period { color: var(--c-text5); font-size: var(--fs-xs); }
.wt-card-empty { padding: 12px 16px; color: var(--c-text5); font-size: var(--fs-sm); }
.wt-card-desc {
    padding: 8px 16px;
    border-top: 1px solid var(--c-border);
    font-size: var(--fs-xs);
    color: var(--c-text4);
}

/* Editace šablony — dvousloupcový grid */
.wt-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 992px) {
    .wt-edit-grid { grid-template-columns: 1fr; }
}
.card-header-simple {
    padding: 12px 16px;
    font-weight: 600;
    font-size: var(--fs-sm);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Přidání hlídače do šablony — inline form */
.wt-add-item-form { margin: 0; }
.wt-add-item-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.wt-add-item-period { max-width: 80px; }
.wt-add-item-unit { max-width: 100px; }
/* Editovatelné řádky hlídačů v šabloně */
.wt-items-list { padding: 8px 16px; }
.wt-item-edit-row {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid var(--c-border);
}
.wt-item-edit-row:last-child { border-bottom: none; }
.wt-item-edit-row input[type="text"] { flex: 1; min-width: 0; }

@media (max-width: 768px) {
    .wt-add-item-row, .wt-item-edit-row { flex-wrap: wrap; }
    .wt-add-item-period, .wt-add-item-unit { max-width: none; flex: 1; }
}

@media (max-width: 576px) {
    .detail-top-panel-header {
        padding: 6px 10px 4px;
        flex-direction: column;
        align-items: flex-start;
    }
    .detail-top-panel-body { padding: 6px 10px 8px; }
    .watcher-cards-scroll {
        padding: 8px 10px;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .panel-section-title {
        font-size: var(--fs-2xs);
        letter-spacing: 0;
    }
}

/* Šablony hlídačů v add item formuláři */
.template-category { margin-bottom: 8px; }
.template-category-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-xs);
    color: var(--c-text3);
    padding: 4px 0;
    border-bottom: 1px solid var(--c-surface3);
    margin-bottom: 4px;
}
.template-category-header strong { font-weight: 600; }
.template-watcher-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0 3px 16px;
    font-size: var(--fs-sm);
    cursor: pointer;
}
.template-watcher-item:hover { background: var(--c-surface2); border-radius: var(--radius-sm); }
.template-watcher-item .form-check-input { width: 14px; height: 14px; margin: 0; }
.template-watcher-name { flex: 1; color: var(--c-text); }
.template-watcher-period { font-size: var(--fs-xs); color: var(--c-text5); white-space: nowrap; }
.template-filter-msg {
    padding: 6px 12px;
    font-size: var(--fs-xs);
    color: var(--c-text4);
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 4px;
}
.template-filter-msg i { margin-right: 4px; }

/* Globální alert bar — nahoře na každé stránce */
.global-alert-bar {
    display: flex;
    gap: 8px;
    padding: 4px 16px;
    background: var(--c-surface2);
    border-bottom: 1px solid var(--c-border2);
    font-size: var(--fs-xs);
}
.global-alert-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s;
}
.global-alert-chip.danger {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}
.global-alert-chip.danger:hover {
    background: #fecaca;
}
.global-alert-chip.warning {
    background: var(--status-caution-bg);
    color: var(--status-warning-text);
}
.global-alert-chip.warning:hover {
    background: #fef08a;
}
.global-alert-chip.muted {
    background: var(--c-surface2);
    color: var(--c-text4);
}
.global-alert-chip.muted:hover {
    background: var(--c-surface3);
}
/* Push notifikace — zvoneček v alert baru */
.push-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--c-text5);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: all 0.15s;
    margin-left: auto;
    padding: 0;
}
.push-toggle-btn:hover {
    background: var(--c-surface2);
    color: var(--c-text3);
}
.push-toggle-btn.subscribed {
    color: #8b5cf6;
}
.push-toggle-btn.subscribed:hover {
    background: rgba(139,92,246,0.1);
}
[data-bs-theme="dark"] .push-toggle-btn:hover {
    background: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .push-toggle-btn.subscribed {
    color: #a78bfa;
}
[data-bs-theme="dark"] .global-alert-bar {
    background: var(--c-surface);
    border-bottom-color: var(--c-border);
}
[data-bs-theme="dark"] .global-alert-chip.danger {
    background: var(--c-dm-danger-bg, #7f1d1d);
    color: var(--c-dm-danger-text, #fca5a5);
}
[data-bs-theme="dark"] .global-alert-chip.warning {
    background: var(--c-dm-warning-bg, #78350f);
    color: var(--c-dm-warning-text, #fbbf24);
}
[data-bs-theme="dark"] .global-alert-chip.muted {
    background: rgba(255,255,255,0.05);
    color: var(--c-text4);
}

/* Dark mode */
[data-bs-theme="dark"] .detail-top-panel {
    background: var(--c-surface);
    border-color: var(--c-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
[data-bs-theme="dark"] .detail-top-panel-header {
    border-bottom-color: var(--c-border);
}
[data-bs-theme="dark"] .panel-info-row {
    border-bottom-color: var(--c-border);
}
[data-bs-theme="dark"] .panel-info-label {
    color: var(--c-dm-text, #94a3b8);
}
[data-bs-theme="dark"] .panel-info-value {
    color: #e2e8f0;
}
[data-bs-theme="dark"] .panel-section-title {
    color: var(--c-dm-text, #94a3b8);
}
[data-bs-theme="dark"] .panel-alert-pill {
    background: var(--c-surface3);
}
[data-bs-theme="dark"] .panel-next-deadline .days-big.days-danger { color: var(--c-dm-danger-text, #fca5a5); }
[data-bs-theme="dark"] .panel-next-deadline .days-big.days-warning { color: var(--c-dm-warning-text, #fbbf24); }
[data-bs-theme="dark"] .panel-next-deadline .days-big.days-ok { color: var(--c-dm-ok-text, #6ee7b7); }
[data-bs-theme="dark"] .panel-next-deadline .days-big.days-safe { color: var(--c-dm-ok-text, #6ee7b7); }
[data-bs-theme="dark"] .panel-next-deadline .days-date { color: var(--c-dm-text, #94a3b8); }
[data-bs-theme="dark"] .panel-next-deadline .days-label { color: var(--c-dm-text, #94a3b8); }

/* News V2 dark mode */
[data-bs-theme="dark"] .news-item-v2 { border-bottom-color: var(--c-border); }
[data-bs-theme="dark"] .news-icon-v2 { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
[data-bs-theme="dark"] .news-unread .news-icon-v2 { background: var(--c-primary); color: #fff; }
[data-bs-theme="dark"] .news-title-v2 { color: #e2e8f0; }
[data-bs-theme="dark"] .news-unread .news-title-v2 { color: #93c5fd; }
[data-bs-theme="dark"] .news-desc-v2 { color: var(--c-dm-text, #94a3b8); }
[data-bs-theme="dark"] .news-num { color: var(--c-dm-text, #64748b); }

/* Watcher cards scroll dark mode */
[data-bs-theme="dark"] .watcher-cards-scroll .watcher-card-b.active-filter {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Status dot only dark mode */
[data-bs-theme="dark"] .status-dot-only { opacity: 0.9; }

/* ============================================================
   PRIORITY BADGE — inline editable number in deadline tables
   ============================================================ */
.priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: 700;
    cursor: pointer;
    transition: box-shadow 0.15s;
    line-height: 1;
}
.priority-badge:hover {
    box-shadow: 0 0 0 2px var(--c-border2);
}
.priority-1 {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
    border: 1px solid var(--status-danger-border, rgba(220,38,38,0.2));
}
.priority-2 {
    background: var(--status-caution-bg, #fff7ed);
    color: var(--status-warning-text, #c2410c);
    border: 1px solid var(--status-caution-border, rgba(234,179,8,0.2));
}
.priority-3 {
    background: var(--c-surface3);
    color: var(--c-text4);
    border: 1px solid var(--c-border);
}
.priority-default {
    background: var(--c-surface3);
    color: var(--c-text4);
    border: 1px solid var(--c-border);
}
.priority-badge-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--c-border2);
    color: var(--c-text5);
    font-size: var(--fs-2xs);
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s;
}
.priority-badge-empty:hover {
    opacity: 1;
}
.priority-inline-input {
    width: 42px;
    height: 22px;
    text-align: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    border: 2px solid var(--c-teal);
    border-radius: var(--radius-sm);
    outline: none;
    padding: 0;
}
[data-bs-theme="dark"] .priority-1 {
    background: rgba(220,38,38,0.15);
    color: #fca5a5;
    border-color: rgba(220,38,38,0.3);
}
[data-bs-theme="dark"] .priority-2 {
    background: rgba(234,179,8,0.15);
    color: #fde68a;
    border-color: rgba(234,179,8,0.3);
}

