:root {
    --dark-bg: #0f172a;
    --darker-bg: #0a0f1f;
    --card-bg: #1e293b;
    --card-hover: #334155;
    --border-color: #334155;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-light: rgba(129, 140, 248, 0.1);
    --danger: #f87171;
    --success: #22c55e;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --radius: 12px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

header {
    background-color: rgba(10, 15, 31, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1.1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
}

.nav-links a, .nav-links button {
    color: var(--text-secondary);
    text-decoration: none;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links button:hover {
    color: var(--accent);
    background-color: var(--accent-light);
}

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover { background-color: var(--accent-hover); }

.btn-secondary {
    background-color: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-secondary:hover { background-color: rgba(129, 140, 248, 0.2); }

.btn-danger {
    background-color: rgba(248, 113, 113, 0.12);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger:hover { background-color: rgba(248, 113, 113, 0.22); }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
}
.btn-secondary .btn-spinner { border-color: rgba(129, 140, 248, 0.3); border-top-color: var(--accent); }
@keyframes btn-spin { to { transform: rotate(360deg); } }

.btn-block { width: 100%; }

.hero-section {
    display: flex;
    align-items: center;
    min-height: 78vh;
    padding: 3rem 0;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1.2rem;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 620px;
}

.action-buttons { display: flex; gap: 1rem; }

.kanban-explanation {
    padding: 4rem 0;
    border-top: 1px solid var(--border-color);
}

.kanban-explanation h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
}

.explanation-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.explanation-card {
    background-color: var(--card-bg);
    padding: 1.8rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.explanation-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.explanation-card p { color: var(--text-secondary); }

.legal-page { max-width: 760px; padding-top: 3rem; padding-bottom: 3rem; }
.legal-page h1 { display: flex; align-items: center; gap: 12px; font-size: 2rem; margin-bottom: 0.4rem; }
.legal-page .legal-updated { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 2rem; }
.legal-page .explanation-card { margin-bottom: 1.2rem; }
.legal-page .explanation-card ul { margin: 0.6rem 0 0 1.2rem; color: var(--text-secondary); }
.legal-page .explanation-card li { margin-bottom: 0.4rem; }
.legal-page .explanation-card a, .legal-page a { color: var(--accent); }
.legal-page .legal-note { color: var(--text-secondary); font-size: 0.9rem; margin-top: 1.5rem; }

footer {
    padding: 2.5rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1rem; }
.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

.auth-wrap {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2.2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}

.auth-subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.95rem; }

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--darker-bg);
    padding: 4px;
    border-radius: 10px;
}

.auth-tabs button {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.auth-tabs button.active {
    background: var(--accent);
    color: white;
}

.form-group { margin-bottom: 1.1rem; }

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-hint { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.3rem; }

.agreement-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1.1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.4;
}
.agreement-check input { margin-top: 0.2rem; accent-color: var(--accent); cursor: pointer; }
.agreement-check a { color: var(--accent); text-decoration: none; }
.agreement-check a:hover { text-decoration: underline; }

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-links { display: flex; justify-content: space-between; margin-top: 1rem; font-size: 0.9rem; }
.auth-links a, .auth-links button {
    background: none; border: none; color: var(--accent); cursor: pointer; text-decoration: none; font-size: 0.9rem; padding: 0;
}
.auth-links a:hover, .auth-links button:hover { text-decoration: underline; }

.alert {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}
.alert.show { display: block; }
.alert-error { background: rgba(248, 113, 113, 0.12); color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.3); }
.alert-success { background: rgba(34, 197, 94, 0.12); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.3); }

.captcha-widget {
    display: inline-block;
    width: 100%;
    max-width: 260px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    padding: 10px 12px;
    margin-bottom: 1.1rem;
    font-size: 14px;
}

.captcha-row { display: flex; align-items: center; gap: 10px; }

