/* HR Assistant — Main styles (index.html: login + chat) */

:root {
    --bg: #0f0f12;
    --bg-elevated: #1a1a1f;
    --surface: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --accent: #e07a5f;
    --accent-2: #ff6b4a;
    --purple: #7c5cff;
    --green: #10b981;
    --radius: 12px;
    --font: 'Inter', 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
}

html.has-stored-session .login-page { display: none !important; }
html.has-stored-session #mainApp { display: flex !important; }

/* ========== LOGIN PAGE ========== */
.login-page {
    height: 100vh;
    overflow: hidden;
    background: #08080c;
}

.login-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
    height: 100vh;
}

/* --- Left hero column --- */
.login-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    height: 100%;
    min-height: 0;
    background: #0a0a0e;
}

.login-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 45% at 0% 100%, rgba(124, 92, 255, 0.1), transparent 55%),
        radial-gradient(ellipse 45% 35% at 100% 0%, rgba(255, 107, 74, 0.08), transparent 50%),
        linear-gradient(180deg, #0c0c10 0%, #0a0a0e 100%);
    pointer-events: none;
    z-index: 0;
}

.login-hero-content {
    position: relative;
    z-index: 2;
    grid-column: 1;
    padding: 28px 20px 22px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    height: 100%;
}

.login-hero-scene {
    position: relative;
    z-index: 1;
    grid-column: 2;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.login-hero-scene::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #0a0a0e 0%, rgba(10, 10, 14, 0.75) 12%, rgba(10, 10, 14, 0.2) 28%, transparent 45%);
    z-index: 1;
    pointer-events: none;
}

.login-hero-scene-img {
    width: 140%;
    max-width: none;
    height: 112%;
    object-fit: contain;
    object-position: center bottom;
    display: block;
    margin-right: -12%;
}

.login-hero-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.login-logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 11px;
    background: linear-gradient(145deg, #ff6b4a 0%, #e07a5f 50%, #c45a3f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 16px rgba(255, 107, 74, 0.35);
    flex-shrink: 0;
}

.login-hero-brand-name {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.02em;
}

.login-hero-brand-tag {
    font-size: 13px;
    font-weight: 600;
    color: #ff6b4a;
    margin-top: 2px;
}

.login-hero-main {
    flex: 1;
    padding: 14px 0 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

.login-hero-title {
    font-size: clamp(2rem, 3.2vw, 2.85rem);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.login-gradient-text {
    background: linear-gradient(90deg, #ff6b4a 0%, #f4a261 40%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-hero-subtitle {
    color: #9ca3af;
    line-height: 1.55;
    font-size: 14px;
    max-width: 420px;
    margin-bottom: 12px;
}

.login-hero-quote-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: rgba(14, 14, 20, 0.88);
    border: 1px solid rgba(124, 92, 255, 0.35);
    box-shadow:
        0 0 20px rgba(124, 92, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    max-width: 420px;
}

.login-hero-quote-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.login-hero-quote-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: #f4f4f5;
    margin: 0;
}

.login-hero-message-body {
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
    max-width: 420px;
}

.login-hero-highlights {
    list-style: none;
    display: grid;
    gap: 8px;
    max-width: 420px;
}

.login-hero-highlights li {
    font-size: 13px;
    color: #d4d4d8;
    padding-left: 28px;
    position: relative;
    line-height: 1.4;
}

.login-hero-highlights li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b4a, #e07a5f);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.login-hero-footer {
    padding-top: 2px;
    flex-shrink: 0;
}

.login-hero-status {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 320px;
}

.login-hero-status-avatar {
    width: 48px;
    height: 48px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-hero-status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 3px;
}

.login-hero-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.92); }
}

.login-hero-status-quote {
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

.login-hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: #9ca3af;
}

.login-hero-trust span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.login-hero-trust svg {
    width: 16px;
    height: 16px;
}

/* --- Right: login panel --- */
.login-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    padding: 20px 24px 36px;
    background: #0a0a0a;
}

.login-card-v2 {
    width: 100%;
    max-width: 460px;
    background: #141418;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 28px 30px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.login-card-brand {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo-icon-lg {
    width: 48px;
    height: 48px;
    border-radius: 11px;
    margin: 0 auto 12px;
}

.login-card-brand-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 3px;
    letter-spacing: -0.02em;
}

