/* v20260401 */
body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	margin: 0;
	background: #f6f7fb;
	color: #1d1f23;
	display: flex;
	height: 100vh;
}
.sidebar {
	width: 240px;
	background: #1f2937;
	color: #fff;
	display: flex;
	flex-direction: column;
	padding: 20px 0;
}
.sidebar .brand {
	padding: 0 20px 20px;
	font-size: 20px;
	font-weight: bold;
	border-bottom: 1px solid #374151;
	margin-bottom: 20px;
}
.sidebar nav {
	display: flex;
	flex-direction: column;
	flex: 1;
	overflow-y: auto;
	min-height: 0;
}
.sidebar nav a {
	color: #d1d5db;
	padding: 12px 20px;
	text-decoration: none;
	font-size: 15px;
	transition: background 0.2s;
}
.sidebar nav a:hover {
	background: #374151;
	color: #fff;
}
.sidebar nav a.active {
	background: #2563eb;
	color: #fff;
}
.sidebar-footer {
	margin-top: auto;
	padding: 12px 16px;
	border-top: 1px solid #374151;
}
.sidebar-user-capsule {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border: 1.5px solid #4b5563;
	border-radius: 20px;
	background: transparent;
	cursor: default;
}
.sidebar-user-capsule .username {
	flex: 1;
	font-size: 13px;
	color: #e5e7eb;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.sidebar-user-capsule .icon-btn {
	background: none;
	border: none;
	color: #9ca3af;
	cursor: pointer;
	padding: 2px;
	font-size: 16px;
	line-height: 1;
	display: flex;
	align-items: center;
	transition: color 0.2s;
}
.sidebar-user-capsule .icon-btn:hover {
	color: #fff;
}
.main-content {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
}
header {
	background: #fff;
	padding: 16px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid #e5e7eb;
	margin-bottom: 24px;
}
header .title {
	font-size: 18px;
	font-weight: 600;
}
.container {
	max-width: 1200px;
	margin: 0 auto;
}
.card {
	background: #fff;
	padding: 20px;
	border-radius: 10px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
	margin-bottom: 20px;
}
button {
	background: #2563eb;
	color: #fff;
	border: none;
	padding: 8px 14px;
	border-radius: 6px;
	cursor: pointer;
}
input, select, textarea {
	padding: 8px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	width: 100%;
	box-sizing: border-box;
	margin-top: 6px;
}
table {
	width: 100%;
	border-collapse: collapse;
}
th, td {
	padding: 10px;
	border-bottom: 1px solid #e5e7eb;
	text-align: left;
	font-size: 14px;
}
.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
}
.muted {
	color: #6b7280;
	font-size: 13px;
}
.flex {
	display: flex;
	gap: 12px;
	align-items: center;
}
.right {
	text-align: right;
}
.login-box {
	max-width: 360px;
	margin: 80px auto;
	background: #fff;
	padding: 24px;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

/* Modal */
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal-container {
  background: #fff;
  width: 600px;
  max-width: 90%;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.close-btn:hover {
  color: #111827;
}
.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}
.stats-group {
  margin-bottom: 12px;
}
.stats-group:last-child {
  margin-bottom: 0;
}
.stats-group-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
  padding-left: 8px;
  border-left: 4px solid #2563eb;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.stats-item {
  display: flex;
  flex-direction: column;
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #f3f4f6;
}
.stats-item label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}
.stats-item span {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.stats-grid-compact {
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.stats-grid-compact .stats-item {
  padding: 4px 8px;
  background: #f8fafc;
  border-radius: 4px;
  border: 1px solid #f1f5f9;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.stats-grid-compact .stats-item label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 0;
}

.stats-grid-compact .stats-item span {
  font-size: 13px;
  font-weight: 700;
}

.stats-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid #e5e7eb;
  padding-top: 20px;
}

.stats-metrics-selector {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  flex: 1;
}

.metric-checkbox {
  display: flex;
  align-items: center;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.2s;
  white-space: nowrap;
}

.metric-checkbox:hover {
  background: #f3f4f6;
}

.metric-checkbox input {
  margin: 0 8px 0 0;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.metric-checkbox span {
  font-weight: 500;
}

.stats-range-control {
  width: 180px;
  margin-left: 30px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
  padding: 0 4px;
}

#stats-range-slider {
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  outline: none;
  margin: 0;
}

/* Form UX Optimizations */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 16px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.form-control {
  background: #fff;
  border: 1px solid #d1d5db;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.poster-upload-area {
  border: 2px dashed #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 15px;
  background: #f9fafb;
  transition: border-color 0.2s;
}
.poster-upload-area:hover {
  border-color: #2563eb;
}
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f9fafb;
}
.btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}
.btn-secondary:hover {
  background: #f3f4f6;
}
.city-tag {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.city-tag:hover {
  background: #2563eb;
  color: #fff;
}

/* Quill Editor Video Resize Helper */
.ql-editor iframe {
  pointer-events: none;
}

/* Table embed styling */
.ql-editor .ql-table-embed {
  margin: 10px 0;
}
.ql-editor .ql-table-embed table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
}
.ql-editor .ql-table-embed td {
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  min-width: 50px;
  vertical-align: top;
}
.ql-editor .ql-table-embed td:focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}
.ql-editor .ql-table-embed td.ql-table-cell-selected {
  background: #dbeafe;
  box-shadow: inset 0 0 0 2px #2563eb;
}
.ql-editor .ql-table-embed td[contenteditable="true"] {
  cursor: text;
}

/* fallback for plain table */
.ql-editor table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
  background: #fff;
}
.ql-editor table td {
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  min-width: 50px;
  vertical-align: top;
}
.ql-editor table td:focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: #f3f4f6;
  color: #374151;
}

.status-paid { color: #059669; font-weight: 600; }
.status-pending { color: #d97706; font-weight: 600; }
.status-closed { color: #6b7280; }
.status-refunding { color: #dc2626; }
.status-refunded { color: #9ca3af; }

/* Custom table button in Quill toolbar */
.ql-snow .ql-toolbar button.ql-custom-table:hover,
.ql-snow .ql-toolbar button.ql-table-menu-btn:hover {
  color: #2563eb;
}

/* Settings page */
.auth-checkbox-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 12px 0;
}
.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  transition: background 0.2s;
}
.auth-checkbox-label:hover {
  background: #f3f4f6;
}
.auth-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}
.btn-success {
  background: #10b981;
}
.btn-success:hover {
  background: #059669;
}
.btn-danger {
  background: #ef4444;
}
.btn-danger:hover {
  background: #dc2626;
}
.password-form {
  max-width: 400px;
}
.password-form .form-group {
  margin-bottom: 14px;
}
.password-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}
