/* ============================================================
   IMAP Migration Bridge - Custom Styles
   Base: Bootstrap 5.3 | Font: Inter
   Design: Light/Dark mode with CSS custom properties
   ============================================================ */

/* ============================================================
   CSS Custom Properties (Design Tokens) – Light Mode (default)
   ============================================================ */
:root {
    /* Primary palette – magenta-navy */
    --im-primary: #2c387e;
    --im-primary-light: #3949ab;
    --im-primary-dark: #1a237e;
    --im-primary-bg: #e8eaf6;
    --im-primary-bg-subtle: #f0f1fa;
    --im-gradient: linear-gradient(135deg, #1a237e 0%, #5c6bc0 100%);
    --im-gradient-hero: linear-gradient(135deg, #1a237e 0%, #283593 50%, #5c6bc0 100%);

    /* Semantic colors */
    --im-success: #3949ab;
    --im-success-bg: #e8eaf6;
    --im-danger: #d93025;
    --im-danger-bg: #fce8e6;
    --im-warning: #f9ab00;
    --im-warning-bg: #fef7e0;
    --im-info: #0ea5e9;
    --im-info-bg: #e0f2fe;

    /* Text */
    --im-text: #1a1a2e;
    --im-text-secondary: #4a5568;
    --im-text-muted: #718096;
    --im-text-on-primary: #ffffff;

    /* Surfaces */
    --im-border: #e2e8f0;
    --im-border-light: #edf2f7;
    --im-bg: #f7f8fc;
    --im-bg-card: #ffffff;
    --im-bg-elevated: #ffffff;
    --im-bg-input: #ffffff;
    --im-bg-hover: rgba(44, 56, 126, 0.04);

    /* Navbar */
    --im-navbar-bg: var(--im-gradient-hero);
    --im-navbar-shadow: 0 4px 20px rgba(44, 56, 126, 0.15);

    /* Footer */
    --im-footer-bg: #ffffff;
    --im-footer-border: var(--im-border-light);

    /* Radii */
    --im-radius: 12px;
    --im-radius-sm: 8px;
    --im-radius-lg: 16px;
    --im-radius-pill: 100px;

    /* Shadows */
    --im-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.03);
    --im-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(0, 0, 0, 0.03);
    --im-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07), 0 8px 24px rgba(0, 0, 0, 0.04);
    --im-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08), 0 16px 40px rgba(0, 0, 0, 0.06);
    --im-shadow-hover: 0 6px 20px rgba(44, 56, 126, 0.12);

    /* Transitions */
    --im-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --im-transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Fonts */
    --im-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
    --im-font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco',
                    'Courier New', monospace;

    /* Alert text colors (light mode) */
    --im-alert-warning-text: #92400e;
    --im-alert-danger-text: #991b1b;
    --im-alert-success-text: #1a237e;
    --im-alert-info-text: #1e40af;

    /* Option warning hover */
    --im-option-warning-hover: #fef3cd;

    /* Table stripe */
    --im-table-stripe: rgba(0, 0, 0, 0.015);

    /* Mobile table card bg */
    --im-mobile-card-bg: #ffffff;

    /* Bootstrap variable overrides – navy primary */
    --bs-primary: #2c387e;
    --bs-primary-rgb: 44, 56, 126;
    --bs-link-color: #2c387e;
    --bs-link-hover-color: #1a237e;
    --bs-link-color-rgb: 44, 56, 126;
    --bs-link-hover-color-rgb: 26, 35, 126;
}

/* ============================================================
   Dark Mode
   ============================================================ */
[data-theme="dark"] {
    /* Primary palette – navy brighter for dark bg */
    --im-primary: #9fa8da;
    --im-primary-light: #c5cae9;
    --im-primary-dark: #7986cb;
    --im-primary-bg: rgba(159, 168, 218, 0.12);
    --im-primary-bg-subtle: rgba(159, 168, 218, 0.06);
    --im-gradient: linear-gradient(135deg, #5c6bc0 0%, #9fa8da 100%);
    --im-gradient-hero: linear-gradient(135deg, #0a0e24 0%, #111a3a 50%, #1a2450 100%);

    /* Semantic colors – adjusted for dark */
    --im-success: #9fa8da;
    --im-success-bg: rgba(159, 168, 218, 0.1);
    --im-danger: #f87171;
    --im-danger-bg: rgba(248, 113, 113, 0.1);
    --im-warning: #fbbf24;
    --im-warning-bg: rgba(251, 191, 36, 0.1);
    --im-info: #38bdf8;
    --im-info-bg: rgba(56, 189, 248, 0.1);

    /* Text */
    --im-text: #e2e8f0;
    --im-text-secondary: #a0aec0;
    --im-text-muted: #8899aa;

    /* Surfaces */
    --im-border: #2d3748;
    --im-border-light: #1e2a3a;
    --im-bg: #0f172a;
    --im-bg-card: #1a2332;
    --im-bg-elevated: #1e293b;
    --im-bg-input: #1a2332;
    --im-bg-hover: rgba(159, 168, 218, 0.06);

    /* Navbar */
    --im-navbar-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);

    /* Footer */
    --im-footer-bg: #1a2332;
    --im-footer-border: #2d3748;

    /* Shadows – darker, more subtle */
    --im-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 4px rgba(0, 0, 0, 0.15);
    --im-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.15);
    --im-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.2);
    --im-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.25);
    --im-shadow-hover: 0 6px 20px rgba(159, 168, 218, 0.15);

    /* Alert text colors (dark mode) */
    --im-alert-warning-text: #fbbf24;
    --im-alert-danger-text: #f87171;
    --im-alert-success-text: #9fa8da;
    --im-alert-info-text: #9fa8da;

    /* Option warning hover */
    --im-option-warning-hover: rgba(251, 191, 36, 0.15);

    /* Table stripe */
    --im-table-stripe: rgba(255, 255, 255, 0.02);

    /* Mobile table card bg */
    --im-mobile-card-bg: var(--im-bg-card);

    color-scheme: dark;

    /* =========================================================
       BOOTSTRAP 5 CORE CSS VARIABLES OVERRIDE
       Toto přepíše Bootstrap interní proměnné které řídí
       barvu textu, pozadí, border VŠECH Bootstrap komponent.
       Bez tohoto Bootstrap ignoruje dark mode úplně.
       ========================================================= */
    --bs-body-color: #e2e8f0;
    --bs-body-color-rgb: 226, 232, 240;
    --bs-body-bg: #0f172a;
    --bs-body-bg-rgb: 15, 23, 42;

    --bs-emphasis-color: #f1f5f9;
    --bs-emphasis-color-rgb: 241, 245, 249;

    --bs-secondary-color: rgba(226, 232, 240, 0.75);
    --bs-secondary-color-rgb: 226, 232, 240;
    --bs-secondary-bg: #1e293b;
    --bs-secondary-bg-rgb: 30, 41, 59;

    --bs-tertiary-color: rgba(226, 232, 240, 0.5);
    --bs-tertiary-color-rgb: 226, 232, 240;
    --bs-tertiary-bg: #1a2332;
    --bs-tertiary-bg-rgb: 26, 35, 50;

    --bs-heading-color: #f1f5f9;
    --bs-link-color: #9fa8da;
    --bs-link-color-rgb: 206, 147, 216;
    --bs-link-hover-color: #c5cae9;
    --bs-link-hover-color-rgb: 225, 190, 231;

    --bs-border-color: #2d3748;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.1);

    /* Bootstrap component backgrounds */
    --bs-card-bg: #1a2332;
    --bs-card-border-color: #2d3748;
    --bs-card-cap-bg: #1e293b;

    /* Forms */
    --bs-form-control-bg: #1a2332;
    --bs-form-control-disabled-bg: #1e293b;

    /* Tables */
    --bs-table-color: #e2e8f0;
    --bs-table-bg: transparent;
    --bs-table-border-color: #2d3748;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-striped-color: #e2e8f0;
    --bs-table-hover-bg: rgba(159, 168, 218, 0.06);
    --bs-table-hover-color: #e2e8f0;
    --bs-table-active-bg: rgba(159, 168, 218, 0.1);
    --bs-table-active-color: #e2e8f0;
}

/* ============================================================
   Theme transition – smooth switch between modes
   ============================================================ */
html[data-theme],
html:not([data-theme]) {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body,
.card,
.navbar-im,
.footer-im,
.form-control,
.form-select,
.input-group-text,
.accordion-button,
.accordion-body,
.alert,
.badge,
.btn-outline-secondary,
.table,
.breadcrumb-im,
.auth-card,
.empty-state {
    transition:
        background-color 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease;
}

/* ============================================================
   Global / Base
   ============================================================ */
body {
    font-family: var(--im-font);
    color: var(--im-text);
    background-color: var(--im-bg);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(44, 56, 126, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(57, 73, 171, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] body {
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(159, 168, 218, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(159, 168, 218, 0.02) 0%, transparent 50%);
}

/* Page fade-in */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

main.container {
    animation: fadeInUp 0.4s var(--im-transition) both;
    flex: 1 0 auto;
}

/* Selection */
::selection {
    background-color: var(--im-primary-bg);
    color: var(--im-primary-dark);
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--im-text);
    letter-spacing: -0.02em;
}

h1 {
    font-weight: 700;
    font-size: 1.85rem;
    letter-spacing: -0.03em;
}

h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* Page header pattern */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--im-border-light);
}

.page-header h1 {
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--im-text-muted);
    margin-bottom: 0;
    font-size: 0.95rem;
}

.text-muted {
    color: var(--im-text-muted) !important;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar-im {
    background: var(--im-gradient-hero) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--im-navbar-shadow);
    padding: 0.6rem 0;
    backdrop-filter: blur(12px);
}

.navbar-im .navbar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-im .navbar-brand .brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--im-radius-sm);
    font-size: 1.1rem;
    backdrop-filter: blur(4px);
}

.navbar-im .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.85rem !important;
    border-radius: var(--im-radius-sm);
    transition: all var(--im-transition);
}

.navbar-im .nav-link:hover,
.navbar-im .nav-link:focus {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12);
}

.navbar-im .nav-link i {
    margin-right: 0.3em;
}

.navbar-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--im-radius-pill);
    margin-right: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-user-info .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

/* Hamburger custom */
.navbar-im .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.6rem;
    border-radius: var(--im-radius-sm);
}

.navbar-im .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
}

/* Keep backward compat with bg-primary navbar class */
.navbar.navbar-dark.bg-primary {
    background: var(--im-gradient-hero) !important;
    box-shadow: var(--im-navbar-shadow);
}

.navbar-brand i {
    margin-right: 0.3em;
}

/* Theme toggle button in navbar */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all var(--im-transition);
    font-size: 1rem;
    padding: 0;
    line-height: 1;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: rotate(15deg);
}

.theme-toggle:active {
    transform: scale(0.92);
}

.theme-toggle .bi-moon-fill,
.theme-toggle .bi-sun-fill {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ============================================================
   Navbar V2 - Modern sticky navbar
   ============================================================ */
.navbar-v2 {
    background: var(--im-gradient-hero);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--im-navbar-shadow);
}

.navbar-v2__inner {
    display: flex;
    align-items: center;
    height: 60px;
    gap: 1rem;
}

/* Brand */
.navbar-v2__brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
}

.navbar-v2__brand:hover {
    color: #fff;
}

.navbar-v2__brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.navbar-v2__brand-text {
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.navbar-v2__brand-text span {
    font-weight: 700;
}

/* Nav links */
.navbar-v2__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 2rem;
}

.navbar-v2__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--im-radius-sm);
    transition: all var(--im-transition);
    white-space: nowrap;
}

.navbar-v2__link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.navbar-v2__link--active {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

.navbar-v2__link i {
    font-size: 1rem;
}

/* Right side */
.navbar-v2__right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* User button */
.navbar-v2__user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.65rem 0.3rem 0.3rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--im-radius-pill);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all var(--im-transition);
    font-size: 0.85rem;
    font-weight: 500;
}

.navbar-v2__user:hover {
    background: rgba(255, 255, 255, 0.18);
}

.navbar-v2__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
}

.navbar-v2__username {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Footer V2 */
.footer-v2 {
    background: var(--im-bg-card);
    border-top: 1px solid var(--im-border-light);
    margin-top: auto;
    padding: 1.25rem 0;
}

.footer-v2__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-v2__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--im-text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
}

.footer-v2__brand i {
    color: var(--im-primary);
}

.footer-v2__copy {
    color: var(--im-text-muted);
    font-size: 0.8rem;
}

@media (max-width: 991.98px) {
    .navbar-v2__inner {
        height: 56px;
    }
}

/* ============================================================
   Breadcrumbs
   ============================================================ */
.breadcrumb-im {
    background: transparent;
    padding: 0.75rem 0 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.breadcrumb-im .breadcrumb-item a {
    color: var(--im-primary);
    text-decoration: none;
    transition: color var(--im-transition);
}

.breadcrumb-im .breadcrumb-item a:hover {
    color: var(--im-primary-dark);
}

.breadcrumb-im .breadcrumb-item.active {
    color: var(--im-text-muted);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
    border: 1px solid var(--im-border-light);
    border-radius: var(--im-radius-lg);
    box-shadow: var(--im-shadow);
    background: var(--im-bg-card);
    overflow: hidden;
    transition: box-shadow var(--im-transition), transform var(--im-transition);
}

.card-header {
    border-radius: var(--im-radius-lg) var(--im-radius-lg) 0 0 !important;
    font-weight: 600;
    border-bottom: 1px solid var(--im-border-light);
    background: var(--im-bg-elevated);
    padding: 1rem 1.25rem;
}

.card-header.bg-secondary {
    background: linear-gradient(135deg, #5f6368 0%, #80868b 100%) !important;
}

/* Server cards in migration form */
.server-karta {
    border: 1px solid var(--im-border-light);
}

.server-karta .card-header {
    font-size: 0.95rem;
}

/* Stat cards */
.stat-karta {
    text-align: center;
    padding: 1.75rem 1.25rem;
    border-radius: var(--im-radius-lg);
    background: var(--im-bg-card);
    border: 1px solid var(--im-border-light);
    position: relative;
    overflow: hidden;
    transition: all var(--im-transition);
}

.stat-karta:hover {
    box-shadow: var(--im-shadow-md);
    transform: translateY(-2px);
}

.stat-karta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--im-gradient);
    opacity: 0.7;
    transition: opacity var(--im-transition);
}

.stat-karta:hover::before {
    opacity: 1;
}

