:root {
	--bg: #ffffff;
	--text: #1f2937;
	--navbar-bg: #f3f4f6;
	--panel-bg: #ffffff;
	--border: #cccccc;
	--item-border: #e2e8f0;
	--item-hover: #ebf8ff;
	--badge-bg: #ffffff;
	--badge-text: #1f2937;
	--badge-border: #1f2937;
	--status-published-bg: #d1fae5;
	--status-draft-bg: #ffdb58;
	--status-deleted-bg: #fee2e2;
}

html.dark {
	--bg: #111827;
	--text: #e5e7eb;
	--navbar-bg: #374151;
	--panel-bg: #1f2937;
	--border: #4b5563;
	--item-border: #4b5563;
	--item-hover: #374151;
	--badge-bg: #000;
	--badge-text: #e5e7eb;
	--badge-border: #e5e7eb;
	--status-published-bg: #064e3b;
	--status-draft-bg: #b8860b;
	--status-deleted-bg: #7f1d1d;
}

html,
body {
	margin: 0;
	padding: 0;
	font-family: "Poppins", sans-serif;
	background: var(--bg);
	color: var(--text);
}

.navbar {
	background: var(--navbar-bg);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 4px;
}

.nav-title {
	font-size: 1.25rem;
	font-weight: bold;
}

@media (max-width: 640px) {
	.nav-title {
		display: none;
	}
}

.nav-controls {
	display: flex;
	align-items: center;
}

.nav-select,
.status-select {
	position: relative;
	appearance: none;
	height: 40px;
	margin-right: 8px;
	font-size: 1rem;
	padding: 0 32px 0 12px;
	background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
	background-position: right 12px center;
	background-size: 12px 8px;
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--text);
	cursor: pointer;
}

.nav-btn,
#mode-btn {
	height: 40px;
	margin-right: 8px;
	padding: 0 12px;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--text);
	cursor: pointer;
}

.row2 {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	padding: 0.5rem 16px;
}

.row2.status-published {
	background: var(--status-published-bg);
}

.row2.status-draft {
	background: var(--status-draft-bg);
}

.row2.status-deleted {
	background: var(--status-deleted-bg);
}

.row2 .main-title {
	font-size: 2rem;
	margin: 0;
}

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

.status-badge {
	background: var(--badge-bg);
	color: var(--badge-text);
	border: 1px solid var(--badge-border);
	border-radius: 9999px;
	padding: 0.25rem 0.75rem;
	font-size: 0.875rem;
	margin-right: 8px;
}

.status-select {
	height: 32px;
	margin: 0;
	font-size: 0.875rem;
	padding: 0 28px 0 8px;
	background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
	background-position: right 8px center;
	background-size: 12px 8px;
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--text);
	cursor: pointer;
}

.sidebar-panel {
	position: fixed;
	top: 0;
	left: 0;
	height: 100vh;
	width: 100%;
	background: var(--panel-bg);
	box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
	z-index: 20;
	transform: translateX(-100%);
	transition: transform 0.3s ease;
}

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

@media (min-width: 768px) {
	.sidebar-panel {
		width: 16rem;
	}
}

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

.sidebar-list {
	list-style: none;
	margin: 0;
	padding: 1rem;
}

.sidebar-list li {
	margin-bottom: 0.5rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--item-border);
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.2s;
	color: var(--text);
}

.sidebar-list li:hover {
	background: var(--item-hover);
}

.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 30;
}

.modal {
	background: var(--panel-bg);
	border-radius: 8px;
	width: 90%;
	max-width: 600px;
	max-height: 90%;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

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

.modal-body {
	padding: 1rem;
	flex: 1;
	min-height: 350px;
}

.modal-body textarea {
	width: 100%;
	box-sizing: border-box;
	background: var(--bg);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 4px;
	resize: vertical;
	padding: 0.5rem;
	font-family: "Poppins", monospace;
	min-height: 250px;
	max-height: 450px;
	overflow-y: scroll;
}

.modal-footer {
	padding: 1rem;
	border-top: 1px solid var(--border);
	display: flex;
	justify-content: center;
}

.modal-copy-btn {
	padding: 0.5rem 1rem;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 4px;
	cursor: pointer;
	color: var(--text);
}

html,
body {
	height: 100vh;
	margin: 0;
	display: flex;
	flex-direction: column;
}

.nav-group {
	display: flex;
}

.nav-arrow-btn {
	height: 40px;
	padding: 0 12px;
	background: var(--bg);
	border: 1px solid var(--border);
	border-top-left-radius: 4px;
	border-bottom-left-radius: 4px;
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
	font-weight: bold;
	cursor: pointer;
	color: var(--text);
	margin-right: -1px;
}

.nav-select {
	appearance: none;
	height: 40px;
	font-size: 1rem;
	padding: 0 32px 0 12px;
	background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
	border: 1px solid var(--border);
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
	border-top-right-radius: 4px;
	border-bottom-right-radius: 4px;
	color: var(--text);
	cursor: pointer;
	margin-right: 8px;
}

#save-btn {
	background-color: #2e7d32;
	border-color: #2e7d32;
	color: #ffffff;
}

