/* ═══════════════════════════════════════════════════════════
   SEKTOR PANEL — style.css
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html {
    touch-action: pan-x pan-y;
    -ms-touch-action: pan-x pan-y;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #f0f4fb, #e8eef8);
    color: #111;
    overflow-x: hidden;
    overscroll-behavior: none;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, #f0f4fb, #e8eef8);
    pointer-events: none;
}

/* ── GLASS UTILITY ───────────────────────────────────────── */

.glass {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    border: 1.5px solid rgba(255,255,255,0.82);
    box-shadow: 0 8px 40px rgba(80,100,160,0.10), inset 0 1px 0 rgba(255,255,255,0.85);
}

/* ── LOGIN ───────────────────────────────────────────────── */

.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-box {
    max-width: 420px;
    width: 100%;
    padding: 44px 40px;
    border-radius: 28px;
}

.auth-box h1 {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 3px;
    margin-bottom: 4px;
}

.sub {
    text-align: center;
    opacity: 0.55;
    margin-bottom: 28px;
    font-size: 14px;
}

.auth-box input {
    width: 100%;
    padding: 13px 16px;
    margin: 7px 0;
    border-radius: 14px;
    border: 1.5px solid rgba(0,0,0,0.09);
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(14px);
    outline: none;
    font-size: 15px;
    transition: border-color 0.2s;
}

.auth-box input:focus { border-color: rgba(80,120,220,0.4); }

.auth-box button {
    width: 100%;
    padding: 13px;
    margin-top: 12px;
    border: none;
    border-radius: 14px;
    background: #111;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-box button:hover { background: #2a2a2a; }

.error {
    background: rgba(255,80,80,0.10);
    color: #900;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 14px;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */

.sidebar {
    position: fixed;
    top: 16px;
    left: 16px;
    bottom: 16px;
    width: 240px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    padding: 18px 16px;
    gap: 6px;
    z-index: 1000;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar { display: none; }

.logo {
    text-decoration: none;
    color: #111;
    font-weight: 800;
    font-size: 18px;
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.55);
    border: 1.5px solid rgba(255,255,255,0.7);
    transition: background 0.2s;
    letter-spacing: 1px;
}

.logo:hover { background: rgba(255,255,255,0.80); }

.sidebar-domain {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.38;
    padding: 0 4px 6px 15px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: -2px;
    text-transform: uppercase;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 800;
    opacity: 0.32;
    padding: 10px 4px 4px 15px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.nav {
    text-decoration: none;
    color: #111;
    opacity: 0.72;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 13px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 9px;
}

.nav:hover { opacity: 1; background: rgba(255,255,255,0.48); }
.nav.active { background: rgba(255,255,255,0.65); opacity: 1; }

.nav.danger {
    margin-top: auto;
    background: rgba(255,80,80,0.12);
    color: #900;
    opacity: 1;
}

.nav.danger:hover { background: rgba(255,80,80,0.24); }

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* ── TOPBAR ──────────────────────────────────────────────── */

.topbar {
    position: sticky;
    top: 16px;
    z-index: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 22px;
    margin: 16px 16px 0 274px;
    border-radius: 20px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.greeting {
    font-weight: 700;
    font-size: 14px;
    opacity: 0.65;
}

.user {
    font-weight: 700;
    opacity: 0.7;
    font-size: 14px;
    text-decoration: none;
    color: inherit;
    padding: 7px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.5);
    border: 1.5px solid rgba(255,255,255,0.75);
    transition: background 0.2s;
}

.user:hover { background: rgba(255,255,255,0.8); }

/* ── HAMBURGER ───────────────────────────────────────────── */

.menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    gap: 5px;
    flex-shrink: 0;
}

.menu-btn .bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: #111;
}

.menu-btn-inside {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    align-self: flex-end;
    margin-bottom: 4px;
    position: relative;
    flex-shrink: 0;
}

.menu-btn-inside .bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: #111;
    position: absolute;
}

