/**
 * Mini CMS — Admin Dashboard Styles
 * Light theme default, sidebar layout
 *
 * ═══════════════════════════════════════════════════════════
 * DESIGN CONSTRAINTS (AI agents must follow):
 * ═══════════════════════════════════════════════════════════
 * - font-weight: max 500 (no bold/600+)
 * - border-radius: use --radius (4px) or --radius-lg (8px) only
 * - colors: use CSS variables, never hardcode
 * - spacing: 4px grid (4, 8, 12, 16, 20, 24...)
 * ═══════════════════════════════════════════════════════════
 */

/* ── Reset & Variables ─────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Light theme (default) - warm cream/stone palette */
    --bg: #faf9f7;
    --bg-sidebar: #e9e7e3;
    --bg-preview: #e4e2de;
    --bg-input: #faf9f7;
    --bg-card: #faf9f7;
    --bg-hover: #eeece8;
    --bg-active: #e8e6e1;
    --border: #dedad4;
    --border-subtle: #e8e5df;
    --text: #2d2a26;
    --text-muted: #78736b;
    --text-subtle: #a39d94;
    --primary: #5c6b5e;
    --primary-hover: #4a574c;
    --primary-text: #fff;
    --danger: #b54a4a;
    --danger-hover: #9c3f3f;
    --danger-bg: #f8eeee;
    --success: #5a8a5e;
    --radius: 4px;
    --radius-lg: 8px;
    --radius-pill: 20px;
    --shadow: 0 2px 12px rgba(45, 42, 38, .06);
    --shadow-lg: 0 4px 24px rgba(45, 42, 38, .10);
    --transition: .15s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* Typography scale (rem) - kooskõlas editor.css */
    --font-xs: 0.75rem;
    --font-sm: 0.8125rem;
    --font-base: 0.875rem;
    --font-lg: 1rem;
    --font-xl: 1.125rem;
    /* Spacing (4px grid) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
}

[data-theme="dark"] {
    /* Dark theme - VSCode/Anti inspired warm dark */
    --bg: #1a1918;
    --bg-sidebar: #232220;
    --bg-preview: #1a1918;
    --bg-input: #1a1918;
    --bg-card: #2a2927;
    --bg-hover: #333231;
    --bg-active: #3a3937;
    --border: #3a3836;
    --border-subtle: #333130;
    --text: #e8e6e3;
    --text-muted: #9a9590;
    --text-subtle: #6b6661;
    --primary: #7d9a7f;
    --primary-hover: #6b876d;
    --primary-text: #1a1918;
    --danger: #c66;
    --danger-hover: #b55;
    --danger-bg: rgba(204, 102, 102, .15);
    --success: #7d9a7f;
    --shadow: 0 2px 12px rgba(0, 0, 0, .4);
    --shadow-lg: 0 4px 24px rgba(0, 0, 0, .5);
}

/* Auto dark mode via system preference (for login page without JS) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #1a1918;
        --bg-sidebar: #232220;
        --bg-preview: #1a1918;
        --bg-input: #1a1918;
        --bg-card: #2a2927;
        --bg-hover: #333231;
        --bg-active: #3a3937;
        --border: #3a3836;
        --border-subtle: #333130;
        --text: #e8e6e3;
        --text-muted: #9a9590;
        --text-subtle: #6b6661;
        --primary: #7d9a7f;
        --primary-hover: #6b876d;
        --primary-text: #1a1918;
        --danger: #c66;
        --danger-hover: #b55;
        --danger-bg: rgba(204, 102, 102, .15);
        --success: #7d9a7f;
        --shadow: 0 2px 12px rgba(0, 0, 0, .4);
        --shadow-lg: 0 4px 24px rgba(0, 0, 0, .5);
    }
}

html {
    font-size: 16px;
}

html,
body {
    height: 100%;
}

body {
    font-size: var(--font-base);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ── Utility classes ────────────────────────────────────── */
.u-hidden {
    display: none !important;
}

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

.invite-url-field {
    margin-bottom: var(--space-4);
}

.twofa-qr-wrap {
    text-align: center;
    margin: var(--space-2) 0;
}

