/* ==========================================================================
   Link4Links - Modern Light Theme & Light Blue Cards (cards.css)
   ========================================================================== */

/* Light Theme Base & Web Background */
html, body {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #0f172a !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

#siteBg {
    background: #ffffff !important;
    min-height: 100vh;
    padding-bottom: 30px;
}

#site {
    max-width: 1280px !important;
    width: 96% !important;
    margin: 0 auto !important;
    padding: 0 12px !important;
    text-align: left !important;
    box-sizing: border-box !important;
    background: transparent !important;
}

#mainWide, #mainContent, #content, .border, .pa, #contentRow {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    box-sizing: border-box !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Remove old legacy sections */
#sidebar, #menuzone, ul.menu, #illustration, .moto, .motob, .moto2, .moto3, .motoyel, #logo {
    display: none !important;
}

/* ==========================================================================
   Compact Modern Header (Light Theme)
   ========================================================================== */
.compact-header {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 8px 16px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    margin-top: 10px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.header-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    color: #0284c7 !important;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    transition: opacity 0.15s ease;
}

.header-logo:hover {
    opacity: 0.85;
}

.logo-mark {
    font-size: 20px;
}

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

.nav-tab {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #475569 !important;
    text-decoration: none !important;
    border-radius: 6px;
    background: transparent;
    transition: all 0.2s ease;
}

.nav-tab:hover {
    color: #0f172a !important;
    background: #e2e8f0;
}

.nav-tab.active {
    color: #ffffff !important;
    background: #2563eb !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.header-lang {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.header-lang a {
    display: inline-block;
    line-height: 1;
}

.header-lang img {
    border: none !important;
    border-radius: 3px;
    transition: transform 0.15s ease;
    vertical-align: middle;
}

.header-lang img:hover {
    transform: scale(1.15);
}

.header-auth {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #0369a1;
    background: #e0f2fe;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #7dd3fc;
    font-weight: 700;
}

.user-badge .user-icon {
    font-size: 14px;
}

.user-badge .user-name {
    color: #0c4a6e;
    font-weight: 800;
}

.btn-logout {
    font-size: 12px;
    font-weight: 600;
    color: #dc2626 !important;
    text-decoration: none !important;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(220, 38, 38, 0.25);
    background: #fee2e2;
    transition: background 0.15s ease;
}

.btn-logout:hover {
    background: #fecaca;
}

.header-login-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
}

.header-login-form input[type="text"],
.header-login-form input[type="password"] {
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 5px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
}

.header-login-form input[type="text"]:focus,
.header-login-form input[type="password"]:focus {
    border-color: #2563eb;
}

.btn-login-submit {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-login-submit:hover {
    background: #1d4ed8;
}

.btn-reg-link {
    font-size: 12px;
    color: #0284c7 !important;
    text-decoration: none !important;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 5px;
    background: #e0f2fe;
}

.btn-reg-link:hover {
    background: #bae6fd;
}

/* ==========================================================================
   Add Link Form (Collapsible)
   ========================================================================== */
.link-form-toggle-wrap {
    margin-bottom: 12px;
}

.btn-toggle-link-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 700;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.btn-toggle-link-form:hover {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #172554;
}

.btn-toggle-link-form.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}

.link-form-container {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    margin-bottom: 18px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.link-form-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.link-form-header-row h3 {
    margin: 0 !important;
}

.link-type-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e2e8f0;
    padding: 3px;
    border-radius: 6px;
}

