/* ============================================
   K8s Auto Deployer - Dashboard Styles
   Theme: Dark + Gold (鎏金色)
   ============================================ */

:root {
    /* Gold accent colors */
    --gold-primary: #D4AF37;
    --gold-light: #F4E4A6;
    --gold-dark: #AA8C2C;
    --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #F4E4A6 50%, #D4AF37 100%);

    /* Dark theme colors */
    --bg-primary: #0A0A0B;
    --bg-secondary: #111113;
    --bg-tertiary: #18181B;
    --bg-card: #1A1A1D;
    --bg-hover: #222225;

    /* Text colors */
    --text-primary: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;

    /* Status colors */
    --status-running: #22C55E;
    --status-stopped: #EF4444;
    --status-deploying: #F59E0B;
    --status-pending: #6B7280;
    --status-suspended: #F97316;

    /* Borders */
    --border-color: #27272A;
    --border-light: #3F3F46;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.3);

    /* Sizing */
    --sidebar-width: 240px;
    --detail-panel-width: 380px;
    --header-height: 64px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

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

html,
body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

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

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    font-size: 24px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

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

.nav-item.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-primary);
}

.nav-icon {
    font-size: 18px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

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

/* Main Content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: margin-right var(--transition-normal);
}

.main.has-panel {
    margin-right: var(--detail-panel-width);
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--gold-primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--gold-light);
    box-shadow: var(--shadow-gold);
}

.btn-gold {
    background: var(--gold-gradient);
    color: #000;
    font-weight: 600;
}

.btn-gold:hover {
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-danger-outline {
    background: transparent;
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

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

.btn-small:active {
    transform: scale(0.95);
    background: var(--gold-dark);
    border-color: var(--gold-primary);
}

.btn-small.refreshing {
    pointer-events: none;
    opacity: 0.7;
}

.btn-small.refreshing::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 6px;
    border: 2px solid var(--text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

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

/* Content Area */
.content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Project Card */
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.project-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.project-card.active {
    border-color: var(--gold-primary);
}

.project-card.active::before {
    opacity: 1;
}

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

.project-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.project-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.running {
    background: var(--status-running);
    box-shadow: 0 0 8px var(--status-running);
}

.status-dot.stopped {
    background: var(--status-stopped);
    animation: none;
}

.status-dot.deploying {
    background: var(--status-deploying);
}

.status-dot.not_deployed {
    background: var(--status-pending);
    animation: none;
}

.status-dot.suspended {
    background: #F97316;
    animation: suspendPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px #F97316;
}

@keyframes suspendPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-domain {
    font-size: 13px;
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

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

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.empty-state h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Detail Panel */
.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--detail-panel-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-panel.open {
    transform: translateX(0);
}

.detail-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.detail-title {
    font-size: 18px;
    font-weight: 600;
    margin: 8px 0;
}

.detail-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Tabs */
.detail-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
}

.tab {
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    position: relative;
    transition: color var(--transition-fast);
}

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

.tab.active {
    color: var(--gold-primary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold-primary);
}

/* Tab Content */
.detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex: 1;
    min-width: 100px;
}

/* Domain Link */
.domain-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--gold-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.domain-link:hover {
    background: var(--bg-hover);
}

.external-icon {
    font-size: 12px;
}

/* Config Grid */
.config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.config-item {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 8px;
}

.config-item label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.config-item span {
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-all;
}

/* Danger Zone */
.danger-zone {
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Environment Variables */
.env-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.env-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
}

.env-key {
    color: var(--gold-primary);
}

