:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #475569;
    --success: #10b981;
    --error: #ef4444;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: row;
    flex: 1;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Top navigation bar */
.topbar {
    height: 56px;
    min-height: 56px;
    background: #0d1117;
    border-bottom: 1px solid rgba(71, 85, 105, 0.5);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 200;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 300px;
    min-width: 300px;
    flex-shrink: 0;
}

.topbar-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #c9a84c;
    letter-spacing: -0.01em;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    flex: 1;
}

.breadcrumb-parent {
    color: var(--text-secondary);
}

.breadcrumb-sep {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 180px;
    justify-content: flex-end;
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #1a2235;
    border: 1px solid rgba(71, 85, 105, 0.6);
    border-radius: 6px;
    padding: 0 0.5rem 0 0.75rem;
    height: 34px;
    color: var(--text-secondary);
}

.topbar-search-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    width: 180px;
}

.topbar-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.topbar-ask-btn {
    background: #1e3a5f;
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #6366f1;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: background 0.15s;
}

.topbar-ask-btn:hover {
    background: #254a7a;
}

/* --- Ask Viola Overlay --- */
.viola-ask-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(5, 8, 20, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.viola-ask-overlay.open {
    display: flex;
}

.viola-ask-modal {
    background: #0f1729;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 16px;
    width: 100%;
    max-width: 780px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.1);
    overflow: hidden;
}

.viola-ask-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem;
}

.viola-ask-textarea {
    flex: 1;
    background: #1a2235;
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.35rem;
    line-height: 1;
    padding: 1rem 1.25rem;
    outline: none;
    font-family: inherit;
    height: 64px;
    transition: border-color 0.2s;
}

.viola-ask-textarea:focus {
    border-color: rgba(99, 102, 241, 0.6);
}

.viola-ask-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.viola-ask-send {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    padding: 0 1.6rem;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
    height: 64px;
}

.viola-ask-send:hover {
    opacity: 0.88;
}

.viola-ask-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.viola-ask-response {
    display: none;
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid rgba(71, 85, 105, 0.25);
    margin-top: -0.25rem;
}

.viola-ask-response.visible {
    display: block;
}

.viola-ask-response-inner {
    background: #131c2e;
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.65;
    max-height: 340px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 1rem;
}

.viola-ask-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: viola-spin 0.7s linear infinite;
}

@keyframes viola-spin {
    to { transform: rotate(360deg); }
}

.viola-ask-context-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1.25rem 0.6rem;
    font-size: 0.72rem;
    color: #6366f1;
}

.topbar-bell {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.topbar-bell:hover {
    color: var(--text-primary);
}

.topbar-bell-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 7px;
    height: 7px;
    background: #c9a84c;
    border-radius: 50%;
    border: 1.5px solid #0d1117;
}

.topbar-notif-count {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.topbar-avatar-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: opacity 0.15s;
}

.topbar-avatar-btn:hover {
    opacity: 0.85;
}

/* Sidebar */
.sidebar {
    width: 300px;
    min-width: 300px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
    position: sticky;
    top: 0;
    overflow: hidden;
    transition: width 0.25s ease, min-width 0.25s ease;
}

.sidebar.collapsed {
    width: 48px;
    min-width: 48px;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-nav,
.sidebar.collapsed .sidebar-footer {
    opacity: 0;
    pointer-events: none;
}




/* Hamburger toggle — lives in the topbar */
.sidebar-toggle {
    background: transparent;
    border: none;
    border-radius: 0.4rem;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 0.5rem;
}


.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Nav sections */
.nav-section {
    padding: 1.25rem 0 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-section:last-child {
    border-bottom: none;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.3);
    padding: 0 1rem 0.5rem;
    display: block;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
    color: rgba(255,255,255,0.55);
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
}

.nav-item span:first-of-type {
    flex: 1;
}

.nav-item svg {
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.85);
}

.nav-item.active {
    background: rgba(201,168,76,0.12);
    border-left-color: #c9a84c;
    color: #ffffff;
    font-weight: 500;
}

.nav-item.active svg {
    stroke: #c9a84c;
}

/* Nav badges */
.nav-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15em 0.55em;
    border-radius: 999px;
    line-height: 1.5;
    flex-shrink: 0;
}

.nav-badge-count {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
}

