/* ==================== Sidebar Buttons ==================== */

.sidebar-btn {
	display: block;
	width: 100%;
	padding: 10px 14px;
	margin-top: 14px;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	border-radius: 8px;
	border: 1px solid #2c3350;
	background: #0a0c13;
	color: #b8c3d8;
	cursor: pointer;
	transition:
		background 0.15s,
		border-color 0.15s,
		color 0.15s;
}

.sidebar-btn:hover {
	background: #131729;
	border-color: #3d4872;
	color: #f1f5f9;
}

.sidebar-btn-edit.active {
	background: rgba(124, 58, 237, 0.18);
	border-color: #7c3aed;
	color: #c4b5fd;
}

.sidebar-btn-download {
	background: rgba(124, 58, 237, 0.12);
	border-color: #7c3aed;
	color: #c4b5fd;
}

.sidebar-btn-download:hover {
	background: rgba(124, 58, 237, 0.28);
	border-color: #8b5cf6;
	color: #e9d5ff;
}

.sidebar-btn-graph {
	background: rgba(14, 165, 233, 0.1);
	border-color: #0ea5e9;
	color: #7dd3fc;
}

.sidebar-btn-graph:hover {
	background: rgba(14, 165, 233, 0.22);
	border-color: #38bdf8;
	color: #bae6fd;
}

/* ==================== Editor Icon Buttons ==================== */

.editor-icons {
	display: inline-flex;
	gap: 2px;
	margin-left: 6px;
	flex-shrink: 0;
}

.edited-item {
	border-left-color: #f59e0b !important;
}

.edited-pill {
	margin-left: 6px;
	padding: 1px 6px;
	border-radius: 999px;
	font-size: 0.62rem;
	color: #fef3c7;
	background: rgba(245, 158, 11, 0.22);
	border: 1px solid rgba(245, 158, 11, 0.5);
}

.editor-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	color: #7f8ca4;
	cursor: pointer;
	transition:
		background 0.12s,
		color 0.12s,
		border-color 0.12s;
}

.editor-icon-btn:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: #2c3350;
}

.editor-icon-edit:hover {
	color: #c4b5fd;
}

.editor-icon-delete {
	color: #7f8ca4;
}

.editor-icon-delete:hover {
	color: #ef4444;
	background: rgba(239, 68, 68, 0.1);
	border-color: rgba(239, 68, 68, 0.25);
}

/* ==================== Add Button ==================== */

.editor-add-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: calc(100% - 20px);
	margin: 8px 10px;
	padding: 8px 12px;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 500;
	color: #7f8ca4;
	background: transparent;
	border: 1px dashed #2c3350;
	border-radius: 8px;
	cursor: pointer;
	transition:
		background 0.12s,
		color 0.12s,
		border-color 0.12s;
}

.editor-add-btn:hover {
	color: #c4b5fd;
	background: rgba(124, 58, 237, 0.08);
	border-color: #7c3aed;
}

/* ==================== Message Name Row ==================== */

.msg-name-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}

.msg-edited-row {
	margin-top: 2px;
}

.msg-edited-badge,
.status-badge {
	display: inline-block;
	padding: 2px 7px;
	border-radius: 999px;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.status-badge.status-changed {
	color: #422006;
	background: #facc15;
	border: 1px solid #eab308;
}

.status-badge.status-new {
	color: #3b2600;
	background: #fde047;
	border: 1px solid #f59e0b;
}

.changed-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: #facc15;
	box-shadow: 0 0 0 1px #eab308;
	margin-left: 6px;
	vertical-align: middle;
}

.dv-overlay {
	position: fixed;
	inset: 0;
	z-index: 2200;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.66);
}

.dv-modal {
	width: min(1200px, 96vw);
	height: min(86vh, 860px);
	display: flex;
	flex-direction: column;
	background: #0e1017;
	border: 1px solid #1f2439;
	border-radius: 12px;
	overflow: hidden;
}

.dv-head,
.dv-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border-bottom: 1px solid #1f2439;
}

.dv-foot {
	border-bottom: none;
	border-top: 1px solid #1f2439;
	justify-content: flex-end;
	gap: 8px;
}

.dv-head h2 {
	margin: 0;
	font-size: 1rem;
}

.dv-close {
	background: none;
	border: none;
	color: #94a3b8;
	font-size: 1.4rem;
	cursor: pointer;
}

.dv-body {
	flex: 1;
	overflow: auto;
}

.dv-table {
	width: 100%;
	border-collapse: collapse;
	font-family: "Fira Mono", "Consolas", monospace;
	font-size: 0.74rem;
}

.dv-table th,
.dv-table td {
	padding: 3px 6px;
	border-bottom: 1px solid #14192d;
	vertical-align: top;
	white-space: pre;
}

.dv-ln {
	width: 58px;
	text-align: right;
	color: #64748b;
	background: #090d18;
}

.dv-code {
	min-width: 420px;
	color: #cbd5e1;
}

.dv-del {
	background: rgba(239, 68, 68, 0.14);
}

.dv-add {
	background: rgba(34, 197, 94, 0.14);
}

.dv-btn {
	padding: 7px 12px;
	border-radius: 8px;
	border: 1px solid #2c3350;
	background: #131729;
	color: #dbe2ef;
	cursor: pointer;
}