.twofa-qr-img {
    max-width: 180px;
    border-radius: var(--radius);
}

.settings-hint-strong {
    font-weight: 500;
}

.sidebar-header.clickable {
    cursor: pointer;
    margin-bottom: var(--space-2);
}

.settings-actions.mt-2 {
    margin-top: var(--space-2);
}

.doc-debug-pre {
    font-size: 0.6875rem;
    opacity: 0.6;
    white-space: pre-wrap;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ── App Body Layout ───────────────────────────────────── */
.app-body {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
    width: 400px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-sidebar);
}

#sidebarMain {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 400;
    letter-spacing: -0.3px;
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition);
}

/* ── Sidebar Tabs ───────────────────────────────────────── */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-sidebar);
    flex-shrink: 0;
}

.tab-item {
    flex: 1;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
}

.tab-item:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-active);
}

.sidebar-content-view {
    flex: 1;
    overflow-y: auto;
    display: none;
}

.sidebar-content-view.active {
    display: block;
}

/* ── Content Sections ────────────────────────────────────── */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-xs);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

/* ── Search View ────────────────────────────────────────── */
.search-container {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-sidebar);
    z-index: 10;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: var(--font-base);
    color: var(--text);
    outline: none;
    transition: border var(--transition);
}

.search-input:focus {
    border-color: var(--primary);
}

.search-results {
    padding-bottom: 20px;
}

.search-section-title {
    font-size: var(--font-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 12px 16px 4px;
}

/* ── User Row Improvements ──────────────────────────────── */
.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition);
}

.user-item:hover {
    background: var(--bg-hover);
}

.user-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-base);
    color: var(--primary);
    flex-shrink: 0;
}

.user-item-info {
    flex: 1;
    overflow: hidden;
}

.user-item-name {
    font-size: var(--font-base);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-item-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-item.user-add {
    background: transparent;
    border-bottom: 1px solid var(--border);
}

.user-item.user-add:hover {
    background: var(--bg-hover);
}

.user-item.user-add .user-item-avatar {
    background: var(--primary);
    color: var(--primary-text);
    font-size: var(--font-xl);
    font-weight: 300;
}

.user-item.user-add .user-item-name {
    color: var(--text-muted);
}

.user-item.user-add:hover .user-item-name {
    color: var(--text);
}

.sidebar-brand:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

.brand-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.site-list {
    flex: 1;
    overflow-y: auto;
}

.site-list::-webkit-scrollbar {
    width: 4px;
}

.site-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.site-loading,
.site-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-sm);
}

/* ── Site Row ──────────────────────────────────────────── */
.site-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background var(--transition);
    gap: 10px;
}

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

.site-row.active {
    background: var(--bg-card);
    border-right: 2px solid var(--text-muted);
}

.site-thumb {
    width: 40px;
    height: 28px;
    border-radius: 4px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-xs);
    font-weight: 400;
    color: var(--text-muted);
}

.site-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.site-info {
    flex: 1;
    min-width: 0;
}

.site-name {
    font-size: var(--font-base);
    font-weight: 400;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
    margin-bottom: 2px;
}

.site-sub {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
}

.site-domain {
    font-size: var(--font-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.site-files {
    font-size: 0.6875rem;
    color: var(--text-subtle);
}

.badge {
    font-size: 0.5625rem;
    font-weight: 400;
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    letter-spacing: .3px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ── Sidebar Settings Panel ────────────────────────────── */
.sidebar-settings {
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
    display: none;
}

.sidebar-settings.open {
    display: block;
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: 0 -4px 12px rgba(45, 42, 38, .04);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}

.settings-header:hover {
    background: var(--bg-hover);
}

#webmasterSettingsHeader,
#userSettingsHeader,
#settingsHeader {
    cursor: default;
}

#webmasterSettingsHeader:hover,
#userSettingsHeader:hover,
#settingsHeader:hover {
    background: transparent;
}

#webmasterSettingsName,
#userSettingsName,
#settingsName {
    min-width: 0;
}

.invite-inline {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}

.invite-inline .settings-input {
    flex: 1;
    min-width: 0;
}

.wm-header-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.wm-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 4px;
    flex-wrap: wrap;
}

