:root {
    --bg-main: #06090e;
    --bg-card: rgba(13, 19, 32, 0.75);
    --bg-card-hover: rgba(20, 28, 48, 0.85);
    --bg-surface: #0e1524;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(6, 182, 212, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #06b6d4;
    --primary-glow: rgba(6, 182, 212, 0.3);
    --primary-hover: #0891b2;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 12px 20px;
    gap: 12px;
}

/* --- Topbar --- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    gap: 12px;
}

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

.brand-icon {
    font-size: 22px;
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.4));
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 9px;
    color: var(--text-secondary);
    display: block;
}

/* --- Integrated Navigation Pills in Topbar --- */
.nav-pills {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.35);
    padding: 3px 5px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow-x: visible;
}

.nav-pill {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.nav-pill:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.nav-pill.active {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.22), rgba(139, 92, 246, 0.22));
    color: #38bdf8;
    border-color: rgba(6, 182, 212, 0.45);
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.25);
    font-weight: 600;
}

.pill-badge {
    background: rgba(6, 182, 212, 0.3);
    color: #e0f2fe;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 600;
}

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

.status-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 500;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* --- Common Button Styles --- */
button, input, select, textarea {
    font-family: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0891b2, #0369a1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-xs {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 6px;
}

/* --- Main Workspace Viewport --- */
.workspace-viewport {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    display: none;
    height: 100%;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
}

.tab-pane.active {
    display: flex;
}

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

/* Panels */
.panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow: hidden;
}

.full-panel {
    height: 100%;
    flex: 1;
}

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

.panel-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.badge {
    background: rgba(6, 182, 212, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-glow {
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

/* --- TAB 1: Agents Layout (Split view) --- */
.agents-workspace-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 14px;
    height: 100%;
    min-height: 0;
}

.agents-main-panel, .quick-skills-panel {
    height: 100%;
    min-height: 0;
}

/* Department Filter Bar */
.department-filter-bar {
    display: flex;
    gap: 6px;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.department-filter-bar::-webkit-scrollbar {
    display: none;
}

.dept-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.dept-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.18);
}

.dept-pill.active {
    background: rgba(6, 182, 212, 0.18);
    border-color: var(--primary);
    color: #38bdf8;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.dept-pill .badge-count {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
}

.dept-pill.active .badge-count {
    background: rgba(6, 182, 212, 0.35);
    color: #e0f2fe;
}

.badge-dept {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.agent-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.agent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 4px;
    flex: 1;
}

.agent-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agent-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.agent-card.drag-over {
    border-color: var(--primary);
    background: rgba(6, 182, 212, 0.12);
    box-shadow: 0 0 18px var(--primary-glow);
    transform: scale(1.01);
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-edit-agent, .btn-delete-agent {
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    outline: none;
    line-height: 1;
}

.btn-edit-agent {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}

.btn-edit-agent:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.btn-delete-agent {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.btn-delete-agent:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.agent-avatar {
    font-size: 26px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    border: 1px solid var(--border-color);
}

.agent-meta {
    flex: 1;
}

.agent-meta h3 {
    font-size: 14px;
    font-weight: 600;
}

.agent-meta p {
    font-size: 11px;
    color: var(--text-muted);
}

.agent-model-select {
    width: 100%;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #e2e8f0;
    font-size: 11px;
    outline: none;
    cursor: pointer;
}

.agent-model-select:focus {
    border-color: var(--primary);
}

.agent-skills-box {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 38px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-color);
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.35);
    border-radius: 6px;
    font-size: 11px;
    color: #7dd3fc;
}

.skill-tag-remove {
    cursor: pointer;
    font-size: 12px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.skill-tag-remove:hover {
    opacity: 1;
    color: #f87171;
}

/* Quick Skills Tray */
.quick-skill-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
    flex: 1;
}

/* --- TAB 2: Full Inventory Grid --- */
.inventory-header {
    margin-bottom: 14px;
}

.inventory-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-category-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filter-pill {
    padding: 5px 12px;
    font-size: 11px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-primary);
}

.filter-pill.active {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.45);
    color: #38bdf8;
    font-weight: 600;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 12px;
    overflow-y: auto;
    padding-right: 4px;
    flex: 1;
}

.skill-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    gap: 10px;
    cursor: grab;
    transition: all 0.2s ease;
    align-items: flex-start;
}