.btn-type-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-type-tab:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.btn-type-tab.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.link-form-container h3 {
    margin: 0 0 10px 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

.link-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.link-form-grid input[type="text"],
.link-form-grid select {
    padding: 7px 10px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.link-form-grid input[type="text"]:focus,
.link-form-grid select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.form-field-label { flex: 1 1 120px; min-width: 110px; }

.wrap-input-url {
    flex: 3 1 240px;
    min-width: 200px;
}

.wrap-input-url input {
    width: 100%;
}

.wrap-input-file {
    flex: 3 1 240px;
    min-width: 200px;
    position: relative;
}

.file-dropzone {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #ffffff;
    border: 2px dashed #93c5fd;
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s ease;
    user-select: none;
    min-height: 35px;
}

.file-dropzone:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

.file-drop-icon {
    font-size: 16px;
    line-height: 1;
}

.file-drop-btn {
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
}

.file-drop-hint {
    font-size: 11px;
    color: #64748b;
    margin-left: auto;
}

.file-upload-status-msg {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    box-sizing: border-box;
}

.file-upload-status-msg.is-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.file-upload-status-msg.is-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.file-upload-progress-box {
    margin-top: 6px;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 6px 10px;
    box-sizing: border-box;
}

.file-upload-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #1e293b;
}

.file-name-text {
    max-width: 75%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-percent-text {
    color: #2563eb;
}

.file-progress-track {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.file-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #0ea5e9);
    border-radius: 4px;
    transition: width 0.15s ease;
}

.form-field-url { flex: 3 1 240px; min-width: 200px; }
.form-field-desc { flex: 2 1 180px; min-width: 150px; }
.form-field-group-new { flex: 1 1 130px; min-width: 120px; }
.form-field-group-select { flex: 1 1 140px; min-width: 130px; }

.btn-save-link {
    background: #10b981 !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 7px 18px !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.btn-save-link:hover {
    background: #059669 !important;
}

.link-form-container.is-editing {
    border: 2px solid #2563eb !important;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.2) !important;
    background: #eff6ff !important;
}

.link-form-container.is-editing h3 {
    color: #1e40af !important;
}

.btn-cancel-edit {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    background: #64748b;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.btn-cancel-edit:hover {
    background: #475569;
}

.link-form-guest {
    border-left: 4px solid #0284c7 !important;
}

.guest-hint {
    font-size: 13px;
    color: #475569;
    margin: 4px 0 0 0;
    line-height: 1.4;
}

.guest-hint a {
    color: #0284c7 !important;
    font-weight: 600;
    text-decoration: underline !important;
}

/* ==========================================================================
   Toolbar for Sorting, Filtering and Thumbnails Toggle
   ========================================================================== */
.links-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 14px;
}

.toolbar-section, .toolbar-left-actions, .toolbar-sort {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    border-right: 1px solid #cbd5e1;
    padding-right: 12px;
}

.toolbar-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-right: 4px;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: #ffffff;
    color: #334155 !important;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1.3;
}

.toolbar-btn:hover {
    background: #e2e8f0;
    color: #0f172a !important;
    border-color: #94a3b8;
}

.toolbar-btn.active {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.toolbar-btn-modal {
    background: #eff6ff;
    color: #1e40af !important;
    border-color: #93c5fd;
}

.toolbar-btn-modal:hover {
    background: #dbeafe;
    border-color: #60a5fa;
}

/* ==========================================================================
   Active Filter Banner (Filtrováno za skupinu)
   ========================================================================== */
.active-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #1e3a8a;
}

.active-filter-text strong {
    color: #172554;
}