.wm-info-email {
    font-size: var(--font-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.settings-site-name {
    font-size: var(--font-sm);
    font-weight: 400;
    color: var(--text);
    letter-spacing: -0.1px;
}

.settings-toggle {
    font-size: 0.625rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.sidebar-settings.collapsed .settings-toggle {
    transform: rotate(-90deg);
}

.settings-body {
    padding: 0 16px 16px;
}

.sidebar-settings.collapsed .settings-body {
    display: none;
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-value {
    font-size: var(--font-xs);
    color: var(--text);
}

.settings-lbl {
    font-size: 0.6875rem;
    color: var(--text-muted);
    width: 60px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-val {
    font-size: var(--font-sm);
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-input {
    flex: 1;
    font-size: var(--font-sm);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 5px 9px;
    color: var(--text);
    background: var(--bg-input);
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), background var(--transition);
}

.settings-input:focus {
    border-color: var(--primary);
    background: var(--bg);
}

.settings-footer {
    display: flex;
    gap: 8px;
    align-items: center;
}

.apply-btn {
    flex: 1;
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    padding: 8px;
    color: var(--primary-text);
    font-size: var(--font-sm);
    font-weight: 400;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition);
}

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

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

/* ── Profile display / edit ────────────────────────── */

.profile-display {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.profile-name {
    font-size: var(--font-base);
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-actions {
    display: flex;
    gap: 8px;
}

.settings-actions .apply-btn {
    flex: 1;
}

.settings-actions .admin-btn-ghost {
    flex: 0;
    white-space: nowrap;
}

/* ── Billing toggle ───────────────────────────────── */

.billing-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.billing-toggle-btn {
    flex: 1;
    border: none;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: var(--font-xs);
    font-family: inherit;
    padding: 6px 8px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.billing-toggle-btn+.billing-toggle-btn {
    border-left: 1.5px solid var(--border);
}

.billing-toggle-btn.active {
    background: var(--primary);
    color: var(--primary-text);
}

.billing-toggle-btn:hover:not(.active) {
    background: var(--bg-hover);
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.collapsible-arrow {
    font-size: 0.625rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.collapsible-body {
    margin-top: 8px;
}

.backup-codes-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 8px 0;
}

.backup-code {
    font-family: monospace;
    font-size: var(--font-xs);
    padding: 4px 6px;
    background: var(--bg-hover);
    border-radius: 4px;
    text-align: center;
    letter-spacing: 1px;
}

.twofa-status-enabled {
    font-size: var(--font-xs);
    font-weight: 500;
    color: var(--success);
    margin-bottom: 8px;
}

.apply-btn-danger {
    background: var(--danger);
}

.apply-btn-danger:hover {
    background: var(--danger-hover);
}

.delete-btn {
    background: none;
    border: none;
    padding: 8px;
    font-size: var(--font-xs);
    color: var(--text-subtle);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: color var(--transition);
}

.delete-btn:hover {
    color: var(--danger);
}

/* ── Site Add Row ──────────────────────────────────────── */
.site-row.site-add {
    background: transparent;
    border-bottom: 1px solid var(--border);
}

.site-row.site-add:hover {
    background: var(--bg-hover);
}

.site-row.site-add .site-thumb {
    background: var(--primary);
    color: var(--primary-text);
    font-size: var(--font-xl);
    font-weight: 300;
    border-color: var(--primary);
}

.site-row.site-add .site-name {
    color: var(--text-muted);
}

.site-row.site-add:hover .site-name {
    color: var(--text);
}

/* ── Sidebar Footer ───────────────────────────────────── */
.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    margin-top: auto;
}

.footer-left {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.user-footer-label {
    font-size: var(--font-xs);
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 0;
    transition: color var(--transition);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.user-footer-label:hover {
    color: var(--text);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-toggle {
    display: flex;
    gap: 2px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    padding: 2px;
    cursor: pointer;
}

.theme-toggle.collapsed button {
    display: none;
}

.theme-toggle.collapsed button.active {
    display: flex;
}

.theme-toggle button {
    width: 26px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--font-sm);
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
}

.theme-toggle button:hover {
    color: var(--text);
}

.theme-toggle button.active {
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: var(--font-base);
    color: var(--text-muted);
    border: none;
    background: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: color var(--transition), background var(--transition);
}

.btn-logout:hover {
    color: var(--danger);
    background: var(--danger-bg);
    text-decoration: none;
}

/* ── Preview Area ──────────────────────────────────────── */
.preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-preview);
}

/* ── Welcome Screen ───────────────────────────────────── */
.welcome-screen {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
}

.welcome-content {
    width: 100%;
}

.welcome-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.welcome-list li {
    font-size: var(--font-base);
    color: var(--text);
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.welcome-list li:last-child {
    border-bottom: none;
}

.welcome-list li::before {
    content: "✓ ";
    color: var(--success);
}

/* ── Preview View ─────────────────────────────────────── */
.preview-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-bar {
    height: 48px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    flex-shrink: 0;
    gap: 16px;
    position: relative;
}

.preview-label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    position: absolute;
    left: 20px;
    max-width: calc(50% - 100px);
}

.preview-name {
    font-size: var(--font-base);
    font-weight: 400;
    color: var(--text);
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-domain {
    font-size: var(--font-xs);
    color: var(--text-subtle);
    white-space: nowrap;
}

.device-switch {
    display: flex;
    background: var(--bg-preview);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
    gap: 1px;
    flex-shrink: 0;
}

.dev-btn {
    border: none;
    background: none;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: var(--font-xs);
    font-weight: 400;
    color: var(--text-muted);
    font-family: inherit;
    transition: background var(--transition), color var(--transition);
}

.dev-btn.active {
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.dev-btn:hover:not(.active) {
    color: var(--text);
}

.btn-open {
    font-size: var(--font-lg);
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px;
    border-radius: 4px;
    transition: color var(--transition);
    position: absolute;
    right: 20px;
}

.btn-open:hover {
    color: var(--text);
    text-decoration: none;
}

/* ── Preview Frame ─────────────────────────────────────── */
.preview-frame-wrap {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
    overflow: auto;
}

.preview-container {
    width: 100%;
    background: var(--bg);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: max-width .3s ease;
}

.preview-container[data-device="tablet"] {
    max-width: 820px;
}

.preview-container[data-device="mobile"] {
    max-width: 390px;
}

.preview-container iframe {
    width: 100%;
    height: 600px;
    border: none;
    display: block;
}

/* ── Login page ────────────────────────────────────────── */
.admin-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--bg-preview);
}

[data-theme="dark"] .admin-login-page {
    background: linear-gradient(135deg, #1a1918 0%, #252422 100%);
}

/* Login page theme toggle */
.login-theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    box-shadow: var(--shadow);
}

.login-theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--text-muted);
}

/* Light mode: show sun, hide moon */
.login-theme-toggle .icon-moon {
    display: none;
}

/* Dark mode (explicit): show moon, hide sun */
[data-theme="dark"] .login-theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .login-theme-toggle .icon-moon {
    display: block;
}

/* Dark mode (system preference): show moon, hide sun */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .login-theme-toggle .icon-sun {
        display: none;
    }

    :root:not([data-theme="light"]) .login-theme-toggle .icon-moon {
        display: block;
    }
}

.admin-login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.admin-login-logo {
    margin-bottom: 16px;
    color: var(--text);
}

.admin-login-card h1 {
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.admin-login-hint {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.admin-login-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: .85rem;
    margin-bottom: 16px;
}

/* ── Login / 2FA (from admin_login.php) ────────────────── */
.admin-2fa-code-input {
    font-family: monospace;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    text-align: center;
    padding: 0.75rem 1rem;
}

.admin-2fa-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1rem;
}

.admin-back-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
}

.admin-back-link:hover {
    color: var(--primary);
}

/* ── Web eID login ─────────────────────────────────────── */
.admin-login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    font-size: .8rem;
    color: var(--text-muted);
}

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

.admin-btn-web-eid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 20px;
    font-size: .9rem;
    font-weight: 400;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    font-family: inherit;
}

.admin-btn-web-eid:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.admin-btn-web-eid:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ── Form fields ───────────────────────────────────────── */
.admin-field {
    margin-bottom: 14px;
    text-align: left;
}

.admin-field label {
    display: block;
    font-size: .8rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.admin-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.admin-field input[type="text"],
.admin-field input[type="email"],
.admin-field input[type="password"],
.admin-field input[type="url"],
.admin-field select {
    width: 100%;
    padding: 10px 14px;
    font-size: .95rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    transition: border-color var(--transition);
}

.admin-field input:focus,
.admin-field select:focus {
    outline: none;
    border-color: var(--text-muted);
    box-shadow: 0 0 0 3px rgba(92, 107, 94, .1);
}

.admin-field small {
    display: block;
    font-size: .7rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ── Webmasters ───────────────────────────────────────── */
.wm-2fa-badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-lg);
    vertical-align: middle;
}

.wm-2fa-on {
    background: rgba(39, 174, 96, .15);
    color: var(--success);
}

.wm-2fa-off {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.admin-btn-ghost-sm {
    font-size: .75rem;
    padding: 2px 8px;
    margin-left: 6px;
    vertical-align: middle;
}

.webmasters-list {
    margin-top: 10px;
}

.account-section#webmastersSection .badge {
    margin-left: 8px;
    vertical-align: middle;
}

/* ── Buttons ───────────────────────────────────────────── */
.admin-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: .9rem;
    font-weight: 400;
    color: var(--primary-text);
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), transform .1s;
    width: 100%;
    font-family: inherit;
}

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