.captcha-checkbox {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    border: 1.5px solid var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    background: transparent;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.captcha-checkbox:hover { border-color: var(--accent); }
.captcha-checkbox.solved { border-color: var(--success); background: var(--success); }
.captcha-checkbox.error { border-color: var(--danger); }

.captcha-checkbox .captcha-spinner {
    display: none;
    width: 14px; height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: captcha-spin 0.7s linear infinite;
}
.captcha-checkbox.solving .captcha-spinner { display: block; }
@keyframes captcha-spin { to { transform: rotate(360deg); } }

.captcha-check { display: none; color: white; }
.captcha-checkbox.solved .captcha-check { display: block; }

.captcha-label { flex: 1; color: var(--text); }

.captcha-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}
.captcha-footer svg { flex-shrink: 0; opacity: 0.8; }

.cabinet-wrap, .admin-wrap { padding: 3rem 0; position: relative; }

.cabinet-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.cabinet-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(129, 140, 248, 0.35);
}

.cabinet-header h1 { font-size: 1.9rem; margin-bottom: 0.3rem; }
.cabinet-header .cabinet-meta { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; color: var(--text-secondary); font-size: 0.95rem; }

.verified-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.board-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--card-bg) 0%, var(--darker-bg) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    box-shadow: var(--shadow);
}

.board-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
}

.board-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--accent-light);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.9rem;
}

.board-card h2 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.board-card .board-card-subtitle { color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 1rem; }

.link-copy-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 0.6rem 0.6rem 1rem;
    max-width: 420px;
}

.board-link {
    font-family: 'SFMono-Regular', Consolas, monospace;
    color: var(--text);
    font-size: 0.88rem;
    overflow-x: auto;
    white-space: nowrap;
    flex: 1;
}

.link-copy-box button {
    flex-shrink: 0;
    padding: 0.45rem 0.7rem;
    background: var(--accent-light);
    color: var(--accent);
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}
.link-copy-box button:hover { background: rgba(129, 140, 248, 0.25); }

.card-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; }

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.tip-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
}
.tip-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.tip-card .tip-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
}
.tip-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.tip-card p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.5; }

.admin-callout {
    margin-top: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}
.admin-callout p { color: var(--text); font-size: 0.92rem; }
.admin-callout strong { color: var(--accent); }

table.admin-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
table.admin-table th, table.admin-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.92rem;
}
table.admin-table th { color: var(--text-secondary); font-weight: 600; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-muted { background: var(--border-color); color: var(--text-secondary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-danger { background: rgba(248, 113, 113, 0.15); color: var(--danger); }

.admin-section { margin-top: 2.5rem; }
.admin-section h2 { font-size: 1.4rem; margin-bottom: 1rem; }

.ticket-status-heading { display: flex; align-items: center; gap: 0.6rem; }
.ticket-status-group + .ticket-status-group { margin-top: 2rem; }

.table-wrap { overflow-x: auto; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 0.5rem 1rem; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; border-radius: 6px; }

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}
.stat-tile {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.2rem;
}
.stat-tile-label { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 0.4rem; }
.stat-tile-value { font-size: 1.7rem; font-weight: 700; color: var(--text); }

.chart-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.2rem 1rem 0.5rem;
}
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 140px;
}
.chart-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    height: 100%;
    gap: 2px;
    min-width: 6px;
}
.chart-bar-col:hover { opacity: 0.85; }
.chart-bar-solved { background: var(--success); border-radius: 2px 2px 0 0; min-height: 0; }
.chart-bar-failed { background: var(--danger); border-radius: 2px 2px 0 0; min-height: 0; }

.chart-timeline {
    position: relative;
    padding-top: 0.6rem;
    margin-top: 0.3rem;
    border-top: 1px dashed var(--border-color);
}
.chart-labels {
    display: flex;
    gap: 3px;
}
.chart-label-col {
    flex: 1;
    min-width: 6px;
    text-align: center;
    position: relative;
}
.chart-label-col::before {
    content: '';
    position: absolute;
    top: -0.7rem;
    left: 50%;
    width: 1px;
    height: 5px;
    background: var(--border-color);
}
.chart-label-col span {
    display: inline-block;
    font-size: 0.68rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.chart-legend {
    display: flex;
    gap: 1.2rem;
    justify-content: flex-end;
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.chart-dot-solved { background: var(--success); }
.chart-dot-failed { background: var(--danger); }

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.pagination button {
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
}
.pagination button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

.admin-search {
    position: relative;
    max-width: 340px;
    margin-bottom: 1rem;
}
.admin-search i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.85rem;
    pointer-events: none;
}
.admin-search input {
    width: 100%;
    padding: 0.6rem 0.9rem 0.6rem 2.2rem;
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}
.admin-search input:focus {
    outline: none;
    border-color: var(--accent);
}
.admin-search .no-results {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(10, 15, 31, 0.6);
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    width: min(560px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.modal-content h3 { font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--accent); }

.modal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 1.5rem; }

.ticket-modal { width: min(600px, 100%); display: flex; flex-direction: column; }

.ticket-modal-header {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin: -2rem -2rem 1.2rem -2rem;
    padding: 1.3rem 2rem;
    background: var(--darker-bg);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius) var(--radius) 0 0;
}