.env-value {
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-text {
    color: var(--text-muted);
    font-size: 13px;
}


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

.section-header h3 {
    margin-bottom: 0;
}

/* Config Form */
.config-form {
    padding: 0;
    margin-top: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

/* Editable Env Vars */
.env-edit-row {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 8px;
}

.env-edit-key,
.env-edit-value {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 8px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.env-edit-key:focus,
.env-edit-value:focus {
    border-color: var(--gold-primary);
    outline: none;
}

.btn-remove-env {
    background: transparent;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    display: flex;
    align-items: center;
}

.btn-remove-env:hover {
    color: #F87171;
}

.status-indicator {
    font-size: 12px;
    color: var(--gold-primary);
    margin-right: 8px;
}

.logs-actions {
    display: flex;
    align-items: center;
}

/* Logs */
.logs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.logs-header h3 {
    margin-bottom: 0;
}

.logs-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

/* Form */
form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

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

.hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 24px;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 300;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--status-running);
}

.toast.error {
    border-color: var(--status-stopped);
}

.toast.warning {
    border-color: var(--status-suspended);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .logo-text,
    .nav-item span:not(.nav-icon) {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .detail-panel {
        width: 100%;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Build Logs Container */
.build-logs-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.build-log-entry {
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    line-height: 1.5;
    background: var(--bg-tertiary);
}

.build-log-entry:last-child {
    margin-bottom: 0;
}

.build-log-entry.success {
    background: rgba(34, 197, 94, 0.1);
    border-left: 3px solid var(--status-running);
}

.build-log-entry.error {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--status-stopped);
}

.build-log-time {
    color: var(--text-muted);
    font-size: 10px;
    flex-shrink: 0;
    width: 70px;
}

.build-log-message {
    color: var(--text-primary);
    flex: 1;
    word-break: break-word;
}

.build-log-entry.error .build-log-message {
    color: #EF4444;
}

.build-log-entry.success .build-log-message {
    color: #22C55E;
}

/* ============================================
   Settings Page Styles
   ============================================ */

.settings-page {
    max-width: 600px;
    padding: 0 24px;
}

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

.settings-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.settings-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.token-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.token-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.token-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.token-badge {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.token-badge.configured {
    background: rgba(34, 197, 94, 0.15);
    color: var(--status-running);
}

.token-badge.not-configured {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

.token-form .form-group {
    margin-bottom: 16px;
}

.token-input-group {
    display: flex;
    gap: 8px;
}

.token-input-group input {
    flex: 1;
}

.token-validation-status {
    display: block;
    font-size: 12px;
    margin-top: 6px;
    min-height: 16px;
}

.token-validation-status.validating {
    color: var(--gold-primary);
}

.token-validation-status.valid {
    color: var(--status-running);
}

.token-validation-status.invalid {
    color: var(--status-stopped);
}

/* Config Item Full Width */
.config-item-full {
    grid-column: span 2;
}

.token-status-text {
    color: var(--text-secondary);
}

.token-status-text.configured {
    color: var(--status-running);
}

/* Config code display (for command/args) */
.config-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Token Actions Row */
.token-actions-row {
    margin-top: -8px;
    margin-bottom: 16px;
}

/* ============================================
   Login Screen Styles
   ============================================ */

.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    font-size: 64px;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.google-signin-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    min-height: 44px;
}

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

/* ============================================
   User Info in Sidebar
   ============================================ */

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
}

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

.user-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    transition: color var(--transition-fast);
}

.btn-logout:hover {
    color: var(--status-stopped);
}

/* ============================================
   Users Page (Admin)
   ============================================ */

.users-page {
    padding: 0;
}

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

.users-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.users-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background: var(--bg-secondary);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.users-table td {
    font-size: 14px;
    color: var(--text-primary);
}

.users-table tr:last-child td {
    border-bottom: none;
}

.users-table tr:hover td {
    background: var(--bg-hover);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-cell img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.role-badge.admin {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold-primary);
}

.role-badge.user {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-secondary);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.2);
    color: var(--status-running);
}

.status-badge.disabled {
    background: rgba(239, 68, 68, 0.2);
    color: var(--status-stopped);
}

.btn-edit {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.btn-edit:hover {
    background: var(--bg-hover);
    border-color: var(--gold-primary);
}

/* User Edit Modal */
.modal-large {
    max-width: 500px;
}

.project-permissions {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
}

.project-permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 4px;
}

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

.project-permission-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}

.project-permission-item select {
    width: auto;
    padding: 4px 8px;
    font-size: 12px;
}

/* ============================================
   GitHub OAuth Connection Styles
   ============================================ */

/* GitHub Button */
.btn-github {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #24292e;
    color: #fff;
    border: 1px solid #444;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-github:hover {
    background-color: #2f363d;
    border-color: #555;
}

.btn-github.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-github .github-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.btn-github.btn-small .github-icon {
    width: 16px;
    height: 16px;
}

/* GitHub Connected State */
.github-connected {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(35, 134, 54, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(35, 134, 54, 0.3);
}

.github-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(35, 134, 54, 0.5);
}