.btn-clear-filter {
    font-size: 12px;
    font-weight: 700;
    color: #dc2626 !important;
    background: #ffffff;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid #fca5a5;
    text-decoration: none !important;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-clear-filter:hover {
    background: #fee2e2;
}

/* ==========================================================================
   Modal Popup for Group Selection (Zobrazit za skupinu)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.modal-box {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border: 1px solid #cbd5e1;
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.15s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.modal-close:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.modal-body {
    padding: 12px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-item-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1 1 auto;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.modal-item:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1 !important;
}

.modal-item.active {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.modal-item.active .modal-item-count {
    color: #bfdbfe;
}

.modal-item-count {
    font-size: 11px;
    color: #64748b;
    font-weight: normal;
}

.modal-item-del {
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    text-decoration: none !important;
    cursor: pointer;
    line-height: 1;
}

.modal-item-del:hover {
    background: #fecaca;
}

/* ==========================================================================
   Compact Grid & Light Blue Cards
   ========================================================================== */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* The Link Card - Light blue background (#eaf4ff) */
.link-card {
    background: #eaf4ff !important;
    color: #0f172a !important;
    border-radius: 8px;
    border: 1px solid #bfdbfe !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 10px;
    box-sizing: border-box;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
    border-color: #60a5fa !important;
}

/* 1. SEKCE: POPISY (Stmavena jemně o jeden stupeň, tvoří rozbalovací záhlaví karty) */
.card-sec-popisy {
    background: #d8eaff !important;
    border-bottom: 1px solid #93c5fd !important;
    margin: -10px -10px 0 -10px;
    padding: 8px 10px 7px 10px;
    border-radius: 7px 7px 0 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.card-sec-popisy:hover {
    background: #c7e0ff !important;
}

.card-desc-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}

.card-toggle-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #2563eb;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.08);
    flex-shrink: 0;
    margin-top: 1px;
    transition: transform 0.22s ease, background 0.15s ease, color 0.15s ease;
}

.card-sec-popisy:hover .card-toggle-arrow {
    background: rgba(37, 99, 235, 0.16);
}

.link-card.is-expanded .card-toggle-arrow {
    transform: rotate(180deg);
    background: rgba(37, 99, 235, 0.22);
    color: #1d4ed8;
}

.card-desc-main {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    flex: 1;
}

.badge-file-type {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    margin-right: 4px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

/* Druhý popis: Tmavě modrý */
.card-desc-second {
    font-size: 12px;
    color: #1e3a8a !important;
    font-weight: 700 !important;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* 2. SEKCE: DATUMY (Normální písmo) */
.card-sec-datumy {
    background: #d8eaff !important;
    border-bottom: 1px solid #93c5fd !important;
    margin: 0 -10px 8px -10px;
    padding: 6px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: #1e293b;
    font-weight: normal !important;
    transition: margin-bottom 0.15s ease, border-bottom 0.15s ease, background 0.15s ease;
}

/* Pokud je karta sbalená, sekce datumů vyplní spodek karty a zaoblí se */
.link-card:not(.is-expanded) .card-sec-datumy {
    border-bottom: none !important;
    margin-bottom: -10px !important;
    border-radius: 0 0 7px 7px !important;
    padding-bottom: 8px !important;
}

/* SPODNÍ 2 SEKCE (Náhled + Skupiny) - výchozím stavem skryté, rozbalí se po kliknutí na nadpis */
.card-sec-collapsible {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}

.link-card.is-expanded .card-sec-collapsible {
    display: flex;
    animation: cardExpandAnim 0.22s ease-out;
}

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

.card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    font-weight: normal !important;
}

.text-dim {
    color: #64748b;
}

/* 3. SEKCE: NÁHLED S URL A AKČNÍ TLAČÍTKA */
.card-sec-nahled-url {
    padding: 5px 0;
    border-bottom: 1px solid #93c5fd !important;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Náhled webu (screenshot) - klikatelný odkaz */
.card-thumb-wrap {
    width: 100%;
    height: 75px;
    border-radius: 5px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    box-sizing: border-box;
    display: block;
    position: relative;
    cursor: pointer;
    text-decoration: none !important;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-thumb-wrap.card-preview-link:hover {
    border-color: #2563eb;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);
    transform: translateY(-1px);
}

.card-mini-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

/* Favicon + doména banner - klikatelný odkaz */
.card-thumb-favicon-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    box-sizing: border-box;
    min-height: 34px;
    cursor: pointer;
    text-decoration: none !important;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.card-thumb-favicon-wrap.card-preview-link:hover {
    background: #eff6ff;
    border-color: #60a5fa;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.card-favicon {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    flex-shrink: 0;
    vertical-align: middle;
}

.card-favicon-domain {
    font-size: 11px;
    font-weight: 600;
    color: #1e3a8a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-link-arrow {
    margin-left: auto;
    font-size: 13px;
    font-weight: 700;
    color: #3b82f6;
    transition: transform 0.15s ease, color 0.15s ease;
}

.card-thumb-favicon-wrap.card-preview-link:hover .card-link-arrow {
    transform: translate(2px, -2px);
    color: #1d4ed8;
}

/* Karta se souborem: Download Box */
.card-file-download-box {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #93c5fd;
    border-radius: 6px;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: all 0.15s ease;
    cursor: pointer;
    min-height: 44px;
}

.card-file-download-box:hover {
    background: #e0f2fe;
    border-color: #3b82f6;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.18);
    transform: translateY(-1px);
}

.card-file-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.card-file-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.card-file-title {
    font-size: 12px;
    font-weight: 700;
    color: #1e3a8a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.card-file-sub {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    margin-top: 1px;
    line-height: 1.2;
}

.card-file-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    background: #2563eb;
    color: #ffffff;
    padding: 5px 9px;
    border-radius: 5px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s ease;
    line-height: 1.2;
}

.card-file-download-box:hover .card-file-dl-btn {
    background: #1d4ed8;
}

/* URL akční tlačítka */
.card-url-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-height: 26px;
}

.card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    padding: 5px 9px;
    transition: all 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.2;
}

/* Offline (modré tlačítko/kolečko) */
.btn-offline {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-radius: 14px;
    padding: 4px 10px;
    box-shadow: 0 2px 5px rgba(2, 132, 199, 0.25);
}

.btn-offline:hover {
    background: #0369a1 !important;
}

/* Admin a akční ikony */
.card-admin-btns {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 5px;
    background: #ffffff;
    color: #0f172a !important;
    text-decoration: none !important;
    font-size: 12px;
    border: 1px solid #bfdbfe;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-icon:hover {
    background: #dbeafe;
    border-color: #60a5fa;
}

.btn-icon.btn-edit:hover {
    background: #dbeafe !important;
    border-color: #3b82f6 !important;
}

.btn-icon.btn-del:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
}