.row2 {
	flex: 0 0 auto;
}

.main-container {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

#sidebar-panel {
	z-index: 100;
}

.sidebar-panel {
	position: fixed;
	top: 0;
	left: 0;
	height: 100vh;
	background: var(--panel-bg);
	display: flex;
	flex-direction: column;
	box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
	z-index: 20;
	transform: translateX(-100%);
	transition: transform .3s ease;
}

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

@media(min-width:768px) {
	.sidebar-panel {
		width: 16rem;
	}
}

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

.sidebar-list {
	list-style: none;
	margin: 0;
	padding: 1rem;
	flex: 1;
	overflow-y: auto;
}

.sidebar-list li {
	margin-bottom: .5rem;
	padding: .5rem .75rem;
	border: 1px solid var(--item-border);
	border-radius: 4px;
	cursor: pointer;
	transition: background .2s;
	color: var(--text);
}

.sidebar-list li:hover {
	background: var(--item-hover);
}

.accordion {
	border: 1px solid var(--border);
	border-radius: 4px;
	overflow: hidden;
	margin: 8px;
}

.accordion-item {
	border-bottom: 1px solid var(--border);
}

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

.accordion-header {
	padding: 6px 8px;
	cursor: pointer;
	background: var(--navbar-bg);
	color: var(--text);
	position: relative;
}

.accordion-header::after {
	content: '+';
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.accordion-item.active .accordion-header::after {
	content: '−';
}

.accordion-content {
	max-height: 0;
	overflow: hidden;
	transition: max-height .3s ease;
	background: var(--panel-bg);
}

.accordion-item.active .accordion-content {
	max-height: 520px;
}

.accordion-content .form-fields {
	padding: 16px;
}

.form-label {
	display: flex;
	align-items: center;
	margin-bottom: 2px;
}

.form-label label {
	margin: 0;
	color: var(--text);
}

.badge-es {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 6px;
	border: 1px solid var(--border);
	border-radius: 4px;
	font-size: 0.75rem;
	color: var(--text);
	text-decoration: none;
	transition: transform .2s;
}

.badge-es:hover {
	transform: translateX(4px);
}

.accordion-content .form-fields input {
	width: 100%;
	box-sizing: border-box;
	padding: 8px;
	margin-bottom: 12px;
	border: 1px solid var(--border);
	border-radius: 4px;
	background: var(--bg);
	color: var(--text);
}

.sidebar-list::-webkit-scrollbar {
	width: 8px;
}

.sidebar-list::-webkit-scrollbar-track {
	background: var(--panel-bg);
}

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

.flatpickr-calendar {
	background: var(--panel-bg);
	color: var(--text);
}

.flatpickr-months,
.flatpickr-weekdays {
	background: var(--navbar-bg);
}
.mobile-force { flex-direction: column !important; }
.flatpickr-weekday,
.flatpickr-day {
	color: var(--text);
}

	/* Mobile View below */
    @media(max-width:640px) {
      #toggle-width-btn { display: none; }
      #row-c-columns { flex-direction: column !important; }
	  .editor {
		width:auto;
	  }
    }
	.editor {
		width: 99%;
	}
    
    /* Editor width handling */
    .editor { background-color: white; }
    /* Scroll-to-top spacer */
    .bottom-spacer { padding: 0.5rem 0; display: flex; justify-content: center; }
    .scroll-top { width: 48px; height: 48px; border-radius: 50%; background: var(--navbar-bg); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.5rem; }