/* Stat card color variants */
.stat-karta--primary::before { background: var(--im-gradient); }
.stat-karta--success::before { background: linear-gradient(135deg, #2c387e, #3949ab); }
.stat-karta--danger::before { background: linear-gradient(135deg, #c5221f, #ea4335); }
.stat-karta--info::before { background: linear-gradient(135deg, #0288d1, #29b6f6); }
.stat-karta--warning::before { background: linear-gradient(135deg, #f57f17, #fbc02d); }

.stat-karta .stat-hodnota {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--im-text);
    line-height: 1.1;
    margin-bottom: 0.35rem;
    letter-spacing: -0.03em;
}

.stat-karta .stat-popisek {
    font-size: 0.8rem;
    color: var(--im-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* Icon circle inside stat card */
.stat-karta .icon-circle {
    margin-bottom: 0.75rem;
    width: 52px;
    height: 52px;
    font-size: 1.3rem;
}

/* Gradient stat cards (admin dashboard) */
.stat-karta-gradient {
    border-radius: var(--im-radius-lg);
    padding: 1.75rem 1.5rem;
    border: none;
    position: relative;
    overflow: hidden;
    color: #fff;
    transition: all var(--im-transition);
}

.stat-karta-gradient:hover {
    transform: translateY(-3px);
    box-shadow: var(--im-shadow-lg);
}

.stat-karta-gradient::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.stat-karta-gradient .stat-hodnota {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.stat-karta-gradient .stat-popisek {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.stat-karta-gradient .stat-icon {
    font-size: 1.5rem;
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.stat-karta-gradient--primary { background: linear-gradient(135deg, #2c387e 0%, #9fa8da 100%); }
.stat-karta-gradient--success { background: linear-gradient(135deg, #2c387e 0%, #3949ab 100%); }
.stat-karta-gradient--info { background: linear-gradient(135deg, #0277bd 0%, #29b6f6 100%); }
.stat-karta-gradient--danger { background: linear-gradient(135deg, #c62828 0%, #ef5350 100%); }
.stat-karta-gradient--secondary { background: linear-gradient(135deg, #455a64 0%, #78909c 100%); }
.stat-karta-gradient--warning { background: linear-gradient(135deg, #f57f17 0%, #fbc02d 100%); }

[data-theme="dark"] .stat-karta-gradient--primary { background: linear-gradient(135deg, #1a237e 0%, #5c6bc0 100%); }
[data-theme="dark"] .stat-karta-gradient--success { background: linear-gradient(135deg, #0d1642 0%, #42a5f5 100%); }
[data-theme="dark"] .stat-karta-gradient--info { background: linear-gradient(135deg, #01579b 0%, #0288d1 100%); }
[data-theme="dark"] .stat-karta-gradient--danger { background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%); }
[data-theme="dark"] .stat-karta-gradient--secondary { background: linear-gradient(135deg, #37474f 0%, #607d8b 100%); }
[data-theme="dark"] .stat-karta-gradient--warning { background: linear-gradient(135deg, #e65100 0%, #f9a825 100%); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    border-radius: var(--im-radius-sm);
    font-weight: 500;
    padding: 0.5rem 1.15rem;
    transition: all var(--im-transition);
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--im-gradient);
    border: none;
    box-shadow: 0 2px 8px rgba(44, 56, 126, 0.2);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--im-primary-dark) 0%, var(--im-primary) 100%);
    box-shadow: 0 4px 16px rgba(44, 56, 126, 0.3);
    transform: translateY(-1px);
}

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

.btn-success {
    background: linear-gradient(135deg, #2c387e 0%, #3949ab 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(57, 73, 171, 0.15);
}

.btn-success:hover {
    box-shadow: 0 4px 16px rgba(57, 73, 171, 0.25);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #c5221f 0%, #ea4335 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(217, 48, 37, 0.15);
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(217, 48, 37, 0.25);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--im-primary);
    border-color: var(--im-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--im-primary);
    border-color: var(--im-primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(44, 56, 126, 0.25);
    transform: translateY(-1px);
}

.btn-outline-primary:active {
    background-color: var(--im-primary-dark);
    border-color: var(--im-primary-dark);
    transform: translateY(0);
}

/* Bootstrap bg-primary override to teal */
.bg-primary {
    background-color: var(--im-primary) !important;
}

.text-primary {
    color: var(--im-primary) !important;
}

.border-primary {
    border-color: var(--im-primary) !important;
}

/* Badge specific overrides */
.badge.bg-primary {
    background-color: var(--im-primary) !important;
}

.badge.bg-success {
    background-color: var(--im-success) !important;
}

.badge.bg-info {
    background-color: var(--im-info) !important;
}

/* Bootstrap success overrides → navy */
.bg-success {
    background-color: var(--im-success) !important;
}

.text-success {
    color: var(--im-success) !important;
}

/* Pagination active */
.page-item.active .page-link {
    background-color: var(--im-primary);
    border-color: var(--im-primary);
}

.page-link {
    color: var(--im-primary);
}

.page-link:hover {
    color: var(--im-primary-dark);
}

.btn-outline-purple {
    color: #2c387e;
    border-color: #2c387e;
    background: transparent;
}

.btn-outline-purple:hover,
.btn-outline-purple:focus {
    background-color: #2c387e;
    border-color: #2c387e;
    color: #fff;
}

.btn-outline-purple:active,
.btn-check:checked + .btn-outline-purple {
    background-color: #1a237e;
    border-color: #1a237e;
    color: #fff;
}

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

.btn-outline-secondary:hover {
    background-color: var(--im-bg-hover);
    border-color: var(--im-text-muted);
    color: var(--im-text);
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    border-radius: var(--im-radius);
    font-weight: 600;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Spinner in buttons */
.btn .spinner-border-sm {
    margin-right: 0.4em;
    vertical-align: -0.1em;
}

/* ============================================================
   Form Inputs
   ============================================================ */
.form-control,
.form-select {
    padding: 0.65rem 1rem;
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius-sm);
    font-size: 0.9rem;
    transition: border-color var(--im-transition), box-shadow var(--im-transition),
                background-color 0.3s ease;
    color: var(--im-text);
    background-color: var(--im-bg-input);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--im-primary-light);
    box-shadow: 0 0 0 3px rgba(44, 56, 126, 0.12);
    background-color: var(--im-bg-input);
    color: var(--im-text);
}

.form-control::placeholder {
    color: var(--im-text-muted);
    font-weight: 400;
}

.form-label {
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--im-text-secondary);
    margin-bottom: 0.35rem;
}

.form-check-input {
    width: 1.15em;
    height: 1.15em;
    margin-top: 0.15em;
    border: 1.5px solid var(--im-border);
    transition: all var(--im-transition);
    background-color: var(--im-bg-input);
}

.form-check-input:checked {
    background-color: var(--im-primary);
    border-color: var(--im-primary);
}

.form-check-input:focus {
    border-color: var(--im-primary-light);
    box-shadow: 0 0 0 3px rgba(44, 56, 126, 0.12);
}

textarea.form-control {
    line-height: 1.5;
}

/* Input group for host:port */
.input-group .form-control[name*="_port"] {
    max-width: 100px;
    text-align: center;
}

.input-group-text {
    background-color: var(--im-bg-elevated);
    border-color: var(--im-border);
    color: var(--im-text-muted);
    font-size: 0.88rem;
}

/* Dark mode select arrow fix */
[data-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a0aec0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* ============================================================
   Status Badges (pill shape with icons)
   ============================================================ */
.badge {
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    padding: 0.35em 0.75em;
    border-radius: var(--im-radius-pill);
}

.badge-stav-cekajici {
    background-color: var(--im-border-light) !important;
    color: var(--im-text-muted) !important;
}
.badge-stav-cekajici::before {
    content: "\f293"; /* bi-clock */
    font-family: "bootstrap-icons";
    margin-right: 0.35em;
    font-size: 0.7em;
}

.badge-stav-ve_fronte {
    background-color: var(--im-info-bg) !important;
    color: var(--im-primary) !important;
}
.badge-stav-ve_fronte::before {
    content: "\f3c0"; /* bi-hourglass-split */
    font-family: "bootstrap-icons";
    margin-right: 0.35em;
    font-size: 0.7em;
}

.badge-stav-bezici {
    background-color: var(--im-primary-bg) !important;
    color: var(--im-primary) !important;
    animation: badgePulse 2s ease-in-out infinite;
}
.badge-stav-bezici::before {
    content: "\f5a0"; /* bi-arrow-repeat */
    font-family: "bootstrap-icons";
    margin-right: 0.35em;
    font-size: 0.7em;
    display: inline-block;
    animation: spin 1.5s linear infinite;
}

.badge-stav-dokoncena {
    background-color: var(--im-success-bg) !important;
    color: var(--im-success) !important;
}
.badge-stav-dokoncena::before {
    content: "\f26b"; /* bi-check-circle-fill */
    font-family: "bootstrap-icons";
    margin-right: 0.35em;
    font-size: 0.7em;
}

.badge-stav-chyba {
    background-color: var(--im-danger-bg) !important;
    color: var(--im-danger) !important;
}
.badge-stav-chyba::before {
    content: "\f623"; /* bi-x-circle-fill */
    font-family: "bootstrap-icons";
    margin-right: 0.35em;
    font-size: 0.7em;
}

.badge-stav-zrusena {
    background-color: var(--im-warning-bg) !important;
    color: var(--im-warning) !important;
}
.badge-stav-zrusena::before {
    content: "\f2e3"; /* bi-dash-circle */
    font-family: "bootstrap-icons";
    margin-right: 0.35em;
    font-size: 0.7em;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.7; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ============================================================
   Tables
   ============================================================ */
.table {
    --bs-table-bg: transparent;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--im-text);
}

.table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--im-text-muted);
    border-bottom: 2px solid var(--im-border-light);
    padding: 1rem 1.15rem;
    white-space: nowrap;
    background: var(--im-bg-elevated);
}

.table td {
    padding: 1.05rem 1.15rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--im-border-light);
    font-size: 0.9rem;
    line-height: 1.8;
}

.table tbody tr {
    transition: all var(--im-transition);
}

.table-hover tbody tr:hover {
    background-color: var(--im-bg-hover) !important;
    box-shadow: inset 3px 0 0 var(--im-primary);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: var(--im-table-stripe);
}

/* Modern table wrapper */
.table-modern {
    border-radius: var(--im-radius);
    overflow: hidden;
}

.table-modern .table {
    margin-bottom: 0;
}

.table-modern .table th:first-child { border-top-left-radius: var(--im-radius); }
.table-modern .table th:last-child { border-top-right-radius: var(--im-radius); }

/* ============================================================
   Step Indicator (Migration Wizard)
   ============================================================ */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 1.5rem 0;
    counter-reset: step;
}

.step-indicator__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 0 0 auto;
    min-width: 100px;
}

.step-indicator__dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--im-border-light);
    color: var(--im-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
    transition: all var(--im-transition-slow);
    border: 2px solid var(--im-border);
}

.step-indicator__label {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--im-text-muted);
    transition: color var(--im-transition);
    text-align: center;
}

.step-indicator__line {
    flex: 1;
    height: 2px;
    background: var(--im-border-light);
    margin: 0 -8px;
    position: relative;
    top: -12px;
    z-index: 1;
    min-width: 40px;
    transition: background var(--im-transition-slow);
}

/* Active step */
.step-indicator__step--active .step-indicator__dot {
    background: var(--im-gradient);
    color: #fff;
    border-color: var(--im-primary);
    box-shadow: 0 2px 12px rgba(44, 56, 126, 0.3);
}

.step-indicator__step--active .step-indicator__label {
    color: var(--im-primary);
    font-weight: 600;
}

/* Completed step */
.step-indicator__step--done .step-indicator__dot {
    background: var(--im-success);
    color: #fff;
    border-color: var(--im-success);
}

.step-indicator__step--done .step-indicator__label {
    color: var(--im-success);
}

.step-indicator__line--done {
    background: var(--im-success);
}

.step-indicator__line--active {
    background: linear-gradient(90deg, var(--im-success) 0%, var(--im-primary-light) 100%);
}

/* ============================================================
   Unified Wizard Stepper (shared by nova.php + hromadny_import.php)
   ============================================================ */
.im-wizard {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 2rem 1rem 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.im-wizard__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    position: relative;
    z-index: 1;
    cursor: default;
    min-width: 90px;
}

.im-wizard__circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    background: var(--im-bg-card);
    border: 3px solid var(--im-border);
    color: var(--im-text-muted);
    transition: all var(--im-transition-slow);
    position: relative;
}

.im-wizard__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--im-text-muted);
    text-align: center;
    transition: color var(--im-transition-slow);
    white-space: nowrap;
}

.im-wizard__connector {
    flex: 1;
    min-width: 40px;
    max-width: 120px;
    height: 3px;
    background: var(--im-border-light);
    margin-top: 22.5px; /* center with circle */
    border-radius: 2px;
    transition: background var(--im-transition-slow);
    position: relative;
    overflow: hidden;
}

.im-wizard__connector::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--im-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

/* Active step */
.im-wizard__step--active .im-wizard__circle {
    background: var(--im-gradient);
    border-color: var(--im-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(44, 56, 126, 0.35), 0 0 0 6px var(--im-primary-bg);
}

.im-wizard__step--active .im-wizard__label {
    color: var(--im-primary);
    font-weight: 700;
}

/* Completed step */
.im-wizard__step--done .im-wizard__circle {
    background: var(--im-success);
    border-color: var(--im-success);
    color: #fff;
    box-shadow: 0 2px 8px rgba(57, 73, 171, 0.2);
}

.im-wizard__step--done .im-wizard__label {
    color: var(--im-success);
}

.im-wizard__connector--done::after {
    transform: scaleX(1);
    background: var(--im-success);
}

.im-wizard__connector--active::after {
    transform: scaleX(1);
    background: linear-gradient(90deg, var(--im-success), var(--im-primary));
}

/* Wizard content animation */
.wizard-obsah {
    animation: wizardFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes wizardFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Wizard form switch */
.wizard-obsah .form-switch .form-check-input {
    width: 2.5em;
    cursor: pointer;
}

.wizard-obsah .form-switch .form-check-input:checked {
    background-color: var(--im-success);
    border-color: var(--im-success);
}

/* Wizard responsive */
@media (max-width: 575.98px) {
    .im-wizard {
        padding: 1.25rem 0.25rem 1rem;
    }

    .im-wizard__circle {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
        border-width: 2px;
    }

    .im-wizard__label {
        font-size: 0.72rem;
    }

    .im-wizard__connector {
        min-width: 20px;
        margin-top: 17.5px;
    }

    .im-wizard__step {
        min-width: 60px;
    }
}

/* ============================================================
   Wizard Page Hero (shared)
   ============================================================ */
.wizard-hero {
    background: var(--im-gradient-hero);
    border-radius: var(--im-radius-lg);
    padding: 2rem 2.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: hidden;
}

.wizard-hero::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -8%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.wizard-hero__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.wizard-hero__title {
    color: #fff !important;
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.wizard-hero__subtitle {
    color: rgba(255, 255, 255, 0.7);
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
}

.wizard-hero__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 767.98px) {
    .wizard-hero {
        padding: 1.5rem;
        text-align: center;
    }
    .wizard-hero__content {
        flex-direction: column;
        text-align: center;
    }
    .wizard-hero__actions {
        justify-content: center;
    }
    .wizard-hero__title {
        font-size: 1.35rem;
    }
}

/* ============================================================
   Server Flow Cards (nova.php - source → target visual)
   ============================================================ */
.server-flow {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 1.5rem;
}

.server-flow__panel {
    flex: 1;
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    padding: 0;
    overflow: hidden;
    transition: all var(--im-transition);
}

.server-flow__panel--source {
    border-radius: var(--im-radius-lg) 0 0 var(--im-radius-lg);
    border-right: none;
}

.server-flow__panel--target {
    border-radius: 0 var(--im-radius-lg) var(--im-radius-lg) 0;
    border-left: none;
}

.server-flow__panel:hover {
    box-shadow: var(--im-shadow-md);
    z-index: 1;
}

.server-flow__header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
}

.server-flow__header--source {
    background: linear-gradient(135deg, #546e7a, #78909c);
}

.server-flow__header--target {
    background: linear-gradient(135deg, #2c387e, #3949ab);
}

.server-flow__header-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.server-flow__body {
    padding: 1.25rem;
}

.server-flow__arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    flex-shrink: 0;
    background: var(--im-bg-card);
    border-top: 1px solid var(--im-border);
    border-bottom: 1px solid var(--im-border);
    position: relative;
    z-index: 2;
}

.server-flow__arrow-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--im-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 16px rgba(44, 56, 126, 0.3);
    animation: pulseArrow 2.5s ease-in-out infinite;
}

@keyframes pulseArrow {
    0%, 100% { box-shadow: 0 4px 16px rgba(44, 56, 126, 0.3); }
    50% { box-shadow: 0 4px 24px rgba(44, 56, 126, 0.5); }
}

.server-flow__verify-btn {
    margin-top: 0.75rem;
}

.server-flow__verify-result {
    margin-top: 0.5rem;
}

@media (max-width: 991.98px) {
    .server-flow {
        flex-direction: column;
    }

    .server-flow__panel--source {
        border-radius: var(--im-radius-lg) var(--im-radius-lg) 0 0;
        border-right: 1px solid var(--im-border);
        border-bottom: none;
    }

    .server-flow__panel--target {
        border-radius: 0 0 var(--im-radius-lg) var(--im-radius-lg);
        border-left: 1px solid var(--im-border);
        border-top: none;
    }

    .server-flow__arrow {
        flex-direction: row;
        width: auto;
        height: 48px;
        border-top: none;
        border-bottom: none;
        border-left: 1px solid var(--im-border);
        border-right: 1px solid var(--im-border);
    }
}

/* ============================================================
   Summary Flow (Step 3 visual summary)
   ============================================================ */
.summary-flow {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1.5rem;
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius-lg);
    overflow: hidden;
    background: var(--im-bg-card);
    box-shadow: var(--im-shadow-sm);
}

.summary-flow__server {
    flex: 1;
    padding: 1.5rem;
    text-align: center;
}

.summary-flow__server-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin: 0 auto 0.75rem;
}

.summary-flow__server-icon--source {
    background: linear-gradient(135deg, rgba(84, 110, 122, 0.12), rgba(84, 110, 122, 0.05));
    color: #607d8b;
    border: 2px solid rgba(84, 110, 122, 0.2);
}

.summary-flow__server-icon--target {
    background: linear-gradient(135deg, var(--im-success-bg), rgba(57, 73, 171, 0.05));
    color: var(--im-success);
    border: 2px solid rgba(57, 73, 171, 0.2);
}

.summary-flow__server-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--im-text-muted);
    margin-bottom: 0.3rem;
}

.summary-flow__server-host {
    font-size: 1rem;
    font-weight: 700;
    color: var(--im-text);
    word-break: break-all;
    margin-bottom: 0.2rem;
}

.summary-flow__server-user {
    font-size: 0.85rem;
    color: var(--im-text-secondary);
}

.summary-flow__arrow {
    width: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-flow__arrow-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--im-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 3px 12px rgba(44, 56, 126, 0.25);
}

@media (max-width: 575.98px) {
    .summary-flow {
        flex-direction: column;
    }
    .summary-flow__arrow {
        width: auto;
        height: 40px;
        transform: rotate(90deg);
    }
}

/* ============================================================
   Settings Panel (step 2 nova.php)
   ============================================================ */
.settings-panel {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--im-shadow-sm);
}

.settings-panel__header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--im-border-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--im-bg-elevated);
}

.settings-panel__header-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--im-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.settings-panel__header-icon--warning {
    background: var(--im-warning-bg);
    color: var(--im-warning);
}

.settings-panel__header-icon--primary {
    background: var(--im-primary-bg);
    color: var(--im-primary);
}

.settings-panel__header-icon--star {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #f57c00;
}

.settings-panel__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--im-text);
    margin: 0;
}

.settings-panel__body {
    padding: 1.5rem;
}

/* Wizard navigation bar */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    margin-top: 0.5rem;
    border-top: 1px solid var(--im-border-light);
}

/* Active settings tags (summary) */
.settings-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.settings-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--im-radius-pill);
    font-size: 0.78rem;
    font-weight: 500;
    background: var(--im-primary-bg);
    color: var(--im-primary);
    border: 1px solid rgba(44, 56, 126, 0.15);
}

/* Meta info row (name + schedule) */
.meta-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--im-bg-elevated);
    border: 1px solid var(--im-border-light);
    border-radius: var(--im-radius);
    margin-bottom: 1.5rem;
}

.meta-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
}

.meta-info-item__label {
    color: var(--im-text-muted);
    font-weight: 500;
}

.meta-info-item__value {
    color: var(--im-text);
    font-weight: 600;
}

/* ============================================================
   Import Upload Zone (hromadny_import.php)
   ============================================================ */
.upload-zone {
    background: var(--im-bg-card);
    border: 2px dashed var(--im-border);
    border-radius: var(--im-radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all var(--im-transition);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone--dragover {
    border-color: var(--im-primary);
    background: var(--im-primary-bg-subtle);
}

.upload-zone__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--im-primary-bg);
    color: var(--im-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem;
}

.upload-zone__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--im-text);
    margin-bottom: 0.35rem;
}

.upload-zone__subtitle {
    font-size: 0.85rem;
    color: var(--im-text-muted);
    margin-bottom: 1rem;
}

/* Import step cards */
.import-step-card {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--im-shadow-sm);
    transition: all var(--im-transition);
}

.import-step-card__header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--im-border-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--im-bg-elevated);
}

.import-step-card__header-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--im-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.import-step-card__header-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--im-text);
    flex: 1;
}