.dv-btn-primary {
	background: #7c3aed;
	border-color: #7c3aed;
	color: #fff;
}

/* ==================== Modal Overlay ==================== */

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

.editor-modal {
	width: min(680px, 92vw);
}

.editor-modal {
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	background: #0e1017;
	border: 1px solid #1f2439;
	border-radius: 14px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
	overflow: hidden;
}

.editor-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px 14px;
	border-bottom: 1px solid #1f2439;
}

.editor-modal-header h2 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
	color: #f1f5f9;
}

.editor-modal-close {
	background: none;
	border: none;
	color: #7f8ca4;
	font-size: 1.5rem;
	cursor: pointer;
	padding: 0 4px;
	line-height: 1;
}

.editor-modal-close:hover {
	color: #f1f5f9;
}

.editor-modal-body {
	flex: 1;
	overflow-y: auto;
	padding: 18px 22px;
}

.editor-modal-body::-webkit-scrollbar {
	width: 6px;
}

.editor-modal-body::-webkit-scrollbar-thumb {
	background: #303b68;
	border-radius: 4px;
}

.editor-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 14px 22px;
	border-top: 1px solid #1f2439;
}

/* ==================== Form Elements ==================== */

.editor-form-row {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 12px;
	position: relative;
}

.editor-label {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #7f8ca4;
}

.editor-required {
	color: #ef4444;
}

.editor-input {
	width: 100%;
	font-family: inherit;
	font-size: 0.82rem;
	padding: 8px 10px;
	border-radius: 7px;
	border: 1px solid #2c3350;
	background: #0a0c13;
	color: #ecf2ff;
	outline: none;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}

.editor-input:focus {
	border-color: #7c3aed;
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

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

select.editor-input {
	appearance: none;
	background-image:
		linear-gradient(45deg, transparent 50%, #7f8ca4 50%),
		linear-gradient(135deg, #7f8ca4 50%, transparent 50%);
	background-position:
		calc(100% - 14px) calc(50% - 2px),
		calc(100% - 9px) calc(50% - 2px);
	background-size:
		5px 5px,
		5px 5px;
	background-repeat: no-repeat;
	padding-right: 28px;
}

textarea.editor-input {
	resize: vertical;
	min-height: 48px;
}

.editor-error {
	font-size: 0.7rem;
	color: #ef4444;
	min-height: 0;
}

/* ==================== Buttons ==================== */

.editor-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 8px 16px;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 500;
	border-radius: 8px;
	border: 1px solid #2c3350;
	background: #131729;
	color: #b8c3d8;
	cursor: pointer;
	transition:
		background 0.12s,
		border-color 0.12s,
		color 0.12s;
}

.editor-btn:hover {
	background: #1a2040;
	border-color: #3d4872;
	color: #f1f5f9;
}

.editor-btn-primary {
	background: #7c3aed;
	border-color: #7c3aed;
	color: #fff;
}

.editor-btn-primary:hover {
	background: #6d28d9;
	border-color: #6d28d9;
}

.editor-btn-danger {
	background: rgba(239, 68, 68, 0.15);
	border-color: rgba(239, 68, 68, 0.35);
	color: #fca5a5;
}

.editor-btn-danger:hover {
	background: rgba(239, 68, 68, 0.25);
	border-color: #ef4444;
	color: #fecaca;
}

.editor-btn-sm {
	padding: 5px 10px;
	font-size: 0.74rem;
}

/* ==================== Section Headers ==================== */

.editor-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 16px 0 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid #1f2439;
	font-size: 0.85rem;
	font-weight: 600;
	color: #c4b5fd;
}

/* ==================== Field Cards ==================== */

.editor-fields-box {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.editor-field-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px;
	background: rgba(15, 17, 26, 0.7);
	border: 1px solid #1a2038;
	border-radius: 10px;
}

.editor-field-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.editor-field-grid-5 {
	grid-template-columns: repeat(5, 1fr);
}

.editor-field-controls {
	display: flex;
	justify-content: flex-end;
	gap: 6px;
	margin-top: 8px;
}

/* ==================== Message Suggestions (Add Route) ==================== */

.editor-suggest {
	position: absolute;
	z-index: 2100;
	top: 100%;
	left: 0;
	padding: 4px 0;
	min-width: 100%;
	max-height: 220px;
	overflow-y: auto;
	border-radius: 8px;
	border: 1px solid #1f2439;
	background: #020617;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.editor-suggest.hidden {
	display: none;
}

.editor-suggest-item {
	padding: 4px 10px;
	font-size: 0.8rem;
	color: #cbd5f5;
	cursor: pointer;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}

.editor-suggest-item:hover,
.editor-suggest-item-active {
	background: #1e293b;
	color: #f9fafb;
}

@media (max-width: 640px) {
	.editor-field-grid {
		grid-template-columns: 1fr;
	}
	.editor-field-grid-5 {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ==================== Confirm Dialog ==================== */

.editor-confirm-msg {
	margin: 0 0 12px;
	font-size: 0.92rem;
	color: #f1f5f9;
}

.editor-confirm-warn {
	margin: 0;
	font-size: 0.78rem;
	color: #9aa3b0;
	font-style: italic;
}
