/* ═══════════════════════════════════════════════════════════════
   Call Assistant — Visual Workflow Builder Theme
   Canvas-based flowchart with AI Brain center + block nodes
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
	--bg-deep: #06060f;
	--bg-surface: #0d0d1a;
	--bg-card: rgba(20, 20, 40, 0.7);
	--bg-card-hover: rgba(30, 30, 55, 0.8);
	--bg-input: rgba(15, 15, 30, 0.85);
	--border: rgba(255, 255, 255, 0.06);
	--border-focus: rgba(0, 212, 255, 0.5);
	--accent: #00d4ff;
	--accent-glow: rgba(0, 212, 255, 0.2);
	--accent-violet: #7c3aed;
	--accent-violet-glow: rgba(124, 58, 237, 0.2);
	--accent-green: #10b981;
	--accent-red: #ef4444;
	--accent-amber: #f59e0b;
	--text: #e8e8f0;
	--text-muted: #8888a8;
	--text-dim: #555570;
	--radius: 16px;
	--radius-sm: 10px;
	--radius-xs: 6px;
	--transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
	font-family: 'Inter', -apple-system, sans-serif;
	background: var(--bg-deep);
	color: var(--text);
	line-height: 1.6;
	height: 100vh;
	overflow: hidden;
}

/* ─── Top Bar ─── */
.topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 24px;
	height: 56px;
	background: rgba(6, 6, 15, 0.9);
	backdrop-filter: blur(20px);
	border-bottom: 1px solid var(--border);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-center { display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	font-size: 16px;
}

.topbar-brand .logo {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: linear-gradient(135deg, var(--accent), var(--accent-violet));
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
}

.topbar-divider {
	width: 1px;
	height: 24px;
	background: var(--border);
}

.compile-status {
	font-size: 12px;
	padding: 4px 12px;
	border-radius: 20px;
	font-weight: 500;
}

.compile-status.compiled {
	background: rgba(16, 185, 129, 0.15);
	color: var(--accent-green);
	border: 1px solid rgba(16, 185, 129, 0.25);
}

.compile-status.uncompiled {
	background: rgba(245, 158, 11, 0.15);
	color: var(--accent-amber);
	border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ─── Buttons ─── */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 16px;
	border: none;
	border-radius: var(--radius-xs);
	font-family: 'Inter', sans-serif;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition);
	white-space: nowrap;
	text-decoration: none;
}

.btn-primary {
	background: linear-gradient(135deg, var(--accent), #0099cc);
	color: #000;
	box-shadow: 0 2px 12px rgba(0, 212, 255, 0.25);
}

.btn-primary:hover {
	box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
	transform: translateY(-1px);
}

.btn-compile {
	background: linear-gradient(135deg, #7c3aed, #5b21b6);
	color: #fff;
	box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
	position: relative;
	overflow: hidden;
}

.btn-compile:hover {
	box-shadow: 0 4px 24px rgba(124, 58, 237, 0.5);
	transform: translateY(-1px);
}

.btn-compile.compiling {
	pointer-events: none;
	opacity: 0.8;
}

.btn-compile.compiling::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
	animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(100%); }
}

.btn-secondary {
	background: var(--bg-card);
	color: var(--text);
	border: 1px solid var(--border);
}

.btn-secondary:hover {
	background: var(--bg-card-hover);
	border-color: rgba(255, 255, 255, 0.12);
}

.btn-danger {
	background: rgba(239, 68, 68, 0.15);
	color: var(--accent-red);
	border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-icon {
	width: 32px;
	height: 32px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-xs);
	background: var(--bg-card);
	border: 1px solid var(--border);
	color: var(--text-muted);
	cursor: pointer;
	transition: var(--transition);
	font-size: 14px;
}

.btn-icon:hover { background: var(--bg-card-hover); color: var(--text); }

/* ─── Canvas ─── */
.canvas-wrap {
	position: fixed;
	top: 56px;
	left: 0;
	right: 0;
	bottom: 48px;
	overflow: hidden;
	background:
		radial-gradient(ellipse 800px 600px at 50% 40%, rgba(0, 212, 255, 0.03), transparent),
		radial-gradient(ellipse 600px 500px at 30% 70%, rgba(124, 58, 237, 0.03), transparent);
}

/* Grid dots */
.canvas-wrap::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
	background-size: 40px 40px;
	pointer-events: none;
}