.import-step-card__header-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.import-step-card__body {
    padding: 1.5rem;
}

.import-step-card__footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--im-border-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* File structure reference table */
.file-struct-table {
    background: var(--im-bg-elevated);
    border: 1px solid var(--im-border-light);
    border-radius: var(--im-radius);
    padding: 1rem 1.25rem;
}

.file-struct-table__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--im-text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.file-struct-table td {
    padding: 0.2rem 0.5rem 0.2rem 0;
    font-size: 0.8rem;
    vertical-align: top;
}

.file-struct-table td:first-child {
    font-family: var(--im-font-mono);
    font-weight: 600;
    color: var(--im-primary);
    white-space: nowrap;
}

/* Import history card */
.import-history {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius-lg);
    overflow: hidden;
    box-shadow: var(--im-shadow-sm);
    margin-top: 2rem;
}

.import-history__header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--im-border-light);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--im-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Import step card table styling */
.import-step-card .table thead th {
    background: var(--im-bg-elevated);
    border-bottom: 2px solid var(--im-border);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--im-text-muted);
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.import-step-card .table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--im-border-light);
    font-size: 0.88rem;
}

.import-step-card .table tbody tr:last-child td {
    border-bottom: none;
}

.import-step-card .table tbody tr:hover {
    background: var(--im-bg-hover);
}

/* Preset provider buttons */
.preset-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: var(--im-radius-pill);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--im-transition);
}

/* Name/schedule row (step 1 top) */
.migration-meta-bar {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--im-shadow-sm);
}

/* ============================================================
   IMAP Connection Test Result
   ============================================================ */
.imap-test-result {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1rem;
    border-radius: var(--im-radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    margin-top: 0.5rem;
    animation: fadeInUp 0.3s ease both;
}

.imap-test-result--success {
    background: var(--im-success-bg);
    color: var(--im-success);
    border: 1px solid rgba(57, 73, 171, 0.2);
}

.imap-test-result--error {
    background: var(--im-danger-bg);
    color: var(--im-danger);
    border: 1px solid rgba(217, 48, 37, 0.2);
}

.imap-test-result--loading {
    background: var(--im-primary-bg);
    color: var(--im-primary);
    border: 1px solid rgba(44, 56, 126, 0.15);
}

.imap-test-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

@keyframes checkPop {
    0%   { transform: scale(0); opacity: 0; }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.imap-test-icon--animated {
    animation: checkPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ============================================================
   SSE Log Viewer (Terminal Theme)
   ============================================================ */
#log-kontejner {
    background: linear-gradient(180deg, #0f172a 0%, #1a1a2e 100%);
    color: #d4d4d4;
    font-family: var(--im-font-mono);
    font-size: 0.8rem;
    line-height: 1.65;
    padding: 1.25rem;
    border-radius: var(--im-radius);
    max-height: 500px;
    overflow-y: auto;
    scroll-behavior: smooth;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
    position: relative;
}

#log-kontejner::before {
    content: '';
    display: block;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, transparent 100%);
    z-index: 1;
    margin: -1.25rem -1.25rem 0.5rem;
    padding: 0 1.25rem;
    pointer-events: none;
}

/* Scrollbar styling */
#log-kontejner::-webkit-scrollbar {
    width: 6px;
}

#log-kontejner::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

#log-kontejner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

#log-kontejner::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.log-radek {
    padding: 2px 0.5rem;
    white-space: pre-wrap;
    word-break: break-all;
    border-radius: 3px;
    margin: 1px 0;
    transition: background var(--im-transition);
}

.log-radek:hover {
    background: rgba(255, 255, 255, 0.04);
}

.log-cas {
    color: #608b4e;
    margin-right: 0.75em;
    opacity: 0.8;
}

.log-uroven {
    font-weight: 600;
    margin-right: 0.75em;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding: 1px 6px;
    border-radius: 3px;
    display: inline-block;
    min-width: 4em;
    text-align: center;
}

.log-uroven-info {
    color: #7dc4e4;
    background: rgba(125, 196, 228, 0.1);
}

.log-uroven-ladeni {
    color: #9cdcfe;
    background: rgba(156, 220, 254, 0.08);
}

.log-uroven-varovani {
    color: #f6c177;
    background: rgba(246, 193, 119, 0.1);
}

.log-uroven-chyba {
    color: #ed8796;
    background: rgba(237, 135, 150, 0.15);
}

.log-udalost {
    color: #c6a0f6;
    margin-right: 0.75em;
    font-weight: 500;
}

.log-zprava {
    color: #cad3f5;
}

.log-chyba {
    background-color: rgba(237, 135, 150, 0.06);
    border-left: 2px solid #ed8796;
}

.log-varovani {
    background-color: rgba(246, 193, 119, 0.06);
    border-left: 2px solid #f6c177;
}

/* New log entry animation */
@keyframes logSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.log-radek--new {
    animation: logSlideIn 0.25s ease both;
}

/* Empty state float animation */
@keyframes floatBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

/* ============================================================
   Toast Notifications
   ============================================================ */
#toast-kontejner {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1090;
    min-width: 300px;
    max-width: 420px;
}

.toast {
    border: none;
    border-radius: var(--im-radius-sm);
    box-shadow: var(--im-shadow-lg);
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    backdrop-filter: blur(10px);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(100px) scale(0.95);
    }
}

.toast .toast-body {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
}

/* ============================================================
   Accordion (imapsync parameters)
   ============================================================ */
.accordion {
    border-radius: var(--im-radius);
    overflow: hidden;
}

.accordion-item {
    border-color: var(--im-border-light);
    background: var(--im-bg-card);
}

.accordion-item:first-of-type {
    border-top-left-radius: var(--im-radius);
    border-top-right-radius: var(--im-radius);
}

.accordion-item:last-of-type {
    border-bottom-left-radius: var(--im-radius);
    border-bottom-right-radius: var(--im-radius);
}

.accordion-button {
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.85rem 1.15rem;
    color: var(--im-text);
    transition: all var(--im-transition);
    background: var(--im-bg-card);
}

.accordion-button:not(.collapsed) {
    background-color: var(--im-primary-bg-subtle);
    color: var(--im-primary);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(44, 56, 126, 0.12);
    border-color: transparent;
}

.accordion-button::after {
    transition: transform var(--im-transition);
}

/* Dark mode accordion button arrow */
[data-theme="dark"] .accordion-button::after {
    filter: invert(0.7);
}

[data-theme="dark"] .accordion-button:not(.collapsed)::after {
    filter: invert(0.5) sepia(1) saturate(5) hue-rotate(130deg);
}

.accordion-body {
    padding: 1rem 1.15rem;
    background: var(--im-bg-card);
}

.accordion-body .mb-3:last-child {
    margin-bottom: 0 !important;
}

/* ============================================================
   Option rows (imapsync parameter list)
   ============================================================ */
.option-row {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid var(--im-border-light);
    border-radius: 4px;
    transition: background var(--im-transition);
}

.option-row:last-child {
    border-bottom: none;
}

.option-row:hover {
    background: var(--im-bg-hover);
}

.option-row--warning {
    background-color: var(--im-warning-bg);
    border-left: 3px solid var(--im-warning);
    padding-left: 0.85rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.option-row--warning:hover {
    background-color: var(--im-option-warning-hover);
}

.option-warning {
    color: var(--im-warning);
    font-size: 0.82rem;
    margin: 0.3rem 0 0 0;
    font-weight: 500;
    line-height: 1.4;
}

.option-help {
    color: var(--im-text-muted);
    font-size: 0.8rem;
    margin: 0.2rem 0 0 0;
    line-height: 1.4;
}

/* ============================================================
   Progress / Running Migration
   ============================================================ */
.progress {
    height: 8px;
    border-radius: var(--im-radius-pill);
    background-color: var(--im-border-light);
    overflow: hidden;
}

.progress-bar {
    border-radius: var(--im-radius-pill);
    transition: width 0.6s ease;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

/* Animated gradient for running state */
.progress-running {
    position: relative;
    overflow: hidden;
}

.progress-running .progress-bar {
    background: linear-gradient(90deg,
        var(--im-primary) 0%,
        var(--im-primary-light) 50%,
        var(--im-primary) 100%);
    background-size: 200% 100%;
    animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    border-radius: var(--im-radius-sm);
    border: none;
    font-size: 0.9rem;
    padding: 0.85rem 1.15rem;
}

.alert-warning {
    background-color: var(--im-warning-bg);
    color: var(--im-alert-warning-text);
    border-left: 3px solid var(--im-warning);
}

.alert-danger {
    background-color: var(--im-danger-bg);
    color: var(--im-alert-danger-text);
    border-left: 3px solid var(--im-danger);
}

.alert-success {
    background-color: var(--im-success-bg);
    color: var(--im-alert-success-text);
    border-left: 3px solid var(--im-success);
}

.alert-info {
    background-color: var(--im-info-bg);
    color: var(--im-alert-info-text);
    border-left: 3px solid var(--im-info);
}

/* Footer base - enhanced version in modern components section */

.footer-im a {
    color: var(--im-text-secondary);
    text-decoration: none;
    transition: color var(--im-transition);
}

.footer-im a:hover {
    color: var(--im-primary);
}

.footer-im .footer-version {
    opacity: 0.5;
    font-size: 0.75rem;
}

/* ============================================================
   Utility Classes
   ============================================================ */
.fade-in {
    animation: fadeInUp 0.4s ease both;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }

.text-gradient {
    background: var(--im-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--im-gradient) !important;
}

.border-accent {
    border-left: 3px solid var(--im-primary) !important;
}

.rounded-im {
    border-radius: var(--im-radius) !important;
}

.shadow-im {
    box-shadow: var(--im-shadow) !important;
}

/* shadow-hover deaktivovan */

/* hover-lift deaktivovan */

/* Divider with text */
.divider-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--im-text-muted);
    font-size: 0.82rem;
    margin: 1.5rem 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--im-border-light);
}

/* Icon circle */
.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.icon-circle-sm {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
}

.icon-circle-primary {
    background: var(--im-primary-bg);
    color: var(--im-primary);
}

.icon-circle-success {
    background: var(--im-success-bg);
    color: var(--im-success);
}

.icon-circle-danger {
    background: var(--im-danger-bg);
    color: var(--im-danger);
}

.icon-circle-warning {
    background: var(--im-warning-bg);
    color: var(--im-warning);
}

/* ============================================================
   Auth Pages (Login, Register)
   ============================================================ */
.auth-container {
    max-width: 440px;
    margin: 2rem auto;
}