.nav-badge-new {
    background: rgba(201,168,76,0.2);
    color: #c9a84c;
    border: 1px solid rgba(201,168,76,0.4);
}

.nav-badge-alert {
    background: rgba(201,168,76,0.25);
    color: #c9a84c;
    min-width: 1.4em;
    text-align: center;
}

.sidebar-footer {
    position: relative;
    border-top: 1px solid var(--border);
    padding: 0.5rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.sidebar-user:hover {
    background: var(--surface-light);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* User popup menu */
.user-popup {
    position: absolute;
    bottom: calc(100% - 0.5rem);
    left: 0.5rem;
    right: 0.5rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.4rem;
    transform: translateY(6px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
    z-index: 50;
    box-shadow: 0 -4px 16px var(--shadow);
}

.user-popup.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.user-popup-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

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

.user-popup-icon {
    font-size: 1rem;
    opacity: 0.8;
}

.user-popup-item--danger {
    color: var(--error);
}

.user-popup-item--danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main content area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 2rem;
    min-width: 0;
    position: relative;
}

/* Right Panel */
.right-panel {
    width: 300px;
    min-width: 300px;
    border-left: 1px solid #1e2535;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    overflow-y: auto;
    background: #0f1623;
}

.right-panel-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #5a6a8a;
    margin-bottom: 0.75rem;
}

.rp-setup-toggle {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #5a6a8a;
    margin-bottom: 0.75rem;
    text-align: left;
}
.rp-setup-toggle:hover { color: #8a94a8; }

.right-panel-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Compact setup checklist in right panel */
.rp-checklist {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.rp-checklist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #1a2a4a;
}
.rp-checklist-item:last-child {
    border-bottom: none;
}
.rp-checklist-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rp-checklist-icon--complete { background: #0f2a1a; }
.rp-checklist-icon--active   { background: #2a1f0a; }
.rp-checklist-icon--locked   { background: #1a1f2e; }
.rp-checklist-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}
.rp-checklist-title {
    font-size: 0.72rem;
    font-weight: 500;
    color: #c8d8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rp-checklist-item--locked .rp-checklist-title { color: #4a5a7a; }
.rp-checklist-status {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.rp-checklist-status--complete { color: #4caf7d; }
.rp-checklist-status--locked   { color: #3a4a6a; }
.rp-checklist-connect-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.65rem;
    font-weight: 600;
    color: #c9a84c;
    cursor: pointer;
    text-align: left;
}
.rp-checklist-connect-btn:hover { color: #e0c070; }

.hris-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border: 1.5px dashed #2a3347;
    border-radius: 10px;
    padding: 0.75rem 0.875rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: border-color 0.2s, background 0.2s;
    margin-top: 0.5rem;
}

.hris-item:first-of-type {
    margin-top: 0;
}

.hris-item:hover {
    border-color: #c9a84c55;
    background: #1a2235;
}

.hris-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.hris-item-icon-plus {
    background: #1e2535;
    border: 1.5px dashed #3a4a6a;
    color: #5a6a8a;
}

.hris-item-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.hris-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #c8d0e0;
}

.hris-item-sub {
    font-size: 0.72rem;
    color: #5a6a8a;
}

.hris-item-arrow {
    color: #3a4a6a;
    flex-shrink: 0;
}

.tip-card {
    display: flex;
    gap: 0.75rem;
    background: #131c2e;
    border-radius: 10px;
    padding: 0.875rem;
    margin-top: 0.5rem;
}

.tip-card:first-of-type {
    margin-top: 0;
}

.tip-card-accent {
    width: 3px;
    border-radius: 2px;
    background: #c9a84c;
    flex-shrink: 0;
    align-self: stretch;
}

.tip-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tip-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #c8d0e0;
    margin: 0;
}

.tip-card-text {
    font-size: 0.73rem;
    color: #5a6a8a;
    line-height: 1.5;
    margin: 0;
}

.right-panel-action-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    background: #131c2e;
    border: 1px solid #1e2535;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: #a0aec0;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    text-align: left;
    margin-top: 0.5rem;
}

.right-panel-action-btn:first-of-type {
    margin-top: 0;
}

.right-panel-action-btn:hover {
    background: #1a2640;
    border-color: #2a3a55;
    color: #c8d0e0;
}

/* Settings modal */
.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.settings-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.settings-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    width: 90%;
    max-width: 480px;
    overflow: hidden;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.settings-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.settings-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem;
    border-radius: 0.25rem;
    transition: color 0.15s;
}

.settings-close:hover {
    color: var(--text-primary);
}

.settings-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.settings-key-row {
    display: flex;
    gap: 0.5rem;
}

.settings-input {
    flex: 1;
    padding: 0.7rem 0.875rem;
    font-size: 0.875rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

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

.settings-key-action {
    padding: 0.7rem 1rem;
    font-size: 0.8rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.settings-key-action:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.settings-save-key {
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--primary-color);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: background 0.15s;
    align-self: flex-start;
}

.settings-save-key:hover {
    background: var(--primary-hover);
}


main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 0;
}

main.compact {
    padding-top: 1.5rem;
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

footer {
    text-align: center;
    padding: 10px 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .topbar-brand {
        font-size: 1rem;
    }
    .topbar-search-input {
        width: 100px;
    }
    .topbar-breadcrumb {
        display: none;
    }
}

.search-greeting {
    font-size: 2.00rem;
    font-weight: 700;
    font-style: italic;
    background: linear-gradient(135deg, var(--primary-color), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Welcome panel */
.welcome-panel {
    padding: 2rem;
    max-width: 780px;
    width: 100%;
}

.welcome-panel-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.welcome-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.welcome-btn-setup {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #1e2a1a;
    border: 1px solid #c9a84c;
    color: #c9a84c;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background 0.15s;
}

.welcome-btn-setup:hover { background: #263320; }

.welcome-btn-help {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.85rem;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.welcome-btn-help:hover { background: var(--surface-light); }

.welcome-btn-guide {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: 1.5px solid #c9a84c;
    color: #c9a84c;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.welcome-btn-guide:hover { background: rgba(201,168,76,0.08); }

.welcome-btn-guide-plus {
    font-size: 1rem;
    line-height: 1;
}

.welcome-card {
    background: #161f2e;
    border: 1px solid #2a3347;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.welcome-card-left {
    flex: 1;
}

.welcome-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.welcome-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #1e2a1a;
    border: 1px solid #c9a84c40;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.welcome-card-greeting {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.welcome-card-tagline {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.welcome-card-body {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.welcome-steps-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 1rem;
}

.wsb-step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
}

.wsb-step--done .wsb-step-label {
    color: #4caf7d;
    opacity: 0.8;
}

.wsb-step--done .wsb-check {
    color: #4caf7d;
    flex-shrink: 0;
}

.wsb-step--active .wsb-step-label {
    color: var(--text-primary);
    font-weight: 600;
}

.wsb-step--future .wsb-step-num,
.wsb-step--future .wsb-step-label {
    color: var(--text-secondary);
    opacity: 0.5;
}

.wsb-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.wsb-step--active .wsb-step-num {
    border-color: #c9a84c;
    color: #c9a84c;
}

.wsb-step--future .wsb-step-num {
    border-color: var(--text-secondary);
}

.wsb-step-btn {
    background: transparent;
    border: 1.5px solid #c9a84c;
    color: #c9a84c;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    margin-left: 0.25rem;
}

.wsb-step-btn:hover { background: rgba(201,168,76,0.1); }

.wsb-sep {
    color: var(--text-secondary);
    opacity: 0.4;
    font-size: 0.85rem;
    margin: 0 0.1rem;
    user-select: none;
}

.welcome-card-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.welcome-gauge-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-gauge {
    position: absolute;
    top: 0;
    left: 0;
}

.welcome-gauge-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.welcome-gauge-pct {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.welcome-gauge-sub {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.welcome-gauge-steps {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Setup Checklist */
.setup-checklist {
    max-width: 780px;
    width: 100%;
    padding: 0 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setup-checklist-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--surface);
}

.checklist-item--complete {
    border-color: #2d5a3d;
    background: rgba(76, 175, 125, 0.04);
}

.checklist-item--active {
    border-color: #c9a84c;
    background: rgba(201, 168, 76, 0.04);
}

.checklist-item--locked {
    border-color: #2a2a2a;
    opacity: 0.6;
}

.checklist-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checklist-item-icon--complete {
    background: rgba(76, 175, 125, 0.15);
    border: 1px solid #2d5a3d;
}

.checklist-item-icon--active {
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid #5a4a1a;
}

.checklist-item-icon--locked {
    background: rgba(255,255,255,0.04);
    border: 1px solid #333;
}

.checklist-item-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.checklist-item-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.checklist-item--locked .checklist-item-title {
    color: var(--text-secondary);
}

.checklist-item-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.checklist-item-status {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.checklist-item-status--complete {
    color: #4caf7d;
}

.checklist-item-status--locked {
    color: #555;
}

.checklist-item-connect-btn {
    background: transparent;
    border: 1px solid #c9a84c;
    color: #c9a84c;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.checklist-item-connect-btn:hover {
    background: rgba(201, 168, 76, 0.12);
}

/* What You'll Unlock + Ask Viola */
.unlock-section {
    max-width: 780px;
    width: 100%;
    padding: 0 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.unlock-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.unlock-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.unlock-card {
    background: var(--surface);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.unlock-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.unlock-card-icon--red   { background: rgba(224, 90, 90, 0.15); }
.unlock-card-icon--gold  { background: rgba(201, 168, 76, 0.15); }
.unlock-card-icon--blue  { background: rgba(90, 142, 224, 0.15); }

.unlock-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.unlock-card-body {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}

.unlock-card-cta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    align-self: flex-end;
}

.ask-viola-card {
    background: var(--surface);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ask-viola-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.ask-viola-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.2rem;
}

.ask-viola-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.ask-viola-live-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: #c9a84c;
    border: 1px solid #5a4a1a;
    background: rgba(201, 168, 76, 0.08);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.ask-viola-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ask-viola-prompt {
    background: transparent;
    border: 1px solid #333;
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.ask-viola-prompt:hover {
    border-color: #c9a84c;
    color: var(--text-primary);
}

.ask-viola-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #0e1520;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
}

.ask-viola-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.87rem;
}

.ask-viola-input::placeholder {
    color: var(--text-secondary);
}

.ask-viola-send {
    background: transparent;
    border: 1px solid #5a4a1a;
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.ask-viola-send:hover {
    background: rgba(201, 168, 76, 0.12);
}

/* Search section */
.search-section {
    margin-bottom: 0.5rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 800px;
    width: 100%;
    display: flex;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--background);
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

.search-section input {
    flex: 1;
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-section input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-section input::placeholder {
    color: var(--text-secondary);
}

.search-section button {
    background: linear-gradient(135deg, var(--primary-color), #ec4899);
    border: none;
    border-radius: 1rem;
    padding: 1rem 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
}

.search-section button:hover {
    opacity: 0.85;
}

/* Beta badge */
.beta-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    padding: 0.15em 0.6em;
    border-radius: 0.4em;
    vertical-align: super;
    -webkit-text-fill-color: #fff;
    margin-left: 0.25rem;
}

/* Auth gate overlay */
.auth-gate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-dialog {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2.5rem;
    max-width: 400px;
    width: 90%;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.auth-brand {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.auth-dot {
    color: #c9a84c;
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

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

.auth-field {
    margin-bottom: 1rem;
}

.auth-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background: var(--surface-light);
    border: 1.5px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.auth-input:focus {
    border-color: #c9a84c;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: #c9a84c;
    color: #0f172a;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.auth-btn:hover:not(:disabled) {
    background: #b8963d;
}

.auth-switch {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1.25rem;
}

.auth-link {
    background: none;
    border: none;
    color: #c9a84c;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
}

.auth-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    min-height: 1.2em;
    text-align: center;
}

/* Home view fade */
.home-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.35s ease;
}

.home-view.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Create Project Modal */
.project-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.project-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.project-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    width: 90%;
    max-width: 520px;
    overflow: hidden;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.2s ease;
}

.project-overlay.visible .project-modal {
    transform: translateY(0) scale(1);
}

.project-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
}

.project-modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.project-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 0.4rem;
    transition: color 0.15s, background 0.15s;
}

.project-modal-close:hover {
    color: var(--text-primary);
    background: var(--surface-light);
}

.project-modal-body {
    padding: 0 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.project-name-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    transition: border-color 0.2s;
}

.project-name-input-wrap:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.project-name-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.project-name-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-primary);
    min-width: 0;
}

.project-name-input::placeholder {
    color: var(--text-secondary);
}

.project-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.45rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.project-chip:hover {
    background: var(--surface-light);
    border-color: var(--primary-color);
}

.project-info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--surface-light);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.project-info-icon {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--text-secondary);
    opacity: 0.8;
}

.project-file-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1.5px dashed var(--border);
    border-radius: 0.75rem;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    text-align: left;
}

.project-file-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
    background: var(--surface-light);
}

.project-file-btn.has-file {
    border-style: solid;
    border-color: var(--primary-color);
    color: var(--text-primary);
    background: var(--surface-light);
}

.project-modal-error {
    font-size: 0.8rem;
    color: var(--error);
    min-height: 1em;
}

.project-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem 1.5rem;
}

.project-create-btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.project-create-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.project-create-btn:not(:disabled):hover {
    background: var(--primary-hover);
}

.project-create-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

/* ── Tip card clickable state ── */
.tip-card-clickable {
    cursor: pointer;
    transition: background 0.15s;
}
.tip-card-clickable:hover {
    background: #172035;
}
.tip-card-learn {
    font-size: 0.72rem;
    font-weight: 500;
    color: #c9a84c;
    margin-left: 0.4rem;
    white-space: nowrap;
}

/* ── Org Chart Tip Overlay ── */
.orgchart-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(5, 10, 20, 0.78);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    overflow-y: auto;
}
.orgchart-overlay.visible {
    opacity: 1;
    pointer-events: all;
}
.orgchart-modal {
    background: #0d1524;
    border: 1px solid #1e2d45;
    border-radius: 1.25rem;
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    margin: auto;
}
.orgchart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #1e2d45;
    gap: 1rem;
}
.orgchart-modal-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.orgchart-modal-title-row h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #c8d0e0;
    margin: 0;
}
.orgchart-modal-close {
    background: transparent;
    border: none;
    color: #5a6a8a;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 0.4rem;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.orgchart-modal-close:hover {
    color: #c8d0e0;
    background: #1a2540;
}
.orgchart-modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
}
.orgchart-intro {
    font-size: 0.88rem;
    color: #7a8faf;
    line-height: 1.65;
    margin: 0;
    border-left: 3px solid #c9a84c;
    padding-left: 1rem;
}