/* Tlačítko uložit (jen ikonka bez popisu) */
.btn-save-icon {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
}

.btn-save-icon:hover {
    background: #dcfce7 !important;
    border-color: #86efac !important;
}

/* 4. SEKCE: ROZDĚLENÍ SKUPIN (Jako poslední dolů v kartě) */
.card-sec-skupiny {
    padding-top: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.badge-group {
    background: #dbeafe;
    color: #1e40af;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #bfdbfe;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
}

.badge-group-link {
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.badge-group-link:hover {
    background: #bfdbfe;
    color: #172554;
    border-color: #93c5fd;
}

.badge-public {
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #bbf7d0;
}

.badge-private {
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* Grid Date & Group Divider */
.grid-date-divider {
    grid-column: 1 / -1;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    border-left: 3px solid #2563eb;
    margin: 6px 0 2px 0;
}

/* ==========================================================================
   Group Accordion (Sbalené sekce dle skupin)
   ========================================================================== */
.accordion-global-ctrls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 7px 12px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
}

.accordion-ctrls-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.btn-accordion-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #ffffff;
    color: #1e40af;
    border: 1px solid #93c5fd;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-accordion-ctrl:hover {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #172554;
}

.groups-accordion-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.group-accordion-item {
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.group-accordion-item:hover {
    border-color: #93c5fd;
}

.group-accordion-item.is-open {
    border-color: #60a5fa;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
}

.group-accordion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #eff6ff;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.group-accordion-header:hover {
    background: #dbeafe;
}

.group-accordion-item.is-open .group-accordion-header {
    background: #dbeafe;
    border-bottom: 1px solid #bfdbfe;
}

.grp-toggle-icon {
    font-size: 14px;
    font-weight: 800;
    color: #2563eb;
    width: 16px;
    text-align: center;
    transition: transform 0.15s ease;
}

.grp-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e3a8a;
    flex: 1 1 auto;
}

.grp-badge-count {
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
}

.group-accordion-body {
    padding: 12px;
    background: #f8fafc;
}

#content h3 {
    color: #0f172a !important;
    font-size: 16px;
    font-weight: 700;
    margin: 10px 0 12px 0;
}

.group-empty {
    font-size: 13px;
    color: #64748b;
    font-style: italic;
    padding: 12px 0;
}

/* Footer (Light Theme) */
#footer {
    background: #f8fafc !important;
    border-top: 1px solid #cbd5e1 !important;
    color: #64748b !important;
    padding: 16px 0 !important;
    font-size: 12px;
    margin-top: 30px;
}

#footerContent {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

/* ==========================================================================
   Modern Registration & Auth Card
   ========================================================================== */
.auth-card {
    max-width: 440px;
    margin: 24px auto 36px auto;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 24px 28px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    text-align: left;
}

.auth-card-header {
    margin-bottom: 16px;
}

.auth-card-title {
    margin: 0 0 6px 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-card-hint {
    margin: 0 !important;
    font-size: 13px !important;
    color: #64748b !important;
    line-height: 1.45;
}

.auth-alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
    box-sizing: border-box;
}

.auth-alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.auth-alert-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.auth-form-group {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: left;
}

.auth-label {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 4px;
}

.req-star {
    color: #dc2626;
    font-weight: 700;
}

.auth-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    font-family: inherit;
}