.menu-btn-inside .bar1 { transform: rotate(45deg); top: 17px; }
.menu-btn-inside .bar2 { opacity: 0; }
.menu-btn-inside .bar3 { transform: rotate(-45deg); top: 17px; }

/* ── CONTENT ─────────────────────────────────────────────── */

.content {
    margin-left: 274px;
    padding: 20px 20px 40px;
}

.hero {
    text-align: left;
    padding: 20px 20px 10px;
}

.hero h1 {
    font-size: 32px;
    margin: 0 0 5px;
    font-weight: 800;
}

.hero p {
    margin: 0;
    opacity: 0.55;
    font-size: 15px;
}

/* ── GRID / CARDS ────────────────────────────────────────── */

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 0 20px;
}

.card {
    padding: 26px 28px;
    border-radius: 22px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.42;
}

.card p {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

@media (hover: hover) {
    .card:hover {
        border-color: rgba(255,255,255,0.98);
        box-shadow: 0 12px 50px rgba(80,100,160,0.15), inset 0 1px 0 rgba(255,255,255,0.95);
    }
}

.wide { grid-column: span 2; }

/* ── BADGES ──────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
}

.badge-green { background: rgba(34,197,94,0.14); color: #166534; }
.badge-red   { background: rgba(239,68,68,0.14); color: #991b1b; }
.badge-blue  { background: rgba(59,130,246,0.14); color: #1d4ed8; }
.badge-ping  { background: rgba(100,116,139,0.12); color: #475569; }

/* ── BUTTONS ─────────────────────────────────────────────── */

.btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    background: #111;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover { background: #2d2d2d; }

.btn-outline {
    padding: 10px 20px;
    border: 1.5px solid rgba(0,0,0,0.15);
    border-radius: 12px;
    background: rgba(255,255,255,0.6);
    color: #111;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-outline:hover { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.25); }

.btn-danger {
    padding: 10px 20px;
    border: 1.5px solid rgba(239,68,68,0.3);
    border-radius: 12px;
    background: rgba(239,68,68,0.08);
    color: #991b1b;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover { background: rgba(239,68,68,0.18); }

.btn-success {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    background: rgba(34,197,94,0.85);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-success:hover { background: rgba(34,197,94,1); }

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 12px;
    background: rgba(255,255,255,0.6);
    border: 1.5px solid rgba(255,255,255,0.8);
    color: #111;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s;
    flex-shrink: 0;
}

.back-btn:hover { background: rgba(255,255,255,0.9); }

/* ── SETTINGS ────────────────────────────────────────────── */

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0 20px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 22px 28px;
}

.settings-info h3 {
    margin: 0 0 5px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.42;
}

.settings-info p { margin: 0; font-size: 15px; opacity: 0.72; }

/* ── TOGGLE SWITCH ───────────────────────────────────────── */

/*
 * Správné použití:
 *
 *   <label class="toggle-row">
 *     <input type="checkbox">
 *     <div class="toggle-track">
 *       <div class="toggle-thumb"></div>
 *     </div>
 *   </label>
 */

.toggle-row {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
}

/* skrytý nativní checkbox */
.toggle-row input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* dráha / track */
.toggle-track {
    position: relative;
    width: 50px;
    height: 28px;
    border-radius: 14px;
    background: rgba(0,0,0,0.12);
    border: 1.5px solid rgba(0,0,0,0.08);
    transition: background 0.26s cubic-bezier(0.4,0,0.2,1),
                border-color 0.26s cubic-bezier(0.4,0,0.2,1);
}

/* kulička / thumb */
.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 5px rgba(0,0,0,0.22);
    transition: transform 0.26s cubic-bezier(0.4,0,0.2,1);
    will-change: transform;
}

/* aktivní stav */
.toggle-row input:checked + .toggle-track {
    background: #22c55e;
    border-color: #16a34a;
}

/* kulička posunutá doprava:
   track šířka 50px − 2×border 3px − thumb 18px − left offset 3px = 26px
   ale border je uvnitř box-sizing, takže:
   50px − 3px(left) − 18px(thumb) − 3px(right margin) = 26px */
.toggle-row input:checked + .toggle-track .toggle-thumb {
    transform: translateX(22px);
}

/* hover efekty */
.toggle-row:hover .toggle-track {
    border-color: rgba(0,0,0,0.16);
}

.toggle-row:hover input:checked + .toggle-track {
    background: #16a34a;
    border-color: #15803d;
}

/* focus přístupnost */
.toggle-row input:focus-visible + .toggle-track {
    outline: 2px solid rgba(80,120,220,0.5);
    outline-offset: 2px;
}

/* ── ADMIN PANEL ─────────────────────────────────────────── */

.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 16px;
    flex-wrap: wrap;
}

