/* ADMIN CENTRUM DOP — vizuální styl sdílený s Portálem 2 (floating shell, Sora/Outfit, modrý akcent) */

:root {
    --dop-navy: #0d2a49;
    --dop-navy-deep: #061525;
    --dop-navy-mid: #143a5c;
    --dop-accent: #3b82f6;
    --dop-accent-soft: #60a5fa;
    --dop-accent-deep: #2563eb;
    --dop-success: #10b981;
    --dop-surface: #e8eef5;
    --dop-surface-elevated: #ffffff;
    --dop-ink: #0f172a;
    --dop-ink-muted: #64748b;
    --dop-border: rgba(13, 42, 73, 0.1);
    --dop-border-soft: #edf2f7;
    --dop-danger: #ef4444;
    --dop-warning: #f59e0b;
    --dop-thead: #f1f5f9;
    --dop-shadow-sm: 0 1px 2px rgba(13, 42, 73, 0.04);
    --dop-shadow-md: 0 10px 28px rgba(13, 42, 73, 0.08);
    --dop-shadow-sidebar: 0 4px 16px rgba(6, 21, 37, 0.14), 0 18px 48px rgba(6, 21, 37, 0.22);
    --dop-font: "Sora", system-ui, -apple-system, sans-serif;
    --dop-font-display: "Outfit", "Sora", system-ui, sans-serif;
    --dop-sidebar-float: 14px;
    --dop-sidebar-radius: 28px;
    --dop-ease: cubic-bezier(0.16, 1, 0.3, 1);

    color-scheme: light;
    --navy: var(--dop-navy);
    --navy-2: var(--dop-navy-mid);
    --ink: var(--dop-ink);
    --muted: var(--dop-ink-muted);
    --line: var(--dop-border-soft);
    --surface: var(--dop-surface-elevated);
    --canvas: var(--dop-surface);
    --blue: var(--dop-accent);
    --blue-soft: #eaf2ff;
    --green: #168b62;
    --green-soft: #e9f8f1;
    --orange: #c6791d;
    --orange-soft: #fff4e4;
    --violet: #7056c8;
    --violet-soft: #f1edff;
    --shadow: var(--dop-shadow-md);
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
html, body { margin: 0; width: 100%; min-width: 320px; height: 100%; min-height: 100%; }
body {
    font-family: var(--dop-font);
    background: radial-gradient(ellipse 70% 50% at 0% 0%, rgba(59, 130, 246, 0.06), transparent 55%), var(--canvas);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell {
    display: flex;
    gap: var(--dop-sidebar-float);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: var(--dop-sidebar-float);
    overflow: hidden;
}

/* SIDEBAR — floating oval, stejný jazyk jako Portál 2 */
.sidebar {
    position: relative;
    width: 264px;
    flex: 0 0 264px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 14px 14px;
    color: #e8f0ff;
    background: radial-gradient(ellipse at 5% 0%, rgba(59, 130, 246, 0.22), transparent 45%), linear-gradient(160deg, var(--dop-navy-mid), var(--dop-navy) 54%, var(--dop-navy-deep));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--dop-sidebar-radius);
    box-shadow: var(--dop-shadow-sidebar);
    overflow: hidden;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 7px 26px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; color: #fff; font: 800 16px var(--dop-font-display), sans-serif; letter-spacing: -.06em; background: linear-gradient(145deg, #60a5fa, var(--dop-accent-deep)); box-shadow: 0 8px 22px rgba(6, 21, 37, 0.47); }
.brand strong, .brand small { display: block; }
.brand strong { font: 700 14px var(--dop-font-display), sans-serif; letter-spacing: -.02em; color: #fff; }
.brand small { margin-top: 4px; color: rgba(255, 255, 255, 0.55); font-size: 10px; }

.nav-list { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 45px; padding: 0 13px; border: 1px solid transparent; border-radius: 12px; color: rgba(232, 240, 255, 0.72); background: transparent; text-align: left; font-size: 13px; font-weight: 600; transition: .16s var(--dop-ease); }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.nav-item.active { color: #fff; background: linear-gradient(100deg, var(--dop-accent-deep), var(--dop-accent-soft)); box-shadow: 0 7px 20px rgba(5, 14, 29, 0.33); }
.nav-icon { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; color: #a8c9ee; background: rgba(255, 255, 255, 0.09); font-size: 15px; }
.nav-item.active .nav-icon { color: #fff; background: rgba(255, 255, 255, 0.2); }
.nav-count { display: none; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 999px; color: #eaf2fb; background: #27384b; font-size: 10px; font-weight: 800; line-height: 1; }
.nav-item.has-unread .nav-count { display: inline-flex; border-color: rgba(255, 130, 146, 0.2); color: #fff; background: #d83d5c; box-shadow: 0 0 0 3px rgba(216, 61, 92, 0.13); }
.nav-item.has-unread:not(.active) { color: #f4f7fb; background: rgba(255, 255, 255, 0.04); }

.sidebar-bottom { margin-top: auto; }
.secure-note { display: flex; align-items: center; gap: 8px; padding: 13px 10px; color: rgba(255, 255, 255, 0.52); font-size: 10px; line-height: 1.45; }
.secure-dot, .live-pill i, .online-mark i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 99px; background: var(--dop-success); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1); }
.logout-link { display: flex; justify-content: space-between; align-items: center; min-height: 42px; padding: 0 11px; border-top: 1px solid rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.63); text-decoration: none; font-size: 12px; }
.logout-link:hover { color: white; }

.main-area {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--dop-border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--dop-shadow-md);
    overflow: hidden;
}

.topbar { display: flex; align-items: center; gap: 15px; min-height: 68px; padding: 13px 28px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar-title { min-width: 0; }
.eyebrow { margin: 0 0 6px; color: #8b9aae; font-size: 9px; font-weight: 800; letter-spacing: .15em; line-height: 1.3; }
.topbar h1 { margin: 0; color: var(--ink); font: 750 19px var(--dop-font-display), sans-serif; letter-spacing: -.035em; }

.theme-toggle { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; margin-left: auto; border: 1px solid var(--dop-border); border-radius: 50%; color: var(--dop-ink-muted); background: var(--dop-surface-elevated); transition: .16s var(--dop-ease); }
.theme-toggle:hover { border-color: rgba(37, 99, 235, 0.28); color: var(--dop-accent-deep); box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1); }
.theme-toggle .theme-icon-sun { display: none; }
.theme-toggle .theme-icon-moon { display: block; }
html[data-theme="light"] .theme-toggle .theme-icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle { margin-left: auto; }
html[data-theme="light"] .theme-toggle { margin-left: 0; }

.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #d9e8f8; border-radius: 50%; color: #1d69cc; background: #edf5ff; font-size: 15px; font-weight: 700; }
.user-meta strong, .user-meta small { display: block; }
.user-meta strong { max-width: 190px; overflow: hidden; color: #24364b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { margin-top: 3px; color: #8795a7; font-size: 10px; }
.menu-button { display: none; }
.content-scroll { flex: 1; min-height: 0; overflow: auto; padding: 28px 30px max(28px, env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.page-section { display: none; width: min(1320px, 100%); margin: 0 auto; padding-bottom: 28px; }
.page-section.active { display: block; animation: appear .18s ease-out; }
@keyframes appear { from { opacity: .55; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
.welcome-row h2 { margin: 0; font: 750 clamp(22px, 2.1vw, 28px) var(--dop-font-display), sans-serif; letter-spacing: -.045em; }
.muted { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.live-pill, .online-mark { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 8px 11px; border: 1px solid #d9eee4; border-radius: 99px; color: #407c62; background: #f4fcf7; font-size: 10px; font-weight: 700; }
.live-pill i { width: 6px; height: 6px; flex-basis: 6px; box-shadow: none; }
.online-mark { padding: 6px 9px; color: #657b70; font-size: 9px; }
.online-mark i { width: 6px; height: 6px; flex-basis: 6px; box-shadow: none; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { display: flex; align-items: center; gap: 14px; min-height: 100px; padding: 18px; border: 1px solid var(--dop-border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); transition: .18s var(--dop-ease); }
.stat-card:hover { box-shadow: 0 15px 30px rgba(13, 42, 73, 0.12); transform: translateY(-1px); }
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 13px; font-size: 19px; font-weight: 700; }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.violet { color: var(--violet); background: var(--violet-soft); }
.stat-icon.orange { color: var(--orange); background: var(--orange-soft); }
.stat-icon.red { color: var(--dop-danger); background: #fef2f2; }
.stat-value, .stat-label { display: block; }
.stat-value { font: 800 24px var(--dop-font-display), sans-serif; letter-spacing: -.04em; }
.stat-label { margin-top: 4px; color: #7f8da0; font-size: 10px; line-height: 1.4; }
.dashboard-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: start; gap: 16px; }
.panel { min-width: 0; padding: 21px; border: 1px solid var(--dop-border); border-radius: 19px; background: var(--surface); box-shadow: var(--shadow); }
.panel:hover { box-shadow: 0 15px 34px rgba(13, 42, 73, 0.1); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel-heading h3, .form-heading h3, .chat-preview h3 { margin: 0; font: 750 15px var(--dop-font-display), sans-serif; letter-spacing: -.025em; }
.text-button { padding: 6px 0; border: 0; color: var(--dop-accent-deep); background: transparent; font-size: 11px; font-weight: 700; white-space: nowrap; }
.text-button:hover { color: #1454a2; }
.text-button span { margin-left: 3px; }
.work-list, .ticket-list { display: grid; gap: 9px; }
.work-item, .ticket-item { min-width: 0; padding: 13px 14px; border: 1px solid var(--dop-border-soft); border-radius: 14px; background: #fcfdff; transition: .16s var(--dop-ease); }
.work-item:hover, .ticket-item:hover { border-color: rgba(59, 130, 246, 0.25); box-shadow: 0 6px 16px rgba(13, 42, 73, 0.06); }
.work-item-top, .ticket-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.work-title { margin: 0; color: #26374c; font-size: 12px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.work-description { margin: 7px 0 0; color: #738196; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.work-meta { display: flex; flex-wrap: wrap; gap: 7px 11px; margin-top: 9px; color: #8793a3; font-size: 9px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 5px 8px; border-radius: 99px; color: #3d6da4; background: var(--blue-soft); font-size: 9px; font-weight: 700; }
.status-pill.done { color: #24815e; background: var(--green-soft); }
.ticket-subject { margin: 0; color: #29394c; font-size: 11px; font-weight: 700; line-height: 1.4; }
.ticket-meta { margin-top: 7px; color: #8592a2; font-size: 9px; }
.priority-pill { flex: 0 0 auto; padding: 4px 7px; border-radius: 7px; color: #7f6a4b; background: #fff7e9; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.priority-pill.p1, .priority-pill.p2 { color: #b3533d; background: #fff0ed; }
.chat-preview { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; padding: 18px 21px; }
.chat-preview > div { display: flex; align-items: center; gap: 13px; }
.chat-preview .muted { margin-top: 4px; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 0 16px; border: 0; border-radius: 12px; color: white; background: linear-gradient(110deg, var(--dop-accent-deep), var(--dop-accent-soft)); box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22); font-size: 11px; font-weight: 700; text-decoration: none; transition: .16s var(--dop-ease); }
.primary-button:hover { filter: brightness(1.04); box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3); }
.primary-button span { font-size: 15px; }
.link-button { min-height: 39px; }
.readonly-banner { display: flex; align-items: center; gap: 11px; margin: 16px 30px 0; padding: 12px 15px; border: 1px solid #dbe8f8; border-radius: 13px; color: #2969ba; background: #eff6ff; }
.readonly-banner > span { font-size: 18px; }
.readonly-banner strong, .readonly-banner small { display: block; }
.readonly-banner strong { font-size: 11px; }
.readonly-banner small { margin-top: 3px; color: #6683a5; font-size: 10px; line-height: 1.4; }

.work-form { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(220px, 1.4fr) minmax(140px, .7fr) auto; align-items: end; gap: 12px; margin-bottom: 16px; padding: 16px; }
.form-heading { display: flex; align-items: center; gap: 11px; align-self: center; }
.form-heading .stat-icon { width: 36px; height: 36px; flex-basis: 36px; }
.form-heading .muted { margin-top: 3px; font-size: 10px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { color: #526175; font-size: 10px; font-weight: 700; }
.field small { color: #929eac; font-weight: 500; }
.field input, .field textarea, .field select { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #dfe6ed; border-radius: 10px; outline: none; color: #25364a; background: #fff; font-size: 12px; }
.field textarea { min-height: 40px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #76a7ea; box-shadow: 0 0 0 3px rgba(36, 117, 232, 0.08); }
.work-form .primary-button { min-width: 150px; }
.filter-group { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: #f1f4f8; }
.filter-button { min-height: 29px; padding: 0 9px; border: 0; border-radius: 8px; color: #718095; background: transparent; font-size: 9px; font-weight: 700; white-space: nowrap; }
.filter-button.active { color: #295eaa; background: #fff; box-shadow: 0 1px 4px rgba(29, 53, 84, 0.06); }
.work-list:not(.compact-list) { gap: 10px; }
.work-actions { display: flex; justify-content: flex-end; margin-top: 11px; }
.small-button { min-height: 30px; padding: 0 10px; border: 1px solid #d8e8df; border-radius: 9px; color: #26805f; background: #f1fbf6; font-size: 10px; font-weight: 700; }
.small-button:hover { background: #e4f7ed; }
.small-button.reopen { border-color: #dce7f5; color: #3c6ca7; background: #f5f9ff; }
.empty-state, .empty-cell { padding: 22px 12px; color: #8996a7; text-align: center; font-size: 11px; line-height: 1.55; }
.skeleton { height: 58px; border-radius: 12px; background: linear-gradient(90deg, #f3f6f9, #fafbfd, #f3f6f9); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.chat-section { height: 100%; min-height: 420px; }
.chat-panel { display: flex; flex-direction: column; height: min(650px, calc(100dvh - 210px)); min-height: 400px; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; padding: 15px 19px; border-bottom: 1px solid var(--dop-border-soft); }
.chat-head strong, .chat-head small { display: block; }
.chat-head strong { font-size: 12px; }
.chat-head small { margin-top: 4px; color: #8491a1; font-size: 10px; }
.chat-messages { display: flex; flex: 1 1 auto; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; padding: 18px 20px; background: #fbfcfe; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.message { display: flex; align-items: flex-start; gap: 9px; max-width: min(78%, 620px); }
.message.mine { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar { display: grid; place-items: center; width: 29px; height: 29px; flex: 0 0 29px; border-radius: 50%; color: #3c68a0; background: #e8f1ff; font-size: 11px; font-weight: 800; }
.message.mine .message-avatar { color: #197451; background: #e5f6ed; }
.message-body { min-width: 0; padding: 9px 12px; border: 1px solid #e8edf3; border-radius: 4px 14px 14px 14px; background: white; box-shadow: 0 2px 6px rgba(25, 50, 78, 0.03); }
.message.mine .message-body { border-color: #d8e8fb; border-radius: 14px 4px 14px 14px; background: #f1f7ff; }
.message-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 5px; }
.message-head strong { color: #526277; font-size: 9px; }
.message-head time { color: #9aa6b4; font-size: 8px; }
.message-text { color: #39495c; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-image { display: block; max-width: min(100%, 350px); max-height: 310px; margin-top: 7px; border-radius: 10px; object-fit: contain; background: #e7edf4; }
.message-file-name { margin-top: 5px; color: #8491a1; font-size: 8px; }
.chat-composer { position: relative; display: flex; align-items: flex-end; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; padding: 12px 14px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--dop-border-soft); background: #fff; }
.chat-censor-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; flex: 0 0 100%; width: fit-content; padding: 6px 10px; border: 1px solid #e0e8f0; border-radius: 10px; color: #718096; background: transparent; font: inherit; font-size: 10px; cursor: pointer; }
.chat-censor-toggle:hover { color: #315f91; border-color: #a9c7ec; }
.chat-censor-toggle.active { color: #f4ca76; border-color: #8a642d; background: #302719; }
.message-censored-badge { display: inline-block; margin: 0 0 5px; padding: 3px 7px; border: 1px solid #7b5d2a; border-radius: 999px; color: #f3c56f; background: #302719; font-size: 8px; }
.attach-button, .send-button { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid #e0e8f0; border-radius: 12px; color: #66788e; background: #f8fafc; font-size: 22px; font-weight: 400; }
.attach-button:hover { color: var(--dop-accent-deep); background: #eef5ff; }
.chat-composer textarea { flex: 1; min-height: 38px; max-height: 120px; resize: none; padding: 10px 12px; border: 1px solid #e0e8f0; border-radius: 12px; outline: none; color: #2b3c50; background: #fbfcfe; font-size: 12px; line-height: 1.4; }
.chat-composer textarea:focus { border-color: #83afe9; background: #fff; }
.send-button { border-color: var(--dop-accent-deep); color: #fff; background: var(--dop-accent-deep); font-size: 20px; font-weight: 700; }
.send-button:disabled { opacity: .55; }
.image-preview { position: absolute; bottom: calc(100% + 1px); left: 14px; display: flex; align-items: center; gap: 9px; max-width: calc(100% - 28px); padding: 8px 10px; border: 1px solid #e0e8f0; border-radius: 12px 12px 0 0; color: #63748a; background: #fff; font-size: 10px; }
.image-preview.hidden { display: none; }
.image-preview img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; }
.image-preview button { border: 0; color: #a04d4d; background: transparent; font-size: 16px; }
.readonly-chat-note { padding: 13px; border-top: 1px solid var(--dop-border-soft); color: #68809b; background: #f4f8fd; text-align: center; font-size: 10px; }

.helpdesk-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: none; }
.helpdesk-kpi { width: 100%; color: var(--ink); text-align: left; cursor: pointer; }
.helpdesk-kpi:hover { transform: translateY(-2px); border-color: rgba(59, 130, 246, 0.33); }
.helpdesk-panel { overflow: hidden; }
.ticket-item-button { display: block; width: 100%; border: 1px solid var(--dop-border-soft); color: inherit; text-align: left; cursor: pointer; }
.helpdesk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 18px; }
.helpdesk-toolbar .filter-group { margin-right: auto; }
.helpdesk-search { display: flex; align-items: center; gap: 9px; min-width: min(260px, 100%); height: 38px; padding: 0 11px; border: 1px solid #dfe6ed; border-radius: 11px; color: #8392a6; background: #fff; }
.helpdesk-search input { width: 100%; min-width: 0; border: 0; outline: none; color: #25364a; background: transparent; font-size: 11px; }
.helpdesk-row { cursor: pointer; transition: background .14s ease; }
.helpdesk-row:hover, .helpdesk-row:focus { outline: none; background: #f4f8fd; }
.helpdesk-row td { padding: 12px 10px; border-bottom: 1px solid var(--dop-border-soft); color: #59687a; font-size: 10px; vertical-align: middle; }
.helpdesk-row td:first-child { white-space: nowrap; }
.helpdesk-row strong { display: block; color: #29394d; font-size: 10px; line-height: 1.45; }
.helpdesk-row small { display: block; margin-top: 3px; color: #8996a7; font-size: 9px; }
.helpdesk-status-pill { display: inline-flex; padding: 5px 8px; border: 1px solid var(--dop-border); border-radius: 99px; color: #44526a; background: #eef2f7; font-size: 9px; font-weight: 700; white-space: nowrap; }
.helpdesk-status-pill.status-new { color: #1d69cc; border-color: #c9ddf7; background: #eaf2ff; }
.helpdesk-status-pill.status-approval { color: #946a1a; border-color: #ead8ab; background: #fff4e0; }
.helpdesk-status-pill.status-in_progress { color: #b8611e; border-color: #f0cba0; background: #fff0e0; }
.helpdesk-status-pill.status-testing { color: #6b3dad; border-color: #ddc7f5; background: #f4edff; }
.helpdesk-status-pill.status-done { color: #168b62; border-color: #a9e2cb; background: #e9f8f1; }
.helpdesk-status-pill.status-closed { color: #5d6b7d; border-color: #d4dbe3; background: #eef1f5; }
.helpdesk-dialog { width: min(1040px, calc(100vw - 26px)); max-width: 1040px; }
.helpdesk-dialog form { display: block; padding: 22px; }
.helpdesk-dialog .project-dialog-head { margin-bottom: 18px; }
.helpdesk-dialog-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .8fr); gap: 14px; align-items: start; }
.helpdesk-detail-main, .helpdesk-detail-side { display: grid; gap: 12px; min-width: 0; }
.helpdesk-detail-card { min-width: 0; padding: 16px; border: 1px solid var(--dop-border-soft); border-radius: 15px; background: #fafbfd; }
.helpdesk-detail-card h4 { margin: 0 0 11px; color: var(--ink); font: 700 12px var(--dop-font-display), sans-serif; }
.helpdesk-detail-flags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.helpdesk-ticket-message, .helpdesk-callout p, .helpdesk-official-note p { margin: 7px 0 0; color: #4a5a6e; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.helpdesk-callout { margin: 8px 0; padding: 10px 12px; border: 1px solid #ead8ab; border-radius: 11px; background: #fff8e8; }
.helpdesk-callout strong, .helpdesk-official-note strong { color: #946a1a; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.helpdesk-callout.desired { border-color: #a9e2cb; background: #eefbf4; }
.helpdesk-callout.desired strong { color: #168b62; }
.helpdesk-detail-meta { margin: 9px 0 0; color: #647387; font-size: 10px; line-height: 1.5; }
.helpdesk-detail-meta strong { color: #2a3a4e; }
.helpdesk-official-note { margin-top: 13px; padding: 11px; border: 1px solid #c9ddf7; border-radius: 11px; background: #eef5ff; }
.helpdesk-official-note strong { color: #1d69cc; }
.helpdesk-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.helpdesk-attachment-image { display: grid; width: min(180px, 42vw); overflow: hidden; border: 1px solid var(--dop-border-soft); border-radius: 10px; color: #4a5a6e; background: #fff; text-decoration: none; }
.helpdesk-attachment-image img { width: 100%; height: 110px; object-fit: cover; }
.helpdesk-attachment-image span { padding: 6px 8px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.helpdesk-file-chip { display: inline-flex; align-items: center; max-width: 100%; padding: 7px 9px; border: 1px solid #c9ddf7; border-radius: 9px; color: #1d69cc; background: #eef5ff; font-size: 9px; text-decoration: none; overflow-wrap: anywhere; }
.helpdesk-history { display: grid; gap: 9px; }
.helpdesk-history-entry { display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--dop-border-soft); }
.helpdesk-history-entry:last-child { border-bottom: 0; }
.history-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--dop-accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.13); }
.helpdesk-history-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.helpdesk-history-top strong { color: #2a3a4e; font-size: 10px; line-height: 1.45; }
.helpdesk-history-top time, .helpdesk-history-entry small { color: #8996a7; font-size: 9px; white-space: nowrap; }
.helpdesk-history-entry p { margin: 6px 0; color: #59687a; font-size: 10px; line-height: 1.5; white-space: pre-wrap; }
.helpdesk-dialog .helpdesk-detail-side .field { margin: 10px 0; }
.helpdesk-attachment-picker { padding: 10px; border: 1px dashed var(--dop-border); border-radius: 11px; }
.helpdesk-attachment-picker input { max-width: 100%; color: #647387; font-size: 9px; }
.helpdesk-attachment-picker small { color: #8292a7; font-size: 9px; overflow-wrap: anywhere; }
.helpdesk-readonly-note { margin: 12px 0 0; color: #946a1a; font-size: 10px; }
.helpdesk-reply-button { background: linear-gradient(100deg, #147bd4, #2762d8); }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 9px 11px; border-bottom: 1px solid var(--dop-border-soft); color: #8996a6; font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 11px; border-bottom: 1px solid var(--dop-border-soft); color: #59687a; font-size: 10px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { min-width: 230px; color: #29394d; font-weight: 650; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: min(380px, calc(100vw - 32px)); padding: 12px 15px; border-radius: 12px; color: #fff; background: var(--dop-navy); box-shadow: 0 9px 30px rgba(6, 21, 37, 0.19); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s ease; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #9f3737; }
.sidebar-backdrop { display: none; }

/* ===== DIALOGY, PROJEKTOVÝ FORMULÁŘ, PRŮBĚH PRÁCE, ONLINE LIDÉ, ODSTÁVKA ===== */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.icon-button { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border: 1px solid var(--dop-border-soft); border-radius: 8px; color: #647387; background: #fff; font-size: 12px; }
.icon-button:hover { color: var(--dop-accent-deep); border-color: rgba(59, 130, 246, 0.3); background: #eef5ff; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 15px; border: 1px solid #dfe6ed; border-radius: 11px; color: #44526a; background: #fff; font-size: 11px; font-weight: 700; }
.secondary-button:hover { background: #f4f7fb; }

dialog { padding: 0; border: 0; }
dialog::backdrop { background: rgba(6, 14, 27, 0.5); backdrop-filter: blur(2px); }
.work-dialog { width: min(640px, calc(100vw - 26px)); max-width: 640px; overflow: visible; border: 1px solid var(--dop-border); border-radius: 22px; background: var(--dop-surface-elevated); color: var(--ink); box-shadow: 0 30px 70px rgba(6, 21, 37, 0.35); }
.work-dialog form { display: grid; gap: 14px; padding: 22px; }
.project-dialog-head { display: flex; align-items: flex-start; gap: 13px; }
.project-dialog-head > div { flex: 1; min-width: 0; }
.project-dialog-head h3 { margin: 0; font: 750 16px var(--dop-font-display), sans-serif; letter-spacing: -.03em; }
.dialog-x { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border: 1px solid var(--dop-border-soft); border-radius: 50%; color: #8996a7; background: transparent; font-size: 16px; }
.dialog-x:hover { color: #44526a; background: #f4f7fb; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.project-title-field input { font-size: 13px; font-weight: 650; }
.project-fields-row { display: grid; grid-template-columns: minmax(160px, .9fr) minmax(220px, 1.1fr); gap: 14px; align-items: start; }
.project-upload { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border: 1px dashed #c6d3e0; border-radius: 11px; color: #44526a; background: #fafbfd; cursor: pointer; }
.project-upload:hover { border-color: #9db8dd; background: #f3f7fc; }
.upload-icon { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; color: #3d6da4; background: var(--blue-soft); font-size: 13px; }
.upload-copy { min-width: 0; }
.upload-copy strong, .upload-copy small { display: block; }
.upload-copy strong { font-size: 10px; }
.upload-copy small { margin-top: 2px; color: #8996a7; font-size: 9px; }
.project-file-selection { margin-top: 6px; color: #647387; font-size: 9px; overflow-wrap: anywhere; }
.existing-project-files { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.existing-files-label { color: #8996a7; font-size: 9px; font-weight: 700; }
.existing-project-files a { display: inline-flex; align-items: center; padding: 6px 9px; border: 1px solid #c9ddf7; border-radius: 9px; color: #1d69cc; background: #eef5ff; font-size: 9px; text-decoration: none; }

.work-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.work-image-link { display: grid; width: min(160px, 40vw); overflow: hidden; border: 1px solid var(--dop-border-soft); border-radius: 10px; color: #4a5a6e; background: #fff; text-decoration: none; }
.work-image-link img { width: 100%; height: 95px; object-fit: cover; }
.work-image-link span { padding: 6px 8px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.work-file-link { display: inline-flex; align-items: center; max-width: 100%; padding: 7px 9px; border: 1px solid #c9ddf7; border-radius: 9px; color: #1d69cc; background: #eef5ff; font-size: 9px; text-decoration: none; overflow-wrap: anywhere; }
.work-progress { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--dop-border-soft); }
.work-progress-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.work-progress-heading strong { color: #526175; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.work-progress-heading span { color: #929eac; font-size: 8px; }
.work-progress-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.work-progress-list li > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.work-progress-list li strong { color: #39495c; font-size: 10px; }
.work-progress-list li time { color: #9aa6b4; font-size: 8px; white-space: nowrap; }
.work-progress-list li p { margin: 4px 0 0; color: #647387; font-size: 10px; line-height: 1.5; white-space: pre-wrap; }
.work-progress-empty p { margin: 0; color: #8996a7; font-size: 10px; }
.work-progress-compose { margin-top: 10px; }
.work-progress-compose summary { color: var(--dop-accent-deep); font-size: 10px; font-weight: 700; cursor: pointer; }
.work-progress-form { display: grid; gap: 8px; margin-top: 8px; }
.work-progress-form textarea { width: 100%; padding: 9px 11px; border: 1px solid #dfe6ed; border-radius: 10px; outline: none; color: #25364a; background: #fff; font-size: 11px; resize: vertical; }
.work-progress-form .primary-button { justify-self: start; min-height: 34px; }

.online-panel .panel-heading { margin-bottom: 11px; }
.online-users { display: flex; flex-wrap: wrap; gap: 8px; }
.online-users.compact { gap: 6px; }
.online-person { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #d9eee4; border-radius: 99px; color: #407c62; background: #f4fcf7; font-size: 10px; font-weight: 650; }
.online-person i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 99px; background: var(--dop-success); }
.online-empty { color: #8996a7; font-size: 10px; }

.maintenance-panel .panel-heading { margin-bottom: 16px; }
.maintenance-form { display: grid; gap: 16px; }
.maintenance-toggle { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--dop-border-soft); border-radius: 14px; background: #fafbfd; cursor: pointer; }
.maintenance-toggle input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--dop-accent-deep); }
.maintenance-toggle-copy strong, .maintenance-toggle-copy small { display: block; }
.maintenance-toggle-copy strong { font-size: 12px; }
.maintenance-toggle-copy small { margin-top: 4px; color: #647387; font-size: 10px; line-height: 1.5; }
.maintenance-fields { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 12px; }
.maintenance-preview { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid #ead8ab; border-radius: 13px; background: #fff8e8; }
.maintenance-preview.is-disabled { opacity: .6; }
.maintenance-preview-icon { font-size: 18px; }
.maintenance-preview strong { display: block; color: #946a1a; font-size: 11px; }
.maintenance-preview p { margin: 5px 0 0; color: #7a5e26; font-size: 10px; line-height: 1.5; }
.maintenance-preview-warning { margin: 6px 0 0; color: #b3533d; font-size: 9px; }

@media (max-width: 1080px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .work-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-heading { grid-column: 1 / -1; }
    .work-form .primary-button { justify-self: start; }
}

@media (max-width: 760px) {
    .app-shell { gap: 0; padding: 0; }
    .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(290px, calc(100vw - 55px)); height: 100vh; height: 100dvh; padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: max(14px, env(safe-area-inset-bottom)); border-radius: 0; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 18px 0 45px rgba(7, 22, 41, 0.27); }
    .sidebar.open { transform: none; }
    .sidebar-backdrop.show { position: fixed; inset: 0; z-index: 35; display: block; background: rgba(7, 22, 41, 0.46); backdrop-filter: blur(2px); }
    .main-area { border-radius: 0; border: 0; }
    .topbar { min-height: 68px; gap: 11px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; }
    .menu-button { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 37px; height: 37px; flex: 0 0 37px; padding: 8px; border: 1px solid #e2e9f0; border-radius: 10px; background: white; }
    .menu-button span { height: 2px; width: 100%; border-radius: 2px; background: #52647a; }
    .topbar h1 { font-size: 17px; }
    .topbar-title .eyebrow { margin-bottom: 3px; font-size: 8px; }
    .user-meta { display: none; }
    .avatar { width: 34px; height: 34px; }
    .content-scroll { padding: 20px 16px max(25px, env(safe-area-inset-bottom)); }
    .welcome-row { align-items: flex-start; margin-bottom: 16px; }
    .welcome-row h2 { font-size: 22px; }
    .welcome-row .muted { max-width: 48ch; font-size: 11px; }
    .live-pill { padding: 7px 8px; font-size: 8px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .chat-preview { align-items: flex-start; flex-direction: column; }
    .chat-preview .primary-button { align-self: stretch; }
    .readonly-banner { margin: 10px 12px 0; }
    .readonly-banner small { font-size: 9px; }
    .chat-panel { height: calc(100dvh - 190px); min-height: 360px; }
    .chat-section { min-height: 0; }
    .chat-messages { padding: 14px 11px; }
    .message { max-width: 90%; }
    .panel { padding: 16px; }
    .panel-heading { align-items: flex-start; flex-wrap: wrap; }
}

@media (max-width: 520px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .stat-card { min-height: 83px; gap: 9px; padding: 12px 10px; border-radius: 14px; }
    .stat-icon { width: 33px; height: 33px; flex-basis: 33px; border-radius: 10px; font-size: 16px; }
    .stat-value { font-size: 20px; }
    .stat-label { font-size: 9px; }
    .panel { padding: 14px; border-radius: 15px; }
    .panel-heading h3, .form-heading h3 { font-size: 13px; }
    .text-button { font-size: 10px; }
    .work-form { grid-template-columns: 1fr; gap: 11px; padding: 14px; }
    .work-files-field { grid-column: auto; }
    .form-heading { grid-column: auto; }
    .work-form .primary-button { width: 100%; }
    .filter-group { width: 100%; }
    .filter-button { flex: 1; padding: 0 5px; font-size: 8px; }
    .ticket-item, .work-item { padding: 11px; }
    .helpdesk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .welcome-row .live-pill { display: none; }
    .link-button { width: 100%; }
    .chat-panel { height: calc(100dvh - 176px); min-height: 310px; }
    .chat-head { padding: 12px 13px; }
    .chat-composer { gap: 6px; padding-right: 9px; padding-left: 9px; }
    .attach-button, .send-button { width: 35px; height: 37px; flex-basis: 35px; }
    .chat-composer textarea { font-size: 16px; }
    .table-wrap { margin: 0 -3px; width: calc(100% + 6px); }
    th, td { padding-right: 8px; padding-left: 8px; }
    .toast { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* ===== TMAVÝ REŽIM — paleta shodná s Portálem 2 (#171b1f / #1b1f24 / #2c323a) ===== */
html[data-theme="dark"] {
    color-scheme: dark;
}
html[data-theme="dark"] :root,
html[data-theme="dark"] body {
    --dop-surface: #15181c;
    --dop-surface-elevated: #1b1f24;
    --dop-ink: #d8dde4;
    --dop-ink-muted: #8d9cb0;
    --dop-border: #2c323a;
    --dop-border-soft: #23282e;
    --dop-thead: #181b20;
    --dop-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --dop-shadow-md: 0 10px 28px rgba(0, 0, 0, 0.35);
    --dop-shadow-sidebar: 0 4px 16px rgba(0, 0, 0, 0.4), 0 18px 48px rgba(0, 0, 0, 0.45);
    --navy: var(--dop-navy);
    --ink: var(--dop-ink);
    --muted: var(--dop-ink-muted);
    --line: var(--dop-border-soft);
    --surface: var(--dop-surface-elevated);
    --canvas: var(--dop-surface);
    --blue-soft: #16243d;
    --green-soft: #12291f;
    --orange-soft: #2e2211;
    --violet-soft: #221c38;
    --shadow: var(--dop-shadow-md);
}
html.theme-switching, html.theme-switching * { transition: none !important; }
html[data-theme="dark"] body {
    background: radial-gradient(ellipse 70% 50% at 0% 0%, rgba(59, 130, 246, 0.08), transparent 55%), var(--canvas);
    color: var(--ink);
}
html[data-theme="dark"] .main-area {
    border-color: var(--dop-border);
    background: var(--dop-surface-elevated);
}
html[data-theme="dark"] .topbar {
    background: rgba(27, 31, 36, 0.72);
    border-bottom-color: var(--dop-border);
}
html[data-theme="dark"] .eyebrow { color: #7c8aa0; }
html[data-theme="dark"] .theme-toggle {
    border-color: var(--dop-border);
    color: var(--dop-ink-muted);
    background: var(--dop-surface);
}
html[data-theme="dark"] .theme-toggle:hover { border-color: rgba(96, 165, 250, 0.35); color: #93c5fd; }
html[data-theme="dark"] .avatar { border-color: #2b4a73; color: #8fc1ff; background: #16243d; }
html[data-theme="dark"] .user-meta strong { color: #e4e9f0; }
html[data-theme="dark"] .user-meta small { color: #7c8aa0; }
html[data-theme="dark"] .live-pill, html[data-theme="dark"] .online-mark { border-color: #1f4030; color: #6fcf9e; background: #11201a; }
html[data-theme="dark"] .stat-card, html[data-theme="dark"] .panel { border-color: var(--dop-border); background: var(--dop-surface-elevated); }
html[data-theme="dark"] .stat-card:hover, html[data-theme="dark"] .panel:hover { box-shadow: 0 15px 34px rgba(0, 0, 0, 0.4); }
html[data-theme="dark"] .stat-icon.red { background: #321515; }
html[data-theme="dark"] .stat-label { color: #7c8aa0; }
html[data-theme="dark"] .text-button { color: #60a5fa; }
html[data-theme="dark"] .text-button:hover { color: #93c5fd; }
html[data-theme="dark"] .work-item, html[data-theme="dark"] .ticket-item { border-color: var(--dop-border-soft); background: #181b20; }
html[data-theme="dark"] .work-item:hover, html[data-theme="dark"] .ticket-item:hover { border-color: rgba(96, 165, 250, 0.3); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
html[data-theme="dark"] .work-title, html[data-theme="dark"] .ticket-subject { color: #e4e9f0; }
html[data-theme="dark"] .work-description { color: #a7b2c2; }
html[data-theme="dark"] .work-meta, html[data-theme="dark"] .ticket-meta { color: #7c8aa0; }
html[data-theme="dark"] .status-pill { color: #8fc1ff; background: var(--blue-soft); }
html[data-theme="dark"] .status-pill.done { color: #6fcf9e; background: var(--green-soft); }
html[data-theme="dark"] .priority-pill { color: #e0c27a; background: #2e2211; }
html[data-theme="dark"] .priority-pill.p1, html[data-theme="dark"] .priority-pill.p2 { color: #e59485; background: #321c17; }
html[data-theme="dark"] .readonly-banner { border-color: #234b80; color: #8fc1ff; background: #16243d; }
html[data-theme="dark"] .readonly-banner small { color: #7ba0c9; }
html[data-theme="dark"] .field > span { color: #a7b2c2; }
html[data-theme="dark"] .field small { color: #6b7686; }
html[data-theme="dark"] .field input, html[data-theme="dark"] .field textarea, html[data-theme="dark"] .field select { border-color: #2c323a; color: #e4e9f0; background: #181b20; }
html[data-theme="dark"] .field input:focus, html[data-theme="dark"] .field textarea:focus, html[data-theme="dark"] .field select:focus { border-color: #3b7fd1; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18); }
html[data-theme="dark"] .filter-group { background: #181b20; }
html[data-theme="dark"] .filter-button { color: #8d9cb0; }
html[data-theme="dark"] .filter-button.active { color: #93c5fd; background: #23282e; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
html[data-theme="dark"] .small-button { border-color: #1f4030; color: #6fcf9e; background: #11201a; }
html[data-theme="dark"] .small-button:hover { background: #163123; }
html[data-theme="dark"] .small-button.reopen { border-color: #234b80; color: #8fc1ff; background: #16243d; }
html[data-theme="dark"] .empty-state, html[data-theme="dark"] .empty-cell { color: #7c8aa0; }
html[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #181b20, #1f242b, #181b20); }
html[data-theme="dark"] .chat-head { border-bottom-color: var(--dop-border-soft); }
html[data-theme="dark"] .chat-head small { color: #7c8aa0; }
html[data-theme="dark"] .chat-messages { background: #15181c; }
html[data-theme="dark"] .message-avatar { color: #8fc1ff; background: #16243d; }
html[data-theme="dark"] .message.mine .message-avatar { color: #6fcf9e; background: #11201a; }
html[data-theme="dark"] .message-body { border-color: #23282e; color: #d8dde4; background: #1b1f24; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
html[data-theme="dark"] .message.mine .message-body { border-color: #234b80; background: #16243d; }
html[data-theme="dark"] .message-head strong { color: #a7b2c2; }
html[data-theme="dark"] .message-head time, html[data-theme="dark"] .message-file-name { color: #6b7686; }
html[data-theme="dark"] .message-text { color: #d8dde4; }
html[data-theme="dark"] .message-image { background: #23282e; }
html[data-theme="dark"] .chat-composer { border-top-color: var(--dop-border-soft); background: #1b1f24; }
html[data-theme="dark"] .chat-censor-toggle { border-color: #2c323a; color: #8d9cb0; }
html[data-theme="dark"] .chat-censor-toggle:hover { color: #93c5fd; border-color: #3b7fd1; }
html[data-theme="dark"] .attach-button, html[data-theme="dark"] .send-button { border-color: #2c323a; color: #a7b2c2; background: #181b20; }
html[data-theme="dark"] .attach-button:hover { color: #93c5fd; background: #16243d; }
html[data-theme="dark"] .chat-composer textarea { border-color: #2c323a; color: #e4e9f0; background: #181b20; }
html[data-theme="dark"] .chat-composer textarea:focus { border-color: #3b7fd1; background: #1b1f24; }
html[data-theme="dark"] .send-button { border-color: var(--dop-accent-deep); color: #fff; background: var(--dop-accent-deep); }
html[data-theme="dark"] .image-preview { border-color: #2c323a; color: #a7b2c2; background: #1b1f24; }
html[data-theme="dark"] .readonly-chat-note { border-top-color: var(--dop-border-soft); color: #7c8aa0; background: #181b20; }
html[data-theme="dark"] .helpdesk-search { border-color: #2c323a; color: #8d9cb0; background: #181b20; }
html[data-theme="dark"] .helpdesk-search input { color: #e4e9f0; }
html[data-theme="dark"] .helpdesk-row:hover, html[data-theme="dark"] .helpdesk-row:focus { background: #1f242b; }
html[data-theme="dark"] .helpdesk-row td { border-bottom-color: var(--dop-border-soft); color: #a7b2c2; }
html[data-theme="dark"] .helpdesk-row strong { color: #e4e9f0; }
html[data-theme="dark"] .helpdesk-row small { color: #7c8aa0; }
html[data-theme="dark"] .helpdesk-status-pill { color: #a7b2c2; border-color: #2c323a; background: #181b20; }
html[data-theme="dark"] .helpdesk-status-pill.status-new { color: #8fc1ff; border-color: #234b80; background: #16243d; }
html[data-theme="dark"] .helpdesk-status-pill.status-approval { color: #e0c27a; border-color: #5a4720; background: #2e2211; }
html[data-theme="dark"] .helpdesk-status-pill.status-in_progress { color: #e5a96a; border-color: #5c3f1c; background: #2e2010; }
html[data-theme="dark"] .helpdesk-status-pill.status-testing { color: #c3a4f0; border-color: #4a3a6b; background: #231c38; }
html[data-theme="dark"] .helpdesk-status-pill.status-done { color: #6fcf9e; border-color: #1f4030; background: #11201a; }
html[data-theme="dark"] .helpdesk-status-pill.status-closed { color: #a7b2c2; border-color: #2c323a; background: #1b1f24; }
html[data-theme="dark"] .helpdesk-detail-card { border-color: var(--dop-border-soft); background: #181b20; }
html[data-theme="dark"] .helpdesk-detail-card h4 { color: var(--ink); }
html[data-theme="dark"] .helpdesk-ticket-message, html[data-theme="dark"] .helpdesk-callout p, html[data-theme="dark"] .helpdesk-official-note p { color: #a7b2c2; }
html[data-theme="dark"] .helpdesk-callout { border-color: #5a4720; background: #2e2211; }
html[data-theme="dark"] .helpdesk-callout strong, html[data-theme="dark"] .helpdesk-official-note strong { color: #e0c27a; }
html[data-theme="dark"] .helpdesk-callout.desired { border-color: #1f4030; background: #11201a; }
html[data-theme="dark"] .helpdesk-callout.desired strong { color: #6fcf9e; }
html[data-theme="dark"] .helpdesk-detail-meta { color: #7c8aa0; }
html[data-theme="dark"] .helpdesk-detail-meta strong { color: #e4e9f0; }
html[data-theme="dark"] .helpdesk-official-note { border-color: #234b80; background: #16243d; }
html[data-theme="dark"] .helpdesk-official-note strong { color: #8fc1ff; }
html[data-theme="dark"] .helpdesk-attachment-image { border-color: var(--dop-border-soft); color: #a7b2c2; background: #181b20; }
html[data-theme="dark"] .helpdesk-file-chip { border-color: #234b80; color: #8fc1ff; background: #16243d; }
html[data-theme="dark"] .helpdesk-history-entry { border-bottom-color: var(--dop-border-soft); }
html[data-theme="dark"] .helpdesk-history-top strong { color: #e4e9f0; }
html[data-theme="dark"] .helpdesk-history-top time, html[data-theme="dark"] .helpdesk-history-entry small { color: #7c8aa0; }
html[data-theme="dark"] .helpdesk-history-entry p { color: #a7b2c2; }
html[data-theme="dark"] .helpdesk-attachment-picker { border-color: #2c323a; }
html[data-theme="dark"] .helpdesk-attachment-picker input { color: #a7b2c2; }
html[data-theme="dark"] .helpdesk-attachment-picker small { color: #6b7686; }
html[data-theme="dark"] .helpdesk-readonly-note { color: #e0c27a; }
html[data-theme="dark"] th { border-bottom-color: var(--dop-border-soft); color: #7c8aa0; background: transparent; }
html[data-theme="dark"] td { border-bottom-color: var(--dop-border-soft); color: #a7b2c2; }
html[data-theme="dark"] td:first-child { color: #e4e9f0; }
html[data-theme="dark"] .toast { background: #0d2a49; box-shadow: 0 9px 30px rgba(0, 0, 0, 0.5); }
html[data-theme="dark"] .toast.error { background: #6b2323; }
html[data-theme="dark"] .work-dialog { border-color: var(--dop-border); background: var(--dop-surface-elevated); color: var(--ink); }
html[data-theme="dark"] .dialog-x { color: #8d9cb0; }
html[data-theme="dark"] .secondary-button { border-color: #2c323a; color: #a7b2c2; background: #181b20; }
html[data-theme="dark"] .secondary-button:hover { background: #1f242b; }

/* ===== PŘIHLÁŠENÍ / 2FA — dvoukolonkový styl shodný s Portálem 2 ===== */
.login-stage { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; min-height: 100vh; min-height: 100dvh; overflow: hidden; background: #fff; }
.login-brand, .login-panel { position: relative; z-index: 2; }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(32px, 5vw, 64px); color: var(--dop-ink); background: radial-gradient(ellipse at 10% 0%, rgba(59, 130, 246, 0.12), transparent 50%), linear-gradient(165deg, var(--dop-navy-mid), var(--dop-navy) 55%, var(--dop-navy-deep)); }
.login-brand .brand { padding: 0; }
.login-brand .brand strong { color: #fff; }
.login-brand .brand small { color: rgba(255, 255, 255, 0.6); }
.login-eyebrow { margin: 0 0 16px; color: #93c5fd; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.login-hero h1 { margin: 0; color: #fff; font: 800 clamp(32px, 4.4vw, 48px) var(--dop-font-display), sans-serif; letter-spacing: -.03em; line-height: 1.12; }
.login-hero h1 span.highlight { color: #60a5fa; }
.login-lead { margin: 18px 0 0; max-width: 420px; color: rgba(255, 255, 255, 0.68); font-size: 14px; line-height: 1.65; }
.login-features-row { display: flex; gap: 24px; margin-top: 34px; }
.login-feature-item { display: flex; flex-direction: column; align-items: flex-start; }
.login-feature-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 10px; border-radius: 14px; color: #bfdbfe; background: rgba(59, 130, 246, 0.18); font-size: 19px; }
.login-feature-title { color: #e8f0ff; font-size: 12px; font-weight: 700; line-height: 1.3; }
.login-tagline { margin-top: 36px; color: #93c5fd; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.login-panel { display: grid; place-items: center; padding: clamp(24px, 4vw, 48px); background: var(--dop-surface); }
.login-card { width: min(440px, 100%); padding: 44px 38px 32px; border-radius: 28px; background: var(--dop-surface-elevated); border: 1px solid var(--dop-border-soft); box-shadow: 0 25px 60px rgba(13, 42, 73, 0.12), 0 4px 20px rgba(15, 23, 42, 0.04); animation: cardRise .6s var(--dop-ease) .1s both; }
@keyframes cardRise { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
.login-card .brand { padding: 0 0 22px; }
.login-card .brand strong { color: var(--dop-ink); }
.login-card .brand small { color: var(--dop-ink-muted); }
.login-card h1 { margin: 0; font: 800 26px var(--dop-font-display), sans-serif; letter-spacing: -.02em; color: var(--dop-ink); }
.login-card .lead { margin: 8px 0 24px; color: var(--dop-ink-muted); font-size: 13px; line-height: 1.55; }
.login-card .eyebrow { margin: 0 0 10px; color: var(--dop-accent-deep); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-error { margin: 0 0 18px; padding: 12px 14px; border: 1px solid #fecaca; border-radius: 12px; color: #dc2626; background: #fee2e2; font-size: 13px; font-weight: 600; line-height: 1.45; }
.login-form { display: grid; gap: 14px; }
.login-form label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; color: var(--dop-navy-mid); }
.login-form input { width: 100%; height: 48px; padding: 0 16px; border: 1px solid var(--dop-border); border-radius: 13px; outline: none; color: var(--dop-ink); background: var(--dop-surface); font-size: 14px; transition: .18s var(--dop-ease); }
.login-form input:focus { border-color: var(--dop-accent); background: var(--dop-surface-elevated); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); }
.login-form .primary-button { width: 100%; height: 48px; margin-top: 6px; font-size: 13px; }
.logout-link.standalone { display: inline-flex; margin-top: 20px; color: var(--dop-ink-muted); font-size: 12px; text-decoration: none; }
.logout-link.standalone:hover { color: var(--dop-accent-deep); }

.pin-form { align-items: center; text-align: center; }
.pin-label { justify-self: center; }
.pin-value { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 6px 0 4px; }
.pin-dot { width: 14px; height: 14px; border: 2px solid var(--dop-border); border-radius: 50%; background: transparent; transition: .16s var(--dop-ease); }
.pin-dot.filled { border-color: var(--dop-accent-deep); background: var(--dop-accent-deep); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15); }
.pin-feedback { min-height: 16px; margin: 0; color: var(--dop-ink-muted); font-size: 11px; }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; justify-self: center; width: min(280px, 100%); margin-top: 8px; }
.pin-key { height: 56px; border: 1px solid var(--dop-border); border-radius: 16px; color: var(--dop-ink); background: var(--dop-surface); font: 700 18px var(--dop-font-display), sans-serif; transition: .14s var(--dop-ease); }
.pin-key:hover:not(:disabled) { border-color: rgba(37, 99, 235, 0.3); background: var(--dop-surface-elevated); box-shadow: 0 4px 12px rgba(13, 42, 73, 0.08); }
.pin-key:active:not(:disabled) { transform: scale(.96); }
.pin-key:disabled { opacity: .55; cursor: not-allowed; }
.pin-key-utility { color: var(--dop-ink-muted); font-size: 13px; font-weight: 700; }
.pin-note { margin-top: 18px; text-align: center; }

@media (max-width: 900px) {
    .login-stage { grid-template-columns: 1fr; }
    .login-brand { padding-bottom: 28px; }
    .login-hero h1 { font-size: clamp(28px, 8vw, 40px); }
    .login-features-row { display: none; }
}

@media (max-width: 640px) {
    .login-brand { padding: 24px 22px 18px; }
    .login-panel { padding: 8px 18px max(24px, env(safe-area-inset-bottom)); }
    .login-card { padding: 30px 22px 24px; border-radius: 22px; }
}

html[data-theme="dark"] .login-stage { background: var(--dop-surface); }
html[data-theme="dark"] .login-error { border-color: rgba(248, 113, 113, 0.35); color: #fca5a5; background: rgba(239, 68, 68, 0.16); }
html[data-theme="dark"] .login-form input { background: #15181c; border-color: #2c323a; color: var(--dop-ink); }
html[data-theme="dark"] .login-form input:focus { background: #1b1f24; border-color: var(--dop-accent); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.22); }
html[data-theme="dark"] .login-card { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
html[data-theme="dark"] .pin-key { background: #15181c; border-color: #2c323a; }
html[data-theme="dark"] .pin-key:hover:not(:disabled) { background: #1b1f24; border-color: rgba(59, 130, 246, 0.35); }