.ticket-modal-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.ticket-welcome {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.ticket-welcome i { color: var(--accent); margin-top: 0.15rem; }

.ticket-messages {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.2rem 0 1rem;
    max-height: 50vh;
    overflow-y: auto;
}

.ticket-msg-row { display: flex; flex-direction: column; max-width: 78%; }
.ticket-msg-row.msg-admin { align-self: flex-end; align-items: flex-end; }
.ticket-msg-row.msg-user { align-self: flex-start; align-items: flex-start; }

.ticket-msg-sender { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--text-secondary); margin-bottom: 0.35rem; }
.ticket-msg-avatar { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.6rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.msg-admin .ticket-msg-avatar { background: linear-gradient(135deg, var(--accent), #6366f1); }
.msg-user .ticket-msg-avatar { background: var(--border-color); color: var(--text); }

.ticket-msg-bubble {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 0.85rem 0.4rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.ticket-msg-text { white-space: pre-wrap; word-break: break-word; }
.ticket-msg-time { align-self: flex-end; font-size: 0.65rem; opacity: 0.65; margin-top: 0.2rem; }
.msg-admin .ticket-msg-bubble { background: linear-gradient(135deg, var(--accent), #6366f1); color: #fff; border-bottom-right-radius: 4px; }
.msg-user .ticket-msg-bubble { background: var(--darker-bg); border: 1px solid var(--border-color); border-bottom-left-radius: 4px; }

.ticket-reply-form { display: flex; gap: 0.6rem; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.ticket-reply-form textarea {
    flex: 1;
    resize: vertical;
    min-height: 46px;
    max-height: 140px;
    padding: 0.6rem 0.9rem;
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}
.ticket-reply-form textarea:focus { outline: none; border-color: var(--accent); }
.ticket-reply-form button { align-self: flex-end; }

@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.2rem; }
    .action-buttons { flex-direction: column; }
    .btn { width: 100%; }
    .board-card { flex-direction: column; align-items: flex-start; }
    .link-copy-box { max-width: 100%; width: 100%; }
    .recent-events-grid { grid-template-columns: 1fr !important; }
}

/* Виджет поддержки (своя система тикетов) */
#support-widget-btn {
    position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px;
    border-radius: 50%; background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
    color: #fff; border: none; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.4);
    font-size: 22px; cursor: pointer; z-index: 2000;
    display: flex; align-items: center; justify-content: center; transition: transform 0.15s ease;
}
#support-widget-btn:hover { transform: scale(1.06); }

#support-widget-panel {
    position: fixed; bottom: 92px; right: 24px; width: 340px;
    max-width: calc(100vw - 32px); max-height: min(520px, calc(100vh - 120px));
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); z-index: 2000;
    display: flex; flex-direction: column; overflow: hidden;
}
#support-widget-panel.hidden { display: none; }

.sw-header { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1rem; border-bottom: 1px solid var(--border-color); background: var(--darker-bg); }
.sw-header h4 { margin: 0; font-size: 1rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.sw-header button { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1rem; }
.sw-header button:hover { color: var(--text); }

.sw-body { flex: 1; overflow-y: auto; padding: 1rem; }
.sw-footer { padding: 0.8rem 1rem; border-top: 1px solid var(--border-color); }

.sw-ticket-item { padding: 0.7rem 0.8rem; border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 0.6rem; cursor: pointer; transition: border-color 0.15s ease; }
.sw-ticket-item:hover { border-color: var(--accent); }
.sw-ticket-item .sw-ticket-subject { font-size: 0.88rem; color: var(--text); margin-bottom: 0.25rem; font-weight: 600; }
.sw-ticket-item .sw-ticket-meta { font-size: 0.75rem; color: var(--text-secondary); display: flex; justify-content: space-between; gap: 0.5rem; }

.sw-empty { color: var(--text-secondary); font-size: 0.85rem; text-align: center; padding: 1.5rem 0.5rem; }

.sw-field { margin-bottom: 0.8rem; }
.sw-field label { display: block; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.3rem; }
.sw-field input, .sw-field textarea {
    width: 100%; padding: 0.55rem 0.7rem; background: var(--darker-bg);
    border: 1px solid var(--border-color); border-radius: 8px; color: var(--text);
    font-family: inherit; font-size: 0.85rem; box-sizing: border-box;
}
.sw-field textarea { resize: vertical; min-height: 70px; }
.sw-field input:focus, .sw-field textarea:focus { outline: none; border-color: var(--accent); }

.sw-btn { width: 100%; padding: 0.6rem; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.sw-btn:hover { background: var(--accent-hover); }
.sw-btn-secondary { background: none; border: 1px solid var(--border-color); color: var(--text-secondary); }
.sw-btn-secondary:hover { border-color: var(--accent); color: var(--text); }

.sw-back { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 0.82rem; margin-bottom: 0.8rem; display: flex; align-items: center; gap: 6px; padding: 0; }
.sw-back:hover { color: var(--text); }

.sw-messages { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 0.8rem; }

.sw-welcome {
    display: flex; align-items: flex-start; gap: 0.5rem;
    background: var(--accent-light); border: 1px solid var(--accent); border-radius: 10px;
    padding: 0.65rem 0.8rem; margin: 0.9rem 0; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45;
}
.sw-welcome i { color: var(--accent); margin-top: 0.15rem; }

.sw-msg-row { display: flex; flex-direction: column; max-width: 85%; }
.sw-msg-row-user { align-self: flex-end; align-items: flex-end; }
.sw-msg-row-admin { align-self: flex-start; align-items: flex-start; }

.sw-msg-sender { display: flex; align-items: center; gap: 5px; font-size: 0.68rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.sw-msg-avatar { width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.55rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.sw-msg-row-user .sw-msg-avatar { background: linear-gradient(135deg, var(--accent), #6366f1); }
.sw-msg-row-admin .sw-msg-avatar { background: var(--border-color); color: var(--text); }

.sw-msg-bubble { display: flex; flex-direction: column; padding: 0.5rem 0.7rem 0.35rem; border-radius: 12px; font-size: 0.85rem; line-height: 1.45; }
.sw-msg-text { white-space: pre-wrap; word-break: break-word; }
.sw-msg-time { align-self: flex-end; font-size: 0.62rem; opacity: 0.65; margin-top: 0.2rem; }
.sw-msg-row-user .sw-msg-bubble { background: linear-gradient(135deg, var(--accent), #6366f1); color: #fff; border-bottom-right-radius: 3px; }
.sw-msg-row-admin .sw-msg-bubble { background: var(--darker-bg); border: 1px solid var(--border-color); border-bottom-left-radius: 3px; }

.sw-status-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 0.8rem; margin-bottom: 0.9rem;
    background: var(--darker-bg); border: 1px solid var(--border-color); border-radius: 10px;
    font-size: 0.85rem; font-weight: 600; color: var(--text);
}
.sw-status-row .sw-status-badge { padding: 0.15rem 0.5rem; border-radius: 6px; font-size: 0.68rem; font-weight: 600; }
.sw-status-open { background: var(--accent-light); color: var(--accent); }
.sw-status-closed { background: var(--border-color); color: var(--text-secondary); }

@media (max-width: 480px) {
    #support-widget-panel { right: 16px; left: 16px; width: auto; bottom: 88px; }
    #support-widget-btn { right: 16px; }
}

/* Всегда последним правилом в файле — при равной специфичности с другими
   одиночными классами (.modal, .admin-section и т.п.) должен побеждать он. */
.hidden { display: none; }