.github-user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.github-username {
    font-weight: 600;
    color: var(--text-primary);
}

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

.manage-repos-link {
    display: block;
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
    margin-top: 4px;
}

.manage-repos-link:hover {
    text-decoration: underline;
}

/* GitHub Connect Section */
.github-connect-section {
    margin-bottom: 16px;
}

/* Authorized Repositories Section */
.authorized-repos-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.authorized-repos-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.repos-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.repo-item {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--bg-tertiary);
    transition: background 0.2s;
}

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

.repo-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
}

.repo-name {
    font-size: 13px;
    font-weight: 500;
}

.repo-visibility {
    font-size: 12px;
}

.repos-list .no-repos,
.repos-list .error {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

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

.loading-text {
    font-size: 13px;
    color: var(--text-muted);
    padding: 12px 0;
}

.add-more-repos-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
}

.add-more-repos-link:hover {
    text-decoration: underline;
}

.hint.small {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    display: block;
}

/* Project GitHub Status */
.project-github-status {
    padding: 8px 0;
    margin-bottom: 8px;
}

.project-github-status .using-global {
    color: var(--text-secondary);
    font-size: 13px;
}

.project-github-status .using-project {
    color: #22C55E;
    font-size: 13px;
    font-weight: 500;
}

.project-github-status .not-connected {
    color: var(--text-muted);
    font-size: 13px;
}

/* Advanced Options (Details/Summary) */
.advanced-options {
    margin-top: 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
}

.advanced-options summary {
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}

.advanced-options summary:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.advanced-options[open] summary {
    border-bottom: 1px solid var(--border-color);
}

.advanced-content {
    padding: 16px;
}

/* Resource Limits Section */
.resource-limits-section {
    margin-top: 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
}

.resource-limits-section summary {
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}

.resource-limits-section summary:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.resource-limits-section[open] summary {
    border-bottom: 1px solid var(--border-color);
}

.resource-limits-content {
    padding: 16px;
}

.resource-limits-content .form-row {
    margin-top: 12px;
}

.resource-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 8px;
}

/* Project Override Section */
.project-github-override {
    margin-top: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
}

.project-github-override summary {
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 12px;
    user-select: none;
}

.project-github-override summary:hover {
    color: var(--text-primary);
}

.project-github-override[open] summary {
    border-bottom: 1px solid var(--border-color);
}

.override-content {
    padding: 12px;
}

/* Nested Advanced Options */
.advanced-options.nested {
    margin-top: 12px;
    background: var(--bg-secondary);
}

.advanced-options.nested summary {
    font-size: 12px;
    padding: 8px 12px;
}

.advanced-options.nested .advanced-content {
    padding: 12px;
}

/* Small adjustments for project panel */
.project-github-override .github-connected {
    padding: 10px 12px;
}

.project-github-override .github-avatar {
    width: 32px;
    height: 32px;
}

.project-github-override .github-username {
    font-size: 13px;
}

/* ============================================
   Repo Selector Modal Styles (Zeabur-like)
   ============================================ */

.modal-repo-selector {
    max-width: 520px;
}

.modal-step {
    padding: 24px;
}

.modal-step form {
    padding: 0;
}

/* Repo Selector Header */
.repo-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.repo-selector-hint {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* Not Connected State */
.repo-selector-not-connected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.not-connected-icon {
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.not-connected-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.not-connected-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Loading State */
.repo-selector-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.repo-selector-loading p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Repo List */
.repo-selector-list {
    max-height: 360px;
    overflow-y: auto;
}

.repo-search {
    margin-bottom: 12px;
}

.repo-search input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.repo-search input:focus {
    outline: none;
    border-color: var(--gold-primary);
}

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

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

.repo-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.repo-list-item:hover {
    background: var(--bg-hover);
    border-color: var(--gold-primary);
}

.repo-list-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.repo-list-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.repo-list-item-visibility {
    font-size: 12px;
    color: var(--text-muted);
}

.repo-list-item-arrow {
    font-size: 16px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.repo-list-item:hover .repo-list-item-arrow {
    color: var(--gold-primary);
    transform: translateX(4px);
}

.repo-list-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.repo-list-empty p {
    margin-bottom: 16px;
}

/* Manual URL Section */
.manual-url-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

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

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

/* Selected Repo Info */
.selected-repo-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 20px;
}

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

.selected-repo-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gold-primary);
    flex: 1;
}