.login-card-brand-sub {
    font-size: 12px;
    font-weight: 600;
    color: #ff6b4a;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.login-desc {
    color: #9ca3af;
    font-size: 13px;
    margin-bottom: 18px;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(235, 51, 73, 0.15);
    border: 1px solid rgba(235, 51, 73, 0.35);
    border-radius: 10px;
    color: #f87171;
    font-size: 13px;
    margin-bottom: 16px;
}

.login-success {
    padding: 12px 14px;
    background: rgba(17, 153, 142, 0.15);
    border: 1px solid rgba(56, 239, 125, 0.35);
    border-radius: 10px;
    color: #4ade80;
    font-size: 13px;
    margin-bottom: 16px;
}

.login-form { display: grid; gap: 16px; }

.form-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-icon input {
    width: 100%;
    padding: 11px 14px 11px 42px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0d0d12;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-with-icon input:focus {
    border-color: #7c5cff;
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

.password-field input { padding-right: 44px; }

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    line-height: 0;
}

.toggle-password:hover {
    color: var(--text, #e4e4e7);
    background: rgba(255, 255, 255, 0.06);
}

.toggle-password:focus-visible {
    outline: 2px solid rgba(124, 92, 255, 0.55);
    outline-offset: 2px;
}

.password-field.no-leading-icon input {
    padding-left: 14px;
}

.forgot-password-panel .password-field input {
    padding-right: 44px;
}

.login-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    cursor: pointer;
    font-size: 13px;
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #7c5cff;
    cursor: pointer;
}

.link-btn {
    background: none;
    border: none;
    color: #ff6b4a;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    text-decoration: none;
}

.link-btn:hover {
    text-decoration: underline;
}

.btn-login-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #7c5cff 0%, #5b3fd4 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-login-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(124, 92, 255, 0.4);
}

.btn-login-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-login-primary.is-loading {
    pointer-events: none;
}

