/* ── Auth Overlay ───────────────────────────────────────────── */
.auth-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(6px);
}

.auth-card {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #e0e0e4);
    border-radius: 12px;
    padding: 40px 36px 32px;
    width: 380px;
    max-width: 92vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.auth-card h1 {
    margin: 0 0 4px;
    font-size: 28px;
    font-weight: 700;
    color: var(--text, #1d1d1f);
    letter-spacing: -0.5px;
}

.auth-subtitle {
    display: block;
    margin: 0 0 24px;
    font-size: 13px;
    color: var(--text-secondary, #6e6e73);
}

.auth-error {
    background: var(--error-bg, #fef2f2);
    border: 1px solid #fca5a5;
    color: var(--error-text, #dc2626);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 16px;
    font-size: 13px;
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #e0e0e4);
    border-radius: 6px;
    padding: 10px 14px;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    color: var(--text, #1d1d1f);
    outline: none;
    transition: border-color 0.15s;
}
.auth-card input:focus {
    border-color: var(--accent, #0071e3);
    box-shadow: 0 0 0 3px var(--accent-light, #e8f2fc);
}

.auth-submit {
    background: var(--accent, #0071e3);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 0;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 4px;
}
.auth-submit:hover {
    background: var(--accent-hover, #0077ED);
}
.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-switch {
    margin: 16px 0 0;
    font-size: 13px;
    color: var(--text-secondary, #6e6e73);
    text-align: center;
}
.auth-switch a {
    color: var(--accent, #0071e3);
    text-decoration: none;
}
.auth-switch a:hover {
    text-decoration: underline;
}

/* ── Modal Overlay (feedback, settings) ────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    backdrop-filter: blur(3px);
}

.modal-card {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #e0e0e4);
    border-radius: 10px;
    padding: 24px 28px 20px;
    width: 420px;
    max-width: 92vw;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}

.modal-card h3 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text, #1d1d1f);
}

.modal-card textarea {
    width: 100%;
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #e0e0e4);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text, #1d1d1f);
    resize: vertical;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.modal-card textarea:focus {
    border-color: var(--accent, #0071e3);
    box-shadow: 0 0 0 3px var(--accent-light, #e8f2fc);
}

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

.modal-actions .small-btn {
    padding: 6px 16px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border, #e0e0e4);
    background: var(--surface, #ffffff);
    color: var(--text, #1d1d1f);
}
.modal-actions .small-btn.accent {
    background: var(--accent, #0071e3);
    border-color: var(--accent, #0071e3);
    color: #fff;
}
.modal-actions .small-btn:hover {
    opacity: 0.85;
}
.modal-actions .small-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Settings modal ────────────────────────────────────────── */
.settings-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}
.settings-row label {
    font-size: 12px;
    color: var(--text-secondary, #6e6e73);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.settings-row input {
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #e0e0e4);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text, #1d1d1f);
    outline: none;
}
.settings-row input:focus {
    border-color: var(--accent, #0071e3);
    box-shadow: 0 0 0 3px var(--accent-light, #e8f2fc);
}
.settings-row .mono {
    font-family: monospace;
    font-size: 13px;
    color: var(--text-secondary, #6e6e73);
    padding: 4px 0;
    user-select: all;
}

/* ── User bar (topbar additions) ───────────────────────────── */
.cu-badge {
    font-size: 12px;
    color: var(--accent, #0071e3);
    background: var(--accent-light, #e8f2fc);
    border: 1px solid var(--border, #e0e0e4);
    border-radius: 12px;
    padding: 2px 10px;
    font-weight: 600;
    white-space: nowrap;
}

.user-badge {
    font-size: 13px;
    color: var(--text, #1d1d1f);
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}
.user-badge:hover {
    background: var(--surface-hover, #f0f0f2);
}

/* ── Toast notification ────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #e0e0e4);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text, #1d1d1f);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 11000;
    animation: toast-in 0.3s ease, toast-out 0.3s ease 2.5s forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toast-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ── Hidden for beta ───────────────────────────────────────── */
.hidden-for-beta { display: none !important; }

/* ── Topbar dropdown menus (File, User) ────────────────────── */
.topbar-menu {
    position: relative;
    display: inline-block;
}
.topbar-menu-trigger {
    cursor: pointer;
}
.topbar-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #e0e0e4);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 130px;
    z-index: 5000;
    padding: 4px 0;
}
.topbar-dropdown-right {
    left: auto;
    right: 0;
}
.topbar-menu.open .topbar-dropdown {
    display: block;
}
/* Scoped under .topbar-dropdown (specificity 0,2,0) so it overrides the
   .topbar-right button rule (0,1,1) — the menus live inside .topbar-right and
   would otherwise inherit the bordered "small-btn" look. */
.topbar-dropdown .topbar-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text, #1d1d1f);
    cursor: pointer;
}
.topbar-dropdown .topbar-dropdown-item:hover {
    background: var(--surface-hover, #f0f0f2);
}

/* ── Import slots (Data section) ────────────────────────────── */
.import-slot {
    display: flex !important;
    align-items: center;
    gap: 4px;
    padding: 3px 8px !important;
}
.import-slot .resource-icon {
    flex-shrink: 0;
}
/* A data file toggled off: dim the whole row so disabled imports are obvious. */
.import-slot.import-off {
    opacity: 0.45;
}
.import-slot .import-enabled {
    cursor: pointer;
}

/* ── Expandable model folders (resource panel) ─────────────── */
.model-folder {
    cursor: pointer;
}
.model-folder .folder-icon {
    display: inline-block;
    transition: transform 0.15s;
    font-size: 10px;
    margin-right: 4px;
}
.model-folder.expanded .folder-icon {
    transform: rotate(90deg);
}
.data-sub-list {
    list-style: none;
    padding: 0 0 0 20px;
    margin: 2px 0 0;
    display: none;
}
.model-folder.expanded .data-sub-list {
    display: block;
}
.data-file-item {
    font-size: 12px;
    color: var(--text-secondary, #6e6e73);
    padding: 2px 0;
}
.data-file-item .resource-icon {
    margin-right: 4px;
}
