/* ============================================================
   SHIFT.CZ — Design System (2026)
   Modern, refined, Material Symbols
   ============================================================ */

:root {
    /* Brand — RESTIQ green (#068731) */
    --brand-50:  #ecfdf2;
    --brand-100: #d1fae0;
    --brand-200: #a7f3c1;
    --brand-300: #6ee7a0;
    --brand-400: #34d378;
    --brand-500: #11b95c;
    --brand-600: #068731;
    --brand-700: #057027;
    --brand-800: #045920;
    --brand-900: #033f17;

    /* Neutral — page off-white, cards pure white, black text */
    --bg:          #f5f6f5;
    --bg-elevated: #ffffff;
    --bg-muted:    #eef0ee;
    --bg-subtle:   #fafbfa;

    --border:        #d8dcd9;
    --border-strong: #c4c9c5;
    --border-subtle: #e8ebe9;

    --text-primary:   #000000;
    --text-secondary: #4b5563;
    --text-tertiary:  #9ca3af;
    --text-on-brand:  #ffffff;

    /* Semantic */
    --success-50:  #ecfdf2;
    --success-500: #068731;
    --success-700: #045920;
    --warning-50:  #fffbeb;
    --warning-500: #f59e0b;
    --warning-700: #b45309;
    --danger-50:   #fef2f2;
    --danger-500:  #ef4444;
    --danger-700:  #b91c1c;
    --info-50:     #ecfdf2;
    --info-500:    #068731;
    --info-700:    #057027;

    /* Surfaces */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.04);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.04);
    --shadow-md: 0 4px 12px -2px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.04);
    --shadow-lg: 0 12px 24px -4px rgb(0 0 0 / 0.08), 0 4px 8px -2px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 24px 48px -12px rgb(0 0 0 / 0.14), 0 8px 16px -8px rgb(0 0 0 / 0.08);

    /* Radii */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 18px;
    --r-2xl: 24px;
    --r-full: 999px;

    /* Easing */
    --ease: cubic-bezier(0.32, 0.72, 0, 1);

    /* Sidebar — pure white, sits on off-white app bg */
    --sidebar-bg:        #ffffff;
    --sidebar-border:    #d8dcd9;
    --sidebar-text:      #4b5563;
    --sidebar-text-dim:  #9ca3af;
    --sidebar-active-bg: #ecfdf2;
    --sidebar-active-fg: #068731;
}

/* ===== Reset / Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv11', 'ss01';
    font-variation-settings: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    color: var(--text-primary);
    background: var(--bg);
}

::selection { background: var(--brand-100); color: var(--brand-800); }

/* ===== Material Symbols ===== */
.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
    font-size: 20px;
    user-select: none;
    line-height: 1;
    flex-shrink: 0;
}
.icon-sm { font-size: 18px; font-variation-settings: 'wght' 400, 'opsz' 20; }
.icon-md { font-size: 22px; }
.icon-lg { font-size: 28px; }
.icon-xl { font-size: 36px; font-variation-settings: 'wght' 300; }
.icon-fill { font-variation-settings: 'FILL' 1; }
.icon-bold { font-variation-settings: 'wght' 600; }

/* ===== Layout ===== */
.app-shell { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}
.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo {
    width: 100%; max-width: 140px; height: auto;
    display: block;
}
.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand-tenant {
    color: var(--sidebar-text-dim); font-size: 12px; margin-top: 6px;
    font-weight: 500;
}

.sidebar-section { padding: 16px 12px 8px; }
.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-text-dim);
    padding: 0 10px 8px;
}
.sidebar-nav { padding: 4px 12px; flex: 1; overflow-y: auto; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 11px;
    border-radius: var(--r-md);
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s var(--ease);
    margin-bottom: 2px;
    position: relative;
}
.sidebar-link:hover { background: var(--bg-muted); color: var(--text-primary); }
.sidebar-link.is-active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-fg);
    font-weight: 600;
}
.sidebar-link.is-active::before {
    content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 22px; border-radius: 0 3px 3px 0;
    background: var(--brand-600);
}
.sidebar-link .material-symbols-outlined {
    font-size: 20px;
    color: var(--sidebar-text-dim);
    transition: color 0.15s var(--ease);
}
.sidebar-link:hover .material-symbols-outlined { color: var(--text-primary); }
.sidebar-link.is-active .material-symbols-outlined { color: var(--brand-600); }

.sidebar-badge {
    margin-left: auto;
    background: var(--brand-500);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: var(--r-full);
    line-height: 1.4;
}

.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 14px 16px;
    display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
    width: 32px; height: 32px;
    border-radius: var(--r-full);
    background: var(--brand-600);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
    flex-shrink: 0;
}
.sidebar-user-info { line-height: 1.2; min-width: 0; }
.sidebar-user-name { color: var(--text-primary); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: var(--sidebar-text-dim); font-size: 11.5px; margin-top: 2px; }

/* ===== Main / Topbar ===== */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 60px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 30;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.topbar-title {
    font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
    color: var(--text-primary);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.icon-btn {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-md);
    color: var(--text-secondary);
    transition: all 0.15s var(--ease);
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
}
.icon-btn:hover { background: var(--bg-muted); color: var(--text-primary); }
.icon-btn .material-symbols-outlined { font-size: 20px; }

.notif-dot {
    position: absolute; top: 6px; right: 6px;
    min-width: 16px; height: 16px;
    background: var(--danger-500);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 0 4px;
    border-radius: var(--r-full);
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    border: 2px solid white;
}