.auth-card {
    border: none;
    border-radius: var(--im-radius-lg);
    box-shadow: var(--im-shadow-md);
    overflow: hidden;
    background: var(--im-bg-card);
}

.auth-card .card-body {
    padding: 2rem;
}

.auth-header {
    text-align: center;
    padding: 2rem 2rem 0;
}

.auth-header__icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.auth-header__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.auth-header__subtitle {
    color: var(--im-text-muted);
    font-size: 0.9rem;
}

/* ============================================================
   Admin Panel
   ============================================================ */
.admin-stat-card {
    border-radius: var(--im-radius);
    padding: 1.25rem;
    border: none;
    box-shadow: var(--im-shadow-sm);
    transition: all var(--im-transition);
    background: var(--im-bg-card);
}

.admin-stat-card:hover {
    box-shadow: var(--im-shadow-md);
    transform: translateY(-2px);
}

/* ============================================================
   Mobile Responsive
   ============================================================ */
@media (max-width: 767.98px) {
    main.container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    #log-kontejner {
        max-height: 350px;
        font-size: 0.72rem;
        padding: 0.85rem;
        border-radius: var(--im-radius-sm);
    }

    .stat-karta .stat-hodnota {
        font-size: 1.35rem;
    }

    .table-responsive {
        font-size: 0.82rem;
    }

    .table td, .table th {
        padding: 0.65rem 0.5rem;
    }

    .btn {
        padding: 0.55rem 1rem;
    }

    .card {
        border-radius: var(--im-radius-sm);
    }

    .step-indicator {
        padding: 1rem 0;
    }

    .step-indicator__dot {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .step-indicator__label {
        font-size: 0.68rem;
    }

    .step-indicator__step {
        min-width: 70px;
    }

    .empty-state {
        padding: 2.5rem 1.5rem;
    }

    .empty-state__icon {
        font-size: 3rem;
    }

    .auth-card .card-body {
        padding: 1.25rem;
    }

    /* Full width buttons on mobile */
    .btn-mobile-full {
        width: 100%;
        display: block;
    }

    /* Collapsible table rows */
    .table-collapse-mobile thead {
        display: none;
    }

    .table-collapse-mobile tr {
        display: block;
        margin-bottom: 0.75rem;
        background: var(--im-mobile-card-bg);
        border-radius: var(--im-radius-sm);
        box-shadow: var(--im-shadow-sm);
        border: 1px solid var(--im-border-light);
        overflow: hidden;
    }

    .table-collapse-mobile td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.55rem 0.85rem;
        border-bottom: 1px solid var(--im-border-light);
        font-size: 0.85rem;
    }

    .table-collapse-mobile td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        color: var(--im-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.03em;
        flex-shrink: 0;
        margin-right: 0.75rem;
    }

    .table-collapse-mobile td:last-child {
        border-bottom: none;
    }

    .navbar-user-info {
        margin: 0.35rem 0;
        font-size: 0.82rem;
    }
}

@media (max-width: 575.98px) {
    .step-indicator__line {
        min-width: 20px;
    }

    #toast-kontejner {
        left: 0.5rem;
        right: 0.5rem;
        min-width: auto;
        max-width: none;
    }
}

/* ============================================================
   Slow spin animation for "bezici" state icon
   ============================================================ */
.spin-slow {
    display: inline-block;
    animation: spinSlow 2s linear infinite;
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ============================================================
   Timeline (detail page)
   ============================================================ */
.casova-osa {
    position: relative;
    padding-left: 1.5rem;
}

.casova-osa::before {
    content: '';
    position: absolute;
    left: 0.45rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--im-border-light);
}

.casova-osa-polozka {
    position: relative;
    padding-bottom: 1.25rem;
}

.casova-osa-polozka:last-child {
    padding-bottom: 0;
}

.casova-osa-tecka {
    position: absolute;
    left: -1.5rem;
    top: 0.35rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--im-bg-card);
    box-shadow: 0 0 0 2px var(--im-border-light);
    z-index: 1;
}

.casova-osa-obsah {
    padding-left: 0.25rem;
}

/* ============================================================
   Log terminal (detail page - #log-vystup)
   ============================================================ */
.log-terminal {
    background: #1e1e1e;
    color: #cccccc;
    font-family: 'Consolas', 'Courier New', 'Liberation Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 0.75rem 1rem;
    min-height: 300px;
    max-height: 520px;
    overflow-y: auto;
    scroll-behavior: smooth;
    border-radius: 0;
    border: none;
    border-top: 1px solid #333;
}

.log-terminal div {
    padding: 1px 0;
    white-space: pre-wrap;
    word-break: break-all;
    border-radius: 0;
    margin: 0;
    font-size: inherit;
    line-height: 1.45;
}

.log-terminal div:hover {
    background: rgba(255, 255, 255, 0.05);
}

.log-terminal::-webkit-scrollbar {
    width: 6px;
}

.log-terminal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

.log-terminal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.log-terminal::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Blinking cursor at end of log */
.log-terminal::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 1em;
    background: #cccccc;
    animation: blink-cursor 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

.log-terminal--done::after {
    display: none;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================================
   Dashboard mobile card colored left borders
   ============================================================ */
@media (max-width: 767.98px) {
    .log-terminal {
        max-height: 350px;
        font-size: 0.75rem;
        padding: 0.85rem;
    }

    .casova-osa {
        padding-left: 1.25rem;
    }
}

/* ============================================================
   DASHBOARD V2 - Hero, Stat Bar, Migration Cards
   ============================================================ */

/* --- Dashboard Hero --- */
.dashboard-hero {
    background: var(--im-gradient-hero);
    border-radius: var(--im-radius-lg);
    padding: 2rem 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.dashboard-hero__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.dashboard-hero__title {
    color: #fff !important;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.dashboard-hero__subtitle {
    color: rgba(255, 255, 255, 0.75);
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
}

.dashboard-hero__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dashboard-hero__btn-primary {
    background: #fff !important;
    color: var(--im-primary-dark) !important;
    border: none !important;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dashboard-hero__btn-primary:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.dashboard-hero__btn-secondary {
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #fff !important;
    padding: 0.65rem 1.25rem;
}

.dashboard-hero__btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    color: #fff !important;
}

/* --- Stat Bar --- */
.stat-bar {
    display: flex;
    align-items: center;
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius-lg);
    padding: 1.25rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--im-shadow-sm);
    gap: 0;
    overflow-x: auto;
}

.stat-bar__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.stat-bar__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-bar__icon--primary { background: var(--im-primary-bg); color: var(--im-primary); }
.stat-bar__icon--info { background: var(--im-info-bg); color: var(--im-info); }
.stat-bar__icon--success { background: var(--im-success-bg); color: var(--im-success); }
.stat-bar__icon--danger { background: var(--im-danger-bg); color: var(--im-danger); }

.stat-bar__value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--im-text);
}

.stat-bar__label {
    font-size: 0.78rem;
    color: var(--im-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.stat-bar__divider {
    width: 1px;
    height: 40px;
    background: var(--im-border);
    margin: 0 1rem;
    flex-shrink: 0;
}

/* --- Live Indicator --- */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: var(--im-primary-bg);
    color: var(--im-primary);
    border-radius: var(--im-radius-pill);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.live-indicator__dot {
    width: 8px;
    height: 8px;
    background: var(--im-primary);
    border-radius: 50%;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* --- Migration Cards Grid --- */
.migration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

/* --- Single Migration Card --- */
.migration-card {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius-lg);
    overflow: hidden;
    transition: box-shadow var(--im-transition), transform var(--im-transition);
    position: relative;
}

.migration-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.migration-card--cekajici::before { background: var(--im-text-muted); }
.migration-card--ve_fronte::before { background: var(--im-info); }
.migration-card--bezici::before { background: linear-gradient(90deg, var(--im-primary), var(--im-primary-light)); }
.migration-card--dokoncena::before { background: var(--im-success); }
.migration-card--chyba::before { background: var(--im-danger); }
.migration-card--zrusena::before { background: var(--im-warning); }

.migration-card:hover {
    box-shadow: var(--im-shadow-md);
    transform: translateY(-2px);
}

.migration-card__header {
    padding: 1.25rem 1.25rem 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.migration-card__title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.migration-card__name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--im-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.migration-card__name:hover {
    color: var(--im-primary);
}

.migration-card__id {
    color: var(--im-text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    flex-shrink: 0;
}

/* Badge v kartě */
.migration-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3em 0.7em;
    border-radius: var(--im-radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.migration-card__badge--cekajici { background: var(--im-border); color: var(--im-text-muted); }
.migration-card__badge--ve_fronte { background: var(--im-info-bg); color: var(--im-info); }
.migration-card__badge--bezici { background: var(--im-primary-bg); color: var(--im-primary); }
.migration-card__badge--dokoncena { background: var(--im-success-bg); color: var(--im-success); }
.migration-card__badge--chyba { background: var(--im-danger-bg); color: var(--im-danger); }
.migration-card__badge--zrusena { background: var(--im-warning-bg); color: var(--im-warning); }

/* Flow vizualizace */
.migration-card__flow {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
}

.migration-card__server {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.migration-card__server-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.migration-card__server-icon--source {
    background: var(--im-border-light);
    color: var(--im-text-muted);
}

.migration-card__server-icon--target {
    background: var(--im-success-bg);
    color: var(--im-success);
}

.migration-card__server-info {
    min-width: 0;
}

.migration-card__server-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--im-text-muted);
    font-weight: 600;
}

.migration-card__server-host {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--im-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.migration-card__server-user {
    font-size: 0.78rem;
    color: var(--im-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.migration-card__flow-arrow {
    color: var(--im-border);
    flex-shrink: 0;
    padding: 0 0.25rem;
}

.migration-card--bezici .migration-card__flow-arrow {
    color: var(--im-primary);
}

.migration-card--dokoncena .migration-card__flow-arrow {
    color: var(--im-success);
}

/* Progress */
.migration-card__progress {
    padding: 0 1.25rem 0.75rem;
}

.migration-card__progress-bar {
    height: 6px;
    background: var(--im-border-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.migration-card__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--im-primary), var(--im-primary-light));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.migration-card__progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--im-text-muted);
}

.migration-card__progress-text strong {
    color: var(--im-primary);
}

/* Stats */
.migration-card__stats {
    padding: 0 1.25rem 0.5rem;
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--im-text-muted);
}

/* Footer */
.migration-card__footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--im-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--im-bg-elevated);
}

.migration-card__date {
    font-size: 0.78rem;
    color: var(--im-text-muted);
}

.migration-card__duration {
    margin-left: 0.5rem;
    padding: 0.15em 0.5em;
    background: var(--im-primary-bg);
    color: var(--im-primary);
    border-radius: var(--im-radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
}

.migration-card__actions {
    display: flex;
    gap: 0.4rem;
}

/* --- Empty State V2 --- */
.empty-state-v2 {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--im-bg-card);
    border: 2px dashed var(--im-border);
    border-radius: var(--im-radius-lg);
}

.empty-state-v2__visual {
    margin-bottom: 2rem;
}

.empty-state-v2__circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--im-primary-bg);
    color: var(--im-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.empty-state-v2__dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.empty-state-v2__dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--im-border);
    animation: dotBounce 1.5s ease-in-out infinite;
}

.empty-state-v2__dots span:nth-child(2) { animation-delay: 0.2s; }
.empty-state-v2__dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(-6px); opacity: 1; }
}

.empty-state-v2__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--im-text);
    margin-bottom: 0.75rem;
}

.empty-state-v2__text {
    color: var(--im-text-muted);
    font-size: 1rem;
    max-width: 400px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* --- Pagination Bar --- */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-bar__info {
    color: var(--im-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- Responsive --- */
@media (max-width: 767.98px) {
    .dashboard-hero {
        padding: 1.5rem;
        text-align: center;
    }

    .dashboard-hero__content {
        flex-direction: column;
        text-align: center;
    }

    .dashboard-hero__title {
        font-size: 1.35rem;
    }

    .dashboard-hero__actions {
        justify-content: center;
    }

    .stat-bar {
        padding: 1rem;
        gap: 0;
        flex-wrap: wrap;
    }

    .stat-bar__item {
        flex: 0 0 50%;
        justify-content: flex-start;
        padding: 0.5rem 0;
    }

    .stat-bar__divider {
        display: none;
    }

    .stat-bar__icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .stat-bar__value {
        font-size: 1.25rem;
    }

    .migration-grid {
        grid-template-columns: 1fr;
    }

    .migration-card__flow {
        flex-direction: column;
        align-items: stretch;
    }

    .migration-card__flow-arrow {
        transform: rotate(90deg);
        text-align: center;
        padding: 0.25rem 0;
    }

    .migration-card__footer {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .migration-card__actions {
        justify-content: flex-end;
    }

    .pagination-bar {
        justify-content: center;
    }
}

/* ============================================================
   Dark mode overrides for Bootstrap components
   ============================================================ */

/* --- Backgrounds --- */
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-body-tertiary {
    background-color: var(--im-bg-elevated) !important;
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-body {
    background-color: var(--im-bg-card) !important;
}

[data-theme="dark"] .bg-body-secondary {
    background-color: var(--im-bg) !important;
}

/* --- Bootstrap color utilities with opacity --- */
[data-theme="dark"] .bg-primary {
    --bs-bg-opacity: 1;
    background-color: var(--im-primary) !important;
}
[data-theme="dark"] .bg-primary.bg-opacity-10 {
    background-color: var(--im-primary-bg) !important;
}
[data-theme="dark"] .bg-primary.bg-opacity-25 {
    background-color: rgba(159, 168, 218, 0.2) !important;
}

[data-theme="dark"] .bg-success.bg-opacity-10 {
    background-color: var(--im-success-bg) !important;
}
[data-theme="dark"] .bg-danger.bg-opacity-10 {
    background-color: var(--im-danger-bg) !important;
}
[data-theme="dark"] .bg-warning.bg-opacity-10 {
    background-color: var(--im-warning-bg) !important;
}
[data-theme="dark"] .bg-info.bg-opacity-10 {
    background-color: var(--im-info-bg) !important;
}
[data-theme="dark"] .bg-secondary.bg-opacity-10 {
    background-color: rgba(160, 174, 192, 0.1) !important;
}

/* --- Text colors --- */
[data-theme="dark"] .text-dark {
    color: var(--im-text) !important;
}
[data-theme="dark"] .text-muted {
    color: var(--im-text-muted) !important;
}
[data-theme="dark"] .text-body {
    color: var(--im-text) !important;
}
[data-theme="dark"] .text-body-secondary {
    color: var(--im-text-secondary) !important;
}
[data-theme="dark"] .text-primary {
    color: var(--im-primary) !important;
}
[data-theme="dark"] .text-success {
    color: var(--im-success) !important;
}
[data-theme="dark"] .text-danger {
    color: var(--im-danger) !important;
}
[data-theme="dark"] .text-warning {
    color: var(--im-warning) !important;
}
[data-theme="dark"] .text-info {
    color: var(--im-info) !important;
}

/* --- Borders --- */
[data-theme="dark"] .border {
    border-color: var(--im-border) !important;
}
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: var(--im-border) !important;
}
[data-theme="dark"] .border-primary {
    border-color: var(--im-primary) !important;
}
[data-theme="dark"] .border-success {
    border-color: var(--im-success) !important;
}
[data-theme="dark"] .border-danger {
    border-color: var(--im-danger) !important;
}
[data-theme="dark"] .border-warning {
    border-color: var(--im-warning) !important;
}
[data-theme="dark"] .border-info {
    border-color: var(--im-info) !important;
}
[data-theme="dark"] .border-secondary {
    border-color: var(--im-text-muted) !important;
}

/* --- Tables --- */
[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--im-text);
    color: var(--im-text);
}
[data-theme="dark"] .table-light {
    --bs-table-bg: var(--im-bg-elevated);
    --bs-table-color: var(--im-text);
    background-color: var(--im-bg-elevated) !important;
    color: var(--im-text-muted) !important;
}
[data-theme="dark"] .table-light th {
    color: var(--im-text-muted) !important;
    border-color: var(--im-border) !important;
}
[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
    border-color: var(--im-border) !important;
}
[data-theme="dark"] .table-hover tbody tr:hover {
    --bs-table-hover-bg: var(--im-bg-hover);
    background-color: var(--im-bg-hover) !important;
}
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: rgba(255, 255, 255, 0.02);
}
[data-theme="dark"] .table-danger {
    --bs-table-bg: var(--im-danger-bg);
    --bs-table-color: var(--im-text);
    background-color: var(--im-danger-bg) !important;
}
[data-theme="dark"] .table-warning {
    --bs-table-bg: var(--im-warning-bg);
    --bs-table-color: var(--im-text);
    background-color: var(--im-warning-bg) !important;
}

/* --- Cards --- */
[data-theme="dark"] .card {
    background-color: var(--im-bg-card);
    border-color: var(--im-border);
}
[data-theme="dark"] .card-header:not(.server-karta__hlavicka--zdroj):not(.server-karta__hlavicka--cil):not(.bg-success):not(.bg-primary):not(.bg-danger):not(.bg-warning):not(.bg-info) {
    background-color: var(--im-bg-elevated);
    border-color: var(--im-border);
    color: var(--im-text);
}
[data-theme="dark"] .card-footer {
    background-color: var(--im-bg-elevated);
    border-color: var(--im-border);
}

/* --- Modals, Dropdowns, List Groups --- */
[data-theme="dark"] .modal-content {
    background-color: var(--im-bg-card);
    border-color: var(--im-border);
    color: var(--im-text);
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--im-border);
}
[data-theme="dark"] .dropdown-menu {
    background-color: var(--im-bg-elevated);
    border-color: var(--im-border);
    box-shadow: var(--im-shadow-lg);
}
[data-theme="dark"] .dropdown-item {
    color: var(--im-text);
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--im-bg-hover);
    color: var(--im-text);
}
[data-theme="dark"] .dropdown-divider {
    border-color: var(--im-border);
}
[data-theme="dark"] .list-group-item {
    background-color: var(--im-bg-card);
    border-color: var(--im-border);
    color: var(--im-text);
}