.admin-toolbar-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.45;
    flex: 1;
}

.admin-wb-list,
.admin-linka-list,
.admin-client-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 20px 20px;
}

.admin-wb-item,
.admin-linka-item,
.admin-client-card {
    border-radius: 18px;
    padding: 18px 22px;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-client-card:hover,
.admin-wb-item:hover,
.admin-linka-item:hover {
    border-color: rgba(255,255,255,0.98);
    box-shadow: 0 12px 40px rgba(80,100,160,0.13);
}

.admin-client-domain {
    font-weight: 800;
    font-size: 15px;
    flex: 1;
}

.admin-client-email {
    font-size: 13px;
    opacity: 0.55;
    flex: 1;
}

.admin-client-arrow {
    opacity: 0.35;
    font-size: 18px;
}

.admin-detail-panel {
    display: none;
    border-radius: 16px;
    background: rgba(255,255,255,0.55);
    border: 1.5px solid rgba(255,255,255,0.75);
    padding: 18px 22px;
    margin-top: 8px;
    gap: 14px;
    flex-direction: column;
}

.admin-detail-panel.open { display: flex; }

.admin-detail-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.admin-detail-kv { font-size: 13px; opacity: 0.7; }
.admin-detail-kv strong { color: #111; opacity: 1; }

.create-db-form {
    background: rgba(255,255,255,0.6);
    border-radius: 16px;
    border: 1.5px solid rgba(255,255,255,0.75);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 20px 20px;
}

.create-db-form h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
}

.create-db-form input,
.create-db-form select {
    padding: 11px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.75);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.create-db-form input:focus,
.create-db-form select:focus { border-color: rgba(80,120,220,0.4); }

.create-db-row { display: flex; gap: 10px; flex-wrap: wrap; }
.create-db-row input { flex: 1; min-width: 140px; }

.create-db-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    border-radius: 12px;
    background: rgba(255,255,255,0.6);
    border: 1.5px solid rgba(255,255,255,0.8);
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: #111;
    transition: background 0.2s;
    user-select: none;
}

.create-db-toggle:hover { background: rgba(255,255,255,0.9); }
.create-db-toggle .chevron { transition: transform 0.25s; }
.create-db-toggle.open .chevron { transform: rotate(90deg); }

.chat-view-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

/* ── POPUPS ──────────────────────────────────────────────── */

.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.28);
    backdrop-filter: blur(6px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.popup-overlay.active { display: flex; }

.popup {
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.popup h3 { margin: 0; font-size: 18px; font-weight: 800; }
.popup p { margin: 0; font-size: 14px; opacity: 0.65; }

.popup input {
    padding: 12px 15px;
    border-radius: 12px;
    border: 1.5px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.7);
    font-size: 15px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
}

.popup input:focus { border-color: rgba(80,120,220,0.4); }

.popup-error { color: #991b1b; font-size: 13px; min-height: 18px; }

.popup-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ── CHAT ────────────────────────────────────────────────── */

.chat-wrap {
    margin: 0 20px 40px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: calc(100vh - 160px);
}

body.service-page .content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 52px);
    overflow: hidden;
    padding-bottom: 0;
}

body.service-page .chat-wrap {
    flex: 1;
    max-height: none;
    margin-bottom: 0;
    border-radius: 22px;
}