.user-menu-trigger {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: var(--r-full);
    transition: all 0.15s var(--ease);
    background: transparent; border: 1px solid transparent;
    cursor: pointer;
}
.user-menu-trigger:hover { background: var(--bg-muted); border-color: var(--border); }
.user-menu-avatar {
    width: 28px; height: 28px; border-radius: var(--r-full);
    background: var(--brand-600);
    color: white; display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
}
.user-menu-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }

.app-content { padding: 28px; flex: 1; max-width: 100%; width: 100%; }

/* ===== Page header ===== */
.page-header {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    margin-bottom: 24px;
}
.page-title {
    font-size: 26px; font-weight: 700; letter-spacing: -0.02em;
    color: var(--text-primary);
}
.page-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Cards ===== */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 20px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s var(--ease);
}
.card-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px;
}
.card-title {
    font-size: 15px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em;
}
.card-subtitle { font-size: 13px; color: var(--text-secondary); }
.card-action { margin-left: auto; }

.card-flat {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 0; overflow: hidden;
}
.card-flat-header { padding: 16px 20px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 12px; }
.card-flat-body { padding: 20px; }

/* ===== Stat Cards ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 18px 20px;
    transition: all 0.2s var(--ease);
    position: relative;
    overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-icon {
    width: 36px; height: 36px;
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.stat-icon .material-symbols-outlined { font-size: 20px; }
.stat-icon-success { background: var(--success-50); color: var(--success-700); }
.stat-icon-warning { background: var(--warning-50); color: var(--warning-700); }
.stat-icon-danger  { background: var(--danger-50); color: var(--danger-700); }
.stat-icon-info    { background: var(--info-50); color: var(--info-700); }
.stat-icon-brand   { background: var(--brand-100); color: var(--brand-700); }
.stat-value {
    font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
    color: var(--text-primary); line-height: 1.1;
}
.stat-label {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}
.stat-delta { font-size: 12px; margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; }
.stat-delta.up { color: var(--success-700); }
.stat-delta.down { color: var(--danger-700); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 14px;
    border-radius: var(--r-md);
    font-weight: 500; font-size: 13.5px;
    transition: all 0.15s var(--ease);
    cursor: pointer; border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1.4;
    text-decoration: none;
    user-select: none;
}
.btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.btn .material-symbols-outlined { font-size: 18px; }

.btn-primary {
    background: var(--text-primary); color: white;
    border-color: var(--text-primary);
}
.btn-primary:hover { background: #1e293b; border-color: #1e293b; box-shadow: var(--shadow-md); }

.btn-brand {
    background: var(--brand-600);
    color: white;
    border-color: var(--brand-700);
    box-shadow: 0 1px 2px 0 rgb(6 135 49 / 0.2);
}
.btn-brand:hover { background: var(--brand-700); box-shadow: 0 4px 12px -2px rgb(6 135 49 / 0.4); }

.btn-secondary {
    background: var(--bg-elevated); color: var(--text-primary);
    border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-muted); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-muted); color: var(--text-primary); }

.btn-danger { background: var(--danger-500); color: white; border-color: var(--danger-500); }
.btn-danger:hover { background: var(--danger-700); }

.btn-success { background: var(--success-500); color: white; border-color: var(--success-500); }
.btn-success:hover { background: var(--success-700); }

.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-sm .material-symbols-outlined { font-size: 16px; }
.btn-lg { padding: 11px 18px; font-size: 14px; }
.btn-lg .material-symbols-outlined { font-size: 20px; }
.btn-icon { padding: 8px; aspect-ratio: 1; }
.btn-block { width: 100%; }

/* ===== Inputs ===== */
.field { display: block; }
.field-label {
    display: block;
    font-size: 12px; font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.005em;
}
/* UPRAVA: :not([type]) zahrne i <input> bez explicitního type (default = text),
   aby měly stejnou velikost jako ostatní vstupy. */
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="time"], input[type="datetime-local"], input[type="number"], input[type="tel"],
input[type="month"], input[type="search"], input[type="url"],
select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: var(--bg-elevated);
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.15s var(--ease);
    line-height: 1.4;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgb(139 92 246 / 0.12);
}
input::placeholder, textarea::placeholder { color: var(--text-tertiary); }
input[type="color"] { padding: 4px; height: 38px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-600); }

.input-with-icon { position: relative; }
.input-with-icon .material-symbols-outlined {
    position: absolute;
    left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
    font-size: 18px;
}
.input-with-icon input { padding-left: 38px; }

/* ===== Badges ===== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.5;
    border: 1px solid transparent;
}
.badge .material-symbols-outlined { font-size: 12px; }
.badge-success { background: var(--success-50); color: var(--success-700); border-color: rgb(16 185 129 / 0.2); }
.badge-warning { background: var(--warning-50); color: var(--warning-700); border-color: rgb(245 158 11 / 0.2); }
.badge-danger  { background: var(--danger-50);  color: var(--danger-700);  border-color: rgb(239 68 68 / 0.2); }
.badge-info    { background: var(--info-50);    color: var(--info-700);    border-color: rgb(59 130 246 / 0.2); }
.badge-brand   { background: var(--brand-100);  color: var(--brand-700);   border-color: rgb(124 58 237 / 0.15); }
.badge-neutral { background: var(--bg-muted);   color: var(--text-secondary); border-color: var(--border); }

.badge-dot::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table.data-table {
    width: 100%; border-collapse: collapse; font-size: 13.5px;
}
table.data-table th {
    text-align: left;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}
table.data-table th:first-child { padding-left: 20px; }
table.data-table th:last-child  { padding-right: 20px; }
table.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}
table.data-table td:first-child { padding-left: 20px; }
table.data-table td:last-child  { padding-right: 20px; }
table.data-table tbody tr:hover { background: var(--bg-subtle); }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== Avatars ===== */
.avatar {
    border-radius: var(--r-full);
    background: var(--brand-600);
    color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 80px; height: 80px; font-size: 26px; border-radius: var(--r-2xl); }