/* Rope canvas (physics threads) */
.rope-canvas {
	position: absolute;
	inset: 0;
	z-index: 5;
	pointer-events: none;
}

.canvas {
	position: absolute;
	width: 100%;
	height: 100%;
}

/* SVG arrows layer */
.arrows-layer {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 1;
}

/* ─── AI Brain Node ─── */
.brain-node {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(124, 58, 237, 0.3), rgba(0, 212, 255, 0.15));
	border: 2px solid rgba(124, 58, 237, 0.4);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 10;
	cursor: pointer;
	box-shadow:
		0 0 40px rgba(124, 58, 237, 0.2),
		0 0 80px rgba(0, 212, 255, 0.1);
	animation: brainPulse 3s ease-in-out infinite;
	transition: transform 0.2s;
}

.brain-node:hover {
	transform: translate(-50%, -50%) scale(1.05);
	border-color: rgba(124, 58, 237, 0.8);
}

.brain-node .brain-emoji { font-size: 36px; }
.brain-node .brain-label {
	font-size: 11px;
	font-weight: 700;
	color: var(--accent);
	margin-top: 4px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

@keyframes brainPulse {
	0%, 100% { box-shadow: 0 0 40px rgba(124, 58, 237, 0.2), 0 0 80px rgba(0, 212, 255, 0.1); }
	50% { box-shadow: 0 0 60px rgba(124, 58, 237, 0.35), 0 0 120px rgba(0, 212, 255, 0.2); }
}

/* ─── Block Node ─── */
.block-node {
	position: absolute;
	width: 220px;
	background: var(--bg-card);
	backdrop-filter: blur(16px);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px 18px;
	cursor: grab;
	z-index: 20;
	transition: box-shadow 0.3s, border-color 0.3s;
	user-select: none;
}

.block-node:hover {
	border-color: rgba(255, 255, 255, 0.12);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 212, 255, 0.08);
}

.block-node.dragging {
	cursor: grabbing;
	z-index: 100;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 255, 0.15);
	border-color: var(--accent);
}

.block-node.selected {
	border-color: var(--accent);
	box-shadow: 0 0 24px var(--accent-glow);
}

.block-node.disabled { opacity: 0.4; }

.block-node-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.block-node-icon { font-size: 20px; }

.block-node-name {
	font-size: 13px;
	font-weight: 600;
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ─── I/O Ports ─── */
.block-port {
	position: absolute;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid var(--accent);
	background: var(--bg-deep);
	z-index: 30;
	cursor: pointer;
}

.block-port-out {
	bottom: -5px;
	left: 50%;
	transform: translateX(-50%);
	border-color: #00d4ff;
}

.block-node:hover .block-port-out {
	background: #00d4ff;
	box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}

.block-node-action-badge {
	font-size: 10px;
	padding: 2px 8px;
	border-radius: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	display: inline-block;
	margin-bottom: 8px;
}

.block-node-action-badge.store {
	background: rgba(16, 185, 129, 0.15);
	color: var(--accent-green);
}

.block-node-action-badge.read {
	background: var(--accent-glow);
	color: var(--accent);
}

.block-node-action-badge.speak {
	background: rgba(245, 158, 11, 0.15);
	color: var(--accent-amber);
}

.block-node-action-badge.calendar {
	background: rgba(59, 130, 246, 0.15);
	color: #3b82f6;
}

.block-node-desc {
	font-size: 11px;
	color: var(--text-muted);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ─── Block I/O Definition ─── */
.block-node-io {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid var(--border);
}

.block-io-section {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
	flex: 1;
}

.block-io-label {
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--text-dim);
	padding: 1px 5px;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--border);
}

.block-param-tag {
	font-size: 10px;
	padding: 1px 6px;
	border-radius: 8px;
	background: rgba(0, 212, 255, 0.08);
	color: rgba(0, 212, 255, 0.7);
	border: 1px solid rgba(0, 212, 255, 0.12);
}

.block-param-tag.out {
	background: rgba(124, 58, 237, 0.1);
	color: rgba(124, 58, 237, 0.7);
	border-color: rgba(124, 58, 237, 0.15);
}

.block-param-tag.more {
	background: rgba(255, 255, 255, 0.04);
	color: var(--text-dim);
	border-color: var(--border);
}