.auth-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-input.is-invalid {
    border-color: #dc2626 !important;
    background: #fff5f5 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.auth-helper-text {
    font-size: 11px;
    color: #64748b;
    margin-top: 1px;
    line-height: 1.3;
}

.btn-auth-submit {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 6px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    margin-top: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    font-family: inherit;
}

.btn-auth-submit:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-auth-submit:active {
    transform: translateY(0);
}

.auth-card-footer {
    font-size: 12px;
    color: #64748b;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    margin-top: 6px;
}

/* ==========================================================================
   Mobile & Tablet Responsiveness (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
    #site {
        width: 100% !important;
        padding: 0 8px !important;
    }

    .compact-header {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 10px 12px !important;
        gap: 10px !important;
    }

    .header-left, .header-right {
        justify-content: space-between;
        width: 100%;
    }

    .header-auth {
        width: 100%;
        justify-content: flex-end;
    }

    .header-login-form {
        width: 100%;
        justify-content: flex-end;
    }

    .link-form-grid {
        flex-direction: column;
        align-items: stretch;
    }

    .link-form-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .link-type-tabs {
        width: 100%;
        display: flex;
        box-sizing: border-box;
    }

    .btn-type-tab {
        flex: 1;
        justify-content: center;
        text-align: center;
    }

    .wrap-input-url,
    .wrap-input-file,
    .link-form-grid input[type="text"],
    .link-form-grid select,
    .btn-save-link {
        width: 100% !important;
    }

    .links-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .toolbar-left-actions, .toolbar-sort, .toolbar-section, .toolbar-filters {
        overflow-x: auto;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    .toolbar-filters {
        border-right: none;
        border-bottom: 1px solid #cbd5e1;
        padding-bottom: 8px;
        padding-right: 0;
    }

    .links-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .card-thumb-wrap {
        height: 85px;
    }

    .card-btn {
        min-height: 36px;
        font-size: 13px;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .auth-card {
        margin: 14px 4px 24px 4px !important;
        padding: 18px 16px !important;
        max-width: 100% !important;
    }
}

/* ==========================================================================
   Dark Theme (Tmavý režim)
   - Pozadí webu: Černé (#000000)
   - Všechen text: Bílý (#ffffff)
   - Karty: Tmavě modré pozadí (#0f274a) a bílý text (#ffffff)
   - První sekce karty (popisy): Tmavší modrá (#08162b) než další sekce
   ========================================================================== */

/* Toggle buttons styling (Light & Dark mode) */
.btn-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    background: #e2e8f0;
    color: #1e293b !important;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1.3;
    user-select: none;
}

.btn-theme-toggle:hover {
    background: #cbd5e1;
    color: #0f172a !important;
}

.btn-toolbar-theme {
    font-weight: 700;
}

.btn-toolbar-theme.active {
    background: #1e293b !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

/* 1. Pozadí webu: ČERNÉ a všechen text: BÍLÝ */
html.theme-dark,
body.theme-dark {
    background-color: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
}

body.theme-dark #siteBg {
    background-color: #000000 !important;
    background-image: none !important;
}

body.theme-dark #site,
body.theme-dark #mainWide,
body.theme-dark #mainContent,
body.theme-dark #content,
body.theme-dark .border,
body.theme-dark .pa,
body.theme-dark #contentRow {
    background: transparent !important;
    color: #ffffff !important;
}

body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3,
body.theme-dark h4,
body.theme-dark h5,
body.theme-dark h6,
body.theme-dark p,
body.theme-dark span,
body.theme-dark strong,
body.theme-dark b,
body.theme-dark label,
body.theme-dark td,
body.theme-dark th,
body.theme-dark div {
    color: #ffffff;
}

body.theme-dark a {
    color: #60a5fa;
}

body.theme-dark #content h3 {
    color: #ffffff !important;
}

/* Header v tmavém režimu */
body.theme-dark .compact-header {
    background: #080f1a !important;
    border: 1px solid #1e293b !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7) !important;
}

body.theme-dark .header-logo {
    color: #38bdf8 !important;
}

body.theme-dark .logo-text {
    color: #ffffff !important;
}

body.theme-dark .btn-theme-toggle {
    background: #1e293b !important;
    color: #ffffff !important;
    border-color: #334155 !important;
}

body.theme-dark .btn-theme-toggle:hover {
    background: #334155 !important;
}