.admin-btn-primary:active {
    transform: scale(.97);
}

.admin-btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.admin-btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 14px;
    font-size: .85rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
    font-family: inherit;
}

.admin-btn-ghost:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.admin-btn-danger {
    padding: 10px 20px;
    font-size: .9rem;
    font-weight: 400;
    color: #fff;
    background: var(--danger);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
    font-family: inherit;
}

.admin-btn-danger:hover {
    background: var(--danger-hover);
}

.admin-btn-danger:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ── Modals ─────────────────────────────────────────────── */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(2px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.admin-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.admin-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.95);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 440px;
    z-index: 210;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}

.admin-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.admin-modal-sm {
    max-width: 360px;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.admin-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 400;
}

.admin-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    line-height: 1;
}

.admin-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.admin-modal-text {
    font-size: .9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.admin-modal-text strong {
    color: var(--text);
    font-weight: 500;
}

.admin-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.admin-modal-actions .admin-btn-primary {
    width: auto;
}

/* ── Toast notifications ───────────────────────────────── */
.admin-toasts {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.admin-toast {
    background: var(--bg-card);
    color: var(--text);
    padding: 10px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: .85rem;
    border-left: 3px solid var(--primary);
    pointer-events: auto;
    animation: adminToastIn .25s ease-out;
}

.admin-toast-error {
    border-left-color: var(--danger);
}

.admin-toast-success {
    border-left-color: var(--success);
}

.admin-toast.removing {
    animation: adminToastOut .2s ease-in forwards;
}

@keyframes adminToastIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes adminToastOut {
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 100;
        transition: left .3s ease;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        left: 0;
    }

    .preview-bar {
        padding: 0 16px;
    }

    .device-switch {
        display: none;
    }

    .welcome-stats {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .preview-frame-wrap {
        padding: 16px;
    }

    .preview-container iframe {
        height: 400px;
    }

    .admin-modal {
        padding: 20px;
        width: 95%;
    }

    .admin-login-card {
        padding: 28px 24px;
    }
}

/* ── Roadmap Tasks Widget ────────────────────────────────── */
.roadmap-widgets-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.roadmap-widget {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.roadmap-file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-sm);
    font-weight: 400;
    text-transform: uppercase;
    color: var(--text);
    padding: 12px 20px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    user-select: none;
}

.roadmap-file-toggle {
    font-size: 0.625rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.roadmap-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
}

.roadmap-widget.open .roadmap-file-toggle {
    transform: rotate(-180deg);
}

.roadmap-tasks {
    display: none;
    padding: 16px 20px;
}

.roadmap-widget.open .roadmap-tasks {
    display: block;
}

.roadmap-widget.open .roadmap-file-header {
    border-bottom: 1px solid var(--border-subtle);
}

.roadmap-empty {
    color: var(--text-muted);
    font-size: var(--font-base);
    text-align: center;
    padding: 20px 0;
}

.roadmap-section {
    margin-bottom: 20px;
}

.roadmap-section:last-child {
    margin-bottom: 0;
}

.roadmap-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.roadmap-section-name {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text);
}