.chat-outer {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.chat-outer .chat-wrap {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.chat-pinned-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-pinned-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.42;
    padding: 4px 6px;
}

.chat-pinned-msg {
    border-radius: 14px;
    padding: 12px 15px;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.chat-pinned-msg .unpin-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.4;
    font-size: 12px;
    color: #111;
    padding: 2px 5px;
    border-radius: 6px;
    transition: opacity 0.2s, background 0.2s;
}

.chat-pinned-msg .unpin-btn:hover { opacity: 1; background: rgba(0,0,0,0.08); }

.chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    flex-shrink: 0;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(80,100,180,0.14);
    color: #334;
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-header-name { font-weight: 800; font-size: 15px; }
.chat-header-sub { font-size: 12px; opacity: 0.45; margin-top: 2px; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overscroll-behavior: contain;
}

.chat-system-msg {
    text-align: center;
    font-size: 12px;
    color: #888;
    background: rgba(0,0,0,0.04);
    border-radius: 12px;
    padding: 8px 16px;
    margin-bottom: 4px;
}

.chat-msg { display: flex; }
.msg-me, .msg-user { justify-content: flex-end; }
.msg-other, .msg-developer { justify-content: flex-start; }

.msg-bubble {
    max-width: 68%;
    padding: 11px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    position: relative;
}

.msg-bubble:hover .msg-pin-btn { display: flex; }

.msg-pin-btn {
    display: none;
    position: absolute;
    top: -10px;
    right: 8px;
    background: rgba(255,255,255,0.92);
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    color: #334;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0,0,0,0.10);
    z-index: 10;
}

.msg-pin-btn:hover { background: #fff; }
.msg-me .msg-pin-btn { right: auto; left: 8px; }

.msg-me .msg-bubble, .msg-user .msg-bubble {
    background: rgba(60,90,210,0.11);
    border-bottom-right-radius: 5px;
}

.msg-other .msg-bubble, .msg-developer .msg-bubble {
    background: rgba(255,255,255,0.82);
    border: 1.5px solid rgba(0,0,0,0.07);
    border-bottom-left-radius: 5px;
}

.msg-text { display: block; margin-bottom: 3px; }

.msg-time {
    font-size: 11px;
    opacity: 0.38;
    margin-top: 5px;
    text-align: right;
}

.msg-developer .msg-time, .msg-other .msg-time { text-align: left; }

.msg-image-wrap { margin: 6px 0; }

.msg-image {
    max-width: 100%;
    max-height: 220px;
    border-radius: 12px;
    display: block;
}

.msg-file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 13px;
    color: #334;
    text-decoration: none;
    background: rgba(0,0,0,0.05);
    padding: 5px 10px;
    border-radius: 10px;
}

.msg-file-link:hover { background: rgba(0,0,0,0.1); }
.msg-file-icon { font-size: 14px; }

.msg-pinned-indicator {
    font-size: 10px;
    opacity: 0.5;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid rgba(0,0,0,0.07);
    flex-shrink: 0;
}

.chat-attach {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(0,0,0,0.05);
    cursor: pointer;
    color: #555;
    flex-shrink: 0;
    transition: background 0.2s;
}

.chat-attach:hover { background: rgba(0,0,0,0.10); }

.chat-input-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.chat-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    background: rgba(60,90,210,0.08);
    padding: 5px 10px;
    border-radius: 10px;
}

.chat-file-clear {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    padding: 0;
    margin: 0;
}

.chat-textarea {
    width: 100%;
    resize: none;
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #111;
    min-height: 24px;
    max-height: 140px;
    overflow-y: auto;
}

.chat-send {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    background: #111;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    padding: 0;
}

.chat-send:hover { background: #333; }

/* ── CUSTOMER LINE (chatlink.php) ────────────────────────── */

.chatlink-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f0f4fb, #e8eef8);
    overscroll-behavior: none;
}