.skill-card:hover {
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.skill-icon {
    font-size: 24px;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

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

.skill-category {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #38bdf8;
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}

.skill-details h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.skill-details p {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Skill Assigned Badges in Quick Tray & Full Inventory */
.skill-assigned-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.skill-assigned-label {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.skill-agent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.skill-agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.skill-agent-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* --- TAB 3: CCTV Live Screen --- */
.cctv-fullscreen-panel {
    padding: 0;
    background: #04070c;
}

.cctv-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #030508;
}

.cctv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(16, 185, 129, 0.25);
    font-family: var(--font-mono);
    font-size: 11px;
}

.cctv-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cctv-indicator {
    color: #ef4444;
    font-weight: 700;
    letter-spacing: 1px;
    animation: blink 1.2s infinite;
}

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

.cctv-cam-id {
    color: #10b981;
    font-weight: 600;
}

.cctv-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.btn-cctv-clear {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    cursor: pointer;
}

.btn-cctv-clear:hover {
    color: #f87171;
    border-color: #f87171;
}

.cctv-feed {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.02) 0%, transparent 80%);
}

.cctv-entry {
    display: flex;
    gap: 8px;
    word-break: break-word;
}

.cctv-entry .time {
    color: #64748b;
    min-width: 75px;
}

.cctv-entry .actor {
    color: #38bdf8;
    font-weight: 600;
    min-width: 140px;
}

.cctv-entry .msg {
    color: #cbd5e1;
    flex: 1;
}

.cctv-entry.system .actor {
    color: #a78bfa;
}