.roadmap-section-status {
    font-weight: 400;
    color: var(--text-muted);
}

.roadmap-section-progress {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.roadmap-progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 10px;
    overflow: hidden;
}

.roadmap-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.roadmap-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.roadmap-task {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition);
}

.roadmap-task:hover {
    background: var(--bg-hover);
}

.roadmap-checkbox {
    font-size: var(--font-base);
    color: var(--text-muted);
    flex-shrink: 0;
}

.roadmap-task.checked .roadmap-checkbox {
    color: var(--primary);
}

.roadmap-task-text {
    font-size: var(--font-sm);
    color: var(--text);
    line-height: 1.4;
}

.roadmap-task.checked .roadmap-task-text {
    color: var(--text-muted);
    text-decoration: line-through;
}

/* MAIN block: aggregated next steps from other roadmaps */
.roadmap-main-next .roadmap-section-header {
    margin-bottom: 6px;
}

.roadmap-main-tasks .roadmap-task {
    padding: 4px 8px;
    font-size: var(--font-xs);
}

.roadmap-main-tasks .roadmap-source {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    min-width: 4em;
    flex-shrink: 0;
    text-transform: none;
}

.roadmap-main-tasks .roadmap-task-text {
    font-size: var(--font-xs);
}

/* ── Docs Editor in Welcome Screen ─────────────────────── */