body.theme-dark .user-badge {
    background: #0d1e38 !important;
    border: 1px solid #1e3a8a !important;
    color: #ffffff !important;
}

body.theme-dark .user-name {
    color: #ffffff !important;
}

body.theme-dark .btn-logout {
    background: #1e293b !important;
    color: #ffffff !important;
    border: 1px solid #334155 !important;
}

body.theme-dark .btn-logout:hover {
    background: #334155 !important;
}

body.theme-dark .header-login-form input[type="text"],
body.theme-dark .header-login-form input[type="password"] {
    background: #0b172a !important;
    border: 1px solid #1e3a8a !important;
    color: #ffffff !important;
}

body.theme-dark .header-login-form input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
}

body.theme-dark .btn-login-submit {
    background: #2563eb !important;
    color: #ffffff !important;
}

body.theme-dark .btn-login-submit:hover {
    background: #1d4ed8 !important;
}

body.theme-dark .btn-reg-link {
    background: transparent !important;
    border: 1px solid #1e3a8a !important;
    color: #60a5fa !important;
}

body.theme-dark .btn-reg-link:hover {
    background: #0d1e38 !important;
}

/* Toolbar v tmavém režimu */
body.theme-dark .links-toolbar {
    background: #080f1a !important;
    border: 1px solid #1e293b !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5) !important;
}

body.theme-dark .toolbar-filters {
    border-right-color: #1e293b !important;
}

body.theme-dark .toolbar-label {
    color: #ffffff !important;
}

body.theme-dark .toolbar-btn {
    background: #0c1a30 !important;
    border: 1px solid #1e3a8a !important;
    color: #ffffff !important;
}

body.theme-dark .toolbar-btn:hover {
    background: #132b4f !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

body.theme-dark .toolbar-btn.active {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4) !important;
}

body.theme-dark .toolbar-btn-modal {
    background: #0c1a30 !important;
    color: #93c5fd !important;
    border-color: #1e3a8a !important;
}

body.theme-dark .toolbar-btn-modal:hover {
    background: #132b4f !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

body.theme-dark .active-filter-bar {
    background: #08162b !important;
    border: 1px solid #1e3a8a !important;
    border-left: 3px solid #2563eb !important;
}

body.theme-dark .active-filter-text {
    color: #ffffff !important;
}

body.theme-dark .btn-clear-filter {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #ffffff !important;
}

body.theme-dark .btn-clear-filter:hover {
    background: #334155 !important;
}

/* Formulář v tmavém režimu */
body.theme-dark .btn-toggle-link-form {
    background: #080f1a !important;
    border: 1px solid #1e3a8a !important;
    color: #ffffff !important;
}

body.theme-dark .btn-toggle-link-form:hover {
    background: #0d1e38 !important;
    border-color: #3b82f6 !important;
}

body.theme-dark .btn-toggle-link-form.active {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

body.theme-dark .link-form-container {
    background: #080f1a !important;
    border: 1px solid #1e3a8a !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
}

body.theme-dark .link-form-container h3 {
    color: #ffffff !important;
}

body.theme-dark .link-type-tabs {
    background: #0d1e38 !important;
    border: 1px solid #1e3a8a !important;
}

body.theme-dark .btn-type-tab {
    color: #cbd5e1 !important;
}

body.theme-dark .btn-type-tab:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

body.theme-dark .btn-type-tab.active {
    background: #2563eb !important;
    color: #ffffff !important;
}

body.theme-dark .link-form-grid input[type="text"],
body.theme-dark .link-form-grid select {
    background: #0c1a30 !important;
    border: 1px solid #1e3a8a !important;
    color: #ffffff !important;
}

body.theme-dark .link-form-grid input[type="text"]:focus,
body.theme-dark .link-form-grid select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
}

body.theme-dark .file-dropzone {
    background: #0c1a30 !important;
    border-color: #2563eb !important;
}

body.theme-dark .file-dropzone:hover {
    background: #112544 !important;
    border-color: #3b82f6 !important;
}

body.theme-dark .file-drop-btn {
    color: #60a5fa !important;
}

body.theme-dark .file-drop-hint {
    color: #cbd5e1 !important;
}

body.theme-dark .file-upload-progress-box {
    background: #08162b !important;
    border-color: #1e3a8a !important;
}

body.theme-dark .file-upload-progress-info {
    color: #ffffff !important;
}

body.theme-dark .file-name-text {
    color: #ffffff !important;
}

body.theme-dark .file-percent-text {
    color: #60a5fa !important;
}

body.theme-dark .file-progress-track {
    background: #1e293b !important;
}

body.theme-dark .link-form-guest {
    border-left: 4px solid #0284c7 !important;
}

body.theme-dark .guest-hint {
    color: #cbd5e1 !important;
}

body.theme-dark .guest-hint a {
    color: #38bdf8 !important;
}

/* 2. KARTY: TMAVĚ MODRÉ POZADÍ A BÍLÝ TEXT */
body.theme-dark .link-card {
    background: #143568 !important;
    border: 1px solid #1e40af !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
}

body.theme-dark .link-card:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35) !important;
    transform: translateY(-2px);
}