/* Sections */
.orgchart-section {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.orgchart-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c9a84c;
    margin: 0;
}

/* Org tree */
.orgchart-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 1rem 0;
}
.orgchart-level {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
.orgchart-node {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.6rem 0.9rem;
    border-radius: 0.6rem;
    border: 1px solid #1e2d45;
    background: #111c30;
    min-width: 130px;
    text-align: center;
}
.orgchart-node-ceo {
    border-color: #c9a84c55;
    background: #171f30;
    min-width: 160px;
}
.orgchart-node-vp {
    border-color: #2a3f60;
    background: #0f1a2e;
}
.orgchart-node-dir {
    min-width: 110px;
    background: #0c1525;
}
.orgchart-node-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #c9a84c;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.orgchart-node-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #c8d0e0;
}
.orgchart-node-meta {
    font-size: 0.68rem;
    color: #4a5a78;
}
.orgchart-connector-v {
    width: 1px;
    height: 20px;
    background: #1e2d45;
    margin: 0 auto;
}
.orgchart-connector-h {
    height: 1px;
    background: #1e2d45;
    margin: 0 auto;
}
.orgchart-connector-h-3 {
    width: calc(66.6% + 2rem);
}
.orgchart-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.orgchart-branch-children {
    display: flex;
    gap: 0.5rem;
}
.orgchart-tree-caption,
.orgchart-table-caption {
    font-size: 0.73rem;
    color: #4a5a78;
    line-height: 1.5;
    margin: 0;
}