/* --- bg-dark utility --- */
[data-theme="dark"] .bg-dark {
    background-color: var(--im-bg-elevated) !important;
}
[data-theme="dark"] .bg-dark.bg-opacity-10 {
    background-color: var(--im-primary-bg) !important;
}
[data-theme="dark"] .bg-dark.text-white {
    color: var(--im-text) !important;
}

/* --- badge bg-light in dark mode --- */
[data-theme="dark"] .badge.bg-light {
    background-color: var(--im-border) !important;
    color: var(--im-text) !important;
}

/* --- text-bg-* Bootstrap color utilities --- */
[data-theme="dark"] .text-bg-primary {
    background-color: rgba(159, 168, 218, 0.15) !important;
    color: var(--im-primary) !important;
}
[data-theme="dark"] .text-bg-success {
    background-color: rgba(159, 168, 218, 0.15) !important;
    color: var(--im-success) !important;
}
[data-theme="dark"] .text-bg-info {
    background-color: rgba(159, 168, 218, 0.15) !important;
    color: var(--im-info) !important;
}
[data-theme="dark"] .text-bg-secondary {
    background-color: rgba(113, 128, 150, 0.15) !important;
    color: var(--im-text-secondary) !important;
}
[data-theme="dark"] .text-bg-danger {
    background-color: rgba(248, 113, 113, 0.15) !important;
    color: var(--im-danger) !important;
}
[data-theme="dark"] .text-bg-warning {
    background-color: rgba(251, 191, 36, 0.15) !important;
    color: var(--im-warning) !important;
}

/* Cards with text-bg-* - inner text must inherit dark mode colors */
[data-theme="dark"] .card.text-bg-primary,
[data-theme="dark"] .card.text-bg-success,
[data-theme="dark"] .card.text-bg-info,
[data-theme="dark"] .card.text-bg-secondary,
[data-theme="dark"] .card.text-bg-danger,
[data-theme="dark"] .card.text-bg-warning {
    border-color: var(--im-border) !important;
}
[data-theme="dark"] .card.text-bg-primary .card-title,
[data-theme="dark"] .card.text-bg-success .card-title,
[data-theme="dark"] .card.text-bg-info .card-title,
[data-theme="dark"] .card.text-bg-secondary .card-title,
[data-theme="dark"] .card.text-bg-danger .card-title,
[data-theme="dark"] .card.text-bg-warning .card-title {
    color: inherit !important;
}
[data-theme="dark"] .card.text-bg-primary .card-text,
[data-theme="dark"] .card.text-bg-success .card-text,
[data-theme="dark"] .card.text-bg-info .card-text,
[data-theme="dark"] .card.text-bg-secondary .card-text {
    color: var(--im-text) !important;
}
[data-theme="dark"] .card.text-bg-primary small,
[data-theme="dark"] .card.text-bg-success small,
[data-theme="dark"] .card.text-bg-info small,
[data-theme="dark"] .card.text-bg-secondary small,
[data-theme="dark"] .card.text-bg-danger small,
[data-theme="dark"] .card.text-bg-warning small {
    color: var(--im-text-muted) !important;
}
[data-theme="dark"] .card.text-bg-primary .display-6,
[data-theme="dark"] .card.text-bg-success .display-6,
[data-theme="dark"] .card.text-bg-info .display-6,
[data-theme="dark"] .card.text-bg-secondary .display-6 {
    color: var(--im-text) !important;
}

/* --- card-header bg-success in dark mode --- */
[data-theme="dark"] .card-header.bg-success {
    background-color: rgba(159, 168, 218, 0.15) !important;
    color: var(--im-success) !important;
    border-color: var(--im-border) !important;
}
[data-theme="dark"] .card-header.bg-success.text-white {
    color: var(--im-success) !important;
}
[data-theme="dark"] .card-header.bg-success .badge {
    background-color: rgba(159, 168, 218, 0.2) !important;
    color: var(--im-success) !important;
}
[data-theme="dark"] .card-header.bg-dark,
[data-theme="dark"] .bg-dark:not(.btn) {
    background-color: var(--im-bg-elevated) !important;
    border-color: var(--im-border) !important;
    color: var(--im-text) !important;
}
[data-theme="dark"] .card-header.bg-dark .badge.bg-light {
    background-color: var(--im-border) !important;
    color: var(--im-text) !important;
}

/* --- Badges with Bootstrap bg-* classes --- */
[data-theme="dark"] .badge.bg-secondary {
    background-color: var(--im-text-muted) !important;
}
[data-theme="dark"] .badge.bg-primary {
    background-color: var(--im-primary) !important;
}
[data-theme="dark"] .badge.bg-success {
    background-color: var(--im-success) !important;
}
[data-theme="dark"] .badge.bg-danger {
    background-color: var(--im-danger) !important;
}
[data-theme="dark"] .badge.bg-warning {
    background-color: var(--im-warning) !important;
    color: #000 !important;
}
[data-theme="dark"] .badge.bg-info {
    background-color: var(--im-info) !important;
}

/* --- HR, Links --- */
[data-theme="dark"] hr {
    border-color: var(--im-border);
    opacity: 0.3;
}
[data-theme="dark"] a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item) {
    color: var(--im-primary);
}
[data-theme="dark"] a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item):hover {
    color: var(--im-primary-light);
}

/* --- Rounded circle icon containers (dashboard stat cards) --- */
[data-theme="dark"] .rounded-circle.bg-primary.bg-opacity-10,
[data-theme="dark"] .rounded-circle[class*="bg-"][class*="bg-opacity-10"] {
    opacity: 0.9;
}

/* --- Bootstrap shadow utilities --- */
[data-theme="dark"] .shadow,
[data-theme="dark"] .shadow-sm,
[data-theme="dark"] .shadow-lg {
    box-shadow: var(--im-shadow) !important;
}

/* --- Pagination --- */
[data-theme="dark"] .page-link {
    background-color: var(--im-bg-card);
    border-color: var(--im-border);
    color: var(--im-primary);
}
[data-theme="dark"] .page-link:hover {
    background-color: var(--im-bg-hover);
    border-color: var(--im-border);
    color: var(--im-primary-light);
}
[data-theme="dark"] .page-item.active .page-link {
    background-color: var(--im-primary);
    border-color: var(--im-primary);
    color: #fff;
}
[data-theme="dark"] .page-item.disabled .page-link {
    background-color: var(--im-bg-elevated);
    border-color: var(--im-border);
    color: var(--im-text-muted);
}

/* --- Form specific dark mode --- */
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-control[readonly] {
    background-color: var(--im-bg-elevated);
    color: var(--im-text-muted);
}
[data-theme="dark"] .form-check-label {
    color: var(--im-text);
}
[data-theme="dark"] .form-text {
    color: var(--im-text-muted) !important;
}

/* --- Toast dark mode --- */
[data-theme="dark"] .toast {
    background-color: var(--im-bg-elevated);
    border-color: var(--im-border);
    box-shadow: var(--im-shadow-lg);
}
[data-theme="dark"] .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* --- code element dark mode --- */
[data-theme="dark"] code {
    background-color: rgba(159, 168, 218, 0.1);
    color: #f0abfc;
    border-radius: 4px;
    padding: 0.15em 0.4em;
}

/* --- thead default styling (without .table-light class) --- */
[data-theme="dark"] thead,
[data-theme="dark"] thead th {
    color: var(--im-text-secondary) !important;
    border-color: var(--im-border) !important;
}

/* --- strong and b inside dark mode --- */
[data-theme="dark"] strong,
[data-theme="dark"] b {
    color: var(--im-text);
}

/* --- .display-* headings --- */
[data-theme="dark"] .display-1,
[data-theme="dark"] .display-2,
[data-theme="dark"] .display-3,
[data-theme="dark"] .display-4,
[data-theme="dark"] .display-5,
[data-theme="dark"] .display-6 {
    color: var(--im-text) !important;
}

/* --- small elements inherit proper text color --- */
[data-theme="dark"] small:not([class*="text-"]) {
    color: var(--im-text-secondary);
}

/* --- .card-body text color --- */
[data-theme="dark"] .card-body {
    color: var(--im-text);
}

/* --- .card-title / .card-text text color --- */
[data-theme="dark"] .card-title {
    color: var(--im-text) !important;
}

/* --- .progress-bar background in dark mode --- */
[data-theme="dark"] .progress {
    background-color: var(--im-bg-elevated);
}

/* --- .text-white override in dark mode where it hurts readability --- */
[data-theme="dark"] .card-header.text-white:not(.bg-danger) {
    color: var(--im-text) !important;
}

/* --- bg-primary card header in dark mode --- */
[data-theme="dark"] .card-header.bg-primary {
    background-color: rgba(159, 168, 218, 0.15) !important;
    color: var(--im-primary) !important;
    border-color: var(--im-border) !important;
}

/* --- .alert in dark mode --- */
[data-theme="dark"] .alert-warning {
    background-color: var(--im-warning-bg) !important;
    color: var(--im-warning) !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
}
[data-theme="dark"] .alert-danger {
    background-color: var(--im-danger-bg) !important;
    color: var(--im-danger) !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
}
[data-theme="dark"] .alert-success {
    background-color: var(--im-success-bg) !important;
    color: var(--im-success) !important;
    border-color: rgba(159, 168, 218, 0.3) !important;
}
[data-theme="dark"] .alert-info {
    background-color: var(--im-info-bg) !important;
    color: var(--im-info) !important;
    border-color: rgba(159, 168, 218, 0.3) !important;
}

/* --- .form-label dark mode --- */
[data-theme="dark"] .form-label {
    color: var(--im-text);
}

/* --- .input-group-text dark mode --- */
[data-theme="dark"] .input-group-text {
    background-color: var(--im-bg-elevated);
    border-color: var(--im-border);
    color: var(--im-text-muted);
}