.btn-loading-label {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.loading-dots {
    display: inline-flex;
    min-width: 1.15em;
    margin-left: 1px;
    letter-spacing: 0.02em;
}

.loading-dots span {
    opacity: 0.2;
    animation: forgotLoadingDot 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes forgotLoadingDot {
    0%,
    80%,
    100% { opacity: 0.2; }
    40% { opacity: 1; }
}

.login-contact-hr {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.login-contact-hr a { color: #ff6b4a; font-weight: 600; }

.login-page-copyright {
    position: absolute;
    bottom: 16px;
    right: 28px;
    font-size: 10px;
    color: #6b7280;
    text-align: right;
}

.forgot-password-panel .form-field input {
    width: 100%;
    padding: 13px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.forgot-password-panel .input-with-icon input {
    padding: 11px 14px 11px 42px;
}

.forgot-password-panel .password-field.no-leading-icon input {
    padding: 11px 44px 11px 14px;
}

.forgot-password-panel .form-field input:focus {
    border-color: #7c5cff;
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

.forgot-password-panel #forgotStep1,
.forgot-password-panel #forgotStep2,
.forgot-password-panel #forgotStep3,
.forgot-password-panel .forgot-step {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.forgot-password-panel .form-field {
    margin: 0;
}

.forgot-password-panel .forgot-step-actions {
    margin-top: 12px;
    padding-top: 4px;
}

.forgot-password-panel .forgot-step .form-field + .form-field {
    margin-top: 0;
}

.forgot-password-panel .btn-login-primary {
    margin: 0;
}

.forgot-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.forgot-desc { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; line-height: 1.5; }
.forgot-password-link { text-align: center; margin-top: 16px; }

/* ========== MAIN APP ========== */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.ambient-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.nav-btn svg,
.sidebar-title svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.orb-1 { width: 320px; height: 320px; background: #e07a5f; top: -80px; left: -80px; }
.orb-2 { width: 280px; height: 280px; background: #7c5cff; bottom: -60px; right: -60px; }
.orb-3 { width: 200px; height: 200px; background: #10b981; top: 40%; left: 50%; }

.top-nav {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(26, 26, 31, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #c45a3f);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.title-main { display: block; font-weight: 700; font-size: 13px; }
.title-sub { display: block; font-size: 10px; color: var(--text-muted); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.2s;
}

.nav-btn:hover { background: rgba(255, 255, 255, 0.1); }
.nav-btn.icon-only { padding: 6px 8px; }
.nav-btn.logout { border-color: rgba(235, 51, 73, 0.35); color: #f87171; }

.client-menu-wrap {
    position: relative;
}

.client-menu-btn {
    min-width: 118px;
    justify-content: space-between;
}

.client-menu-btn .client-caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #a1a1aa;
}

.client-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 140px;
    background: #1a1a22;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    z-index: 1200;
    overflow: hidden;
}

.client-menu-dropdown.open {
    display: block;
}

.client-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: #e4e4e7;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.client-menu-item:hover {
    background: rgba(224, 122, 95, 0.15);
    color: #fff;
}

.client-menu-item.active {
    background: rgba(224, 122, 95, 0.18);
    color: #fff;
    font-weight: 600;
}

.client-menu-item .client-check {
    color: #e07a5f;
    font-size: 12px;
    opacity: 0;
}

.client-menu-item.active .client-check {
    opacity: 1;
}

.user-pill-wrap { position: relative; }

.user-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), #5b3fd4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.user-employee-id {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.user-name { font-size: 12px; font-weight: 600; }

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #1e1e24;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 1000;
}

.user-menu-dropdown.open { display: block; }

.user-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text);
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.user-menu-item:hover { background: rgba(255, 255, 255, 0.06); }

.main-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 232px 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.info-sidebar {
    border-right: 1px solid var(--border);
    background: rgba(26, 26, 31, 0.6);
    overflow-y: auto;
    padding: 12px 10px;
}

.sidebar-section + .sidebar-section { margin-top: 16px; }

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #e4e4e7;
}

.quick-cards { display: grid; gap: 5px; }

.quick-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: inherit;
    transition: border-color 0.2s, transform 0.15s;
}

.quick-card:hover {
    border-color: rgba(224, 122, 95, 0.4);
    transform: translateX(2px);
}

.card-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--card-color) 20%, transparent);
    color: var(--card-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon svg {
    width: 16px;
    height: 16px;
}

.card-title { display: block; font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.card-desc { display: block; font-size: 10px; color: var(--text-muted); margin-top: 1px; line-height: 1.25; }

.help-list {
    list-style: none;
    display: grid;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.help-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    margin-right: 5px;
    text-transform: uppercase;
}

.tag-green { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.tag-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.tag-purple { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.tag-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.tag-rose { background: rgba(244, 63, 94, 0.2); color: #fb7185; }

.chat-area {
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.toast-container-inline {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message { display: flex; max-width: 100%; }
.assistant-message { justify-content: flex-start; }
.user-message { justify-content: flex-end; }

.message-bubble {
    display: flex;
    gap: 8px;
    max-width: min(82%, 640px);
}

.user-message .message-bubble { flex-direction: row-reverse; }

.assistant-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #c45a3f);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.assistant-avatar svg {
    width: 14px;
    height: 14px;
}

.message-content {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

.user-message .message-content {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.25), rgba(91, 63, 212, 0.2));
    border-color: rgba(124, 92, 255, 0.3);
}

.message-content p { margin-bottom: 6px; }
.message-content p:last-child { margin-bottom: 0; }
.greeting { font-weight: 600; font-size: 13px; }
.prompt { color: var(--text-muted); font-size: 12px; }

.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}

.message-content th,
.message-content td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: left;
}

.message-content th { background: rgba(0, 0, 0, 0.2); }

.message-content a { color: #93c5fd; }
.message-content strong { color: #fff; }

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 8px;
}

.typing-bubble {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.typing-bubble span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.2s infinite;
}

.typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.typing-text { font-size: 11px; color: var(--text-muted); }

.input-area {
    padding: 10px 16px 12px;
    border-top: 1px solid var(--border);
    background: rgba(26, 26, 31, 0.8);
    backdrop-filter: blur(8px);
}

.input-container {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 4px 4px 12px;
}

.input-container input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.send-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, var(--accent), #c45a3f);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-btn svg {
    width: 16px;
    height: 16px;
}

.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.input-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.hint-chip {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}

.hint-chip:hover {
    border-color: var(--accent);
    color: var(--text);
}

/* Chat widgets */
.chat-widget {
    margin-top: 12px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.chat-widget label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #d4d4d8;
}

.chat-widget input,
.chat-widget select,
.chat-widget textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0d0d10;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 10px;
}

/* Date inputs — keep native picker fully functional; lighten icon via color-scheme */
.chat-widget input[type="date"],
.chat-widget input.input-date {
    color-scheme: dark;
    min-height: 42px;
    cursor: pointer;
}

.chat-widget input[type="date"]::-webkit-calendar-picker-indicator,
.chat-widget input.input-date::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    /* Native icon is already light under color-scheme:dark — do not invert/hide */
    filter: none;
}

.chat-widget .widget-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-primary {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--purple), #5b3fd4);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.policy-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.policy-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    font-size: 12px;
    text-decoration: none;
}

.chat-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    width: fit-content;
    max-width: 100%;
}

.chat-download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.38);
    color: #fff;
}