/* PRVNÍ DVĚ SEKCE: TROCHU SVĚTLEJŠÍ ALE O NĚCO MÍŇ NEŽ DALŠÍ SEKCE */
/* (odstín #0d2242 jako při kliknutí/hoveru, nyní trvale i bez kliknutí) */
body.theme-dark .card-sec-popisy {
    background: #0d2242 !important;
    border-bottom: 1px solid #1e3a8a !important;
}

body.theme-dark .card-sec-popisy:hover {
    background: #112a52 !important;
}

body.theme-dark .card-desc-main {
    color: #ffffff !important;
}

body.theme-dark .card-desc-second {
    color: #93c5fd !important;
}

body.theme-dark .card-toggle-arrow {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #93c5fd !important;
}

body.theme-dark .link-card.is-expanded .card-toggle-arrow {
    background: rgba(37, 99, 235, 0.45) !important;
    color: #ffffff !important;
}

body.theme-dark .badge-file-type {
    background: #1e3a8a !important;
    color: #dbeafe !important;
    border: 1px solid #3b82f6 !important;
}

/* 2. Sekce karty: Datumy (stejný podklad #0d2242 jako sekce popisů, normální písmo) */
body.theme-dark .card-sec-datumy {
    background: #0d2242 !important;
    border-bottom: 1px solid #1e3a8a !important;
    color: #ffffff !important;
    font-weight: normal !important;
}

body.theme-dark .link-card:not(.is-expanded) .card-sec-datumy {
    border-bottom: none !important;
}

body.theme-dark .card-meta-item {
    color: #ffffff !important;
    font-weight: normal !important;
}

body.theme-dark .card-sec-datumy .text-dim {
    color: #94a3b8 !important;
}

/* 3. Sekce karty: Náhled s URL a stažení souboru (další sekce) */
body.theme-dark .card-sec-nahled-url {
    border-bottom: 1px solid #1e3a8a !important;
}

body.theme-dark .card-thumb-wrap {
    background: #0e2548 !important;
    border: 1px solid #1e3a8a !important;
}

body.theme-dark .card-thumb-wrap.card-preview-link:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

body.theme-dark .card-thumb-favicon-wrap {
    background: #0e2548 !important;
    border: 1px solid #1e3a8a !important;
}

body.theme-dark .card-thumb-favicon-wrap.card-preview-link:hover {
    background: #143360 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25) !important;
}

body.theme-dark .card-favicon-domain {
    color: #ffffff !important;
}

body.theme-dark .card-link-arrow {
    color: #60a5fa !important;
}

body.theme-dark .card-file-download-box {
    background: #0e2548 !important;
    border: 1px solid #1e3a8a !important;
}