/* HRIS sources */
.orgchart-sources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.orgchart-source-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: #0f1a2e;
    border: 1px solid #1e2d45;
    border-radius: 0.75rem;
}
.orgchart-source-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
}
.orgchart-source-icon-workday  { background: #e85e2a; }
.orgchart-source-icon-bamboo   { background: #3dba6e; }
.orgchart-source-icon-rippling { background: #f4a62b; color: #1a1000; }
.orgchart-source-icon-xlsx     { background: #217346; }
.orgchart-source-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}
.orgchart-source-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c8d0e0;
}
.orgchart-source-desc {
    font-size: 0.73rem;
    color: #5a6a8a;
    line-height: 1.5;
}
.orgchart-source-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #3a8fff;
    background: #0d2045;
    border: 1px solid #1e3a6a;
    border-radius: 0.3rem;
    padding: 0.15rem 0.4rem;
    flex-shrink: 0;
    align-self: flex-start;
}
.orgchart-source-badge-file {
    color: #3dba6e;
    background: #0a2017;
    border-color: #1a4030;
}

/* Data table */
.orgchart-table-wrap {
    overflow-x: auto;
    border-radius: 0.6rem;
    border: 1px solid #1e2d45;
}
.orgchart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.73rem;
    white-space: nowrap;
}
.orgchart-table th {
    background: #111c30;
    color: #5a6a8a;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #1e2d45;
}
.orgchart-table td {
    color: #9aaccc;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #101d30;
}
.orgchart-table tr:last-child td {
    border-bottom: none;
}
.orgchart-table tr:hover td {
    background: #0f1a2e;
}