.month-select-wrap {
    margin-top: 10px;
}

.month-select-label {
    margin: 0 0 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.month-select-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.month-chip {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.month-chip:hover { border-color: var(--accent); }

/* Modals */
.modal,
.user-info-modal,
.logout-confirm-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.open,
.modal[style*="display: flex"],
.user-info-modal.open,
.logout-confirm-modal.open {
    display: flex !important;
}

.modal-content {
    background: linear-gradient(180deg, #1c1c22 0%, #17171c 100%);
    border-radius: 12px;
    max-width: 560px;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.modal-content-invite {
    max-width: 640px;
    max-height: 92vh;
}

.modal-form-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.modal-header-accent {
    background: linear-gradient(135deg, #e07a5f 0%, #c45a3f 100%);
    border-bottom: none;
    align-items: center;
}

.modal-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.modal-header-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.modal-header-sub {
    margin: 2px 0 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.3;
}

.modal-close {
    background: rgba(255, 255, 255, 0.14);
    border: none;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.modal-close:hover { background: rgba(255, 255, 255, 0.24); }

.modal-body {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 10px 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
    flex-shrink: 0;
}

.modal-form-section + .modal-form-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7c5cff;
    margin-bottom: 8px;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
}

.modal-form-grid .span-2 {
    grid-column: 1 / -1;
}

.modal-form-note {
    margin: 8px 0 0;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.4;
}

.modal-form-note strong {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.modal-form {
    display: grid;
    gap: 10px;
}

.form-row {
    display: grid;
    gap: 10px;
}

.form-row-2 {
    grid-template-columns: 1fr 1fr;
}

.modal-form .form-field label,
.user-info-modal .form-field label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.modal-form input,
.modal-form select,
.user-info-modal input,
.user-info-modal select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #101016;
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.modal-form input:hover,
.modal-form select:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: #12121a;
}

.modal-form input:focus,
.modal-form select:focus {
    border-color: #7c5cff;
    box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.12);
}

.modal-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.modal-form input::placeholder { color: #6b7280; }

.input-date {
    color-scheme: dark;
    cursor: pointer;
}

.input-date[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    filter: none;
}

.input-uppercase { text-transform: uppercase; }

.form-hint {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.35;
}

.required { color: #e07a5f; }
.optional { color: #9ca3af; font-size: 10px; font-weight: 400; text-transform: none; letter-spacing: 0; }

.input-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.input-row input { flex: 1; min-width: 0; }

.btn-suggest {
    padding: 8px 9px;
    border-radius: 8px;
    border: 1px solid rgba(124, 92, 255, 0.45);
    background: rgba(124, 92, 255, 0.18);
    color: #e9d5ff;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s;
}

.btn-suggest:hover:not(:disabled) {
    background: rgba(124, 92, 255, 0.28);
    border-color: rgba(124, 92, 255, 0.6);
}
.btn-suggest:disabled { opacity: 0.6; cursor: not-allowed; }

.modal-checkbox-box {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(124, 92, 255, 0.07);
    border: 1px solid rgba(124, 92, 255, 0.2);
    border-radius: 9px;
}

.modal-checkbox-box label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    color: #f4f4f5;
}

.modal-checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.modal-checkbox-text strong {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.modal-checkbox-text small {
    font-size: 10px;
    color: #9ca3af;
    line-height: 1.35;
    font-weight: 400;
}

.modal-checkbox-box input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin-top: 1px;
    accent-color: #7c5cff;
    cursor: pointer;
    flex-shrink: 0;
}

.modal-checkbox-box p {
    margin: 6px 0 0 22px;
    font-size: 10px;
    color: #9ca3af;
    line-height: 1.4;
}

.modal-alert {
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 11px;
    line-height: 1.4;
}

.modal-alert-error {
    background: rgba(235, 51, 73, 0.15);
    border: 1px solid rgba(235, 51, 73, 0.35);
    color: #f87171;
}

.modal-alert-success {
    background: rgba(17, 153, 142, 0.15);
    border: 1px solid rgba(56, 239, 125, 0.35);
    color: #4ade80;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 2px;
}

.btn-modal-secondary,
.btn-modal-primary {
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-modal-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-modal-secondary:hover { background: rgba(255, 255, 255, 0.06); }

.btn-modal-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #7c5cff 0%, #5b3fd4 100%);
    color: #fff;
}

.btn-modal-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(124, 92, 255, 0.35);
}

.btn-modal-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ========== INVITE MODAL (onboarding invitation) ========== */
.invite-modal {
    max-width: 600px;
    max-height: 90vh;
    background: #16161b;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
}

.invite-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(180deg, rgba(255, 107, 74, 0.08) 0%, transparent 100%);
}

.invite-modal-header-text h2 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: #fafafa;
    letter-spacing: -0.02em;
}

.invite-modal-header-text p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #a1a1aa;
    max-width: 420px;
}

.invite-modal-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #a1a1aa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.invite-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.18);
}

.invite-modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.invite-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.invite-modal-body::-webkit-scrollbar { width: 5px; }
.invite-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.invite-card {
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.invite-card-title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: #e4e4e7;
    letter-spacing: -0.01em;
}

.invite-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}

