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

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #161922;
    --bg-tertiary: #1e2130;
    --bg-hover: #252836;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border: #2a2d37;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --navbar-height: 48px;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;
    --transition-speed: 200ms;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f4f4f5;
    --bg-tertiary: #e4e4e7;
    --bg-hover: #d4d4d8;
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border: #d4d4d8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
}

[data-theme="light"] .navbar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .sidebar {
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .project-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .channel-card,
[data-theme="light"] .wizard-step-content,
[data-theme="light"] .deliverable-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .dropup-menu {
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .chat-bubble.ai {
    background: var(--bg-secondary);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: var(--border);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
}

/* ── App Shell ─────────────────────────────────────────────── */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    height: var(--navbar-height);
    padding: 0 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    flex-shrink: 0;
    gap: 12px;
}

.navbar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: background var(--transition-speed), color var(--transition-speed);
}

.navbar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    white-space: nowrap;
}

.navbar-logo .logo-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

.navbar-spacer {
    flex: 1;
}

.navbar-cmd {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: border-color var(--transition-speed);
    white-space: nowrap;
}

.navbar-cmd:hover {
    border-color: var(--text-muted);
}

.navbar-cmd kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 5px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    color: var(--text-muted);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: background var(--transition-speed), color var(--transition-speed);
}

.navbar-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.navbar-action-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.navbar-action-btn .notif-badge {
    width: auto;
    height: auto;
    min-width: 16px;
    padding: 0 4px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: #ef4444;
    border-radius: 8px;
    top: 2px;
    right: 2px;
}

/* ── Notification Dropdown ─────────────────────────────────── */

.notif-container {
    position: relative;
}

.notif-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 420px;
    max-height: 520px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.35);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.notif-header-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.notif-mark-read {
    background: none;
    border: none;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}

.notif-mark-read:hover {
    background: rgba(59,130,246,0.1);
}

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

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.notif-item:last-child {
    border-bottom: none;
}

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

.notif-item.read {
    opacity: 0.6;
}

.notif-item.read:hover {
    opacity: 1;
}

.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.notif-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notif-kind-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.notif-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.notif-title {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.notif-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin-top: 6px;
}

.notif-footer {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.notif-footer-link {
    background: none;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.notif-footer-link:hover {
    background: rgba(59,130,246,0.1);
}

/* ── Search Modal (⌘K) ────────────────────────────────────── */

.navbar-cmd-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    z-index: 1100;
    backdrop-filter: blur(4px);
}

.search-modal {
    width: 560px;
    max-width: 92vw;
    max-height: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.search-input-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

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

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

.search-esc {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: inherit;
}

.search-results {
    flex: 1;
    overflow-y: auto;
}

.search-empty {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-groups {
    padding: 6px 0;
}

.search-group {
    padding-bottom: 4px;
}

.search-group-label {
    padding: 8px 18px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background 0.1s;
}

.search-item:hover,
.search-item.selected {
    background: var(--bg-hover);
}

.search-item.selected {
    background: var(--bg-tertiary);
}

.search-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-item-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.search-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-enter {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: inherit;
    flex-shrink: 0;
}

.search-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 18px;
    border-top: 1px solid var(--border);
}

.search-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-hint kbd {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.68rem;
    font-family: inherit;
}

.navbar-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-speed);
}

.navbar-avatar:hover {
    background: var(--bg-tertiary);
}

.navbar-avatar .avatar-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.navbar-avatar .role-badge {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── User Menu Dropdown ────────────────────────────────────── */

.user-menu-container {
    position: relative;
}

.user-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.35);
    z-index: 100;
    padding: 6px;
    display: flex;
    flex-direction: column;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
}

.user-menu-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.user-menu-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-menu-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.user-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 6px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 8px;
    border: none;
    background: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: left;
}

.user-menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-menu-item.logout {
    color: #f87171;
}

.user-menu-item.logout:hover {
    background: rgba(239,68,68,0.08);
    color: #f87171;
}

.user-menu-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.user-menu-item:hover .user-menu-item-icon {
    opacity: 1;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    transition: width var(--transition-speed) ease,
                min-width var(--transition-speed) ease;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 50;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
}

/* ── Workspace Switcher ────────────────────────────────────── */
.ws-switcher {
    position: relative;
    padding: 12px 12px 0;
}
.ws-switcher-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.ws-switcher-btn:hover { background: var(--bg-hover); }
.sidebar.collapsed .ws-switcher-btn { justify-content: center; padding: 8px; }
.ws-switcher-chevron { color: var(--text-muted); display: flex; }

.ws-backdrop {
    position: fixed;
    inset: 0;
    z-index: 199;
}
.ws-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 12px;
    right: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 200;
    overflow: hidden;
    min-width: 220px;
}
.sidebar.collapsed .ws-dropdown { left: 100%; top: 0; right: auto; width: 240px; }