/* --- TAB 4: Chat Sandbox --- */
.chat-sandbox-panel {
    padding: 0;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.chat-target-select {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.chat-target-select select {
    padding: 6px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}

.chat-channel-badge {
    font-size: 11px;
    color: #10b981;
    font-weight: 600;
}

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

.chat-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.5;
}

.chat-bubble.agent {
    align-self: flex-start;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
}

.chat-input-bar {
    display: flex;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.chat-input-bar input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

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

/* --- TAB 5: Kantor 3D Panel & Side Chat Teams/Zoom Style --- */
.office-tab-panel {
    padding: 14px;
}

.office-workspace-layout {
    display: flex;
    gap: 14px;
    width: 100%;
    height: calc(100vh - 170px);
    min-height: 560px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.office-canvas-column {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.office-frame-wrap {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 500px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #090e17;
}

.office-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

/* Sisi Kanan: Side Chat Panel ala Zoom / MS Teams */
.office-side-chat-column {
    width: 390px;
    min-width: 340px;
    max-width: 440px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #090e17;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: -4px 6px 24px rgba(0, 0, 0, 0.45);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.office-side-chat-column.collapsed {
    display: none;
}

.side-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.side-chat-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.side-chat-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.side-chat-avatar-box {
    position: relative;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.side-chat-online-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid #0b1120;
    border-radius: 50%;
    box-shadow: 0 0 6px #10b981;
}

.side-chat-title-group {
    min-width: 0;
    overflow: hidden;
}

.side-chat-name {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-chat-role {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.side-chat-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.side-tool-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.side-tool-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.side-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #070b12;
    scroll-behavior: smooth;
    min-height: 0;
}

.side-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 12.5px;
    line-height: 1.5;
    word-break: break-word;
}

.side-bubble.user {
    align-self: flex-end;
    background: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 3px;
    max-width: 85%;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.side-bubble.agent {
    align-self: flex-start;
    background: #151e2e;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom-left-radius: 3px;
    max-width: 90%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.side-bubble-meta {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

.side-chat-chips {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: #090e17;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}

.side-chat-chips::-webkit-scrollbar {
    display: none;
}

.side-chip-btn {
    flex-shrink: 0;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.side-chip-btn:hover {
    background: #2563eb;
    color: white;
    border-color: #3b82f6;
}

.side-chat-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.side-chat-input {
    flex: 1;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 9px 12px;
    color: #f8fafc;
    font-size: 12.5px;
    outline: none;
    transition: border-color 0.2s;
}

.side-chat-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.side-chat-submit {
    background: #059669;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 0 14px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-chat-submit:hover {
    background: #10b981;
}

@media (max-width: 1024px) {
    .office-workspace-layout {
        flex-direction: column;
        height: auto;
    }
    .office-side-chat-column {
        width: 100%;
        max-width: 100%;
        height: 480px;
    }
}

/* --- Modals --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    background: #0c121e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    padding: 22px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
}

.modal-lg {
    max-width: 620px;
}

.modal-xl, .modal-config-dialog {
    max-width: 880px !important;
    width: 92vw !important;
    max-height: 88vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 22px 26px !important;
    box-sizing: border-box !important;
}

.modal-body-scrollable {
    overflow-y: auto;
    max-height: calc(88vh - 120px);
    padding-right: 8px;
    margin-right: -4px;
}

.modal-body-scrollable::-webkit-scrollbar {
    width: 6px;
}
.modal-body-scrollable::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
.modal-body-scrollable::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.25);
    border-radius: 4px;
}
.modal-body-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.5);
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

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

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

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

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

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

.flex-avatar { 
    width: 80px; 
    flex-shrink: 0;
}

label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

input[type="text"], input[type="password"], input[type="url"], textarea, select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
}

small {
    font-size: 10px;
    color: var(--text-muted);
}

small a {
    color: #38bdf8;
    text-decoration: none;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

/* ==========================================================================
   TERMINAL CLI & GITHUB IMPORT STYLES
   ========================================================================== */

/* Terminal Tab Panel */
.terminal-tab-panel {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

.terminal-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #090d16;
}

.terminal-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #0f172a;
    border-bottom: 1px solid var(--border-color);
}

.terminal-dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.terminal-title {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    margin-left: 8px;
}

.terminal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.terminal-conn-status {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}
.terminal-conn-status.connected { color: #10b981; }
.terminal-conn-status.disconnected { color: #ef4444; }
.terminal-conn-status.connecting { color: #f59e0b; }

.terminal-body {
    flex: 1;
    min-height: 0;
    padding: 10px 14px 4px 14px;
    background: #060911;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.terminal-body .xterm {
    height: 100%;
    padding: 0;
    font-family: 'JetBrains Mono', monospace;
}

.terminal-body .xterm-viewport {
    overflow-y: hidden !important;
}

.terminal-body:hover .xterm-viewport {
    overflow-y: auto !important;
}

/* Modal Sub-tabs for Skill */
.modal-lg {
    max-width: 580px;
}

.modal-tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.modal-tab-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.modal-tab-btn.active {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.4);
    color: #38bdf8;
    font-weight: 600;
}

.modal-tab-content {
    display: none;
}

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

.github-import-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
}

.github-import-info .info-icon {
    font-size: 24px;
    line-height: 1;
}

.github-import-info .info-text strong {
    font-size: 13px;
    color: #38bdf8;
    display: block;
    margin-bottom: 4px;
}

.github-import-info .info-text p {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.import-status-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: #38bdf8;
    margin-bottom: 12px;
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(14, 165, 233, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* API Service Cards in Modal */
.api-service-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.api-service-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

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

.api-provider-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.api-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* ==========================================================================
   AUTOMATIONS & N8N GATEWAY STYLES
   ========================================================================== */
.automations-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 16px;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    padding-top: 6px;
}

.auto-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.automation-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.automation-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
}

.automation-card:hover {
    border-color: rgba(6, 182, 212, 0.35);
    background: rgba(0, 0, 0, 0.45);
}

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

.auto-name-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-name-wrap h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.auto-agent-tag {
    font-size: 11px;
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.auto-card-prompt {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-style: italic;
}

.auto-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
}

.auto-meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.n8n-card {
    background: rgba(13, 19, 32, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    padding: 18px;
}

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

.n8n-badge {
    font-size: 13px;
    font-weight: 700;
    color: #a78bfa;
}

.n8n-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.n8n-card p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 14px;
}

.webhook-url-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 14px;
}

.method-tag {
    font-size: 10px;
    font-weight: 700;
    background: #10b981;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
}

.webhook-url-box code {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #38bdf8;
    flex: 1;
    overflow-x: auto;
}

.n8n-payload-guide {
    margin-bottom: 14px;
}

.n8n-payload-guide .guide-title {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.code-block {
    background: #050811;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: #f1f5f9;
    overflow-x: auto;
}

.n8n-tips {
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px;
    line-height: 1.4;
}

/* --- Modal Memory & Tabbed Executive Knowledge Base --- */
.modal-memory-dialog {
    max-width: 960px !important;
    width: 95% !important;
    max-height: 88vh !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
    padding: 22px 26px !important;
    background: #090e1a !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 20px !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 35px rgba(59, 130, 246, 0.18) !important;
    overflow: hidden;
}

.memory-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    gap: 16px;
}

.memory-header-info {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}

.memory-header-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.memory-header-title-wrap h3 {
    font-size: 17px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.memory-header-sub {
    font-size: 12px;
    color: #94a3b8;
    margin: 4px 0 0 0;
    line-height: 1.5;
}

.memory-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-header-add-mem {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 7px 16px !important;
    border-radius: 20px !important;
    border: 1px solid #34d399 !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.35) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.btn-header-add-mem:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.6) !important;
    transform: translateY(-1px) !important;
}

/* Tab Navigation Kategori (Single Clean Row) */
.memory-tabs-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.memory-tabs-nav::-webkit-scrollbar {
    display: none;
}

.mem-tab-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    border-radius: 18px;
    padding: 6px 13px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.mem-tab-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

.mem-tab-pill.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #60a5fa;
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.3);
}

.mem-tab-pill-add {
    margin-left: auto;
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #34d399 !important;
}

.mem-tab-pill-add:hover {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: #10b981 !important;
    color: #6ee7b7 !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.35) !important;
}

.mem-tab-pill-add.active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5) !important;
}

.mem-pill-count {
    background: rgba(255, 255, 255, 0.1);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    color: inherit;
}

.mem-tab-pill.active .mem-pill-count {
    background: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* Tab Panes */
.memory-view-pane {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.memory-view-pane.active {
    display: flex;
}

/* Toolbar Pencarian & Status */
.memory-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0 10px;
    flex-shrink: 0;
}

.memory-search-box {
    position: relative;
    flex: 1;
    max-width: 360px;
    display: flex;
    align-items: center;
}

.memory-search-box .search-icon {
    position: absolute;
    left: 10px;
    font-size: 12px;
    color: #64748b;
    pointer-events: none;
}

.memory-search-box input {
    width: 100%;
    background: #060913;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 7px 12px 7px 32px;
    color: #f8fafc;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
}

.memory-search-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.memory-active-cat-label {
    font-size: 12px;
    color: #94a3b8;
}

.memory-active-cat-label strong {
    color: #f8fafc;
}

/* Switcher Mode: Atom vs Kartu List */
.memory-view-toggle {
    display: flex;
    align-items: center;
    background: #060913;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.btn-mem-view {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-mem-view:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
}

.btn-mem-view.active {
    background: #1e293b;
    color: #38bdf8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

/* --- ATOMIC NEURAL BRAIN CONTAINER --- */
.memory-atom-container {
    display: flex;
    gap: 0;
    height: 480px;
    width: 100%;
    border-radius: 12px;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.atom-stage-wrapper {
    flex: 1;
    min-width: 0;
    position: relative;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.7) 0%, rgba(2, 6, 23, 0.98) 100%);
}

#brain-atom-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

#brain-atom-canvas:active {
    cursor: grabbing;
}

.atom-overlay-hud {
    position: absolute;
    top: 12px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}

.atom-badge-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #38bdf8;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.atom-hud-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
    animation: atomPulseDot 2s infinite ease-in-out;
}

@keyframes atomPulseDot {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.3); box-shadow: 0 0 12px #38bdf8; }
}

.atom-controls-hud {
    display: flex;
    gap: 6px;
    pointer-events: auto;
}

.atom-btn-tool {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}

.atom-btn-tool:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: #38bdf8;
    color: #f8fafc;
}

.atom-hint-hud {
    position: absolute;
    bottom: 10px;
    left: 14px;
    font-size: 11px;
    color: #64748b;
    pointer-events: none;
    text-shadow: 0 1px 3px #000;
    z-index: 5;
}

.atom-hint-hud strong {
    color: #94a3b8;
}

/* Inspector Sidebar Kanan */
.atom-inspector-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: rgba(10, 15, 30, 0.88);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
    backdrop-filter: blur(12px);
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.atom-inspector-sidebar::-webkit-scrollbar {
    width: 4px;
}

.atom-inspector-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.inspector-placeholder {
    margin: auto;
    text-align: center;
    color: #64748b;
    padding: 20px 10px;
}

.inspector-pulse-core {
    font-size: 44px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.5));
    animation: atomCoreFloat 4s ease-in-out infinite;
}