.chatlink-header {
    padding: 20px 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatlink-brand {
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 2px;
    color: #111;
    text-decoration: none;
}

.chatlink-tagline {
    font-size: 12px;
    opacity: 0.45;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chatlink-main {
    flex: 1;
    display: flex;
    gap: 24px;
    padding: 0 20px 20px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    align-items: flex-start;
}

.chatlink-info-panel {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chatlink-info-card {
    border-radius: 20px;
    padding: 22px 20px;
}

.chatlink-info-card h3 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.45;
}

.chatlink-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 13px;
    line-height: 1.5;
}

.chatlink-feature:last-child { border-bottom: none; }

.chatlink-feature-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.chatlink-feature-text strong { display: block; font-weight: 700; font-size: 13px; }
.chatlink-feature-text span { opacity: 0.55; font-size: 12px; }

.chatlink-chat-panel { flex: 1; min-width: 0; padding-top: 50px;}

.chatlink-chat-panel .chat-wrap {
    margin: 0;
    max-height: calc(100vh - 130px);
    border-radius: 22px;
}

.chatlink-name-prompt {
    border-radius: 22px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.chatlink-name-prompt h2 { margin: 0; font-size: 22px; font-weight: 800; }

.chatlink-name-prompt p {
    margin: 0;
    opacity: 0.55;
    font-size: 14px;
    max-width: 320px;
}

.chatlink-name-prompt input {
    padding: 13px 18px;
    border-radius: 14px;
    border: 1.5px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.75);
    font-size: 15px;
    outline: none;
    width: 100%;
    max-width: 320px;
    transition: border-color 0.2s;
}

.chatlink-name-prompt input:focus { border-color: rgba(80,120,220,0.4); }

.chatlink-pinned-area {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatlink-pinned-area .chat-pinned-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.42;
}

/* ── NASTAVENÍ / FIELD GROUP ─────────────────────────────── */

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-group label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.45;
}

.field-group input,
.field-group select {
    padding: 11px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.72);
    font-size: 14px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
}

.field-group input:focus,
.field-group select:focus { border-color: rgba(80,120,220,0.4); }

/* Tab notification pulse */
@keyframes favicon-pulse { 0%,100%{opacity:1;} 50%{opacity:0;} }

/* ── MOBILNÍ VERZE ───────────────────────────────────────── */

@media (max-width: 930px) {

    .sidebar {
        transform: translateX(-110%);
        transition: transform 0.28s ease;
        top: 0;
        left: 0;
        bottom: 0;
        width: 86%;
        max-width: 320px;
        border-radius: 0 22px 22px 0;
        z-index: 2000;
    }

    .sidebar.active { transform: translateX(0); }

    .topbar {
        position: sticky;
        top: 0;
        margin: 0;
        border-radius: 0;
        z-index: 500;
    }

    .content { margin-left: 0; padding: 10px 10px 30px; }

    body.service-page .content {
        height: calc(100vh - 52px);
        padding: 0;
    }

    body.service-page .hero { display: none; }

    body.service-page .chat-wrap {
        margin: 0;
        border-radius: 0;
        max-height: none;
    }

    .grid { grid-template-columns: 1fr; padding: 0 6px; }
    .wide { grid-column: auto; }
    .settings-list { padding: 0 6px; }

    .chat-wrap { margin: 0 6px 20px; max-height: calc(100vh - 110px); }
    .msg-bubble { max-width: 84%; }

    .menu-btn { display: flex; }
    .menu-btn-inside { display: flex; }

    .hero { padding: 14px 12px 8px; }
    .hero h1 { font-size: 24px; }

    .admin-toolbar { padding: 0 6px 14px; flex-wrap: wrap; }
    .admin-client-list, .admin-wb-list, .admin-linka-list { padding: 0 6px 16px; }

    .chat-outer { flex-direction: column; }
    .chat-outer .chat-wrap { margin: 0; max-height: 60vh; }

    .chat-pinned-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .chat-pinned-msg { flex: 1 1 200px; }

    .chatlink-main { flex-direction: column; padding: 0 10px 20px; gap: 14px; }
    .chatlink-info-panel { width: 100%; }
    .chatlink-chat-panel .chat-wrap { max-height: 60vh; }

    .chat-view-actions { margin-left: 0; width: 100%; }

    .admin-client-card { flex-wrap: wrap; }

    .create-db-form { margin: 0 6px 16px; }
}