/* ─── Side Panel ─── */
.side-panel {
	position: fixed;
	top: 56px;
	right: -420px;
	width: 420px;
	bottom: 48px;
	background: rgba(10, 10, 20, 0.95);
	backdrop-filter: blur(20px);
	border-left: 1px solid var(--border);
	z-index: 50;
	transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	overflow-y: auto;
	padding: 24px;
}

.side-panel.open { right: 0; }

.panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}

.panel-header h3 {
	font-size: 16px;
	font-weight: 700;
}

.panel-close {
	background: none;
	border: none;
	color: var(--text-muted);
	font-size: 20px;
	cursor: pointer;
	padding: 4px;
}

.panel-close:hover { color: var(--text); }

.panel-section {
	margin-bottom: 20px;
}

.panel-section-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-dim);
	margin-bottom: 10px;
}

/* ─── Form Elements ─── */
.form-group { margin-bottom: 14px; }

.form-group label {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: var(--text-muted);
	margin-bottom: 5px;
}

.form-control {
	width: 100%;
	padding: 9px 12px;
	background: var(--bg-input);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
	color: var(--text);
	font-family: 'Inter', sans-serif;
	font-size: 13px;
	transition: var(--transition);
	outline: none;
}

.form-control:focus {
	border-color: var(--border-focus);
	box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder { color: var(--text-dim); }

textarea.form-control { min-height: 80px; resize: vertical; }

select.form-control {
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888a8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 32px;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* ─── Params Editor ─── */
.param-item {
	display: grid;
	grid-template-columns: 1fr 80px 60px 28px;
	gap: 6px;
	align-items: center;
	margin-bottom: 6px;
}

.param-item input, .param-item select {
	padding: 6px 8px;
	font-size: 12px;
	background: var(--bg-input);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--text);
	font-family: 'Inter', sans-serif;
	outline: none;
}

.param-item input:focus, .param-item select:focus {
	border-color: var(--border-focus);
}

.param-remove {
	width: 28px;
	height: 28px;
	border: none;
	background: rgba(239, 68, 68, 0.1);
	color: var(--accent-red);
	border-radius: 4px;
	cursor: pointer;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.param-remove:hover { background: rgba(239, 68, 68, 0.2); }

/* ─── Bottom Bar ─── */
.bottombar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 48px;
	background: rgba(6, 6, 15, 0.9);
	backdrop-filter: blur(20px);
	border-top: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 24px;
	z-index: 100;
	font-size: 12px;
	color: var(--text-muted);
}

.bottombar-left { display: flex; align-items: center; gap: 16px; }
.bottombar-right { display: flex; align-items: center; gap: 12px; }

/* ─── Toast ─── */
.toast-container {
	position: fixed;
	top: 68px;
	right: 24px;
	z-index: 2000;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.toast {
	padding: 10px 18px;
	border-radius: var(--radius-sm);
	font-size: 13px;
	font-weight: 500;
	color: var(--text);
	backdrop-filter: blur(16px);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
	max-width: 360px;
}

.toast.success { background: rgba(16, 185, 129, 0.2); border: 1px solid rgba(16, 185, 129, 0.3); }
.toast.error { background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.3); }
.toast.info { background: rgba(0, 212, 255, 0.15); border: 1px solid rgba(0, 212, 255, 0.25); }

@keyframes slideIn {
	from { opacity: 0; transform: translateX(40px); }
	to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
	to { opacity: 0; transform: translateX(40px); }
}

/* ─── Settings Modal ─── */
.modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
	z-index: 1000;
	align-items: center;
	justify-content: center;
}

.modal-overlay.active { display: flex; animation: fadeInModal 0.2s ease; }

@keyframes fadeInModal {
	from { opacity: 0; }
	to { opacity: 1; }
}

.modal {
	background: var(--bg-surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	width: 90%;
	max-width: 560px;
	max-height: 80vh;
	overflow-y: auto;
	padding: 28px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}

.modal-header h3 { font-size: 17px; font-weight: 700; }

.modal-close {
	background: none;
	border: none;
	color: var(--text-muted);
	font-size: 22px;
	cursor: pointer;
}

.modal-close:hover { color: var(--text); }

.modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 20px;
	padding-top: 14px;
	border-top: 1px solid var(--border);
}