/* NL queries */
.orgchart-query-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.orgchart-query-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.orgchart-query-bubble {
    flex: 1;
    background: #0f1a2e;
    border: 1px solid #1e2d45;
    border-radius: 0.6rem;
    padding: 0.6rem 0.875rem;
    font-size: 0.8rem;
    color: #9aaccc;
    line-height: 1.5;
    font-style: italic;
}
.orgchart-query-bubble::before {
    content: '"';
    color: #c9a84c;
    margin-right: 0.2rem;
}
.orgchart-query-bubble::after {
    content: '"';
    color: #c9a84c;
    margin-left: 0.2rem;
}
.orgchart-query-tag {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #c9a84c;
    white-space: nowrap;
    min-width: 90px;
    text-align: right;
}

/* Intelligence section */
.orgchart-section-intelligence {
    background: #0b1422;
    border: 1px solid #1e2d45;
    border-radius: 0.875rem;
    padding: 1.25rem;
    gap: 1rem;
}
.orgchart-intelligence-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.orgchart-intel-intro {
    font-size: 0.83rem;
    color: #7a8faf;
    line-height: 1.6;
    margin: 0;
}
.orgchart-intel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.orgchart-intel-card {
    background: #0d1828;
    border: 1px solid #1a2a42;
    border-radius: 0.65rem;
    padding: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.orgchart-intel-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #c8d0e0;
}
.orgchart-intel-card-text {
    font-size: 0.73rem;
    color: #5a6a8a;
    line-height: 1.55;
    margin: 0;
}