.avatar-grad-1 { background: var(--brand-700); }
.avatar-grad-2 { background: var(--brand-500); }
.avatar-grad-3 { background: var(--brand-800); }
.avatar-grad-4 { background: #4b5563; }
.avatar-grad-5 { background: var(--brand-600); }

/* ===== Dropdown ===== */
.dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-width: 200px;
    z-index: 50;
    animation: dropdown-in 0.18s var(--ease);
}
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    font-size: 13.5px;
    color: var(--text-primary);
    transition: background 0.1s var(--ease);
    cursor: pointer;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
}
.dropdown-item:hover { background: var(--bg-muted); }
.dropdown-item.is-danger:hover { background: var(--danger-50); color: var(--danger-700); }
.dropdown-item .material-symbols-outlined { font-size: 18px; color: var(--text-tertiary); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== Modal ===== */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    background: rgb(15 23 42 / 0.6);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: modal-fade 0.2s var(--ease);
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: white;
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-xl);
    width: 100%; max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    animation: modal-in 0.25s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
}
.modal-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.modal-close { margin-left: auto; }
.modal-body { padding: 20px 22px; max-height: 60vh; overflow-y: auto; }
.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex; gap: 8px; justify-content: flex-end;
    background: var(--bg-subtle);
}

/* ===== Notifications panel ===== */
.notif-panel {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    width: 360px;
    overflow: hidden;
    z-index: 50;
}
.notif-header { padding: 14px 18px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 10px; }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-empty { padding: 32px 16px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.notif-item {
    display: flex; gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.1s var(--ease);
    cursor: pointer;
}
.notif-item:hover { background: var(--bg-subtle); }
.notif-item:last-child { border-bottom: 0; }
.notif-icon {
    width: 32px; height: 32px;
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-100); color: var(--brand-700);
    flex-shrink: 0;
}
.notif-title { font-size: 13.5px; font-weight: 500; color: var(--text-primary); line-height: 1.35; }
.notif-body { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.4; }
.notif-time { font-size: 11.5px; color: var(--text-tertiary); margin-top: 4px; }

/* ===== Toast ===== */
#toast-host { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border-radius: var(--r-lg);
    background: white;
    box-shadow: var(--shadow-lg);
    border-left: 3px solid var(--brand-500);
    min-width: 280px;
    max-width: 380px;
    font-size: 13.5px;
    animation: toast-in 0.25s var(--ease);
}
.toast.toast-success { border-left-color: var(--success-500); }
.toast.toast-error { border-left-color: var(--danger-500); }
.toast.toast-info { border-left-color: var(--info-500); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px;
    border-radius: var(--r-lg);
    border: 1px solid;
    font-size: 13.5px;
    margin-bottom: 16px;
}
.alert-success { background: var(--success-50); border-color: rgb(16 185 129 / 0.25); color: var(--success-700); }
.alert-error   { background: var(--danger-50);  border-color: rgb(239 68 68 / 0.25);  color: var(--danger-700); }
.alert-warning { background: var(--warning-50); border-color: rgb(245 158 11 / 0.25); color: var(--warning-700); }
.alert-info    { background: var(--info-50);    border-color: rgb(59 130 246 / 0.25); color: var(--info-700); }

/* ===== Timeline ===== */
.timeline {
    position: relative;
    height: 64px;
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}
.timeline-block {
    position: absolute;
    border-radius: 6px;
    padding: 0 8px;
    display: flex; align-items: center;
    font-size: 11px; font-weight: 500; color: white;
    overflow: hidden;
    text-shadow: 0 1px 1px rgb(0 0 0 / 0.15);
}
.timeline-grid {
    position: absolute; top: 0; bottom: 0;
    border-left: 1px dashed rgb(148 163 184 / 0.4);
    pointer-events: none;
}
.timeline-hour { font-size: 10px; color: var(--text-tertiary); position: absolute; bottom: 2px; transform: translateX(-50%); }

/* ===== Shift block ===== */
.shift-block {
    border-left: 3px solid currentColor;
    padding: 10px 12px;
    border-radius: var(--r-md);
    background: white;
    border-top: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    transition: all 0.15s var(--ease);
    cursor: pointer;
}
.shift-block:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ===== Dashboard hero ===== */
.hero-card {
    background: linear-gradient(135deg, #033f17 0%, #045920 30%, #068731 70%, #11b95c 100%);
    border-radius: var(--r-2xl);
    padding: 28px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 48px -16px rgba(6, 135, 49, 0.45);
}
.hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 15%, rgba(255,255,255,0.18), transparent 50%),
                radial-gradient(circle at 15% 85%, rgba(255,255,255,0.08), transparent 50%);
    pointer-events: none;
}
.hero-card > * { position: relative; z-index: 1; }
.hero-eyebrow { font-size: 12.5px; opacity: 0.85; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.hero-display { font-size: 42px; font-weight: 700; letter-spacing: -0.03em; margin-top: 8px; line-height: 1; }
.hero-subtitle { font-size: 14px; opacity: 0.85; margin-top: 4px; }
.hero-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: var(--r-full);
    font-size: 13px; font-weight: 500;
    border: 1px solid rgba(255,255,255,0.18);
}

/* Hero buttons */
.hero-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px;
    border-radius: var(--r-md);
    font-size: 13.5px; font-weight: 600;
    transition: all 0.15s var(--ease);
    border: 1px solid transparent;
    cursor: pointer;
}
.hero-btn-light { background: white; color: var(--brand-700); }
.hero-btn-light:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.hero-btn-glass {
    background: rgba(255,255,255,0.12);
    color: white;
    border-color: rgba(255,255,255,0.22);
    backdrop-filter: blur(8px);
}
.hero-btn-glass:hover { background: rgba(255,255,255,0.2); }