/* Two-column docs layout (50/50) */
.docs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
}

.docs-grid-50 {
    grid-template-columns: 1fr 1fr;
}

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

.docs-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevent content from expanding column */
    margin-bottom: 40px;
}

/* Left column: Roadmap widget */
.docs-col-roadmap {
    min-width: 0;
}

.docs-col-roadmap .docs-section {
    position: sticky;
}

.docs-col-roadmap .roadmap-widget {
    display: block !important;
}

/* Right column: Project Docs */
.docs-col-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    overflow: hidden;
}

.docs-section {
    display: flex;
    flex-direction: column;
}

.docs-col-header {
    font-size: var(--font-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.doc-accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    background: var(--bg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.doc-acc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    background: var(--bg-hover);
    user-select: none;
}

.doc-acc-header h4 {
    font-size: var(--font-sm);
    font-weight: 400;
    text-transform: uppercase;
    color: var(--text);
    margin: 0;
}

.doc-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-toggle {
    font-size: 0.625rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.doc-btn-edit {
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--font-lg);
    opacity: 0.5;
    transition: opacity var(--transition);
}

.doc-btn-edit:hover {
    opacity: 1;
}

.doc-accordion.open .doc-toggle {
    transform: rotate(-180deg);
}

.doc-acc-content {
    display: none;
    border-top: 1px solid var(--border);
}

.doc-accordion.open .doc-acc-content {
    display: block;
}

.doc-rendered {
    padding: 16px 20px;
    margin: 0;
    font-size: var(--font-sm);
    line-height: 1.4;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--bg-card);
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
}

.doc-rendered h1 {
    font-size: 0.9375rem;
    font-weight: 500;
    margin: 16px 0 8px;
    color: var(--text);
}

.doc-rendered h2 {
    font-size: var(--font-base);
    font-weight: 500;
    margin: 14px 0 6px;
    color: var(--text);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 4px;
}

.doc-rendered h3 {
    font-size: var(--font-sm);
    font-weight: 500;
    margin: 12px 0 4px;
    color: var(--text);
}

.doc-rendered h1:first-child,
.doc-rendered h2:first-child,
.doc-rendered h3:first-child {
    margin-top: 0;
}

.doc-rendered p {
    margin-bottom: 8px;
}

.doc-rendered ul,
.doc-rendered ol {
    margin-bottom: 8px;
    padding-left: 20px;
}

.doc-rendered li {
    margin-bottom: 4px;
}

.doc-rendered a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.doc-rendered a:hover {
    color: var(--primary-hover);
}

.doc-rendered strong {
    font-weight: 500;
    color: var(--text);
}

.doc-rendered blockquote {
    border-left: 2px solid var(--primary);
    padding-left: 12px;
    margin: 8px 0;
    color: var(--text-muted);
}

.doc-rendered code {
    background: var(--bg-hover);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.doc-rendered pre {
    background: var(--bg-hover);
    padding: 12px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid var(--border-subtle);
}

.doc-rendered pre code {
    background: transparent;
    padding: 0;
    color: var(--text);
    border-radius: 0;
}

.doc-rendered .mermaid {
    margin: 12px 0;
    padding: 16px 8px;
    overflow-x: auto;
    text-align: center;
}

.doc-rendered .mermaid svg {
    max-width: 100%;
    height: auto;
}

.doc-rendered hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 16px 0;
}

.doc-rendered table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.doc-rendered th,
.doc-rendered td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.doc-rendered th {
    background: var(--bg-hover);
    font-weight: 400;
}

.doc-rendered tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .doc-rendered tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.doc-chk {
    color: var(--text-muted);
    font-size: var(--font-xl);
    vertical-align: middle;
    margin-right: 6px;
    line-height: 1;
}

.doc-chk.checked {
    color: var(--success);
}

.doc-editor-wrap {
    padding: 20px;
    background: var(--bg-card);
}

.doc-textarea {
    width: 100%;
    height: 400px;
    padding: 16px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: var(--font-sm);
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    outline: none;
}

.doc-textarea:focus {
    border-color: var(--primary);
}

.doc-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.doc-loading,
.doc-error {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.doc-error {
    color: var(--danger);
}

/* ── Users Section ─────────────────────────────────────── */
.settings-section {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.settings-section:last-of-type {
    border-bottom: none;
}

.settings-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: var(--font-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-section-header.collapsible-header {
    margin-bottom: 0;
    padding: 6px 0;
}

.settings-section-header.collapsible-header:hover {
    color: var(--text);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.6875rem;
    background: var(--primary);
    color: var(--primary-text);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}

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

.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-link:hover {
    color: var(--text);
}

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

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text);
}

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

.settings-actions-end {
    justify-content: flex-end;
}

.users-list {
    max-height: 180px;
    overflow-y: auto;
}

/* Kontod tab: no scroll, list grows with content */
#globalUsersList.users-list {
    max-height: none;
    overflow: visible;
}

.users-empty,
.users-loading,
.users-error {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-sm);
}