/* --- .btn-outline-* dark mode text on hover --- */
[data-theme="dark"] .btn-outline-secondary {
    color: var(--im-text-secondary);
    border-color: var(--im-border);
}
[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: var(--im-bg-elevated);
    color: var(--im-text);
    border-color: var(--im-text-muted);
}
[data-theme="dark"] .btn-outline-primary {
    color: var(--im-primary);
    border-color: var(--im-primary);
}
[data-theme="dark"] .btn-outline-danger {
    color: var(--im-danger);
    border-color: var(--im-danger);
}
[data-theme="dark"] .btn-outline-warning {
    color: var(--im-warning);
    border-color: var(--im-warning);
}
[data-theme="dark"] .btn-outline-success {
    color: var(--im-success);
    border-color: var(--im-success);
}
[data-theme="dark"] .btn-outline-purple {
    color: #9fa8da;
    border-color: #9fa8da;
}
[data-theme="dark"] .btn-outline-purple:hover,
[data-theme="dark"] .btn-check:checked + .btn-outline-purple {
    background-color: #2c387e;
    border-color: #2c387e;
    color: #fff;
}
[data-theme="dark"] .server-panel__header--target {
    background: linear-gradient(135deg, #1a237e, #3949ab);
}

/* --- Breadcrumb dark mode --- */
[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: var(--im-text-muted);
}
[data-theme="dark"] .breadcrumb-item.active {
    color: var(--im-text-muted);
}
[data-theme="dark"] .breadcrumb {
    --bs-breadcrumb-divider-color: var(--im-text-muted);
}

/* --- .border-* utility classes that need dark override --- */
[data-theme="dark"] .card.border-primary {
    border-color: var(--im-primary) !important;
}
[data-theme="dark"] .card.border-success {
    border-color: var(--im-success) !important;
}
[data-theme="dark"] .card.border-danger {
    border-color: var(--im-danger) !important;
}
[data-theme="dark"] .card.border-warning {
    border-color: var(--im-warning) !important;
}
[data-theme="dark"] .card.border-info {
    border-color: var(--im-info) !important;
}
[data-theme="dark"] .card.border-secondary {
    border-color: var(--im-text-muted) !important;
}

/* ============================================================
   Server Info Cards (detail page)
   ============================================================ */
.server-info-card {
    border-radius: var(--im-radius-lg);
    border: 1px solid var(--im-border-light);
    overflow: hidden;
    transition: all var(--im-transition);
}

.server-info-card:hover {
    box-shadow: var(--im-shadow-md);
}

.server-info-card .card-header {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.server-info-card__header--zdroj {
    background: linear-gradient(135deg, #455a64 0%, #607d8b 100%) !important;
    color: #fff !important;
    border: none !important;
}

.server-info-card__header--cil {
    background: linear-gradient(135deg, #2c387e 0%, #3949ab 100%) !important;
    color: #fff !important;
    border: none !important;
}

[data-theme="dark"] .server-info-card__header--zdroj {
    background: linear-gradient(135deg, #37474f 0%, #546e7a 100%) !important;
}

[data-theme="dark"] .server-info-card__header--cil {
    background: linear-gradient(135deg, #0d1642 0%, #2c387e 100%) !important;
}

.server-info-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--im-border-light);
}

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

.server-info-row__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--im-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.server-info-row__icon--zdroj {
    background: rgba(96, 125, 139, 0.1);
    color: #607d8b;
}

.server-info-row__icon--cil {
    background: var(--im-success-bg);
    color: var(--im-success);
}

/* ============================================================
   Status Hero Card (detail page)
   ============================================================ */
.status-hero {
    border-radius: var(--im-radius-lg);
    text-align: center;
    padding: 2rem 1.5rem;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--im-border-light);
}

.status-hero--bezici {
    border-color: var(--im-primary);
    background: var(--im-primary-bg-subtle);
}

.status-hero--dokoncena {
    border-color: var(--im-success);
    background: var(--im-success-bg);
}

.status-hero--chyba {
    border-color: var(--im-danger);
    background: var(--im-danger-bg);
}

.status-hero--cekajici,
.status-hero--ve_fronte {
    border-color: var(--im-border);
    background: var(--im-bg-elevated);
}

.status-hero--zrusena {
    border-color: var(--im-warning);
    background: var(--im-warning-bg);
}

.status-hero__icon {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    display: block;
    line-height: 1;
}

.status-hero__label {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ============================================================
   Stats Grid (detail page)
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stats-grid__item {
    text-align: center;
    padding: 1.25rem 0.75rem;
    border-radius: var(--im-radius);
    background: var(--im-bg-elevated);
    border: 1px solid var(--im-border-light);
}

.stats-grid__value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stats-grid__label {
    font-size: 0.75rem;
    color: var(--im-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-top: 0.25rem;
}

@media (max-width: 575.98px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .stats-grid__value {
        font-size: 1.35rem;
    }
}

/* ============================================================
   Timeline Modern (detail page)
   ============================================================ */
.timeline-modern {
    position: relative;
    padding-left: 2rem;
}

.timeline-modern::before {
    content: '';
    position: absolute;
    left: 0.6rem;
    top: 0.75rem;
    bottom: 0.75rem;
    width: 2px;
    background: linear-gradient(to bottom, var(--im-border-light), var(--im-primary), var(--im-border-light));
    border-radius: 1px;
}

.timeline-modern__item {
    position: relative;
    padding-bottom: 1.5rem;
    padding-left: 0.75rem;
}

.timeline-modern__item:last-child {
    padding-bottom: 0;
}

.timeline-modern__dot {
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--im-bg-card);
    box-shadow: 0 0 0 2px var(--im-border);
    z-index: 1;
    transition: all var(--im-transition);
}

.timeline-modern__item:hover .timeline-modern__dot {
    transform: scale(1.2);
}

.timeline-modern__time {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--im-text-muted);
    margin-bottom: 0.15rem;
}

.timeline-modern__value {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--im-text);
}

.timeline-modern__meta {
    font-size: 0.82rem;
    color: var(--im-text-muted);
}

/* (step-wizard-modern removed – unified into .im-wizard above) */

/* ============================================================
   Section Heading with icon
   ============================================================ */
.section-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.section-heading__icon {
    width: 42px;
    height: 42px;
    border-radius: var(--im-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    background: var(--im-primary-bg);
    color: var(--im-primary);
}

.section-heading__text h1,
.section-heading__text h2,
.section-heading__text h3 {
    margin-bottom: 0;
}

.section-heading__text p {
    margin-bottom: 0;
    font-size: 0.88rem;
    color: var(--im-text-muted);
}

/* ============================================================
   Empty State Enhanced
   ============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
}

.empty-state__icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
    color: var(--im-primary);
    background: var(--im-primary-bg);
    margin-bottom: 1.5rem;
    position: relative;
}

.empty-state__icon::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px dashed var(--im-border);
    animation: emptyStateRotate 20s linear infinite;
}

@keyframes emptyStateRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.empty-state__icon i {
    display: inline-block;
    animation: floatBounce 3s ease-in-out infinite;
}

.empty-state__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--im-text);
    margin-bottom: 0.5rem;
}

.empty-state__text {
    font-size: 0.95rem;
    color: var(--im-text-muted);
    max-width: 440px;
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* ============================================================
   Admin Stats Cards (grid)
   ============================================================ */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* ============================================================
   Log Terminal Enhanced
   ============================================================ */
.log-terminal-wrapper {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #444;
    margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.log-terminal-toolbar {
    background: #323233;
    padding: 0.4rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 32px;
}

.log-terminal-toolbar__dots {
    display: none;
}

.log-terminal-toolbar__dot {
    display: none;
}

.log-terminal-toolbar__dot--red { display: none; }
.log-terminal-toolbar__dot--yellow { display: none; }
.log-terminal-toolbar__dot--green { display: none; }

.log-terminal-toolbar__title {
    font-family: var(--im-font-mono);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.log-terminal-toolbar__title::before {
    content: '>';
    margin-right: 0.4rem;
    color: var(--im-primary);
    font-weight: 700;
}

.log-terminal-toolbar .badge {
    margin-left: auto;
}

/* ============================================================
   Migration Flow Arrow (dashboard table)
   ============================================================ */
.migration-flow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.migration-flow__server {
    flex: 1;
    min-width: 0;
}

.migration-flow__server-host {
    font-weight: 500;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.migration-flow__server-user {
    font-size: 0.78rem;
    color: var(--im-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.migration-flow__arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--im-primary-bg);
    color: var(--im-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ============================================================
   Modern Navbar enhancements
   ============================================================ */
.navbar-im {
    padding: 0.65rem 0;
}

.navbar-im .navbar-brand {
    font-size: 1.2rem;
}

/* ============================================================
   Modern Footer
   ============================================================ */
.footer-im {
    background: var(--im-footer-bg);
    border-top: 1px solid var(--im-footer-border);
    padding: 2rem 0;
    margin-top: 4rem;
    color: var(--im-text-muted);
    font-size: 0.83rem;
}

/* ============================================================
   Card hover for clickable cards
   ============================================================ */
.card-hoverable:hover {
    box-shadow: var(--im-shadow-md);
    transform: translateY(-2px);
}

/* ============================================================
   Filter bar (admin pages)
   ============================================================ */
.filter-bar {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border-light);
    border-radius: var(--im-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--im-shadow-sm);
}

/* ============================================================
   Admin Hero Section
   ============================================================ */
.admin-hero {
    background: var(--im-gradient-hero);
    border-radius: var(--im-radius-lg);
    padding: 2rem 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.admin-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.admin-hero::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -5%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.admin-hero__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.admin-hero__title {
    color: #fff !important;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.admin-hero__subtitle {
    color: rgba(255, 255, 255, 0.75);
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
}

.admin-hero__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-hero__btn {
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #fff !important;
    padding: 0.5rem 1.1rem;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--im-radius-sm);
    transition: all var(--im-transition);
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(4px);
}

.admin-hero__btn:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.admin-hero__btn i {
    margin-right: 0.35em;
}

/* ============================================================
   Admin Stat Cards (new white style)
   ============================================================ */
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-stat-card {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border-light);
    border-radius: var(--im-radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--im-shadow-sm);
    transition: all var(--im-transition);
}

.admin-stat-card:hover {
    box-shadow: var(--im-shadow-md);
    transform: translateY(-2px);
}

.admin-stat-card__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--im-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.admin-stat-card__icon--primary {
    background: var(--im-primary-bg);
    color: var(--im-primary);
}

.admin-stat-card__icon--success {
    background: var(--im-success-bg);
    color: var(--im-success);
}

.admin-stat-card__icon--info {
    background: var(--im-info-bg);
    color: var(--im-info);
}

.admin-stat-card__icon--danger {
    background: var(--im-danger-bg);
    color: var(--im-danger);
}

.admin-stat-card__icon--warning {
    background: var(--im-warning-bg);
    color: var(--im-warning);
}

.admin-stat-card__icon--secondary {
    background: var(--im-border-light);
    color: var(--im-text-secondary);
}

.admin-stat-card__body {
    flex: 1;
    min-width: 0;
}

.admin-stat-card__value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--im-text);
}

.admin-stat-card__label {
    font-size: 0.82rem;
    color: var(--im-text-muted);
    font-weight: 500;
    margin-top: 0.15rem;
}

.admin-stat-card__sub {
    font-size: 0.75rem;
    color: var(--im-text-muted);
    margin-top: 0.35rem;
}

/* ============================================================
   Admin Status Segments (visual bar chart)
   ============================================================ */
.status-segments {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border-light);
    border-radius: var(--im-radius);
    padding: 1.5rem;
    box-shadow: var(--im-shadow-sm);
}

.status-segments__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--im-text);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-segments__bar {
    display: flex;
    height: 12px;
    border-radius: var(--im-radius-pill);
    overflow: hidden;
    margin-bottom: 1.25rem;
    background: var(--im-border-light);
}

.status-segments__bar-piece {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.status-segments__bar-piece--success { background: var(--im-success); }
.status-segments__bar-piece--primary { background: var(--im-primary); }
.status-segments__bar-piece--info { background: #29b6f6; }
.status-segments__bar-piece--warning { background: var(--im-warning); }
.status-segments__bar-piece--danger { background: var(--im-danger); }
.status-segments__bar-piece--secondary { background: #90a4ae; }

.status-segments__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.status-segments__legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--im-text-secondary);
}

.status-segments__legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-segments__legend-dot--success { background: var(--im-success); }
.status-segments__legend-dot--primary { background: var(--im-primary); }
.status-segments__legend-dot--info { background: #29b6f6; }
.status-segments__legend-dot--warning { background: var(--im-warning); }
.status-segments__legend-dot--danger { background: var(--im-danger); }
.status-segments__legend-dot--secondary { background: #90a4ae; }

.status-segments__legend-count {
    font-weight: 700;
    color: var(--im-text);
}

/* ============================================================
   Admin Activity Timeline
   ============================================================ */
.activity-timeline {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border-light);
    border-radius: var(--im-radius);
    box-shadow: var(--im-shadow-sm);
    overflow: hidden;
}

.activity-timeline__header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--im-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.activity-timeline__header-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--im-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-timeline__item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--im-border-light);
    transition: background var(--im-transition);
}

.activity-timeline__item:last-child {
    border-bottom: none;
}

.activity-timeline__item:hover {
    background: var(--im-bg-hover);
}

.activity-timeline__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.activity-timeline__icon--auth {
    background: var(--im-primary-bg);
    color: var(--im-primary);
}

.activity-timeline__icon--admin {
    background: var(--im-warning-bg);
    color: var(--im-warning);
}

.activity-timeline__icon--job {
    background: var(--im-success-bg);
    color: var(--im-success);
}

.activity-timeline__icon--error {
    background: var(--im-danger-bg);
    color: var(--im-danger);
}

.activity-timeline__body {
    flex: 1;
    min-width: 0;
}

.activity-timeline__event {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--im-text);
    font-family: var(--im-font-mono);
    letter-spacing: -0.01em;
}

.activity-timeline__meta {
    font-size: 0.8rem;
    color: var(--im-text-muted);
    margin-top: 0.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

.activity-timeline__empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--im-text-muted);
    font-size: 0.9rem;
}

/* ============================================================
   Admin Search Bar (enhanced)
   ============================================================ */
.admin-search-bar {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border-light);
    border-radius: var(--im-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--im-shadow-sm);
}

.admin-search-bar .search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.admin-search-bar .search-input-wrap i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--im-text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.admin-search-bar .search-input-wrap input {
    padding-left: 2.5rem;
    border-radius: var(--im-radius-pill);
    border: 1px solid var(--im-border);
    background: var(--im-bg-input);
    transition: all var(--im-transition);
}

.admin-search-bar .search-input-wrap input:focus {
    border-color: var(--im-primary);
    box-shadow: 0 0 0 3px var(--im-primary-bg);
}

/* ============================================================
   Admin Table (enhanced)
   ============================================================ */
.admin-table-card {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border-light);
    border-radius: var(--im-radius);
    box-shadow: var(--im-shadow-sm);
    overflow: hidden;
}

.admin-table-card .table {
    margin-bottom: 0;
}

.admin-table-card .table thead th {
    background: var(--im-bg-elevated);
    border-bottom: 2px solid var(--im-border);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--im-text-muted);
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.admin-table-card .table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--im-border-light);
    font-size: 0.88rem;
}

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

.admin-table-card .table tbody tr:hover {
    background: var(--im-bg-hover);
}

.admin-table-card .table tbody tr:nth-child(even) {
    background: var(--im-table-stripe);
}

.admin-table-card .table tbody tr:nth-child(even):hover {
    background: var(--im-bg-hover);
}

/* User avatar circle */
.user-avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

.user-avatar-circle--primary {
    background: var(--im-primary-bg);
    color: var(--im-primary);
}

.user-avatar-circle--danger {
    background: var(--im-danger-bg);
    color: var(--im-danger);
}

/* ============================================================
   Filter Pills (admin ulohy)
   ============================================================ */
.filter-pills {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border-light);
    border-radius: var(--im-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--im-shadow-sm);
}

.filter-pills__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.filter-pills__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--im-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.25rem;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--im-radius-pill);
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--im-border);
    background: var(--im-bg-input);
    color: var(--im-text-secondary);
    text-decoration: none;
    transition: all var(--im-transition);
    cursor: pointer;
}

.filter-pill:hover {
    border-color: var(--im-primary);
    color: var(--im-primary);
    background: var(--im-primary-bg);
}

.filter-pill--active {
    background: var(--im-primary) !important;
    color: #fff !important;
    border-color: var(--im-primary) !important;
}

.filter-pill--success.filter-pill--active {
    background: var(--im-success) !important;
    border-color: var(--im-success) !important;
}

.filter-pill--danger.filter-pill--active {
    background: var(--im-danger) !important;
    border-color: var(--im-danger) !important;
}

.filter-pill--warning.filter-pill--active {
    background: var(--im-warning) !important;
    border-color: var(--im-warning) !important;
    color: #000 !important;
}

.filter-pill--info.filter-pill--active {
    background: #29b6f6 !important;
    border-color: #29b6f6 !important;
}

.filter-pill--secondary.filter-pill--active {
    background: #78909c !important;
    border-color: #78909c !important;
}

.filter-pill__count {
    background: rgba(0, 0, 0, 0.08);
    padding: 0.1rem 0.45rem;
    border-radius: var(--im-radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
}

.filter-pill--active .filter-pill__count {
    background: rgba(255, 255, 255, 0.25);
}

/* Admin responsive */
@media (max-width: 767.98px) {
    .admin-hero {
        padding: 1.5rem;
        text-align: center;
    }

    .admin-hero__content {
        flex-direction: column;
        text-align: center;
    }

    .admin-hero__title {
        font-size: 1.35rem;
    }

    .admin-hero__actions {
        justify-content: center;
    }

    .admin-stat-grid {
        grid-template-columns: 1fr;
    }

    .admin-stat-card {
        padding: 1rem 1.25rem;
    }

    .admin-stat-card__icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .admin-stat-card__value {
        font-size: 1.35rem;
    }

    .activity-timeline__item {
        padding: 0.85rem 1rem;
        gap: 0.75rem;
    }

    .activity-timeline__meta {
        flex-direction: column;
        gap: 0.15rem;
    }

    /* Mobile: table to cards */
    .admin-table-card .table-to-cards thead {
        display: none;
    }

    .admin-table-card .table-to-cards tbody tr {
        display: block;
        background: var(--im-mobile-card-bg);
        border: 1px solid var(--im-border-light);
        border-radius: var(--im-radius-sm);
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .admin-table-card .table-to-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.4rem 0;
        border-bottom: 1px solid var(--im-border-light);
        font-size: 0.85rem;
    }

    .admin-table-card .table-to-cards tbody td:last-child {
        border-bottom: none;
        justify-content: flex-end;
        padding-top: 0.75rem;
    }

    .admin-table-card .table-to-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--im-text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .filter-pills__row {
        gap: 0.5rem;
    }

    .filter-pill {
        padding: 0.35rem 0.75rem;
        font-size: 0.78rem;
    }

    .status-segments__legend {
        gap: 0.35rem 1rem;
    }
}

/* ============================================================
   Detail Page V2 - Hero, Server Compare, Status, Stats, Timeline
   ============================================================ */

/* --- Detail Hero --- */
.detail-hero {
    background: var(--im-gradient-hero);
    border-radius: var(--im-radius-lg);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.detail-hero__bg-decor {
    position: absolute;
    top: -60%;
    right: -8%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.detail-hero__content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.detail-hero__left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-hero__breadcrumb .breadcrumb {
    margin: 0;
    font-size: 0.82rem;
}

.detail-hero__breadcrumb .breadcrumb-item a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}

.detail-hero__breadcrumb .breadcrumb-item a:hover {
    color: #fff;
}

.detail-hero__breadcrumb .breadcrumb-item.active {
    color: rgba(255,255,255,0.5);
}

.detail-hero__breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.4);
}