.invite-field-full {
    grid-column: 1 / -1;
}

.invite-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #d4d4d8;
    text-transform: none;
    letter-spacing: 0;
}

.invite-field .req {
    color: #ff6b4a;
    font-weight: 600;
}

.invite-field .opt {
    color: #71717a;
    font-size: 11px;
    font-weight: 400;
}

.invite-field input,
.invite-field select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background-color: #1e1e26 !important;
    color: #f4f4f5 !important;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.invite-field input::placeholder {
    color: #71717a;
}

.invite-field input:hover,
.invite-field select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.invite-field input:focus,
.invite-field select:focus {
    border-color: #ff6b4a;
    box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.15);
}

.invite-field select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.invite-field input:-webkit-autofill,
.invite-field input:-webkit-autofill:hover,
.invite-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f4f4f5 !important;
    -webkit-box-shadow: 0 0 0 1000px #1e1e26 inset !important;
    box-shadow: 0 0 0 1000px #1e1e26 inset !important;
    transition: background-color 9999s ease-out 0s;
}

.invite-hint {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #71717a;
    line-height: 1.4;
}

.invite-input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.invite-input-group input {
    flex: 1;
    min-width: 0;
}

.invite-btn-suggest {
    flex-shrink: 0;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 74, 0.35);
    background: rgba(255, 107, 74, 0.12);
    color: #fdba74;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}

.invite-btn-suggest:hover:not(:disabled) {
    background: rgba(255, 107, 74, 0.2);
    border-color: rgba(255, 107, 74, 0.5);
}

.invite-btn-suggest:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.invite-policy-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.invite-policy-toggle:hover {
    border-color: rgba(255, 107, 74, 0.25);
    background: rgba(255, 107, 74, 0.04);
}

.invite-policy-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: #ff6b4a;
    cursor: pointer;
    flex-shrink: 0;
}

.invite-policy-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.invite-policy-copy strong {
    font-size: 13px;
    font-weight: 600;
    color: #f4f4f5;
}

.invite-policy-copy small {
    font-size: 11px;
    color: #a1a1aa;
    line-height: 1.45;
}

.invite-alert {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.45;
}

.invite-alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.invite-alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.invite-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.invite-btn-cancel {
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
    color: #d4d4d8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.invite-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.06);
}

.invite-btn-submit {
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #ff6b4a 0%, #e07a5f 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
}

.invite-btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 107, 74, 0.35);
}

.invite-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.user-info-modal {
    z-index: 10000;
}

.logout-confirm-modal {
    z-index: 10001;
}

.user-info-modal-content {
    background: linear-gradient(180deg, #1c1c22 0%, #17171c 100%);
    border-radius: 14px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.user-settings-modal-content { max-width: 600px; }

.user-info-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.user-info-modal-header h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.user-info-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.user-info-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.user-info-modal-body { padding: 14px; overflow-y: auto; }

.user-settings-body {
    padding: 14px 16px 16px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 14px;
    align-items: start;
}

.user-settings-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding-right: 12px;
}

.user-settings-tab {
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--text-muted);
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
}