/* ===== Mobile menu trigger ===== */
.menu-trigger { display: none; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(148 163 184 / 0.4); border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgb(100 116 139 / 0.6); border: 2px solid transparent; background-clip: content-box; }

/* ===== Utility ===== */
.divider { border-top: 1px solid var(--border-subtle); margin: 16px 0; }
.text-muted { color: var(--text-secondary); }
.text-subtle { color: var(--text-tertiary); }
.text-mono { font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
}
.empty-state .material-symbols-outlined {
    font-size: 48px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    opacity: 0.6;
}
.empty-title { font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.empty-subtitle { font-size: 13px; color: var(--text-tertiary); }

/* ===== Progress ===== */
.progress { height: 6px; background: var(--border-subtle); border-radius: var(--r-full); overflow: hidden; }
.progress-bar { height: 100%; background: var(--brand-600); border-radius: var(--r-full); transition: width 0.3s var(--ease); }
.progress-bar-success { background: var(--brand-600); }
.progress-bar-warning { background: var(--warning-500); }

/* ===== FullCalendar overrides ===== */
.fc { font-family: inherit; --fc-border-color: var(--border); --fc-today-bg-color: var(--brand-50); }
.fc .fc-toolbar-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-primary); }
.fc .fc-button {
    background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-strong);
    text-transform: capitalize; font-weight: 500; font-size: 13px; padding: 6px 12px; box-shadow: none;
    border-radius: var(--r-md);
}
.fc .fc-button:hover { background: var(--bg-muted); }
.fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--brand-600); border-color: var(--brand-600); color: white; }
.fc .fc-button-primary:not(:disabled):active { background: var(--brand-700); }
.fc-event { cursor: pointer; border-radius: 4px; font-size: 12px; padding: 1px 4px; border: none; }

/* ===== Mobile ===== */
@media (max-width: 1024px) {
    .menu-trigger { display: inline-flex; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.25s var(--ease);
        z-index: 60;
        box-shadow: var(--shadow-xl);
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-overlay {
        position: fixed; inset: 0; background: rgb(15 23 42 / 0.5); z-index: 50;
        animation: modal-fade 0.2s var(--ease);
    }
    .app-content { padding: 20px 16px; }
    .topbar { padding: 0 16px; }
}

@media (max-width: 640px) {
    .user-menu-name { display: none; }
    .page-title { font-size: 22px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Animation utility ===== */
.animate-in { animation: fade-up 0.3s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== Utility classes ===== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.hidden { display: none !important; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.h-full { height: 100%; }
.w-full { width: 100%; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* ===== Loading ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-muted), var(--bg-subtle), var(--bg-muted));
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--r-md);
}
@keyframes skeleton-pulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   SHIFTS — Roster grid (week / month)
   ============================================================ */
.shift-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 10px 12px;
    box-shadow: var(--shadow-xs);
    margin-bottom: 14px;
}
.shift-toolbar > * { flex: 0 0 auto; }
.shift-toolbar .spacer { flex: 1; }
.shift-toolbar .month-pill {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-muted);
    border-radius: var(--r-md);
    padding: 6px 10px;
    font-size: 13px; font-weight: 600;
    color: var(--text-primary);
}
.shift-toolbar .month-pill .mini-cal {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: linear-gradient(180deg, var(--brand-600), var(--brand-700));
    color: white;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 8px; font-weight: 700; line-height: 1;
    text-transform: uppercase;
}
.shift-toolbar .month-pill .mini-cal b { font-size: 13px; margin-top: 2px; }
.shift-toolbar .nav-group {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--bg-muted);
    border-radius: var(--r-md);
    padding: 3px;
}
.shift-toolbar .nav-group button {
    background: transparent; border: none; cursor: pointer;
    padding: 5px 8px; border-radius: 6px;
    color: var(--text-secondary);
    display: inline-flex; align-items: center;
}
.shift-toolbar .nav-group button:hover { background: var(--bg-elevated); color: var(--text-primary); }
.shift-toolbar .range-text {
    padding: 0 10px; font-size: 13px; font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}
select.toolbar-select {
    padding: 6px 28px 6px 10px;
    font-size: 13px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);
    background-color: var(--bg-elevated);
    min-width: 160px;
    height: 34px;
    width: auto;
}
.shift-toolbar .wp-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-full);
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
}
.shift-toolbar .wp-pill .wp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-500); }
.shift-toolbar .view-toggle {
    display: inline-flex; align-items: center;
    background: var(--bg-muted);
    border-radius: var(--r-md);
    padding: 3px;
}
.shift-toolbar .view-toggle button {
    background: transparent; border: none; cursor: pointer;
    padding: 5px 12px; border-radius: 6px;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
}
.shift-toolbar .view-toggle button.is-active {
    background: var(--bg-elevated); color: var(--text-primary);
    box-shadow: var(--shadow-xs);
}