.detail-hero__title {
    color: #fff !important;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.detail-hero__badge-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-hero__status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 1rem;
    border-radius: var(--im-radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    color: #fff;
    backdrop-filter: blur(4px);
}

.detail-hero__status-badge--dokoncena {
    background: rgba(57, 73, 171, 0.35);
}

.detail-hero__status-badge--chyba {
    background: rgba(217, 48, 37, 0.35);
}

.detail-hero__status-badge--bezici {
    background: rgba(255,255,255,0.25);
}

.detail-hero__id {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
    font-family: var(--im-font-mono);
}

.detail-hero__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.detail-hero__btn-primary {
    background: #fff !important;
    color: var(--im-primary-dark) !important;
    border: none !important;
    font-weight: 600;
    padding: 0.55rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: var(--im-radius-sm);
    transition: all var(--im-transition);
}

.detail-hero__btn-primary:hover {
    background: rgba(255,255,255,0.9) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.detail-hero__btn-danger {
    background: rgba(217, 48, 37, 0.85) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    font-weight: 600;
    padding: 0.55rem 1.25rem;
    border-radius: var(--im-radius-sm);
    transition: all var(--im-transition);
}

.detail-hero__btn-danger:hover {
    background: rgba(217, 48, 37, 1) !important;
    color: #fff !important;
}

.detail-hero__btn-secondary {
    border: 1px solid rgba(255,255,255,0.35) !important;
    color: #fff !important;
    background: transparent !important;
    padding: 0.55rem 1.1rem;
    border-radius: var(--im-radius-sm);
    font-weight: 500;
    transition: all var(--im-transition);
}

.detail-hero__btn-secondary:hover {
    background: rgba(255,255,255,0.1) !important;
    border-color: rgba(255,255,255,0.55) !important;
    color: #fff !important;
}

.detail-hero__btn-ghost {
    color: rgba(255,255,255,0.7) !important;
    background: transparent !important;
    border: none !important;
    padding: 0.55rem 0.75rem;
    font-weight: 500;
    transition: all var(--im-transition);
}

.detail-hero__btn-ghost:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.08) !important;
    border-radius: var(--im-radius-sm);
}

/* --- Server Compare --- */
.server-compare {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 2rem;
}

.server-compare__card {
    flex: 1;
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    padding: 1.25rem 1rem;
    text-align: center;
    transition: all var(--im-transition);
    position: relative;
}

.server-compare__card--source {
    border-radius: var(--im-radius-lg) 0 0 var(--im-radius-lg);
    border-right: none;
}

.server-compare__card--target {
    border-radius: 0 var(--im-radius-lg) var(--im-radius-lg) 0;
    border-left: none;
}

.server-compare__card:hover {
    box-shadow: var(--im-shadow-md);
    z-index: 1;
}

.server-compare__icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin: 0 auto 0.65rem;
    transition: all var(--im-transition);
}

.server-compare__icon-wrap--source {
    background: linear-gradient(135deg, rgba(96, 125, 139, 0.12), rgba(96, 125, 139, 0.06));
    color: #607d8b;
    border: 2px solid rgba(96, 125, 139, 0.2);
}

.server-compare__icon-wrap--target {
    background: linear-gradient(135deg, var(--im-success-bg), rgba(57, 73, 171, 0.06));
    color: var(--im-success);
    border: 2px solid rgba(57, 73, 171, 0.2);
}

.server-compare__card:hover .server-compare__icon-wrap {
    transform: scale(1.05);
}

.server-compare__label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--im-text-muted);
    margin-bottom: 0.35rem;
}

.server-compare__host {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--im-text);
    margin-bottom: 0.65rem;
    word-break: break-all;
}

.server-compare__details {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
}

.server-compare__detail-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--im-text-secondary);
}

.server-compare__detail-item i {
    font-size: 0.9rem;
    opacity: 0.6;
}

.server-compare__ssl-on {
    color: var(--im-success);
    font-weight: 600;
}

.server-compare__ssl-off {
    color: var(--im-warning);
    font-weight: 600;
}

.server-compare__arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    flex-shrink: 0;
    background: var(--im-bg-card);
    border-top: 1px solid var(--im-border);
    border-bottom: 1px solid var(--im-border);
    position: relative;
    z-index: 2;
}

.server-compare__arrow-line {
    flex: 1;
    width: 2px;
    background: linear-gradient(to bottom, var(--im-border-light), var(--im-primary), var(--im-border-light));
}

.server-compare__arrow-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--im-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(44, 56, 126, 0.3);
}

/* --- Detail Status Indicator --- */
.detail-status {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--im-radius-lg);
    border: 2px solid var(--im-border-light);
    background: var(--im-bg-card);
    margin-bottom: 1.5rem;
    transition: all var(--im-transition);
}

.detail-status--bezici {
    border-color: var(--im-primary);
    background: var(--im-primary-bg-subtle);
}

.detail-status--dokoncena {
    border-color: var(--im-success);
    background: var(--im-success-bg);
}

.detail-status--chyba {
    border-color: var(--im-danger);
    background: var(--im-danger-bg);
}

.detail-status--zrusena {
    border-color: var(--im-warning);
    background: var(--im-warning-bg);
}

.detail-status__visual {
    flex-shrink: 0;
}

.detail-status__ring {
    position: relative;
    width: 76px;
    height: 76px;
}

.detail-status__ring-svg {
    width: 100%;
    height: 100%;
}

.detail-status__ring-progress {
    transition: stroke-dasharray 0.6s ease;
}

.detail-status__ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--im-primary);
    letter-spacing: -0.02em;
}

.detail-status__result {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.detail-status__result--success {
    background: var(--im-success-bg);
    color: var(--im-success);
    box-shadow: 0 0 0 6px rgba(57, 73, 171, 0.1);
}

.detail-status__result--error {
    background: var(--im-danger-bg);
    color: var(--im-danger);
    box-shadow: 0 0 0 6px rgba(217, 48, 37, 0.1);
}

.detail-status__result--cancelled {
    background: var(--im-warning-bg);
    color: var(--im-warning);
    box-shadow: 0 0 0 6px rgba(249, 171, 0, 0.1);
}

.detail-status__result--waiting {
    background: var(--im-bg-elevated);
    color: var(--im-text-muted);
    box-shadow: 0 0 0 6px var(--im-border-light);
}

.detail-status__text {
    flex: 1;
    min-width: 0;
}

.detail-status__label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--im-text);
    margin-bottom: 0.2rem;
}

.detail-status__meta {
    font-size: 0.85rem;
    color: var(--im-text-muted);
}

.detail-status__progress-bar {
    height: 8px;
    background: var(--im-border-light);
    border-radius: var(--im-radius-pill);
    margin-top: 0.75rem;
    overflow: hidden;
    max-width: 400px;
}

.detail-status__progress-fill {
    height: 100%;
    background: var(--im-gradient);
    border-radius: var(--im-radius-pill);
    transition: width 0.6s ease;
}

/* --- Detail Stats --- */
.detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.detail-stats__box {
    text-align: center;
    padding: 1rem 0.75rem;
    border-radius: var(--im-radius);
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    box-shadow: var(--im-shadow-sm);
    transition: all var(--im-transition);
}

.detail-stats__box:hover {
    box-shadow: var(--im-shadow-md);
    transform: translateY(-2px);
}

.detail-stats__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--im-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin: 0 auto 0.75rem;
}

.detail-stats__icon--total {
    background: var(--im-primary-bg);
    color: var(--im-primary);
}

.detail-stats__icon--synced {
    background: var(--im-success-bg);
    color: var(--im-success);
}

.detail-stats__icon--data {
    background: var(--im-info-bg);
    color: var(--im-info);
}

.detail-stats__value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--im-text);
    margin-bottom: 0.2rem;
}

.detail-stats__label {
    font-size: 0.75rem;
    color: var(--im-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* --- Detail Timeline --- */
/* ============================================================
   Detail Info Bar - compact server + stats summary
   ============================================================ */
.detail-info-bar {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border-light);
    border-radius: var(--im-radius-sm);
    padding: 0.85rem 1.15rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.detail-info-bar__servers {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 200px;
}

.detail-info-bar__server {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    font-size: 0.82rem;
}

.detail-info-bar__label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--im-text-muted);
    width: 100%;
}

.detail-info-bar__user {
    color: var(--im-text-muted);
    font-size: 0.78rem;
}

.detail-info-bar__port {
    color: var(--im-text-muted);
    font-size: 0.72rem;
}

.detail-info-bar__stats {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    padding-left: 1rem;
    border-left: 1px solid var(--im-border-light);
}

.detail-info-bar__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.detail-info-bar__stat-val {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--im-text);
    line-height: 1.2;
}

.detail-info-bar__stat-lbl {
    font-size: 0.65rem;
    color: var(--im-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-info-bar__progress {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--im-border-light);
}

@media (max-width: 767.98px) {
    .detail-info-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .detail-info-bar__stats {
        border-left: none;
        padding-left: 0;
        padding-top: 0.5rem;
        border-top: 1px solid var(--im-border-light);
        justify-content: space-around;
    }
}

.detail-timeline {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius-sm);
    overflow: hidden;
    margin-bottom: 1rem;
}

.detail-timeline__header {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--im-border-light);
    font-size: 0.85rem;
    color: var(--im-text);
    display: flex;
    align-items: center;
    background: var(--im-bg);
    font-weight: 600;
}

.detail-timeline__body {
    padding: 0.85rem 1rem;
}

.detail-timeline__track {
    position: relative;
    padding-left: 1.75rem;
}

.detail-timeline__track::before {
    display: none;
}

.detail-timeline__entry {
    position: relative;
    padding-bottom: 1rem;
}

/* Line segment connecting this dot to the next dot */
.detail-timeline__entry::before {
    content: '';
    position: absolute;
    left: calc(-1.75rem + 5px);
    top: 15px;
    bottom: -3px;
    width: 2px;
    background: var(--im-border);
    border-radius: 1px;
}

.detail-timeline__entry:last-child {
    padding-bottom: 0;
}

/* No connecting line after last entry -- clean endpoint */
.detail-timeline__entry:last-child::before {
    display: none;
}

/* Visual end marker for completed timelines */
.detail-timeline__track--ended .detail-timeline__entry:last-child .detail-timeline__dot {
    box-shadow: 0 0 0 3px var(--im-bg-card), 0 0 0 5px currentColor;
}

.detail-timeline__dot {
    position: absolute;
    left: -1.75rem;
    top: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--im-bg-card);
    z-index: 1;
}

.detail-timeline__dot--secondary { background: #90a4ae; }
.detail-timeline__dot--info { background: var(--im-info); }
.detail-timeline__dot--primary { background: var(--im-primary); }
.detail-timeline__dot--success { background: var(--im-success); }
.detail-timeline__dot--danger { background: var(--im-danger); }
.detail-timeline__dot--warning { background: var(--im-warning); }

.detail-timeline__entry:hover .detail-timeline__dot {
    transform: scale(1.2);
}

.detail-timeline__content {
    padding-left: 0.35rem;
}

.detail-timeline__event {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--im-text-muted);
    line-height: 1;
}

.detail-timeline__datetime {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--im-text);
}

.detail-timeline__duration {
    font-size: 0.78rem;
    color: var(--im-text-muted);
}

/* --- Detail Page Responsive --- */
@media (max-width: 767.98px) {
    .detail-hero {
        padding: 1.5rem;
    }

    .detail-hero__title {
        font-size: 1.35rem;
    }

    .detail-hero__content {
        flex-direction: column;
        gap: 1rem;
    }

    .detail-hero__actions {
        width: 100%;
    }

    .detail-hero__actions .btn {
        flex: 1;
        min-width: 0;
        font-size: 0.82rem;
        padding: 0.5rem 0.75rem;
    }

    .server-compare {
        flex-direction: column;
    }

    .server-compare__card--source {
        border-radius: var(--im-radius-lg) var(--im-radius-lg) 0 0;
        border-right: 1px solid var(--im-border);
        border-bottom: none;
    }

    .server-compare__card--target {
        border-radius: 0 0 var(--im-radius-lg) var(--im-radius-lg);
        border-left: 1px solid var(--im-border);
        border-top: none;
    }

    .server-compare__arrow {
        flex-direction: row;
        width: auto;
        height: 48px;
        border-top: none;
        border-bottom: none;
        border-left: 1px solid var(--im-border);
        border-right: 1px solid var(--im-border);
    }

    .server-compare__arrow-line {
        flex: 1;
        height: 2px;
        width: auto;
        background: linear-gradient(to right, var(--im-border-light), var(--im-primary), var(--im-border-light));
    }

    .detail-status {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }

    .detail-status__progress-bar {
        margin-left: auto;
        margin-right: auto;
    }

    .detail-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .detail-stats__value {
        font-size: 1.35rem;
    }

    .detail-stats__box {
        padding: 1rem 0.5rem;
    }

    .detail-stats__icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

@media (max-width: 479.98px) {
    .detail-hero__actions {
        flex-direction: column;
    }

    .detail-hero__actions .btn {
        width: 100%;
    }
}

/* ============================================================
   Migration Cards Grid (prehled.php, hromadny_import.php)
   ============================================================ */

/* Container: 2-column card grid */
#tabulka-uloh,
#tabulka-uloh-import,
.mig-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (max-width: 991.98px) {
    #tabulka-uloh,
    #tabulka-uloh-import,
    .mig-grid {
        grid-template-columns: 1fr;
    }
}

.mig-row {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.15rem;
    background: var(--im-bg-card);
    border: 1px solid var(--im-border-light);
    border-left: 4px solid var(--im-border);
    border-radius: var(--im-radius-sm);
    text-decoration: none;
    color: var(--im-text);
    position: relative;
    overflow: hidden;
    box-shadow: var(--im-shadow-sm);
    transition: all var(--im-transition);
}


/* Status-based left accent + subtle background tint */
.mig-row[data-stav="dokoncena"] {
    border-left-color: #2e7d32;
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.06) 0%, var(--im-bg-card) 50%);
}
.mig-row[data-stav="bezici"] {
    border-left-color: var(--im-primary);
    background: linear-gradient(135deg, var(--im-primary-bg-subtle) 0%, var(--im-bg-card) 50%);
    animation: mig-pulse 2.5s ease-in-out infinite;
}
@keyframes mig-pulse {
    0%, 100% { box-shadow: var(--im-shadow-sm); }
    50% { box-shadow: 0 0 0 2px var(--im-primary-bg), var(--im-shadow); }
}
.mig-row[data-stav="ve_fronte"] {
    border-left-color: var(--im-info);
    background: linear-gradient(135deg, var(--im-info-bg) 0%, var(--im-bg-card) 50%);
}
.mig-row[data-stav="chyba"] {
    border-left-color: var(--im-danger);
    background: linear-gradient(135deg, var(--im-danger-bg) 0%, var(--im-bg-card) 50%);
}
.mig-row[data-stav="zrusena"] {
    border-left-color: var(--im-warning);
    background: linear-gradient(135deg, var(--im-warning-bg) 0%, var(--im-bg-card) 50%);
    opacity: 0.75;
}
.mig-row[data-stav="cekajici"] {
    border-left-color: var(--im-text-muted);
    opacity: 0.85;
}