/* ============================================
   AI Chat Panel Styles
   ============================================ */

.ai-chat-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 150;
}

/* Collapsed Trigger Button - Curved Arc (Full Height) */
.ai-chat-trigger {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px 0 0 30px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.ai-chat-trigger:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold-primary);
    transform: translateX(-4px);
}

.ai-chat-trigger .trigger-icon {
    font-size: 24px;
    color: var(--gold-primary);
    transition: transform var(--transition-fast);
}

.ai-chat-trigger:hover .trigger-icon {
    transform: rotate(45deg);
}

.ai-chat-trigger .trigger-text {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Expanded Chat Container */
.ai-chat-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 420px;
    height: 600px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chat-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.ai-chat-header h3 {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.mode-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-secondary);
}

.mode-badge.editor {
    background: rgba(245, 158, 11, 0.2);
    color: #F59E0B;
}

/* Messages Area */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-welcome-message {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.ai-welcome-message p {
    margin: 0;
}

.ai-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-message.user {
    align-self: flex-end;
    background: var(--gold-primary);
    color: #000;
    border-bottom-right-radius: 4px;
}

.ai-message.assistant {
    align-self: flex-start;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.ai-message.streaming::after {
    content: '▋';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.ai-message .message-content {
    white-space: pre-wrap;
}

/* Think block - collapsible container for <think> tags */
.thinking-block {
    margin: 4px 0;
    background: transparent;
    border-radius: 0;
    overflow: hidden;
}

.thinking-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    padding-left: 10px;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    font-size: 0.75em;
    line-height: 1.2;
    transition: background var(--transition-fast);
    border-left: 2px solid var(--gold-primary);
}

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

.thinking-icon {
    width: 10px;
    height: 10px;
    border: 1.5px solid var(--gold-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

.thinking-block.done .thinking-icon {
    animation: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thinking-block.done .thinking-icon::after {
    content: '✓';
    font-size: 9px;
    color: var(--status-running);
}

.thinking-toggle {
    margin-left: auto;
    font-size: 8px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.thinking-block.expanded .thinking-toggle {
    transform: rotate(180deg);
}

.thinking-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0;
    margin-left: 0;
    color: var(--text-muted);
    font-size: 0.9em;
    line-height: 1.5;
    white-space: pre-wrap;
    /* No border in collapsed state */
}

.thinking-block.expanded .thinking-content {
    max-height: 500px;
    padding: 8px 12px 12px 10px;
    overflow-y: auto;
    border-left: 2px solid var(--gold-primary);
}

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

/* Quick Actions */
.ai-quick-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    overflow-x: auto;
}

.quick-action-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.quick-action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--gold-primary);
    color: var(--text-primary);
}

/* Action Plan Modal */
.ai-action-plan {
    position: absolute;
    inset: 60px 16px 80px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

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

.plan-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.plan-close {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
}

.plan-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

.plan-actions {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

/* Modify Input */
.ai-modify-input {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.ai-modify-input textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
    min-height: 80px;
    margin-bottom: 12px;
}

.modify-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Input Area */
.ai-chat-input {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.ai-chat-input textarea {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    font-family: inherit;
}

.ai-chat-input textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
}

/* Settings Page Mode Selector */
.mode-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mode-option {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-option:hover {
    border-color: var(--gold-primary);
}

.mode-option:has(input:checked) {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.1);
}

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

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

.mode-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Editor Mode Warning */
.editor-mode-warning {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    margin-top: 16px;
}

.warning-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.warning-content h4 {
    color: #F59E0B;
    margin: 0 0 8px 0;
    font-size: 14px;
}

.warning-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.warning-content ul {
    margin: 12px 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.warning-content ul li {
    margin: 4px 0;
}

.accept-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
}

.accept-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold-primary);
}

/* Agent Button Style */
.btn-ai {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: white;
    border: none;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    transform: translateY(-1px);
}

/* ============================================
   TOOL_CALL Indicator Styles
   ============================================ */

.tool-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 8px 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    animation: toolFadeIn 0.3s ease;
}

.tool-indicator.complete {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: rgba(34, 197, 94, 0.3);
    animation: toolFadeOut 0.5s ease forwards;
}

@keyframes toolFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toolFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.tool-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-spinner {
    width: 24px;
    height: 24px;
    color: var(--gold-primary);
}

.tool-indicator.complete .tool-spinner {
    display: none;
}

.tool-indicator.complete .tool-icon::after {
    content: '✓';
    font-size: 20px;
    color: var(--status-running);
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.tool-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.tool-status {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Progress Bar Styles */
.tool-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.tool-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366F1 0%, #8B5CF6 100%);
    border-radius: 2px;
    animation: progressFill 2s ease-in-out forwards;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

@keyframes progressFill {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

.tool-indicator.complete .tool-progress-fill {
    background: linear-gradient(90deg, #22C55E 0%, #10B981 100%);
    width: 100%;
    animation: none;
}

/* ============================================
   kubectl AI Panel Styles (Phase 3)
   ============================================ */

.kubectl-ai-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 400px;
}

.kubectl-ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.kubectl-ai-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.kubectl-ai-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.kubectl-ai-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-pending);
}

.kubectl-ai-status.ready .status-dot {
    background: var(--status-running);
}

.kubectl-ai-status.error .status-dot {
    background: var(--status-failed);
}

/* Quick Commands */
.kubectl-ai-quick-commands {
    margin-bottom: 16px;
}

.quick-commands-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.quick-commands-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-command-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-command-btn:hover {
    background: var(--gold-gradient);
    color: var(--bg-primary);
    border-color: transparent;
}

.quick-command-btn .cmd-icon {
    font-size: 14px;
}

/* Chat Messages */
.kubectl-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 12px;
}

.kubectl-ai-welcome {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.kubectl-ai-welcome .welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.kubectl-ai-welcome h4 {
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.kubectl-ai-welcome p {
    font-size: 13px;
    line-height: 1.5;
    max-width: 300px;
    margin: 0 auto;
}

.kubectl-ai-message {
    margin-bottom: 16px;
    animation: messageFadeIn 0.3s ease;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kubectl-ai-message.user {
    text-align: right;
}

.kubectl-ai-message.user .message-content {
    display: inline-block;
    background: var(--gold-gradient);
    color: var(--bg-primary);
    padding: 10px 14px;
    border-radius: 16px 16px 4px 16px;
    max-width: 85%;
    text-align: left;
}

.kubectl-ai-message.assistant .message-content {
    background: var(--bg-secondary);
    padding: 12px 14px;
    border-radius: 4px 16px 16px 16px;
    border: 1px solid var(--border-color);
}

.kubectl-ai-message .message-timestamp {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.kubectl-ai-message .kubectl-command {
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    margin-top: 8px;
    overflow-x: auto;
}

.kubectl-ai-message .kubectl-command::before {
    content: '$ ';
    color: var(--status-running);
}

.kubectl-ai-message .message-output {
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 6px;
    font-size: 12px;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
}

/* Loading indicator in messages */
.kubectl-ai-message.loading .message-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kubectl-ai-message.loading .loading-dots {
    display: flex;
    gap: 4px;
}

.kubectl-ai-message.loading .loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: loadingDot 1.4s infinite ease-in-out both;
}

.kubectl-ai-message.loading .loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.kubectl-ai-message.loading .loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingDot {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Area */
.kubectl-ai-input-area {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.kubectl-ai-input-area textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    resize: none;
    min-height: 44px;
    max-height: 100px;
    transition: border-color 0.2s ease;
}

.kubectl-ai-input-area textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
}

.kubectl-ai-input-area textarea::placeholder {
    color: var(--text-secondary);
}

.kubectl-ai-send {
    height: 44px;
    padding: 0 20px;
    border-radius: 12px;
}

/* Session Info */
.kubectl-ai-session-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    font-size: 11px;
    color: var(--text-secondary);
}

.kubectl-ai-session-info .session-label {
    opacity: 0.7;
}

.kubectl-ai-session-info .session-id {
    font-family: 'SF Mono', Monaco, monospace;
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

.kubectl-ai-session-info .btn-text {
    background: none;
    border: none;
    color: var(--gold-primary);
    padding: 2px 8px;
    cursor: pointer;
}

.kubectl-ai-session-info .btn-text:hover {
    text-decoration: underline;
}