/* ─── SVG Arrow Styles ─── */
.arrow-line {
	stroke: rgba(0, 212, 255, 0.25);
	stroke-width: 2;
	fill: none;
	stroke-dasharray: 8 4;
	animation: dashFlow 1s linear infinite;
}

.arrow-line.disabled {
	stroke: rgba(255, 255, 255, 0.06);
	stroke-dasharray: 4 8;
	animation: none;
}

@keyframes dashFlow {
	to { stroke-dashoffset: -12; }
}

/* ─── Toggle ─── */
.toggle {
	position: relative;
	width: 36px;
	height: 20px;
	flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle .slider {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 20px;
	cursor: pointer;
	transition: var(--transition);
}

.toggle .slider::before {
	content: '';
	position: absolute;
	height: 14px;
	width: 14px;
	left: 3px;
	bottom: 3px;
	background: var(--text-muted);
	border-radius: 50%;
	transition: var(--transition);
}

.toggle input:checked + .slider {
	background: var(--accent);
}

.toggle input:checked + .slider::before {
	transform: translateX(16px);
	background: #000;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.14); }

/* ─── Compile overlay ─── */
.compile-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(6, 6, 15, 0.9);
	backdrop-filter: blur(8px);
	z-index: 3000;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 20px;
}

.compile-overlay.active { display: flex; }

.compile-spinner {
	width: 60px;
	height: 60px;
	border: 3px solid var(--border);
	border-top-color: var(--accent-violet);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.compile-overlay p {
	font-size: 16px;
	font-weight: 600;
	color: var(--text);
}

.compile-overlay .sub {
	font-size: 13px;
	color: var(--text-muted);
}


.block-node-action-badge.search {
	background: rgba(0, 212, 255, 0.15);
	color: var(--accent);
}


/* ─── Database Tables ─── */
.db-table-wrap {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 16px;
}
.db-table-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}
.db-table-header h4 {
	font-size: 14px;
	margin: 0;
	color: var(--accent);
}
.db-table {
	width: 100%;
	border-collapse: collapse;
}
.db-table th, .db-table td {
	padding: 6px;
	border: 1px solid var(--border);
}
.db-table th {
	background: rgba(255,255,255,0.02);
}
.db-cell-input, .db-col-input {
	width: 100%;
	background: transparent;
	border: none;
	color: var(--text);
	font-size: 13px;
	padding: 4px;
	outline: none;
}
.db-cell-input:focus, .db-col-input:focus {
	background: rgba(0,212,255,0.05);
}
.db-col-input {
	font-weight: 600;
	color: var(--text-muted);
}
.text-red { color: var(--accent-red); }

/* ─── Datasheet Button ─── */
.btn-datasheet {
	background: linear-gradient(135deg, #10b981, #059669);
	color: #fff;
	box-shadow: 0 2px 12px rgba(16, 185, 129, 0.25);
}
.btn-datasheet:hover {
	box-shadow: 0 4px 20px rgba(16, 185, 129, 0.5);
	transform: translateY(-1px);
}

/* ─── Datasheet Block Node (green variant) ─── */
.block-node.datasheet-block {
	border-color: rgba(16, 185, 129, 0.35);
	background: rgba(16, 185, 129, 0.04);
}
.block-node.datasheet-block:hover {
	border-color: rgba(16, 185, 129, 0.6);
	box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px rgba(16, 185, 129, 0.12);
}
.block-node.datasheet-block.selected {
	border-color: var(--accent-green);
	box-shadow: 0 0 24px rgba(16, 185, 129, 0.2);
}
.block-node.datasheet-block .block-port-out {
	border-color: var(--accent-green);
}
.block-node.datasheet-block:hover .block-port-out {
	background: var(--accent-green);
	box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}
.block-node-action-badge.datasheet {
	background: rgba(16, 185, 129, 0.15);
	color: var(--accent-green);
}

/* Mini table preview inside datasheet canvas block */
.ds-block-preview {
	margin-top: 8px;
	border-top: 1px solid rgba(16, 185, 129, 0.15);
	padding-top: 6px;
}
.ds-preview-row {
	display: flex;
	gap: 4px;
	font-size: 10px;
	color: var(--text-muted);
	white-space: nowrap;
	overflow: hidden;
	margin-bottom: 2px;
}
.ds-preview-cell {
	background: rgba(16, 185, 129, 0.07);
	border: 1px solid rgba(16, 185, 129, 0.12);
	border-radius: 3px;
	padding: 1px 5px;
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ds-preview-cell.header {
	color: var(--accent-green);
	font-weight: 600;
}
.ds-more-rows {
	font-size: 10px;
	color: var(--text-dim);
	margin-top: 2px;
}

/* ─── Datasheet Side Panel Grid ─── */
.ds-grid-wrap {
	overflow: auto;
	flex: 1;
	margin-top: 8px;
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
	background: var(--bg-input);
	max-height: 320px;
}
.ds-grid {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}
.ds-grid th, .ds-grid td {
	border: 1px solid rgba(255,255,255,0.05);
	padding: 0;
	min-width: 100px;
}
.ds-grid th {
	background: rgba(16, 185, 129, 0.08);
	position: sticky;
	top: 0;
	z-index: 2;
}
.ds-grid td:first-child, .ds-grid th:first-child {
	min-width: 36px;
	width: 36px;
	text-align: center;
	background: rgba(255,255,255,0.02);
	color: var(--text-dim);
	font-size: 10px;
	padding: 4px;
}
.ds-col-input {
	width: 100%;
	background: transparent;
	border: none;
	color: var(--accent-green);
	font-weight: 600;
	font-size: 11px;
	padding: 5px 7px;
	outline: none;
	font-family: 'Inter', sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.ds-col-input:focus { background: rgba(16, 185, 129, 0.08); }
.ds-cell-input {
	width: 100%;
	background: transparent;
	border: none;
	color: var(--text);
	font-size: 12px;
	padding: 5px 7px;
	outline: none;
	font-family: 'Inter', sans-serif;
}
.ds-cell-input:focus { background: rgba(0,212,255,0.05); }
.ds-del-col-btn, .ds-del-row-btn {
	background: none;
	border: none;
	color: var(--text-dim);
	cursor: pointer;
	font-size: 11px;
	padding: 2px 4px;
	border-radius: 3px;
	display: block;
	width: 100%;
}
.ds-del-col-btn:hover, .ds-del-row-btn:hover {
	background: rgba(239,68,68,0.12);
	color: var(--accent-red);
}
.ds-grid th .th-inner {
	display: flex;
	align-items: center;
}

/* ─── Appointment Cards (Calendar Viewer) ─── */
.appointment-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
	margin-top: 10px;
}
.appointment-card {
	background: rgba(20, 20, 40, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	padding: 16px;
	transition: all 0.2s;
	display: flex;
	flex-direction: column;
	gap: 12px;
	position: relative;
	overflow: hidden;
}
.appointment-card:hover {
	background: rgba(30, 30, 50, 0.6);
	border-color: rgba(255, 255, 255, 0.15);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.appointment-card::before {
	content: '';
	position: absolute;
	top: 0; left: 0;
	width: 4px; height: 100%;
	background: var(--accent-green);
	opacity: 0.8;
}
.apt-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}
.apt-datetime {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.apt-date {
	font-weight: 700;
	font-size: 15px;
	color: #fff;
}
.apt-time {
	font-size: 13px;
	color: var(--accent-green);
	font-weight: 600;
}
.apt-badge {
	background: rgba(16, 185, 129, 0.15);
	color: #10b981;
	padding: 3px 8px;
	border-radius: 12px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.apt-body {
	font-size: 13px;
	color: var(--text-dim);
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.apt-body strong {
	color: var(--text);
	font-weight: 500;
}
.apt-item {
	display: flex;
	gap: 6px;
	align-items: center;
}
.apt-item.stack {
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
}
.apt-raw {
	margin-top: 8px;
	padding-top: 12px;
	border-top: 1px dashed rgba(255, 255, 255, 0.1);
	display: none; /* hidden by default */
}
.appointment-card.expanded .apt-raw {
	display: block;
}
.apt-expand-btn {
	background: none;
	border: none;
	color: var(--accent);
	font-size: 11px;
	border: 1px solid rgba(16, 185, 129, 0.12);
	border-radius: 3px;
	padding: 1px 5px;
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ds-preview-cell.header {
	color: var(--accent-green);
	font-weight: 600;
}
.ds-more-rows {
	font-size: 10px;
	color: var(--text-dim);
	margin-top: 2px;
}

/* ─── Datasheet Side Panel Grid ─── */
.ds-grid-wrap {
	overflow: auto;
	flex: 1;
	margin-top: 8px;
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
	background: var(--bg-input);
	max-height: 320px;
}
.ds-grid {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}
.ds-grid th, .ds-grid td {
	border: 1px solid rgba(255,255,255,0.05);
	padding: 0;
	min-width: 100px;
}
.ds-grid th {
	background: rgba(16, 185, 129, 0.08);
	position: sticky;
	top: 0;
	z-index: 2;
}
.ds-grid td:first-child, .ds-grid th:first-child {
	min-width: 36px;
	width: 36px;
	text-align: center;
	background: rgba(255,255,255,0.02);
	color: var(--text-dim);
	font-size: 10px;
	padding: 4px;
}
.ds-col-input {
	width: 100%;
	background: transparent;
	border: none;
	color: var(--accent-green);
	font-weight: 600;
	font-size: 11px;
	padding: 5px 7px;
	outline: none;
	font-family: 'Inter', sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.ds-col-input:focus { background: rgba(16, 185, 129, 0.08); }
.ds-cell-input {
	width: 100%;
	background: transparent;
	border: none;
	color: var(--text);
	font-size: 12px;
	padding: 5px 7px;
	outline: none;
	font-family: 'Inter', sans-serif;
}
.ds-cell-input:focus { background: rgba(0,212,255,0.05); }
.ds-del-col-btn, .ds-del-row-btn {
	background: none;
	border: none;
	color: var(--text-dim);
	cursor: pointer;
	font-size: 11px;
	padding: 2px 4px;
	border-radius: 3px;
	display: block;
	width: 100%;
}
.ds-del-col-btn:hover, .ds-del-row-btn:hover {
	background: rgba(239,68,68,0.12);
	color: var(--accent-red);
}
.ds-grid th .th-inner {
	display: flex;
	align-items: center;
}

/* ─── Appointment Cards (Calendar Viewer) ─── */
.appointment-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
	margin-top: 10px;
}
.appointment-card {
	background: rgba(20, 20, 40, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	padding: 16px;
	transition: all 0.2s;
	display: flex;
	flex-direction: column;
	gap: 12px;
	position: relative;
	overflow: hidden;
}
.appointment-card:hover {
	background: rgba(30, 30, 50, 0.6);
	border-color: rgba(255, 255, 255, 0.15);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.appointment-card::before {
	content: '';
	position: absolute;
	top: 0; left: 0;
	width: 4px; height: 100%;
	background: var(--accent-green);
	opacity: 0.8;
}
.apt-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}
.apt-datetime {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.apt-date {
	font-weight: 700;
	font-size: 15px;
	color: #fff;
}
.apt-time {
	font-size: 13px;
	color: var(--accent-green);
	font-weight: 600;
}
.apt-badge {
	background: rgba(16, 185, 129, 0.15);
	color: #10b981;
	padding: 3px 8px;
	border-radius: 12px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.apt-body {
	font-size: 13px;
	color: var(--text-dim);
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.apt-body strong {
	color: var(--text);
	font-weight: 500;
}
.apt-item {
	display: flex;
	gap: 6px;
	align-items: center;
}
.apt-item.stack {
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
}
.apt-raw {
	margin-top: 8px;
	padding-top: 12px;
	border-top: 1px dashed rgba(255, 255, 255, 0.1);
	display: none; /* hidden by default */
}
.appointment-card.expanded .apt-raw {
	display: block;
}
.apt-expand-btn {
	background: none;
	border: none;
	color: var(--accent);
	font-size: 11px;
	cursor: pointer;
	padding: 0;
	margin-top: 4px;
	text-align: left;
}
.apt-expand-btn:hover {
	text-decoration: underline;
}

/* ──────────────────── Live Call Indicator ──────────────────── */
#live-call-status {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%) translateY(-100px);
	background: rgba(239, 68, 68, 0.15);
	border: 1px solid rgba(239, 68, 68, 0.3);
	color: #fca5a5;
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 8px;
	z-index: 10000;
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	pointer-events: none;
	backdrop-filter: blur(10px);
	box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}
#live-call-status.active {
	transform: translateX(-50%) translateY(0);
}
.pulsing-dot {
	width: 8px;
	height: 8px;
	background-color: #ef4444;
	border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
	animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
	0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
	70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
	100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