@keyframes atomCoreFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.06); }
}

.inspector-placeholder h4 {
    font-size: 14px;
    color: #cbd5e1;
    margin-bottom: 6px;
    font-weight: 600;
}

.inspector-placeholder p {
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* Card Detail Ketika Elektron Diklik */
.inspector-detail-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.inspector-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.inspector-cat-pill {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 4px;
}

.inspector-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.4;
    margin: 0;
}

.inspector-btn-close {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.inspector-btn-close:hover {
    color: #f8fafc;
}

.inspector-card-body {
    flex: 1;
    overflow-y: auto;
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.inspector-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.inspector-timestamp {
    font-size: 10px;
    color: #64748b;
}

.inspector-actions {
    display: flex;
    gap: 6px;
}

.inspector-actions .btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
}

/* Grid Kartu Memori */
.memory-blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
    gap: 12px;
    max-height: 480px;
    overflow-y: auto;
    padding: 4px 6px 14px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.memory-blocks-grid::-webkit-scrollbar {
    width: 6px;
}

.memory-blocks-grid::-webkit-scrollbar-track {
    background: transparent;
}

.memory-blocks-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.memory-blocks-grid::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

.memory-card {
    background: #0c1424;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 13px 15px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.memory-card:hover {
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Creator Studio Form (Tab Tambah Memori) */
.memory-creator-card {
    background: #0c1424;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px 20px;
    margin-top: 8px;
}

.creator-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 4px 0;
}

.creator-header p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 14px 0;
}