/* Grid wrapper */
.roster {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    position: relative;
}
.roster-scroll {
    overflow-x: auto;
    /* UPRAVA responzivita: hladký scroll na touch zařízeních + tenčí scrollbar */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.roster-grid {
    display: grid;
    grid-template-columns: 220px repeat(7, minmax(140px, 1fr));
    min-width: 1100px;
    font-size: 13px;
}
/* (Sticky pro první sloupec — `.roster-cell.col-first` — je definován níže.) */
/* UPRAVA: měsíční pohled vypadá identicky jako týdenní — stejné rozměry buněk,
   stejné fonty. Rozdíl je jen v počtu dnů: viditelných je ~7 dnů (stejně jako u
   týdenního) a zbytek měsíce je dostupný horizontálním scrollem přes .roster-scroll. */
.roster-grid.is-month {
    grid-template-columns: 220px repeat(var(--cols, 31), 140px);
    width: max-content;
    min-width: 1100px;
}
@media (max-width: 700px) {
    .roster-grid.is-month {
        grid-template-columns: 160px repeat(var(--cols, 31), 108px);
        min-width: 920px;
    }
}
.roster-cell {
    border-right: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    min-height: 50px;
    position: relative;
}
/* BUG-fix: zafixovat první sloupec (jména zaměstnanců / hlavičky řádků) při horizontálním scrollu.
   UPRAVA responzivita: výraznější stín na pravém okraji, takže uživatel vizuálně chápe, že obsah
   pokračuje doprava — kritické na tabletu, kde je grid užší než šířka týdne. */
.roster-cell.col-first {
    border-right: 1px solid var(--border);
    background: var(--bg-subtle);
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: 6px 0 10px -8px rgba(15, 23, 42, 0.22);
}
.roster-cell.is-weekend { background: rgb(252 231 243 / 0.45); }
.roster-cell.is-holiday { background: rgb(252 165 165 / 0.18); }
.roster-cell.col-first.is-weekend, .roster-cell.col-first.is-holiday { background: var(--bg-subtle); }

/* Header rows */
.roster-head-date {
    padding: 10px 10px 8px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}
.roster-head-date small {
    display: block;
    font-size: 11px; font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.roster-head-date b { font-size: 16px; font-weight: 700; }
.roster-head-date.is-today b { color: var(--brand-700); }
.roster-head-date .holiday-name {
    font-size: 10.5px; color: var(--danger-700);
    font-weight: 500; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.roster-head-stat {
    padding: 6px 10px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
}
.roster-head-stat .label-cell {
    text-align: left;
    color: var(--text-tertiary);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    padding-left: 14px;
}

.roster-head-note {
    padding: 6px 10px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
}
.roster-head-note .note-trigger {
    background: transparent; border: 1px solid transparent; cursor: pointer;
    color: var(--text-tertiary);
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; padding: 3px 8px; border-radius: 6px;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    transition: background 0.25s var(--ease), color 0.25s var(--ease),
                border-color 0.25s var(--ease), transform 0.25s var(--ease),
                box-shadow 0.25s var(--ease);
}
/* UPRAVA: prázdná poznámka — "+" zvýrazněn barvou značky s decentním přerušovaným orámováním. */
.roster-head-note .note-trigger:not(.has-note) {
    color: var(--brand-600);
    background: rgba(17, 185, 92, 0.06);
    border-color: rgba(17, 185, 92, 0.32);
    border-style: dashed;
}
.roster-head-note .note-trigger:not(.has-note):hover {
    background: rgba(17, 185, 92, 0.18);
    border-color: var(--brand-600);
    color: var(--brand-700);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(6, 135, 49, 0.22);
}
.roster-head-note .note-trigger.has-note { color: var(--text-primary); }
.roster-head-note .note-trigger.has-note:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.roster-head-wp {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}
.roster-head-wp .wp-name {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 600; color: var(--text-primary);
}
.roster-head-wp .wp-name::before {
    content:''; width: 8px; height: 8px; border-radius: 50%;
    background: var(--brand-500);
}

/* Employee column */
.roster-emp {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}
.roster-emp .emp-avatar {
    width: 32px; height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 600; font-size: 11.5px;
    background: linear-gradient(135deg, #94a3b8, #64748b);
    position: relative;
}
.roster-emp .emp-avatar.online::after {
    content: ''; position: absolute; right: -1px; bottom: -1px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--success-500); border: 2px solid white;
}
.roster-emp .emp-text { min-width: 0; flex: 1; }
.roster-emp .emp-name {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.roster-emp .emp-pos {
    font-size: 11.5px; color: var(--text-tertiary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.roster-emp .emp-hours {
    font-size: 11px; color: var(--text-secondary);
    margin-top: 2px;
    font-feature-settings: 'tnum';
}

/* Day cell */
.day-cell {
    padding: 4px;
    display: flex; flex-direction: column; gap: 3px;
    cursor: pointer;
}
.day-cell:hover { background: rgb(124 58 237 / 0.04); }
.day-cell.is-weekend:hover { background: rgb(252 231 243 / 0.7); }
/* UPRAVA: "+" v prázdné buňce dne — vždy viditelné (decentně), se smooth animací,
   barvou značky a zvětšením při hoveru. Při tažení (drop-target) se schová. */
.day-cell .add-stub {
    color: var(--brand-600);
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    height: 28px; width: 100%;
    opacity: 0.55;
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
    pointer-events: none;
}
.day-cell .add-stub .material-symbols-outlined {
    font-size: 18px;
    border-radius: 999px;
    padding: 3px;
    background: rgba(17, 185, 92, 0.08);
    transition: background 0.28s var(--ease), box-shadow 0.28s var(--ease), transform 0.28s var(--ease);
    will-change: transform;
}
.day-cell:hover .add-stub {
    opacity: 1;
    transform: translateY(-1px);
}
.day-cell:hover .add-stub .material-symbols-outlined {
    background: rgba(17, 185, 92, 0.18);
    box-shadow: 0 4px 14px rgba(6, 135, 49, 0.28);
    transform: scale(1.15);
}
.day-cell.drop-target .add-stub { opacity: 0; }

/* UPRAVA: pokud má buňka už směny/volno, "+" se vykreslí jako malý plovoucí badge
   v pravém dolním rohu — neruší shift karty (které mají v pravém horním rohu vlastní ikony),
   ale je vždy viditelný a nabídne přidání další směny. */
.day-cell .add-stub.is-corner {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: auto;
    height: auto;
    opacity: 0.55;
    z-index: 2;
    transform: none;
}
.day-cell .add-stub.is-corner .material-symbols-outlined {
    font-size: 16px;
    padding: 2px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--brand-600);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14),
                0 0 0 1px rgba(17, 185, 92, 0.18);
}
.day-cell:hover .add-stub.is-corner {
    opacity: 1;
    transform: none;
}
.day-cell:hover .add-stub.is-corner .material-symbols-outlined {
    background: var(--brand-600);
    color: #fff;
    box-shadow: 0 4px 12px rgba(6, 135, 49, 0.4),
                0 0 0 1px var(--brand-600);
    transform: scale(1.15) rotate(90deg);
}

/* Shift card */
.shift-card {
    padding: 4px 8px;
    border-radius: 6px;
    background: #bfdbfe;
    color: #0f172a;
    font-size: 11.5px;
    line-height: 1.35;
    cursor: pointer;
    border: 1px solid rgb(0 0 0 / 0.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.1s var(--ease), box-shadow 0.1s var(--ease);
}
.shift-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); z-index: 2; }
.shift-card.dragging { opacity: 0.5; }
.shift-card .shift-title {
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shift-card .shift-time {
    font-size: 10.5px;
    color: rgb(15 23 42 / 0.7);
    font-feature-settings: 'tnum';
}
.shift-card .shift-icon {
    position: absolute;
    top: 2px; right: 4px;
    font-size: 12px;
    color: rgb(15 23 42 / 0.5);
}
.shift-card.draft {
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.45) 0 4px, transparent 4px 8px);
}
.shift-card.draft::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--warning-500);
}
/* Pending burza — svislé šrafování */
.shift-card.is-pending-swap {
    background-image: repeating-linear-gradient(90deg,
        rgba(0,0,0,0.10) 0 3px, transparent 3px 8px) !important;
    outline: 1.5px dashed rgba(0,0,0,0.35);
    outline-offset: -2px;
}
/* Tužka na vlastní směně (zaměstnanec) */
.shift-card .shift-own-edit {
    position: absolute; top: 2px; right: 2px;
    background: rgba(255,255,255,0.85);
    border: none; border-radius: 4px;
    padding: 1px 3px;
    cursor: pointer;
    color: var(--brand-700);
    display: inline-flex;
    opacity: 0;
    transition: opacity 0.12s var(--ease);
    z-index: 4;
}
.shift-card:hover .shift-own-edit { opacity: 1; }
/* Resize handles for shifting time */
.shift-card .shift-resize {
    position: absolute; top: 0; bottom: 0; width: 8px;
    cursor: ew-resize;
    background: linear-gradient(90deg, rgba(0,0,0,0.18), rgba(0,0,0,0));
    opacity: 0;
    transition: opacity 0.12s var(--ease);
    z-index: 3;
}
.shift-card .shift-resize-right {
    right: 0; left: auto;
    background: linear-gradient(270deg, rgba(0,0,0,0.18), rgba(0,0,0,0));
}
.shift-card .shift-resize-left { left: 0; }
.shift-card:hover .shift-resize { opacity: 1; }
.shift-card.resizing { box-shadow: 0 0 0 2px var(--brand-500) inset; }
.shift-card.resizing .shift-time { font-weight: 700; color: var(--brand-700); }