.users-error {
    color: var(--danger);
}

.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 4px;
    background: var(--bg-hover);
    border-radius: var(--radius);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-email {
    font-size: var(--font-sm);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-actions {
    display: flex;
    gap: 4px;
}

.user-btn-pw {
    padding: 2px 6px;
    font-size: 0.6875rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}

.user-btn-pw:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.user-remove {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--font-lg);
    line-height: 1;
    transition: all var(--transition);
    flex-shrink: 0;
    margin-left: 8px;
}

.user-remove:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ── Account Section ───────────────────────────────────── */
.account-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    overflow: hidden;
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    background: var(--bg-hover);
    transition: background var(--transition);
}

.account-header:hover {
    background: var(--bg-active);
}

.account-toggle {
    color: var(--text-muted);
    font-size: var(--font-xs);
    transition: transform var(--transition);
}

.account-section.open .account-toggle {
    transform: rotate(180deg);
}

.account-body {
    display: none;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.account-section.open .account-body {
    display: block;
}

.account-info {
    margin-bottom: 24px;
}

.account-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.account-row label {
    font-size: var(--font-sm);
    color: var(--text-muted);
}

.account-row span {
    font-size: var(--font-sm);
    color: var(--text);
    font-weight: 500;
}

.account-password h4 {
    font-size: var(--font-base);
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text);
}

.account-password .settings-row {
    margin-bottom: 10px;
}

.account-password .apply-btn {
    margin-top: 8px;
}