.ws-dropdown-label {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ws-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
}
.ws-dropdown-item:hover { background: var(--bg-hover); }
.ws-dropdown-item.active { color: var(--text-primary); }
.ws-dropdown-item.create { color: var(--accent); font-weight: 500; padding: 8px 12px; }
.ws-dropdown-avatar {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ws-dropdown-info { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.ws-dropdown-name { font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-dropdown-meta { font-size: 11px; color: var(--text-muted); }
.ws-dropdown-check { color: var(--accent); display: flex; flex-shrink: 0; }
.ws-dropdown-divider { height: 1px; background: var(--border); margin: 2px 0; }
.ws-create-plus {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--accent);
    flex-shrink: 0;
}
.ws-create-form {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
}
.ws-create-form .form-input { flex: 1; font-size: 12px; padding: 6px 8px; }

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 2px;
}

.sidebar-section-label {
    padding: 16px 12px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-section-label {
    opacity: 0;
    height: 0;
    padding: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: background var(--transition-speed), color var(--transition-speed);
    white-space: nowrap;
    overflow: hidden;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item .nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-item .nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .nav-label {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 8px;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.sidebar-cost {
    display: flex;
    flex-direction: column;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-cost .cost-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sidebar-cost .cost-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-cost .cost-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.sidebar-cost .cost-bar-fill {
    height: 100%;
    width: 35%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.sidebar.collapsed .sidebar-footer {
    display: none;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    background: var(--bg-primary);
}

/* ── Page Stubs ────────────────────────────────────────────── */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.page-header p {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 14px;
}

.page-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Dashboard ─────────────────────────────────────────────── */
/* ── Welcome / Landing Page ──────────────────────────────── */
.welcome-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 48px - 48px);
}

.welcome-card {
    text-align: center;
    max-width: 420px;
    padding: 48px 32px;
}

.welcome-icon {
    margin-bottom: 24px;
}

.welcome-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.welcome-cta {
    display: inline-block;
    padding: 10px 28px;
    font-size: 14px;
}

.welcome-hint {
    margin-top: 16px;
    font-size: 15px;
    color: var(--text-muted);
}

.welcome-link {
    color: var(--accent);
    text-decoration: none;
}

.welcome-link:hover {
    text-decoration: underline;
}

.dashboard {
    max-width: 1280px;
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.dashboard-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.dashboard-subtitle {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 14px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    transition: background var(--transition-speed);
}

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

/* ── Stats Grid ────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color var(--transition-speed);
}

.stat-card:hover {
    border-color: var(--text-muted);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-secondary);
}

.stat-icon svg {
    width: 18px;
    height: 18px;
}

.sparkline {
    flex-shrink: 0;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.stat-card-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-card-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Current Work Banner ───────────────────────────────────── */
.current-work {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    margin-bottom: 28px;
}

.current-work-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.current-work-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.current-work-project {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.current-work-detail {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.current-work-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.current-work-pct {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.current-work-eta {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Dashboard Page ────────────────────────────────────────── */
.dashboard-page {
    max-width: 1280px;
}

/* ── Recent Activity Section ──────────────────────────────── */
.dashboard-activity-section {
    margin-top: 32px;
}

.dashboard-activity-section .section-title {
    display: block;
    margin-bottom: 14px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    transition: background var(--transition-speed);
}

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

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.activity-project {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.activity-action {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Projects Placeholder ─────────────────────────────────── */
.projects-placeholder {
    text-align: center;
    grid-column: 1 / -1;
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* ── Projects Section ──────────────────────────────────────── */
.projects-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

/* ── Filter Bar ────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
}

.filter-btn {
    height: 28px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 6px;
    transition: background var(--transition-speed), color var(--transition-speed);
}

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

.filter-btn.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ── Projects Grid ─────────────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 1100px) {
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

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

/* ── Project Card ──────────────────────────────────────────── */
.project-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: transform var(--transition-speed),
                border-color var(--transition-speed),
                box-shadow var(--transition-speed);
}

.project-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-muted);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.project-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.project-card-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.project-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-repo {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.project-card-pct {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.project-card-task {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.task-badge {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.status-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-dev {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.status-released {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.status-archived {
    background: rgba(113, 113, 122, 0.15);
    color: var(--text-muted);
}

.project-card.archived {
    opacity: 0.75;
}

.project-card.archived:hover {
    opacity: 1;
}

.btn-ghost.btn-sm {
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
}

.archive-page {
    max-width: 1280px;
}

.project-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.project-card-avatars {
    display: flex;
    align-items: center;
}

.mini-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-left: -6px;
}

.mini-avatar:first-child {
    margin-left: 0;
}

.mini-avatar.extra {
    background: var(--bg-hover);
    color: var(--text-muted);
    font-size: 8px;
}

.delivery-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: var(--success);
    padding: 2px 8px;
    border-radius: 4px;
    transition: background var(--transition-speed);
}

.delivery-link:hover {
    background: rgba(34, 197, 94, 0.1);
}

.delivery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.project-card-activity {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Buttons (shared) ──────────────────────────────────────── */
.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary.btn-sm {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    transition: background var(--transition-speed), border-color var(--transition-speed);
}

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

.btn-success {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

/* Shared action button base — Deploy & Archive */
.btn-deploy,
.btn-archive {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    background: rgba(113, 113, 122, 0.15);
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: background var(--transition-speed);
}

.btn-deploy:hover,
.btn-archive:hover {
    background: rgba(113, 113, 122, 0.25);
}

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

.btn-deploy.ready {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.btn-deploy.ready:hover {
    background: rgba(59, 130, 246, 0.25);
}

.btn-deploy.released {
    cursor: default;
    opacity: 1;
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    color: var(--text-muted);
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    transition: background var(--transition-speed), color var(--transition-speed);
}

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

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    flex: 1;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ── Projects Listing ──────────────────────────────────────── */
.projects-listing {
    max-width: 1280px;
}

.projects-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Project Detail ────────────────────────────────────────── */
.project-detail {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--navbar-height) - 48px);
}

.project-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.project-detail-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}



/* btn-archive styles merged into shared .btn-deploy, .btn-archive rule above */

.project-detail-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.project-detail-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.project-detail-repo {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    transition: color var(--transition-speed);
}

.project-detail-repo:hover {
    color: var(--text-secondary);
}

.no-repo {
    font-style: italic;
    opacity: 0.5;
}

.project-detail-repo svg {
    flex-shrink: 0;
}

.project-detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Active Work Banner ────────────────────────────────────── */
.active-work-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.active-work-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── New Repo Banner ──────────────────────────────────────── */
.new-repo-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 8px;
    margin-bottom: 12px;
    color: #f59e0b;
    flex-shrink: 0;
}

.new-repo-banner-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.new-repo-banner-link {
    color: #f59e0b;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.new-repo-banner-link:hover {
    color: #fbbf24;
}

.new-repo-banner-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.new-repo-banner-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* ── Split Layout ──────────────────────────────────────────── */
.split-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 0;
}

.left-panel {
    flex: 6;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.split-divider {
    width: 1px;
    background: var(--border);
    flex-shrink: 0;
    cursor: col-resize;
    position: relative;
}

.split-divider::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -3px;
    right: -3px;
}

.right-panel {
    flex: 4;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    transition: flex var(--transition-speed), min-width var(--transition-speed);
}

.right-panel.folded {
    flex: 0;
    min-width: 44px;
    max-width: 44px;
}

.right-panel.folded .chat-header {
    flex-direction: column;
    padding: 10px 6px;
    gap: 10px;
}

.right-panel.folded .chat-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 12px;
    white-space: nowrap;
}

.right-panel.folded .chat-participants {
    flex-direction: column;
    gap: 4px;
}

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

.chat-fold-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ── Panel Tabs ────────────────────────────────────────────── */
.panel-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    padding: 0 16px;
    height: 42px;
}

.panel-tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: color var(--transition-speed), border-color var(--transition-speed);
    white-space: nowrap;
}

.panel-tab:hover {
    color: var(--text-secondary);
}

.panel-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* ── Overview Tab ──────────────────────────────────────────── */
.overview-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.overview-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.overview-stat-value {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.overview-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.overview-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.overview-tasks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overview-task-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.overview-task-name {
    font-size: 13px;
    font-weight: 500;
    width: 160px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-task-bar {
    flex: 1;
    min-width: 60px;
}

/* ── Tasks Tab ─────────────────────────────────────────────── */
.tasks-table {
    display: flex;
    flex-direction: column;
}

.tasks-table-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border);
}

.th-name { flex: 2; }
.th-progress { flex: 2.5; }
.th-status { flex: 0.8; }
.th-issues { width: 60px; text-align: center; flex-shrink: 0; }
.th-time { width: 70px; text-align: right; flex-shrink: 0; }
.th-estimate { width: 70px; text-align: right; flex-shrink: 0; }

.task-row-group {
    border-bottom: 1px solid var(--border);
}

.task-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 8px;
    cursor: pointer;
    transition: background var(--transition-speed);
}

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

.task-row.expanded {
    background: var(--bg-secondary);
}

.td-name {
    flex: 2;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.td-status {
    flex: 0.8;
    display: flex;
    align-items: center;
}

.expand-arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform var(--transition-speed);
    display: inline-block;
}

.expand-arrow.expanded {
    transform: rotate(90deg);
}

.td-progress {
    flex: 2.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.td-progress-pct {
    font-size: 12px;
    color: var(--text-muted);
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}

.td-issues {
    width: 60px;
    text-align: center;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.td-time, .td-estimate {
    width: 70px;
    text-align: right;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.status-analyzing {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.status-todo {
    background: rgba(113, 113, 122, 0.15);
    color: #a1a1aa;
}

/* Task expanded content */
.task-expanded-content {
    padding: 8px 12px 12px 32px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-expanded-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.task-expanded-issue {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 12px;
}

.issue-id-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.issue-title-inline {
    flex: 1;
    color: var(--text-primary);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.issue-status {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.issue-status.done {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.issue-status.working {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.issue-status.open {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.issue-status.todo {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.issue-pr-link {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── Issues Tab ────────────────────────────────────────────── */
.issues-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.issues-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Dropup menu */
.dropup-container {
    position: relative;
}

.dropup-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dropup-arrow {
    font-size: 10px;
    transition: transform var(--transition-speed);
}

.dropup-arrow.open {
    transform: rotate(180deg);
}

.dropup-menu {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
    z-index: 20;
    display: flex;
    flex-direction: column;
}

.dropup-item {
    display: block;
    width: 100%;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-speed), color var(--transition-speed);
}

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

.dropup-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

.issues-sync-note {
    font-size: 11px;
    color: var(--text-muted);
}

.issues-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.issues-table-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border);
}

.ith-id { width: 55px; flex-shrink: 0; }
.ith-title { flex: 2; min-width: 0; }
.ith-task { flex: 1; min-width: 0; }
.ith-status { width: 90px; flex-shrink: 0; }
.ith-pr { width: 65px; flex-shrink: 0; }
.ith-updated { width: 80px; flex-shrink: 0; }

.issue-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-speed);
}

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

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

.issue-row.done {
    opacity: 0.7;
}

.itd-id { width: 55px; flex-shrink: 0; }
.itd-title { flex: 2; min-width: 0; color: var(--text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itd-task { flex: 1; min-width: 0; color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itd-status { width: 90px; flex-shrink: 0; display: flex; align-items: center; }
.itd-pr { width: 65px; flex-shrink: 0; font-size: 12px; color: var(--text-muted); }
.itd-updated { width: 80px; flex-shrink: 0; font-size: 12px; color: var(--text-muted); }

/* ── Deployment Tab ──────────────────────────────────────── */
.deployment-tab {
    padding: 12px;
}

.deployment-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.deployment-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.deployment-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.deployment-url {
    display: inline-block;
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.deployment-url:hover {
    text-decoration: underline;
}
.deployment-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.deployment-progress .progress-bar {
    flex: 1;
}
.deployment-progress-pct {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
}

/* ── Project Status Bar ───────────────────────────────────── */
.project-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 8px;
}
.project-status-bar.working { background: rgba(59, 130, 246, 0.1); color: var(--accent); }
.project-status-bar.completed { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.project-status-bar.pending { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.working { background: var(--accent); animation: pulse 2s infinite; }
.status-dot.completed { background: #22c55e; }
.status-dot.pending { background: var(--text-muted); }
.status-progress { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.deploy-link { margin-left: auto; color: #22c55e; text-decoration: none; font-size: 12px; }
.deploy-link:hover { text-decoration: underline; }
.issue-link { color: var(--accent); text-decoration: none; }
.issue-link:hover { text-decoration: underline; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Deliverables Tab ──────────────────────────────────────── */
.deliverables-tab {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.deliverable-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex-wrap: wrap;
}

.deliverable-card.latest {
    border-color: var(--accent);
}

.deliverable-card.release {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.04);
}

.deliverables-section {
    margin-bottom: 16px;
}

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

.deliverables-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.deliverables-count {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.deliverable-release-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.deliverable-url.release {
    color: var(--success);
    font-weight: 600;
}

.delivery-dot.release {
    background: var(--success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.deliverable-empty {
    font-size: 13px;
    color: var(--text-muted);
    padding: 16px;
    text-align: center;
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: 8px;
}

.deliverable-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.deliverable-version {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.deliverable-latest-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

.deliverable-label {
    font-size: 12px;
    color: var(--text-muted);
}

.deliverable-url {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--success);
    flex: 1;
    transition: opacity var(--transition-speed);
}

.deliverable-url:hover {
    opacity: 0.8;
}

.deliverable-updated {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── History Tab ───────────────────────────────────────────── */
.history-tab {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 16px;
    border-left: 2px solid var(--border);
}

.history-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    position: relative;
}

.history-time {
    width: 80px;
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
}

.history-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 4px;
    flex-shrink: 0;
    position: relative;
}

.history-dot::before {
    content: "";
    position: absolute;
    left: -21px;
    top: 1px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-action {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.history-detail {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Commander Chat ────────────────────────────────────────── */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    height: 42px;
}

.chat-title {
    font-size: 14px;
    font-weight: 600;
}

.chat-participants {
    display: flex;
    align-items: center;
    gap: 0;
}

.chat-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    margin-left: -4px;
    border: 2px solid var(--bg-primary);
}

.chat-avatar:first-child { margin-left: 0; }
.chat-avatar.ai { background: var(--accent); }
.chat-avatar.user { background: linear-gradient(135deg, var(--accent), #8b5cf6); }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-bubble {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.chat-bubble:last-child {
    margin-bottom: 0;
}

.chat-bubble.ai {
    border-left: 3px solid var(--accent);
}

.chat-bubble.user {
    background: var(--bg-tertiary);
    border-color: transparent;
}

.chat-bubble-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-avatar-sm {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.chat-avatar-sm.ai { background: var(--accent); }
.chat-avatar-sm.user { background: linear-gradient(135deg, var(--accent), #8b5cf6); }

.chat-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.chat-bubble-content {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Markdown rendering inside chat bubbles */
.chat-bubble-content ol,
.chat-bubble-content ul {
    margin: 8px 0;
    padding-left: 24px;
}

.chat-bubble-content ol {
    list-style-type: decimal;
}

.chat-bubble-content ul {
    list-style-type: disc;
}

.chat-bubble-content li {
    margin-bottom: 4px;
    padding-left: 4px;
}

.chat-bubble-content p {
    margin: 6px 0;
}

.chat-bubble-content p:first-child {
    margin-top: 0;
}

.chat-bubble-content p:last-child {
    margin-bottom: 0;
}

.chat-bubble-content code {
    background: var(--bg-tertiary);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
}

.chat-bubble-content pre {
    background: var(--bg-tertiary);
    padding: 10px 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.chat-bubble-content pre code {
    background: none;
    padding: 0;
}

.chat-bubble-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
    margin: 8px 0;
    color: var(--text-muted);
}

.chat-bubble-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.chat-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.chat-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(113, 113, 122, 0.15);
    color: var(--text-muted);
}

.chat-badge.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.chat-badge.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

/* Chat input */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-speed);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-input:focus {
    border-color: var(--accent);
}

.chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    flex-shrink: 0;
    transition: background var(--transition-speed);
}

.chat-send-btn:hover {
    background: var(--accent-hover);
}

/* Plan list in chat */
.chat-plan-list {
    margin: 8px 0 6px 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    counter-reset: plan-step;
}

.chat-plan-item {
    counter-increment: plan-step;
    font-size: 12px;
    line-height: 1.5;
    padding: 5px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    position: relative;
    padding-left: 30px;
}

.chat-plan-item::before {
    content: counter(plan-step);
    position: absolute;
    left: 8px;
    top: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-plan-title {
    font-weight: 600;
    color: var(--text-primary);
}

.chat-plan-detail {
    color: var(--text-muted);
}

.chat-plan-summary {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Confirm plan bubble */
.chat-bubble.confirm-plan {
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.06);
}

.chat-confirm-action {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.btn-confirm-plan {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
    background: var(--success);
    color: #fff;
}

.btn-confirm-plan:disabled {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    cursor: default;
}

/* Confirmed user bubble */
.chat-bubble.confirmed {
    border: 1px solid rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.06);
}

/* ── New Project Wizard ─────────────────────────────────────── */
.new-project-page {
    display: flex;
    justify-content: center;
    padding-top: 16px;
}

.wizard-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.wizard-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.wizard-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: background var(--transition-speed), color var(--transition-speed);
}

.wizard-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Step indicator */
.wizard-steps {
    display: flex;
    align-items: center;
    gap: 0;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wizard-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 2px solid var(--border);
    transition: all var(--transition-speed);
}

.wizard-step.active .wizard-step-number {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.wizard-step.completed .wizard-step-number {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.wizard-step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.wizard-step.active .wizard-step-label {
    color: var(--text-primary);
}

.wizard-step.completed .wizard-step-label {
    color: var(--text-secondary);
}

.wizard-step-line {
    flex: 1;
    height: 2px;
    margin: 0 12px;
    background: var(--border);
    min-width: 20px;
}

/* Step content */
.wizard-step-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
}

.wizard-step-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 4px;
}

.wizard-step-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Form elements */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-speed);
}

.form-input::placeholder {
    color: var(--text-muted);
}

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

.form-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: vertical;
    transition: border-color var(--transition-speed);
}

.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea:focus {
    border-color: var(--accent);
}

.form-textarea.large {
    min-height: 140px;
}

/* Radio card group */
.form-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.form-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color var(--transition-speed), background var(--transition-speed);
}

.form-radio-card:hover {
    border-color: var(--text-muted);
}

.form-radio-card.selected {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

.form-radio-input {
    margin-top: 2px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.form-radio-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.form-radio-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-radio-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.connect-github-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.connect-github-link:hover {
    text-decoration: underline;
}

.connect-gh-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    margin-bottom: 16px;
}

.connect-gh-banner-icon {
    flex-shrink: 0;
    color: var(--accent);
}

.connect-gh-banner-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.user-menu-item.connect-gh {
    color: var(--accent);
}

/* Toggle switch */
.form-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
}

.form-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.form-toggle-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    flex-shrink: 0;
    transition: background var(--transition-speed), border-color var(--transition-speed);
}

.toggle-switch.on {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--transition-speed);
}

.toggle-switch.on .toggle-knob {
    transform: translateX(20px);
}

/* OSS details */
.oss-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.oss-info-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
}

.oss-info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.oss-info-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.oss-info-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.oss-info-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Wizard summary */
.wizard-summary {
    margin-top: 20px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.wizard-summary-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wizard-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
}

.wizard-summary-row + .wizard-summary-row {
    border-top: 1px solid var(--border);
}

.wizard-summary-label {
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.wizard-summary-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

/* Wizard footer */
.wizard-footer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wizard-footer-spacer {
    flex: 1;
}
.wizard-error {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger, #ef4444);
    border-radius: 8px;
    color: #ef4444;
    font-size: 13px;
    margin-top: 8px;
}
.form-help-text {
    color: var(--text-tertiary);
    font-size: 13px;
    margin-top: 6px;
}

/* ── Channels & Integrations ───────────────────────────────── */
.channels-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 8px;
}

.channels-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.channels-header-text {
    flex: 1;
}

.channels-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}

.channels-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 520px;
}

.channels-stats {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.channels-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 80px;
}

.channels-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.channels-stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Channel cards grid */
.channels-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.channel-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.channel-card:hover {
    border-color: var(--text-muted);
}

.channel-card.connected {
    border-color: rgba(34, 197, 94, 0.3);
}

.channel-card.connected:hover {
    border-color: rgba(34, 197, 94, 0.5);
}

.channel-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.channel-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.channel-card-icon svg {
    width: 22px;
    height: 22px;
}

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

.channel-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.channel-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Connect / Disconnect button */
.btn-channel-toggle {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition-speed);
}

.btn-channel-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-channel-toggle.connected {
    background: transparent;
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.btn-channel-toggle.connected:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

/* Feature tags */
.channel-card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.channel-feature-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid;
}

/* Connected details panel */
.channel-card-details {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channel-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.channel-detail-label {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.channel-detail-value {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: var(--font-mono, monospace);
}

.channel-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}

.channel-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-mono, monospace);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 4px;
}

.channel-detail-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--success);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

/* Footer note */
.channels-footer-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.channels-footer-note svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--text-muted);
}

/* ── Connection Status (New Project Step 1) ───────────────── */
.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn .form-input {
    flex: 1;
}

.input-with-btn .btn-primary {
    white-space: nowrap;
    flex-shrink: 0;
}

.input-with-prefix {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary, #2a2a3e);
    border: 1px solid var(--border-primary, #3a3a4e);
    border-radius: 8px;
    overflow: hidden;
}

.input-with-prefix .input-prefix {
    padding: 0 0 0 12px;
    color: var(--text-secondary, #8b8ba7);
    font-size: 0.9rem;
    white-space: nowrap;
    user-select: none;
}

.input-with-prefix .form-input {
    border: none;
    background: transparent;
    padding-left: 4px;
}

.input-with-prefix .form-input:focus {
    box-shadow: none;
}

.input-with-prefix:focus-within {
    border-color: var(--accent, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.conn-status {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    margin-top: 16px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
}

.conn-status.idle {
    border-color: var(--border);
}

.conn-status.checking {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.04);
}

.conn-status.connected {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.04);
}

.conn-status.not-connected {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.04);
}

.conn-status.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.04);
}

.conn-status-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.conn-status-icon.idle {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.conn-status-icon.checking {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent);
}

.conn-status-icon.connected {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.conn-status-icon.not-connected {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.conn-status-icon.error {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.conn-status-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.conn-status-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.conn-status-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(59, 130, 246, 0.25);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Scopes */
.conn-scopes {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.12);
    border-radius: 8px;
}

.conn-scopes-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.conn-scopes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.conn-scope-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
}

/* Sync info */
.conn-sync-info {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.conn-sync-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.conn-sync-icon {
    font-size: 14px;
    color: var(--success);
    flex-shrink: 0;
}

/* Manage installation link (Connected state) */
.conn-manage-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-tertiary, #2a2a3e);
    border: 1px solid var(--border-primary, #3a3a4e);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.conn-manage-link:hover {
    color: var(--text-primary);
    border-color: var(--accent, #6366f1);
    background: rgba(99, 102, 241, 0.08);
}

.repo-manage-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* Install actions (Not Connected state) */
.conn-install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.conn-install-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.conn-help-text {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ── Team Page ─────────────────────────────────────────────── */

.team-page {
    padding: 32px;
    max-width: 960px;
}

.team-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.team-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.team-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

.team-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.team-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.team-stat strong {
    color: var(--text-primary);
}

.team-stat.online {
    display: flex;
    align-items: center;
    gap: 5px;
}

.team-stat-sep {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* ── Team Table ────────────────────────────────────────────── */

.team-table {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.team-table-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.team-th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.team-th.member { width: 260px; flex-shrink: 0; }
.team-th.role   { width: 100px; flex-shrink: 0; }
.team-th.status { width: 110px; flex-shrink: 0; }
.team-th.projects { width: 80px; flex-shrink: 0; }
.team-th.active { flex: 1; }

.team-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

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

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

.team-td.member { width: 260px; flex-shrink: 0; display: flex; align-items: center; gap: 12px; }
.team-td.role   { width: 100px; flex-shrink: 0; }
.team-td.status { width: 110px; flex-shrink: 0; }
.team-td.projects { width: 80px; flex-shrink: 0; color: var(--text-secondary); font-size: 0.875rem; }
.team-td.active { flex: 1; color: var(--text-muted); font-size: 0.85rem; }

.team-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.team-member-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.team-member-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-member-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Role Badges ───────────────────────────────────────────── */

.role-badge-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-badge-tag.owner  { background: rgba(59,130,246,0.15); color: #60a5fa; }
.role-badge-tag.admin  { background: rgba(139,92,246,0.15); color: #a78bfa; }
.role-badge-tag.member { background: rgba(34,197,94,0.12);  color: #4ade80; }
.role-badge-tag.viewer { background: rgba(161,161,170,0.12); color: var(--text-secondary); }

/* ── Team Status ───────────────────────────────────────────── */

.team-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.team-status.online  { color: var(--success); }
.team-status.away    { color: var(--warning); }
.team-status.pending { color: var(--text-muted); font-style: italic; }

/* ── Invite Modal ──────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 440px;
    max-width: 92vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

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

.modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ── Invite Tabs ──────────────────────────────────────────── */
.invite-tabs {
    display: flex;
    padding: 0 24px;
    gap: 0;
    border-bottom: 1px solid var(--border);
}
.invite-tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.invite-tab:hover { color: var(--text-primary); }
.invite-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Form Controls ─────────────────────────────────────────── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}

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

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Invite Role Select ────────────────────────────────────── */

.invite-role-select {
    position: relative;
}

.invite-role-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.invite-role-trigger:hover {
    border-color: var(--text-muted);
}

.dropup-arrow {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.invite-role-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* ── Invite Feedback ───────────────────────────────────────── */

.invite-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.invite-feedback.success {
    background: rgba(34,197,94,0.1);
    color: #4ade80;
}

.invite-feedback.error {
    background: rgba(239,68,68,0.1);
    color: #f87171;
}

/* ── Secondary Button ──────────────────────────────────────── */

.btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

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

/* ── Billing & Usage Page ──────────────────────────────────── */

.billing-page {
    padding: 32px;
    max-width: 1100px;
}

.billing-header {
    margin-bottom: 28px;
}

.billing-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.billing-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* ── Top cards row ─────────────────────────────────────────── */

.billing-top-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.billing-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.billing-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

/* Plan badges */
.plan-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.plan-badge.starter    { background: rgba(161,161,170,0.12); color: var(--text-secondary); }
.plan-badge.growth     { background: rgba(59,130,246,0.15); color: #60a5fa; }
.plan-badge.enterprise { background: rgba(139,92,246,0.15); color: #a78bfa; }

.plan-price-row {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.plan-period {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.plan-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.plan-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

/* Spend card */
.spend-amount-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.spend-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.spend-budget {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.billing-period-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 3px 8px;
    border-radius: 6px;
}

.spend-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spend-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.spend-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    transition: width 0.4s ease;
}

.spend-bar-fill.warning {
    background: var(--warning);
}

.spend-bar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 36px;
    text-align: right;
}

.spend-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(245,158,11,0.1);
    color: #fbbf24;
    font-size: 0.82rem;
    font-weight: 500;
}

/* Payment card */
.payment-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.payment-card-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.payment-details {
    display: flex;
    flex-direction: column;
}

.payment-type {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.payment-expiry {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Billing sections ──────────────────────────────────────── */

.billing-section {
    margin-bottom: 32px;
}

.billing-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

/* ── Usage grid ────────────────────────────────────────────── */

.usage-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.usage-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.usage-card-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.usage-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.usage-values {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.usage-bar-track {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.usage-bar-fill.warning {
    background: var(--warning) !important;
}

.usage-pct {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
}

/* ── Cost table ────────────────────────────────────────────── */

.cost-table {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.cost-table-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.cost-th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    width: 110px;
    flex-shrink: 0;
    text-align: right;
}

.cost-th.project {
    flex: 1;
    text-align: left;
}

.cost-th.total {
    width: 100px;
}

.cost-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

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

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

.cost-td {
    width: 110px;
    flex-shrink: 0;
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.cost-td.project {
    flex: 1;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 500;
}

.cost-td.total {
    width: 100px;
    color: var(--text-primary);
    font-weight: 600;
}

.cost-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cost-total-row {
    background: var(--bg-tertiary);
    border-top: 2px solid var(--border);
}

.cost-total-row:hover {
    background: var(--bg-tertiary);
}

.cost-total-row .cost-td {
    color: var(--text-primary);
}

/* ── Invoice table ─────────────────────────────────────────── */

.invoice-table {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.invoice-table-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.invoice-th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.invoice-th.id     { width: 160px; flex-shrink: 0; }
.invoice-th.date   { width: 140px; flex-shrink: 0; }
.invoice-th.amount { flex: 1; }
.invoice-th.status { width: 80px; flex-shrink: 0; }
.invoice-th.action { width: 100px; flex-shrink: 0; text-align: right; }

.invoice-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

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

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

.invoice-td {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.invoice-td.id     { width: 160px; flex-shrink: 0; font-weight: 500; color: var(--text-primary); }
.invoice-td.date   { width: 140px; flex-shrink: 0; }
.invoice-td.amount { flex: 1; }
.invoice-td.action { width: 100px; flex-shrink: 0; text-align: right; }

.invoice-status {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
}

.invoice-status.paid {
    background: rgba(34,197,94,0.12);
    color: #4ade80;
}

.invoice-status.due {
    background: rgba(245,158,11,0.12);
    color: #fbbf24;
}

/* ── Plan cards v2 (3-tier comparison) ────────────────────── */

.plan-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.plan-card-v2 {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}

.plan-card-v2:hover {
    border-color: var(--text-muted);
}

.plan-card-v2.popular {
    border-color: #f97316;
    border-width: 2px;
}

.plan-card-v2.current {
    background: var(--bg-tertiary);
}

.plan-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.plan-popular-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #fff;
}

.plan-card-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.plan-card-price-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.plan-card-price {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}

.plan-card-period {
    font-size: 1rem;
    color: var(--text-muted);
}

.plan-card-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.plan-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.plan-feature svg {
    flex-shrink: 0;
}

.plan-card-btn {
    width: 100%;
    margin-top: auto;
}

/* ── Usage grid v2 (3 columns) ───────────────────────────── */

.usage-grid-v2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

/* ── Small / Ghost button variants ─────────────────────────── */

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.btn-ghost {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

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

/* ── Responsive billing ────────────────────────────────────── */

@media (max-width: 900px) {
    .billing-top-cards {
        grid-template-columns: 1fr;
    }
    .usage-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Docs Page ─────────────────────────────────────────────── */

.docs-page {
    padding: 32px;
    max-width: 1000px;
}

.docs-header {
    margin-bottom: 24px;
}

.docs-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.docs-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Search bar */
.docs-search-bar {
    position: relative;
    margin-bottom: 20px;
}

.docs-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.docs-search-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 14px 11px 40px;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}

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

.docs-search-input::placeholder {
    color: var(--text-muted);
}

/* Category pills */
.docs-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.docs-cat-pill {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.docs-cat-pill:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.docs-cat-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Articles grid */
.docs-articles {
    margin-bottom: 32px;
}

.docs-articles-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}

.docs-article-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.docs-article-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.docs-article-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-cat-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.docs-cat-tag.getting-started { background: rgba(59,130,246,0.15); color: #60a5fa; }
.docs-cat-tag.projects        { background: rgba(139,92,246,0.15); color: #a78bfa; }
.docs-cat-tag.team            { background: rgba(34,197,94,0.12);  color: #4ade80; }
.docs-cat-tag.billing         { background: rgba(245,158,11,0.12); color: #fbbf24; }
.docs-cat-tag.api             { background: rgba(236,72,153,0.12); color: #f472b6; }
.docs-cat-tag.integrations    { background: rgba(6,182,212,0.12);  color: #22d3ee; }

.docs-video-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
}

.docs-article-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.docs-article-summary {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

.docs-article-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.docs-meta-sep {
    font-size: 0.6rem;
}

/* Empty state */
.docs-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 0;
    color: var(--text-muted);
    text-align: center;
}

.docs-empty p {
    font-size: 0.9rem;
}

/* Footer note (reuse channels pattern) */
.docs-footer-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.docs-footer-note svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--text-muted);
}

/* ── Operations Page ───────────────────────────────────────── */

.ops-page {
    padding: 32px;
    max-width: 1140px;
}

.ops-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.ops-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ops-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

.ops-header-stats {
    display: flex;
    gap: 20px;
}

.ops-hstat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ops-hstat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.ops-hstat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

/* Overview cards */
.ops-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.ops-ov-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ops-ov-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.ops-ov-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

.ops-ov-value.green { color: var(--success); }

/* Project pills */
.ops-project-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.ops-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ops-pill:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ops-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.ops-pill .status-dot {
    width: 7px;
    height: 7px;
}

/* Project panel */
.ops-panels {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ops-project-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.ops-panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.ops-panel-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.ops-panel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ops-panel-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ops-panel-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.ops-panel-version {
    background: var(--bg-tertiary);
    padding: 1px 8px;
    border-radius: 6px;
    font-weight: 600;
    color: var(--text-secondary);
}

.ops-panel-url {
    color: var(--accent);
}

.ops-meta-sep {
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* Health badges */
.health-badge {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.health-badge.healthy  { background: rgba(34,197,94,0.12); color: #4ade80; }
.health-badge.degraded { background: rgba(245,158,11,0.12); color: #fbbf24; }
.health-badge.down     { background: rgba(239,68,68,0.12); color: #f87171; }

/* Metrics grid */
.ops-metrics-grid {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ops-mg-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.ops-metric-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.ops-metric-cards.narrow {
    grid-template-columns: repeat(2, 1fr);
    max-width: 50%;
}

.ops-mc {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ops-mc-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.ops-mc-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.ops-mc-value.green  { color: #4ade80; }
.ops-mc-value.yellow { color: #fbbf24; }

.ops-mc-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.ops-mc-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.ops-mc-sub.muted {
    color: var(--text-muted);
    font-style: italic;
}

.ops-trend {
    font-size: 0.75rem;
    font-weight: 700;
}

.ops-trend.up   { color: #4ade80; }
.ops-trend.down { color: #f87171; }

/* Gauge bars */
.ops-mc-gauge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ops-mc-pct {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
}

.ops-gauge-track {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.ops-gauge-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Sparklines */
.ops-spark {
    margin-top: 4px;
    opacity: 0.8;
}

/* Alerts */
.ops-alerts-section {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
}

.ops-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ops-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.83rem;
}

.ops-alert.info     { background: rgba(59,130,246,0.08); color: var(--text-secondary); }
.ops-alert.warning  { background: rgba(245,158,11,0.08); color: #fbbf24; }
.ops-alert.critical { background: rgba(239,68,68,0.08); color: #f87171; }

.ops-alert-icon {
    flex-shrink: 0;
    display: flex;
}

.ops-alert-msg {
    flex: 1;
}

.ops-alert-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 900px) {
    .ops-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ops-metric-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .ops-metric-cards.narrow {
        max-width: 100%;
    }
}

/* ── Settings Page ─────────────────────────────────────────── */

.settings-page {
    padding: 32px;
    max-width: 960px;
}

.settings-header {
    margin-bottom: 28px;
}

.settings-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Layout: sidebar + content */
.settings-layout {
    display: flex;
    gap: 28px;
}

.settings-nav {
    width: 180px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-nav-item {
    background: none;
    border: none;
    text-align: left;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.settings-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-nav-item.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
}

.settings-content {
    flex: 1;
    min-width: 0;
}

/* Sections */
.settings-section {
    margin-bottom: 32px;
}

.settings-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.settings-section-title.danger {
    color: #f87171;
}

.settings-section-desc {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Form fields */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.settings-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
    max-width: 400px;
}

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

.settings-input-group {
    display: flex;
    align-items: stretch;
    max-width: 400px;
}

.settings-input-prefix {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.settings-input.slug {
    border-radius: 0 8px 8px 0;
    max-width: none;
    flex: 1;
}

.settings-select-display {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 400px;
}

/* Save bar */
.settings-save-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    margin-bottom: 32px;
}

.settings-saved-msg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.83rem;
    font-weight: 600;
    color: #4ade80;
}

/* GitHub connection card */
.settings-gh-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-gh-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.settings-gh-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.settings-gh-org {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 8px;
}

.settings-gh-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
}

.settings-gh-status.connected { color: #4ade80; }

.settings-gh-details {
    display: flex;
    gap: 16px;
}

.settings-gh-detail {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Profile card */
.settings-profile-card {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.settings-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.settings-avatar-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
}

.settings-profile-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Toggle switches */
.settings-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 8px;
    transition: background 0.15s;
}

.settings-toggle-row:hover {
    background: var(--bg-tertiary);
}

.settings-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-toggle-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-toggle-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.settings-toggle {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.settings-toggle.on {
    background: var(--accent);
    border-color: var(--accent);
}

.settings-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.settings-toggle.on .settings-toggle-knob {
    transform: translateX(20px);
}

/* Security cards */
.settings-security-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-sec-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
}

.settings-sec-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-sec-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.settings-sec-status {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
}

.settings-sec-status.enabled {
    background: rgba(34,197,94,0.12);
    color: #4ade80;
}

/* Sessions */
.settings-sessions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-session-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.settings-session-row.current {
    border-color: var(--accent);
}

.settings-session-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-session-device {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-session-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.settings-session-active {
    font-size: 0.78rem;
    font-weight: 600;
    color: #4ade80;
}

/* Audit log */
.settings-audit-log {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-audit-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 8px;
    gap: 12px;
    transition: background 0.15s;
}

.settings-audit-row:hover {
    background: var(--bg-tertiary);
}

.settings-audit-action {
    width: 180px;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-audit-detail {
    flex: 1;
    font-size: 0.83rem;
    color: var(--text-secondary);
}

.settings-audit-time {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Danger zone */
.settings-section.danger {
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 12px;
    padding: 20px;
    background: rgba(239,68,68,0.03);
}

.settings-danger-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-danger-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    gap: 16px;
}

.settings-danger-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-danger-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-danger-outline {
    background: none;
    border: 1px solid rgba(239,68,68,0.4);
    color: #f87171;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-danger-outline:hover {
    background: rgba(239,68,68,0.1);
}

.btn-danger {
    background: #dc2626;
    border: none;
    color: #fff;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Responsive settings */
@media (max-width: 700px) {
    .settings-layout {
        flex-direction: column;
    }
    .settings-nav {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .settings-profile-card {
        flex-direction: column;
    }
}

/* ── Login Page ─────────────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        ellipse at 30% 20%,
        rgba(59, 130, 246, 0.08) 0%,
        transparent 50%
    ),
    radial-gradient(
        ellipse at 70% 80%,
        rgba(139, 92, 246, 0.06) 0%,
        transparent 50%
    );
    pointer-events: none;
}

.login-theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

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

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 24px;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 20px;
    border-radius: 12px;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1;
}

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

.login-btn-github {
    background: #24292e;
    color: #fff;
    border-color: #24292e;
}

.login-btn-github:hover:not(:disabled) {
    background: #2f363d;
    box-shadow: 0 4px 16px rgba(36, 41, 46, 0.3);
}

.login-btn-google {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

.login-btn-google:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--text-muted);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.login-btn-icon {
    display: flex;
    align-items: center;
}

.login-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin 0.6s linear infinite;
}

.login-btn-google .login-btn-spinner {
    border-color: rgba(0, 0, 0, 0.15);
    border-top-color: var(--text-primary);
}

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

.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

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

.login-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.login-feature-icon {
    display: flex;
    align-items: center;
    color: var(--accent);
    flex-shrink: 0;
}

.login-footer {
    text-align: center;
}

.login-footer p {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

/* Light theme adjustments */
[data-theme="light"] .login-card {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .login-page::before {
    background: radial-gradient(
        ellipse at 30% 20%,
        rgba(59, 130, 246, 0.04) 0%,
        transparent 50%
    ),
    radial-gradient(
        ellipse at 70% 80%,
        rgba(139, 92, 246, 0.03) 0%,
        transparent 50%
    );
}

@media (max-width: 480px) {
    .login-card {
        padding: 36px 24px;
    }
    .login-title {
        font-size: 1.5rem;
    }
}

/* ── Agent Status Bar ─────────────────────────────────────── */

.agent-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary, #1e293b);
    border-radius: 6px;
    margin: 0 0 8px 0;
    font-size: 0.8rem;
}

.agent-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.agent-status-dot.idle {
    background: var(--text-muted, #64748b);
}

.agent-status-dot.working {
    background: #3b82f6;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.agent-status-dot.blocked {
    background: #ef4444;
}

.agent-status-text {
    color: var(--text-secondary, #94a3b8);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Chat typing indicator ────────────────────────────────── */

.chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted, #64748b);
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dots .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* ── Disabled radio card + Coming soon badge ──────────────── */

.form-radio-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.form-link {
    color: var(--accent, #3b82f6);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    cursor: pointer;
}

.form-link:hover {
    color: var(--accent-hover, #60a5fa);
}

.form-action {
    color: var(--accent, #3b82f6);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: inherit;
    font-family: inherit;
    text-decoration: none;
}

.form-action:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-hover, #60a5fa);
}

.coming-soon-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--text-muted, #64748b);
    color: var(--bg-primary, #0f172a);
    vertical-align: middle;
    margin-left: 4px;
}