/* Footer */
.orgchart-modal-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.5rem;
    justify-content: flex-end;
    border-top: 1px solid #1e2d45;
}
.orgchart-connect-btn {
    padding: 0.65rem 1.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: #c9a84c;
    color: #0a0e18;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
}
.orgchart-connect-btn:hover {
    background: #ddbf6a;
}
.orgchart-dismiss-btn {
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    color: #5a6a8a;
    border: 1px solid #1e2d45;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.orgchart-dismiss-btn:hover {
    color: #c8d0e0;
    border-color: #2e4060;
}

@media (max-width: 640px) {
    .orgchart-sources-grid,
    .orgchart-intel-grid {
        grid-template-columns: 1fr;
    }
    .orgchart-query-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .orgchart-query-tag {
        text-align: left;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Generated Plans Section ───────────────────────────────────────────────── */
.plans-section {
    width: 100%;
    max-width: 780px;
    padding: 0 2rem 1.5rem;
    margin-top: 1rem;
}

.plans-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.plans-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #8a94a8;
    text-transform: uppercase;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}


.plan-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.plan-card:hover {
    border-color: rgba(201, 168, 76, 0.35);
    background: rgba(201, 168, 76, 0.04);
    transform: translateY(-1px);
}

.plan-card-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.plan-card-company {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plan-card-meta {
    font-size: 0.76rem;
    color: #8a94a8;
}

.plan-card-strategy {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    color: #c9a84c;
    margin-top: 0.2rem;
}

/* ── Plan Viewer Overlay ───────────────────────────────────────────────────── */
.plan-viewer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1300;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.plan-viewer-overlay.visible {
    display: flex;
}

.plan-viewer-modal {
    background: #0d1526;
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 12px;
    width: 860px;
    max-width: calc(100vw - 2rem);
    height: calc(100vh - 4rem);
    max-height: 900px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
}

.plan-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.plan-viewer-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.plan-viewer-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

.plan-viewer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-viewer-download-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #c9a84c, #a8872e);
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.85rem;
    color: #0d1526;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: inherit;
}

.plan-viewer-download-btn:hover { opacity: 0.85; }

.plan-viewer-close-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.plan-viewer-close-btn:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.07);
}