.mig-row:hover {
    box-shadow: var(--im-shadow-md);
    color: var(--im-text);
    text-decoration: none;
    transform: translateY(-2px);
}

/* Card: status column */
.mig-row__status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    grid-row: 1 / -1;
}

.mig-row__main {
    min-width: 0;
    flex: 1;
}

.mig-row__title {
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
    color: var(--im-text);
}

.mig-row__id {
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--im-text-muted);
    background: var(--im-bg);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    margin-left: 0.25rem;
}

.mig-row__route {
    font-size: 0.78rem;
    color: var(--im-text-secondary);
    margin-bottom: 0;
    padding: 0.35rem 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem;
}

.mig-row__route small {
    color: var(--im-text-muted);
}

.mig-row__server {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    flex: 1;
}

.mig-row__server-host {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--im-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mig-row__server-user {
    font-size: 0.72rem;
    color: var(--im-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mig-row__arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--im-primary-bg);
    color: var(--im-primary);
    font-size: 1rem;
    margin: 0 0.25rem;
}

.mig-row__meta {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.76rem;
    color: var(--im-text-muted);
    grid-row: 1 / -1;
    grid-column: 3;
}

.mig-row__stat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--im-text-secondary);
    font-weight: 500;
}

.mig-row__stat i {
    color: var(--im-primary);
    font-size: 0.82rem;
}

.mig-row__date {
    color: var(--im-text-muted);
    margin-left: auto;
}

.mig-row__actions {
    display: flex;
    gap: 0.25rem;
}

.mig-row__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--im-border-light);
    grid-column: 1 / -1;
}

.mig-row__progress-fill {
    height: 100%;
    background: var(--im-primary);
    transition: width 0.5s;
}

@media (max-width: 767.98px) {
    .mig-row__status {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .mig-row__meta {
        justify-content: flex-start;
        padding-top: 0.3rem;
        border-top: 1px solid var(--im-border-light);
    }
    .mig-row__route { flex-wrap: wrap; }
}

/* ============================================================
   Compact Wizard Layout (nova.php, hromadny_import.php)
   ============================================================ */

/* Page header - replaces hero banners */
.page-header-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-header-compact__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--im-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header-compact__title i {
    color: var(--im-primary);
    font-size: 1.1rem;
}

.page-header-compact__subtitle {
    font-size: 0.82rem;
    color: var(--im-text-muted);
    margin: 0;
}

.page-header-compact__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Tab stepper - replaces big circle stepper */
.step-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 1.25rem;
    background: var(--im-border-light);
    border-radius: var(--im-radius);
    padding: 3px;
    overflow: hidden;
}

.step-tabs__tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--im-text-muted);
    background: transparent;
    border-radius: calc(var(--im-radius) - 2px);
    transition: all 0.25s ease;
    cursor: default;
    white-space: nowrap;
}

.step-tabs__tab-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--im-border);
    color: var(--im-text-muted);
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.step-tabs__tab--active {
    background: var(--im-bg-card);
    color: var(--im-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.step-tabs__tab--active .step-tabs__tab-num {
    background: var(--im-primary);
    color: #fff;
}

.step-tabs__tab--done {
    color: var(--im-success);
}

.step-tabs__tab--done .step-tabs__tab-num {
    background: var(--im-success);
    color: #fff;
}

/* Compact server panels */
.server-panels {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    margin-bottom: 1rem;
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius);
    overflow: hidden;
    background: var(--im-bg-card);
}

.server-panel {
    padding: 0;
}

.server-panel__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.server-panel__header--source {
    background: linear-gradient(135deg, #546e7a, #78909c);
}

.server-panel__header--target {
    background: linear-gradient(135deg, #1a237e, #3949ab);
}

.server-panel__header i {
    font-size: 0.9rem;
}

.server-panel__body {
    padding: 0.85rem 1rem;
}

.server-panel__body .mb-3 {
    margin-bottom: 0.6rem !important;
}

.server-panel__body .mb-3:last-child {
    margin-bottom: 0 !important;
}

.server-panel__body .form-label {
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.server-panel__body .form-control,
.server-panel__body .form-select {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
}

.server-panel__body .input-group-text {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}

.server-panels__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    background: var(--im-bg);
    border-left: 1px solid var(--im-border);
    border-right: 1px solid var(--im-border);
}

.server-panels__arrow-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--im-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(44, 56, 126, 0.25);
}

/* Compact verify buttons */
.server-panel__verify {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.server-panel__verify .btn {
    font-size: 0.78rem;
    padding: 0.3rem 0.75rem;
}

/* Compact meta bar (name + schedule inline) */
.meta-bar-compact {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.meta-bar-compact > * {
    flex: 1;
    min-width: 180px;
}

.meta-bar-compact .form-label {
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.meta-bar-compact .form-control {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
}

/* Compact wizard navigation */
.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--im-border-light);
}

.wizard-footer .btn {
    font-size: 0.88rem;
}

/* Compact settings section for step 2 */
.compact-settings {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.compact-settings__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: var(--im-bg);
    border-bottom: 1px solid var(--im-border-light);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--im-text);
}

.compact-settings__header i {
    color: var(--im-primary);
}

.compact-settings__body {
    padding: 0.85rem 1rem;
}

/* Compact summary for step 3 */
.summary-compact {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.summary-compact__server {
    padding: 1rem;
    text-align: center;
}

.summary-compact__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0.4rem;
}

.summary-compact__icon--source {
    background: linear-gradient(135deg, #546e7a, #78909c);
}

.summary-compact__icon--target {
    background: linear-gradient(135deg, #2c387e, #5c6bc0);
}

.summary-compact__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--im-text-muted);
    font-weight: 600;
}

.summary-compact__host {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--im-text);
    margin-top: 0.15rem;
}

.summary-compact__user {
    font-size: 0.82rem;
    color: var(--im-text-secondary);
}

.summary-compact__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    background: var(--im-bg);
    border-left: 1px solid var(--im-border);
    border-right: 1px solid var(--im-border);
}

.summary-compact__arrow-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--im-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

/* Compact settings tags */
.compact-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.compact-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--im-primary-bg);
    color: var(--im-primary-dark);
    padding: 0.2rem 0.6rem;
    border-radius: var(--im-radius-pill);
    font-size: 0.75rem;
    font-weight: 500;
}

.compact-tag i {
    font-size: 0.65rem;
}

/* Compact upload section for hromadny_import */
.upload-compact {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem;
    background: var(--im-bg-card);
    border: 2px dashed var(--im-border);
    border-radius: var(--im-radius);
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.upload-compact:hover,
.upload-compact--dragover {
    border-color: var(--im-primary);
    background: var(--im-primary-bg-subtle);
}

.upload-compact__icon {
    font-size: 2rem;
    color: var(--im-primary);
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--im-primary-bg);
    border-radius: var(--im-radius);
}

.upload-compact__content {
    flex: 1;
    min-width: 0;
}

.upload-compact__title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--im-text);
}

.upload-compact__subtitle {
    font-size: 0.78rem;
    color: var(--im-text-muted);
    margin-top: 0.1rem;
}

.upload-compact__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Compact import step panels */
.import-panel {
    background: var(--im-bg-card);
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.import-panel__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: var(--im-bg);
    border-bottom: 1px solid var(--im-border-light);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--im-text);
    flex-wrap: wrap;
}

.import-panel__header-badges {
    display: flex;
    gap: 0.35rem;
    margin-left: auto;
}

.import-panel__body {
    padding: 0.85rem 1rem;
}

.import-panel__body--flush {
    padding: 0;
}

.import-panel__footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: var(--im-bg);
    border-top: 1px solid var(--im-border-light);
    flex-wrap: wrap;
}

/* Compact file struct reference */
.file-struct-compact {
    font-size: 0.78rem;
    background: var(--im-bg);
    border: 1px solid var(--im-border-light);
    border-radius: var(--im-radius-sm);
    padding: 0.65rem 0.85rem;
}

.file-struct-compact summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--im-text-secondary);
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.file-struct-compact table {
    width: 100%;
    margin-top: 0.5rem;
}

.file-struct-compact td {
    padding: 0.15rem 0.35rem;
    border-bottom: 1px solid var(--im-border-light);
}

.file-struct-compact td:first-child {
    font-weight: 700;
    width: 28px;
    color: var(--im-primary);
}

/* Compact import history */
.import-history-compact {
    margin-top: 1.5rem;
}

.import-history-compact__title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--im-text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Responsive for compact panels */
@media (max-width: 767.98px) {
    .server-panels {
        grid-template-columns: 1fr;
    }

    .server-panels__arrow {
        width: auto;
        height: 36px;
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--im-border);
        border-bottom: 1px solid var(--im-border);
    }

    .summary-compact {
        grid-template-columns: 1fr;
    }

    .summary-compact__arrow {
        width: auto;
        height: 36px;
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--im-border);
        border-bottom: 1px solid var(--im-border);
    }

    .step-tabs__tab {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }

    .step-tabs__tab-num {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }

    .upload-compact {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .upload-compact__actions {
        width: 100%;
        justify-content: center;
    }

    .meta-bar-compact {
        flex-direction: column;
    }

    .page-header-compact {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 575.98px) {
    .step-tabs {
        flex-direction: column;
        gap: 2px;
    }

    .step-tabs__tab {
        justify-content: flex-start;
    }
}

/* ============================================================
   Full HD & Large Screen Optimization (≥1400px)
   ============================================================ */

/* Wider container for large screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
}

@media (min-width: 1600px) {
    .container {
        max-width: 1540px;
    }
}

/* Full-width heroes – break out of container on large screens */
@media (min-width: 1200px) {
    main.container > .wizard-hero,
    main.container > .dashboard-hero,
    main.container > .admin-hero,
    main.container > .detail-hero {
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        border-radius: 0;
        padding-left: calc(50vw - 50% + 2.5rem);
        padding-right: calc(50vw - 50% + 2.5rem);
    }
}

/* Migration card grid: 3 columns on Full HD */
@media (min-width: 1400px) {
    .migration-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

/* Admin stat cards: always 4 columns on xl+ */
@media (min-width: 1200px) {
    .admin-stat-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
}

/* Server flow wider on Full HD */
@media (min-width: 1400px) {
    .server-flow__body {
        padding: 1.5rem 1.75rem;
    }

    .server-flow__header {
        padding: 1.1rem 1.5rem;
        font-size: 1rem;
    }

    .server-flow__arrow {
        width: 72px;
    }

    .server-flow__arrow-icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
}

/* Stats grid wider on large screens */
@media (min-width: 1400px) {
    .stats-grid {
        gap: 1.25rem;
    }

    .stats-grid__item {
        padding: 1.5rem 1rem;
    }

    .detail-stats {
        gap: 1rem;
    }

    .detail-stats__box {
        padding: 1.25rem 1rem;
    }
}

/* Stat bar wider on Full HD */
@media (min-width: 1400px) {
    .stat-bar {
        gap: 1.25rem;
    }
}

/* Wizard stepper wider on Full HD */
@media (min-width: 1400px) {
    .im-wizard {
        max-width: 720px;
        margin: 0 auto 2rem;
    }

    .im-wizard__number {
        width: 56px;
        height: 56px;
        font-size: 1.35rem;
    }

    .im-wizard__label {
        font-size: 0.85rem;
    }
}

/* Summary flow wider on Full HD */
@media (min-width: 1400px) {
    .summary-flow__box {
        padding: 1.75rem;
    }
}

/* Settings panel wider on Full HD */
@media (min-width: 1400px) {
    .settings-panel {
        padding: 1.5rem;
    }

    .settings-panel__header {
        font-size: 1.1rem;
    }
}

/* Admin table better spacing on large screens */
@media (min-width: 1400px) {
    .admin-table-card {
        padding: 0;
    }

    .admin-table-card .table th,
    .admin-table-card .table td {
        padding: 0.85rem 1.25rem;
    }
}

/* Filter pills wider on Full HD */
@media (min-width: 1400px) {
    .filter-pill {
        padding: 0.5rem 1.25rem;
        font-size: 0.88rem;
    }
}

/* Log terminal wider on Full HD */
@media (min-width: 1400px) {
    .log-terminal-wrapper {
        max-height: 600px;
    }
}

/* Detail page: server compare wider */
@media (min-width: 1400px) {
    .server-compare__card {
        padding: 1.5rem;
    }

    .server-compare__arrow {
        width: 72px;
    }
}

/* Timeline wider on Full HD */
@media (min-width: 1400px) {
    .detail-timeline__item {
        padding: 1.25rem 1.5rem;
    }

    .activity-timeline__item {
        padding: 1.1rem 1.5rem;
    }
}

/* Import step cards wider */
@media (min-width: 1400px) {
    .import-step-card {
        padding: 1.5rem;
    }
}

/* Upload zone wider */
@media (min-width: 1400px) {
    .upload-zone {
        padding: 3rem 2rem;
    }
}

/* Auth container centered on Full HD */
@media (min-width: 1400px) {
    .auth-container {
        max-width: 460px;
    }
}

/* ============================================================
   Tablet Responsive Improvements (768px - 991px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 991.98px) {
    .migration-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .detail-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   Small Mobile Improvements (≤575px)
   ============================================================ */
@media (max-width: 575.98px) {
    .wizard-hero__title,
    .dashboard-hero__title,
    .admin-hero__title,
    .detail-hero__title {
        font-size: 1.25rem;
    }

    .wizard-hero__subtitle,
    .dashboard-hero__subtitle,
    .admin-hero__subtitle {
        font-size: 0.82rem;
    }

    .server-flow__header {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .server-flow__header-icon {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .server-flow__body {
        padding: 1rem;
    }

    .server-flow__arrow {
        height: 48px;
        width: auto;
    }

    .server-flow__arrow-icon {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .im-wizard__number {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .im-wizard__label {
        font-size: 0.68rem;
    }

    .im-wizard__connector {
        height: 2px;
    }

    .summary-flow__box {
        padding: 1rem;
    }

    .summary-flow__arrow {
        height: 40px;
    }

    .settings-panel {
        padding: 1rem;
    }

    .upload-zone {
        padding: 1.5rem 1rem;
    }

    .upload-zone__icon {
        font-size: 2rem;
    }

    .migration-card__body {
        padding: 1rem;
    }

    .migration-card__title {
        font-size: 0.9rem;
    }

    .detail-timeline__item {
        padding: 0.75rem 1rem;
    }

    .admin-search-bar {
        padding: 0.75rem;
    }

    .filter-pills__row {
        flex-wrap: wrap;
    }

    .breadcrumb-im {
        font-size: 0.78rem;
    }
}

/* ============================================================
   Print styles
   ============================================================ */
@media print {
    .navbar-im,
    .navbar,
    .footer-im,
    #toast-kontejner,
    .btn,
    .theme-toggle {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    main.container {
        animation: none;
    }
}