/* Leave card */
.leave-card {
    padding: 4px 8px;
    border-radius: 6px;
    background: #fef3c7;
    color: #78350f;
    font-size: 11.5px;
    border: 1px dashed rgb(217 119 6 / 0.4);
    cursor: pointer;
}
.leave-card .leave-name { font-weight: 600; font-size: 11px; }
.leave-card .leave-time { font-size: 10.5px; opacity: 0.75; }
.leave-card.type-vacation  { background: #dcfce7; color: #14532d; border-color: rgb(34 197 94 / 0.4); }
.leave-card.type-sick      { background: #fee2e2; color: #7f1d1d; border-color: rgb(220 38 38 / 0.4); }
.leave-card.type-sick_day  { background: #fee2e2; color: #7f1d1d; border-color: rgb(220 38 38 / 0.4); }
.leave-card.type-doctor    { background: #fed7aa; color: #7c2d12; border-color: rgb(234 88 12 / 0.4); }
.leave-card.type-unpaid    { background: #f3e8ff; color: #581c87; border-color: rgb(168 85 247 / 0.4); }

/* UPRAVA upravy3.txt 20.4: pending žádost o volno = nesdílená, šrafovaná (pattern),
   vizuálně odlišená od běžných (schválených) směn / leave karet. */
.leave-card.is-pending {
    border-style: dashed;
    border-color: rgb(217 119 6 / 0.6);
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.55) 0,
        rgba(255,255,255,0.55) 4px,
        transparent 4px,
        transparent 8px
    );
    position: relative;
}
.leave-card.is-pending .leave-name { font-style: italic; }
.leave-card .leave-actions {
    display: flex; gap: 2px; margin-top: 3px;
}
.leave-card .leave-act {
    flex: 1;
    border: none; cursor: pointer;
    border-radius: 4px;
    padding: 1px 4px;
    display: inline-flex; align-items: center; justify-content: center;
    color: inherit;
    background: rgba(255,255,255,0.65);
    transition: background 0.12s ease;
}
.leave-card .leave-act:hover { background: rgba(255,255,255,0.95); }
.leave-card .leave-act-ok:hover { color: #14532d; }
.leave-card .leave-act-no:hover { color: #7f1d1d; }

/* Drop hover */
.day-cell.drop-target { outline: 2px dashed var(--brand-500); outline-offset: -3px; background: rgb(124 58 237 / 0.08); }

/* Color picker chips */
.color-row { display: flex; gap: 6px; flex-wrap: wrap; }
.color-chip {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--border-strong);
    cursor: pointer;
    transition: transform 0.1s var(--ease);
}
.color-chip:hover { transform: scale(1.1); }
.color-chip.is-active { box-shadow: 0 0 0 2px var(--brand-500); transform: scale(1.1); }

/* Date chips (multi-day picker) */
.date-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.date-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px;
    border-radius: var(--r-full);
    background: var(--brand-100); color: var(--brand-700);
    font-size: 12px; font-weight: 500;
    border: none;
}
.date-chip button {
    background: none; border: none; padding: 0; cursor: pointer;
    color: var(--brand-700); display: inline-flex;
}

/* Half-day toggle */
.day-mode {
    display: flex; gap: 8px;
    background: var(--bg-muted); padding: 4px; border-radius: var(--r-md);
    margin-top: 6px;
}
.day-mode label {
    flex: 1; cursor: pointer;
    padding: 8px 10px;
    text-align: center;
    border-radius: 6px;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
}
.day-mode input[type="radio"] { display: none; }
.day-mode input[type="radio"]:checked + span {
    background: var(--bg-elevated); color: var(--text-primary);
    box-shadow: var(--shadow-xs);
    display: block; padding: 8px 10px; border-radius: 6px;
    margin: -8px -10px;
}

/* Multi-shift wrapper (více směn za den) */
.day-cell .shift-card + .shift-card,
.day-cell .shift-card + .leave-card,
.day-cell .leave-card + .shift-card,
.day-cell .leave-card + .leave-card { margin-top: 2px; }

/* Mobile vertical list */
.shift-mobile { display: none; }
.day-row {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.day-row.is-weekend { background: rgb(252 231 243 / 0.5); }
.day-row.is-holiday { background: rgb(252 165 165 / 0.3); }
.day-row-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.day-row-date { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.day-row-date small { color: var(--text-tertiary); font-weight: 500; margin-left: 6px; text-transform: uppercase; font-size: 11.5px; }
.day-row-empty { color: var(--text-tertiary); font-size: 13px; padding: 8px 0; }
.day-row-list { display: flex; flex-direction: column; gap: 6px; }

/* UPRAVA: výchozí label = plný text, na mobilu se přepne na "Sdílet" */
.shift-share-label-short { display: none; }

@media (max-width: 768px) {
    .roster { display: none; }
    .shift-mobile { display: block; }
    .shift-toolbar { padding: 8px; gap: 6px; flex-wrap: wrap; }
    .shift-toolbar .month-pill { padding: 4px 8px; font-size: 12px; }
    .shift-toolbar select.toolbar-select { min-width: 0; flex: 1; }
    /* 6.4 C — mobil: pouze filter zaměstnance + nav */
    .shift-toolbar #filterPosition,
    .shift-toolbar #filterWorkplace,
    .shift-toolbar #viewToggle { display: none; }
    /* UPRAVA bugs.docx 6.6: filter zaměstnance dostatečně velký, aby bylo vidět jméno,
       ale ne tak, aby Sdílet skočilo na druhý řádek */
    .shift-toolbar #filterEmployee {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 110px);
        font-size: 14px;
        padding: 10px 12px;
        order: 5;
    }
    /* UPRAVA bugs.docx: Sdílet tlačítko menší, posunutí doprava, text = "Sdílet" */
    .shift-share-btn {
        margin-left: auto;
        padding: 6px 10px;
        order: 6;
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .shift-share-btn .shift-share-label-full { display: none; }
    .shift-share-btn .shift-share-label-short { display: inline; font-size: 13px; }
}

/* UPRAVA responzivita: TABLET (mezi 769 a 1199 px) — grid se vejde lépe, menší buňky,
   užší jméno-sloupec, kompaktnější karty směn, lepší wrap toolbaru. Mobile mode už neaktivní,
   takže pořád grid + horizontální scroll, ale s sticky 1. sloupcem (viz .col-first sticky výše). */
@media (min-width: 769px) and (max-width: 1199px) {
    .shift-toolbar {
        padding: 8px 10px;
        gap: 6px;
    }
    .shift-toolbar .month-pill { padding: 5px 8px; font-size: 12px; }
    .shift-toolbar .month-pill .mini-cal { width: 26px; height: 26px; }
    .shift-toolbar .month-pill .mini-cal b { font-size: 11px; }
    .shift-toolbar .range-text { padding: 0 6px; font-size: 12px; }
    .shift-toolbar select.toolbar-select {
        min-width: 0;
        max-width: 180px;
        font-size: 12.5px;
        height: 32px;
        padding: 4px 24px 4px 8px;
    }
    .shift-toolbar .view-toggle button { padding: 4px 9px; font-size: 12px; }
    .shift-share-btn { padding: 6px 12px; font-size: 13px; }
    .shift-share-btn .shift-share-label-full { display: none; }
    .shift-share-btn .shift-share-label-short { display: inline; }
    .shift-toolbar .nav-group { padding: 2px; }
    .shift-toolbar .nav-group button { padding: 4px 6px; }

    /* Roster grid kompaktnější — 160 px sloupec se jménem, menší minimální šířka dne */
    .roster-grid {
        grid-template-columns: 160px repeat(7, minmax(108px, 1fr));
        min-width: 920px;
        font-size: 12.5px;
    }
    /* UPRAVA: měsíční pohled vypadá stejně jako týdenní (stejná šířka buněk),
       ostatní dny se odhalí horizontálním scrollem. */
    .roster-grid.is-month {
        grid-template-columns: 160px repeat(var(--cols, 31), 108px);
        min-width: 920px;
    }
    .roster-emp { padding: 8px 10px; gap: 8px; }
    .roster-emp .emp-avatar { width: 28px; height: 28px; font-size: 11px; }
    .roster-emp .emp-name { font-size: 12.5px; }
    .roster-emp .emp-pos { font-size: 10.5px; }
    .roster-head-date { padding: 8px 4px; font-size: 11.5px; }
    .roster-head-date b { font-size: 14px; }
    .shift-card { font-size: 11.5px; padding: 4px 6px; }
}

/* ===== Print styles ===== */
.print-page { padding: 16px 24px; }
.print-page .print-head {
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 10px;
    margin-bottom: 18px;
}
.print-page table { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-page th, .print-page td { border: 1px solid #cbd5e1; padding: 6px 8px; text-align: left; vertical-align: top; }
.print-page th { background: #f1f5f9; font-weight: 600; }
.print-page td.weekend { background: rgb(252 231 243 / 0.5); }
.print-page td.holiday { background: rgb(252 165 165 / 0.3); }
.print-page .pshift {
    display: block; padding: 3px 5px; border-radius: 4px; margin-bottom: 2px;
    font-size: 11px; line-height: 1.2; background: #dbeafe;
}

@media print {
    body { background: white; }
    .sidebar, .topbar, .alert, .page-header, .shift-toolbar, .modal-backdrop, .toast, #toast-host { display: none !important; }
    .app-shell { display: block !important; }
    .app-main, .app-content { padding: 0 !important; }
    .print-page { padding: 0 12px; }
    @page { size: A4 landscape; margin: 12mm; }
}

/* ===== RESTIQ vlastní JS kalendář (náhrada za <input type="date">) ===== */
.restiq-cal-trigger {
    cursor: pointer;
    background: var(--bg-elevated);
}
.restiq-cal-trigger::-webkit-calendar-picker-indicator { display: none; }

#restiq-cal-host {
    position: absolute; top: 0; left: 0; z-index: 1000;
    pointer-events: none;
}
#restiq-cal-host .restiq-cal-popover { pointer-events: auto; }

.restiq-cal-popover {
    width: 280px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xl);
    padding: 10px;
    font-family: 'Inter', system-ui, sans-serif;
    z-index: 9999;
}
.restiq-cal-head {
    display: flex; align-items: center; gap: 4px;
    margin-bottom: 8px;
}
.restiq-cal-title {
    flex: 1;
    text-align: center;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}
.restiq-cal-nav {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    width: 26px; height: 26px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}
.restiq-cal-nav:hover { background: var(--bg-muted); color: var(--text-primary); }

.restiq-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}
.restiq-cal-weekdays span {
    text-align: center;
    font-size: 10.5px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
    padding: 4px 0;
}

.restiq-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.restiq-cal-day {
    aspect-ratio: 1 / 1;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 0;
}
.restiq-cal-day.is-other-month { color: var(--text-tertiary); opacity: 0.55; }
.restiq-cal-day.is-weekend { color: var(--danger-700); }
.restiq-cal-day.is-weekend.is-other-month { color: var(--danger-700); opacity: 0.4; }
.restiq-cal-day:not(.is-disabled):hover {
    background: var(--brand-50);
    border-color: var(--brand-300);
}
.restiq-cal-day.is-today {
    border-color: var(--brand-400);
    font-weight: 700;
}
.restiq-cal-day.is-selected {
    background: var(--brand-600);
    color: white !important;
    border-color: var(--brand-700);
}
.restiq-cal-day.is-selected:hover {
    background: var(--brand-700);
}
.restiq-cal-day.is-in-range {
    background: var(--brand-100);
    color: var(--brand-800);
}
.restiq-cal-day.is-disabled {
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.35;
}

.restiq-cal-footer {
    display: flex; gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}
.restiq-cal-foot-btn {
    flex: 1;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
}
.restiq-cal-foot-btn:hover { background: var(--border); color: var(--text-primary); }
.restiq-cal-foot-btn.is-primary {
    background: var(--brand-600);
    border-color: var(--brand-700);
    color: white;
}
.restiq-cal-foot-btn.is-primary:hover { background: var(--brand-700); }

/* ===== Schvalování docházky — nová karta s časovou osou ===== */
.approval-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.approval-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(80px, 1fr)) minmax(100px, 0.8fr) minmax(180px, 1.2fr);
    gap: 12px;
    align-items: center;
    padding: 8px 0;
}
.approval-row + .approval-row { border-top: 1px solid var(--border-subtle); }
.approval-emp {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: inherit;
}
.approval-timeline {
    position: relative;
    height: 28px;
    background: var(--bg-muted);
    border-radius: var(--r-sm);
    overflow: hidden;
    margin-top: 6px;
}
.approval-timeline-plan,
.approval-timeline-actual {
    position: absolute;
    height: 10px;
    border-radius: 3px;
    top: 4px;
}
.approval-timeline-plan { background: rgba(6, 135, 49, 0.25); border: 1px dashed var(--brand-600); }
.approval-timeline-actual { background: var(--brand-500); top: 16px; height: 8px; }
.approval-timeline-break { background: var(--warning-500); top: 16px; height: 8px; opacity: 0.85; }
.approval-timeline-axis {
    position: absolute; top: 0; bottom: 0;
    border-left: 1px dotted var(--border);
    font-size: 9px; color: var(--text-tertiary);
    padding-left: 2px;
}

@media (max-width: 900px) {
    .approval-row {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .approval-row > * { font-size: 12.5px; }
}