.plan-viewer-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2.5rem;
    position: relative;
}

.plan-viewer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    height: 100%;
    color: #8a94a8;
    font-size: 0.88rem;
}

.plan-viewer-content {
    display: none;
    color: #c8d0e0;
    font-size: 0.9rem;
    line-height: 1.7;
}

.plan-viewer-content.loaded {
    display: block;
}

/* Mammoth-generated HTML styles */
.plan-viewer-content h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e8eaf0;
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.plan-viewer-content h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #c9a84c;
    margin: 1.2rem 0 0.4rem;
}

.plan-viewer-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #d0d8e8;
    margin: 1rem 0 0.3rem;
}

.plan-viewer-content p {
    margin: 0.4rem 0;
}

.plan-viewer-content ul, .plan-viewer-content ol {
    margin: 0.4rem 0 0.4rem 1.4rem;
}

.plan-viewer-content li {
    margin-bottom: 0.25rem;
}

.plan-viewer-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

.plan-viewer-content th {
    background: rgba(201, 168, 76, 0.12);
    color: #c9a84c;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.plan-viewer-content td {
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
}

.plan-viewer-content tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.plan-viewer-content strong, .plan-viewer-content b {
    color: #e2e8f0;
    font-weight: 600;
}

/* ── Create Plan Modal ─────────────────────────────────────────────────────── */
.create-plan-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.create-plan-overlay.visible {
    display: flex;
}

.create-plan-modal {
    background: #0d1526;
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 12px;
    width: 620px;
    max-width: calc(100vw - 2rem);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}

.create-plan-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.create-plan-modal-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.create-plan-modal-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #e8e8e8;
    margin: 0;
}

.create-plan-modal-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.create-plan-modal-close:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.07);
}

.create-plan-modal-body {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.create-plan-modal-desc {
    font-size: 0.82rem;
    color: #7a8499;
    line-height: 1.5;
    margin: 0;
}

.create-plan-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.create-plan-label {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #8a94a8;
    text-transform: uppercase;
}

.create-plan-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    padding: 0.6rem 0.85rem;
    color: #e2e8f0;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.create-plan-input:focus {
    border-color: rgba(201, 168, 76, 0.5);
}

.create-plan-input::placeholder {
    color: #3d4558;
}

.create-plan-strategy-group {
    display: flex;
    gap: 0.6rem;
}

.create-plan-strategy-option {
    cursor: pointer;
}

.create-plan-strategy-option input[type="radio"] {
    display: none;
}

.create-plan-strategy-pill {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    color: #8a94a8;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.15s;
    user-select: none;
}

.create-plan-strategy-option input[type="radio"]:checked + .create-plan-strategy-pill {
    border-color: #c9a84c;
    color: #c9a84c;
    background: rgba(201, 168, 76, 0.1);
}

.create-plan-strategy-option:hover .create-plan-strategy-pill {
    border-color: rgba(255, 255, 255, 0.22);
    color: #c8d0e0;
}

.create-plan-textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    padding: 0.6rem 0.85rem;
    color: #e2e8f0;
    font-size: 0.88rem;
    outline: none;
    resize: vertical;
    min-height: 90px;
    transition: border-color 0.15s;
    font-family: inherit;
    line-height: 1.5;
}

.create-plan-textarea:focus {
    border-color: rgba(201, 168, 76, 0.5);
}

.create-plan-textarea::placeholder {
    color: #3d4558;
}

.create-plan-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.create-plan-cancel-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    padding: 0.55rem 1rem;
    color: #8a94a8;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.create-plan-cancel-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: #c8d0e0;
}

.create-plan-submit-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #c9a84c, #a8872e);
    border: none;
    border-radius: 7px;
    padding: 0.55rem 1.1rem;
    color: #0d1526;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    font-family: inherit;
}

.create-plan-submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.create-plan-submit-btn:active {
    transform: translateY(0);
}