body.theme-dark .card-file-download-box:hover {
    background: #143360 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

body.theme-dark .card-file-title {
    color: #ffffff !important;
}

body.theme-dark .card-file-sub {
    color: #cbd5e1 !important;
}

body.theme-dark .card-file-dl-btn {
    background: #2563eb !important;
    color: #ffffff !important;
}

body.theme-dark .card-file-download-box:hover .card-file-dl-btn {
    background: #1d4ed8 !important;
}

body.theme-dark .btn-icon {
    background: #0e2548 !important;
    border: 1px solid #1e3a8a !important;
    color: #ffffff !important;
}

body.theme-dark .btn-icon:hover {
    background: #143360 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

body.theme-dark .btn-save-icon {
    background: #064e3b !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

body.theme-dark .btn-save-icon:hover {
    background: #047857 !important;
}

body.theme-dark .btn-icon.btn-del:hover {
    background: #7f1d1d !important;
    border-color: #ef4444 !important;
}

/* 4. Sekce karty: Skupiny (další sekce) */
body.theme-dark .badge-group {
    background: #0e2548 !important;
    color: #93c5fd !important;
    border: 1px solid #1e3a8a !important;
}

body.theme-dark .badge-group-link:hover {
    background: #1e40af !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
}

body.theme-dark .badge-public {
    background: #064e3b !important;
    color: #a7f3d0 !important;
    border: 1px solid #059669 !important;
}

body.theme-dark .badge-private {
    background: #0e2548 !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
}

body.theme-dark .grid-date-divider {
    background: #08162b !important;
    color: #ffffff !important;
    border-left: 3px solid #2563eb !important;
}

/* Skupiny: Modal popup v tmavém režimu */
body.theme-dark .modal-overlay {
    background: rgba(0, 0, 0, 0.85) !important;
}

body.theme-dark .modal-box {
    background: #080f1a !important;
    border: 1px solid #1e3a8a !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9) !important;
}

body.theme-dark .modal-header {
    background: #060b13 !important;
    border-bottom: 1px solid #1e3a8a !important;
}

body.theme-dark .modal-header h4 {
    color: #ffffff !important;
}

body.theme-dark .modal-close {
    color: #cbd5e1 !important;
}

body.theme-dark .modal-close:hover {
    color: #ffffff !important;
    background: #1e293b !important;
}

body.theme-dark .modal-item {
    background: #0c1a30 !important;
    border: 1px solid #1e3a8a !important;
    color: #ffffff !important;
}

body.theme-dark .modal-item:hover {
    background: #132b4f !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

body.theme-dark .modal-item.active {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

body.theme-dark .modal-item-count {
    color: #94a3b8 !important;
}

/* Skupiny: Akordeon v tmavém režimu */
body.theme-dark .accordion-global-ctrls {
    background: #080f1a !important;
    border: 1px solid #1e3a8a !important;
}

body.theme-dark .accordion-ctrls-label {
    color: #ffffff !important;
}

body.theme-dark .btn-accordion-ctrl {
    background: #0c1a30 !important;
    border: 1px solid #1e3a8a !important;
    color: #ffffff !important;
}

body.theme-dark .btn-accordion-ctrl:hover {
    background: #132b4f !important;
    border-color: #3b82f6 !important;
}

body.theme-dark .group-accordion-item {
    background: #080f1a !important;
    border: 1px solid #1e3a8a !important;
}

body.theme-dark .group-accordion-header {
    background: #08162b !important;
}

body.theme-dark .group-accordion-header:hover {
    background: #0d2242 !important;
}

body.theme-dark .group-accordion-item.is-open .group-accordion-header {
    background: #0d2242 !important;
    border-bottom: 1px solid #1e3a8a !important;
}

body.theme-dark .grp-title {
    color: #ffffff !important;
}

body.theme-dark .grp-toggle-icon {
    color: #60a5fa !important;
}

body.theme-dark .grp-badge-count {
    background: #080f1a !important;
    color: #60a5fa !important;
    border-color: #1e3a8a !important;
}

body.theme-dark .group-accordion-body {
    background: #000000 !important;
}

body.theme-dark .group-empty {
    color: #94a3b8 !important;
}

/* Registrační karta v tmavém režimu */
body.theme-dark .auth-card {
    background: #080f1a !important;
    border: 1px solid #1e3a8a !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7) !important;
}

body.theme-dark .auth-card-title {
    color: #ffffff !important;
}

body.theme-dark .auth-card-hint {
    color: #cbd5e1 !important;
}

body.theme-dark .auth-label {
    color: #ffffff !important;
}

body.theme-dark .auth-input {
    background: #0c1a30 !important;
    border: 1px solid #1e3a8a !important;
    color: #ffffff !important;
}

body.theme-dark .auth-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

body.theme-dark .auth-helper-text {
    color: #94a3b8 !important;
}

body.theme-dark .auth-card-footer {
    color: #94a3b8 !important;
    border-top-color: #1e293b !important;
}

/* Footer v tmavém režimu */
body.theme-dark #footer {
    background: #000000 !important;
    border-top: 1px solid #1e293b !important;
    color: #94a3b8 !important;
}