.user-settings-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.user-settings-tab.active {
    background: rgba(124, 92, 255, 0.18);
    color: #ddd6fe;
    font-weight: 600;
}

.user-settings-panels {
    min-width: 0;
}

.user-settings-panel { display: none; }
.user-settings-panel.active { display: block; }

.user-settings-panel h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #f4f4f5;
    letter-spacing: -0.01em;
}

.user-settings-fields {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.user-settings-fields-grid {
    grid-template-columns: 1fr 1fr;
}

.user-settings-panel .form-field label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.user-settings-panel input {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0f0f14;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.user-settings-panel input::placeholder {
    color: #6b7280;
}

.user-settings-panel input:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

.user-settings-panel input:focus {
    border-color: #7c5cff;
    background: #12121a;
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

.user-settings-panel input:-webkit-autofill,
.user-settings-panel input:-webkit-autofill:hover,
.user-settings-panel input:-webkit-autofill:focus,
.user-settings-panel input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px #0f0f14 inset;
    box-shadow: 0 0 0 1000px #0f0f14 inset;
    transition: background-color 9999s ease-out 0s;
}

.user-settings-panel .login-error,
.user-settings-panel .login-success {
    margin-bottom: 10px;
    font-size: 12px;
    padding: 10px 12px;
}

.user-settings-submit {
    width: 100%;
    padding: 10px 16px;
    border-radius: 9px;
    font-size: 13px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.user-settings-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 92, 255, 0.35);
}

.user-settings-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.user-info-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.password-match-hint { font-size: 12px; margin-top: 4px; }
.password-match-hint.match { color: #4ade80; }
.password-match-hint.mismatch { color: #f87171; }

.logout-confirm-modal-content {
    background: linear-gradient(180deg, #1c1c22 0%, #17171c 100%);
    border-radius: 12px;
    padding: 20px 18px 16px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.logout-confirm-icon { color: #f87171; margin-bottom: 10px; }
.logout-confirm-icon svg { width: 40px; height: 40px; }
.logout-confirm-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.logout-confirm-message { color: var(--text-muted); font-size: 12px; line-height: 1.45; margin-bottom: 16px; }

.logout-confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.logout-confirm-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.logout-confirm-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid var(--border);
}

.logout-confirm-ok {
    background: linear-gradient(135deg, #eb3349, #f45c43);
    color: #fff;
}

.toast {
    padding: 12px 16px;
    border-radius: 10px;
    background: #1e1e24;
    border: 1px solid var(--border);
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: slideInToast 0.25s ease;
}

@keyframes slideInToast {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
/* Responsive — login */
@media (max-width: 1100px) {
    .login-page {
        height: auto;
        overflow: auto;
    }

    .login-page-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .login-hero {
        grid-template-columns: 1fr;
        height: auto;
    }

    .login-hero-content {
        grid-column: 1;
        padding: 28px 24px 16px;
        height: auto;
    }

    .login-hero-scene {
        grid-column: 1;
        height: 220px;
        order: 2;
    }

    .login-hero-scene::before {
        background: linear-gradient(180deg, #0a0a0e 0%, transparent 35%, #0a0a0e 100%);
    }

    .login-hero-scene-img {
        width: 100%;
        margin-right: 0;
        object-position: center bottom;
    }

    .login-hero-main {
        padding: 14px 0 10px;
        overflow: visible;
    }

    .login-panel {
        height: auto;
        padding: 20px 20px 32px;
    }
}

@media (max-width: 1024px) {
    .main-content { grid-template-columns: 1fr; }
    .info-sidebar { display: none; }
}

@media (max-width: 640px) {
    .nav-btn:not(.client-menu-btn) span:not(.user-name) { display: none; }
    .user-settings-body { grid-template-columns: 1fr; }
    .user-settings-nav {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding-right: 0;
        padding-bottom: 10px;
    }
    .user-settings-fields-grid { grid-template-columns: 1fr; }
    .form-row-2,
    .modal-form-grid,
    .invite-fields { grid-template-columns: 1fr; }
    .modal-form-grid .span-2,
    .invite-field-full { grid-column: auto; }
    .modal-content,
    .modal-content-invite,
    .invite-modal { max-width: 100%; }
    .invite-input-group { flex-direction: column; }
    .invite-btn-suggest { width: 100%; padding: 9px 12px; }
}