.memory-preset-section {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.preset-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #38bdf8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.memory-presets-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mem-preset-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mem-preset-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.memory-modern-form .form-group label {
    font-size: 11.5px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.memory-modern-form input,
.memory-modern-form select,
.memory-modern-form textarea {
    background: #060913;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    color: #f8fafc;
    font-size: 12.5px;
    outline: none;
    transition: all 0.2s;
    width: 100%;
}

.memory-modern-form input:focus,
.memory-modern-form select:focus,
.memory-modern-form textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.memory-creator-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-glow-submit {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    border: 1px solid #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35) !important;
    font-weight: 600 !important;
    padding: 9px 18px !important;
    border-radius: 8px !important;
}

.btn-glow-submit:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.5) !important;
    transform: translateY(-1px);
}

.memory-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.memory-cat-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-profil_bos {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-bisnis_sawit {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-preferensi_laporan {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-aturan_mutlak {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-fakta_adaptif {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.memory-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
    margin-top: 2px;
    margin-bottom: 4px;
}

.memory-card-content {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 2px solid var(--primary);
}

.memory-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-edit-memory,
.btn-delete-memory {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 3px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-edit-memory:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.btn-delete-memory:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* Inline Edit Form in Memory Card */
.memory-edit-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
    background: rgba(0, 0, 0, 0.35);
    padding: 10px;
    border-radius: 6px;
    border: 1px dashed rgba(56, 189, 248, 0.35);
}

.memory-edit-form .edit-row {
    display: flex;
    gap: 8px;
}

.memory-edit-form input,
.memory-edit-form select,
.memory-edit-form textarea {
    width: 100%;
    background: #06090e;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #f8fafc;
    font-family: inherit;
    font-size: 12px;
    padding: 7px 9px;
    box-sizing: border-box;
}

.memory-edit-form input:focus,
.memory-edit-form select:focus,
.memory-edit-form textarea:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.memory-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}

.memory-edit-actions button {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
}

/* --- Modern Cyberpunk Pagination Bar --- */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    backdrop-filter: blur(16px);
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.pagination-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.pagination-info .badge-total {
    background: rgba(6, 182, 212, 0.15);
    color: var(--primary);
    border: 1px solid rgba(6, 182, 212, 0.35);
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination-per-page {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.select-per-page {
    background: #0f172a !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.select-per-page:hover, .select-per-page:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 10px var(--primary-glow);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-page {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-page:hover:not(:disabled) {
    background: rgba(6, 182, 212, 0.18) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-page:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
}

.btn-page.active {
    background: linear-gradient(135deg, #06b6d4, #0284c7) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.6) !important;
}

.btn-page-nav {
    padding: 0 12px;
    font-weight: 600;
}

.page-ellipsis {
    color: var(--text-muted);
    font-size: 13px;
    padding: 0 4px;
    user-select: none;
}


/* --- Input With Action Buttons (Eye Toggle & Copy) --- */
.input-with-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.input-with-actions input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
}

.btn-input-action {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    min-width: 36px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-input-action:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--primary);
    color: #ffffff;
    transform: translateY(-1px);
}

.api-service-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.api-service-card:hover {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.2);
    transform: translateY(-2px);
}

/* --- CYBER EXECUTIVE CONFIRMATION DIALOG (PENGGANTI WINDOW.CONFIRM) --- */
.modal-cyber-confirm-dialog {
    max-width: 440px;
    padding: 28px 24px 24px;
    text-align: center;
    background: #0b1120;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(59, 130, 246, 0.15);
    position: relative;
    overflow: hidden;
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.modal-backdrop.show .modal-cyber-confirm-dialog {
    transform: scale(1);
}

.cyber-confirm-glow {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 100px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.cyber-confirm-icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.25);
    transition: all 0.3s ease;
}

.cyber-confirm-title {
    font-size: 18px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.cyber-confirm-message {
    font-size: 13px;
    line-height: 1.6;
    color: #94a3b8;
    margin-bottom: 24px;
    white-space: pre-line;
    word-break: break-word;
    padding: 0 8px;
}

.cyber-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.cyber-confirm-actions .btn {
    min-width: 125px;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cyber-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4) !important;
}

.btn-cyber-danger:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%) !important;
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.6) !important;
    transform: translateY(-1px);
}
