:root {
	--brand-blue: #0d6efd;
	--sidebar-bg: #1a1d21;
}

body {
	background-color: #f0f2f5;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

main {
	flex: 1;
}

.alert-dismissible .btn-close {
	padding: 1rem;
	font-size: 12px;
}

/* Navbar */
.navbar-brand {
	font-weight: 700;
	font-size: 1.2rem;
	letter-spacing: -0.3px;
}

.navbar-brand span {
	color: #b4e5fd;
}

.nav-tabs .nav-link {
	color: #666;
}

.nav-item {
	margin: 0 5px;
}

/* Main content */
.main-content {
	padding: 2rem 0;
}

/* Navbar active link */
.navbar-nav .nav-link.active {
	color: #fff !important;
	font-weight: 600;
}

.navbar-nav .nav-link {
color: #eee;
}

/* Status badges */
.badge-active {
	background-color: #198754;
}

.badge-suspended {
	background-color: #dc3545;
}

/* Table tweaks */
.table-admin th {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6c757d;
	white-space: nowrap;
}

.table-admin td {
	vertical-align: middle;
	font-size: 0.88rem;
}

.table-admin .actions-cell {
	white-space: nowrap;
}

/* Form section headers */
.form-section-title {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #6c757d;
	border-bottom: 1px solid #dee2e6;
	padding-bottom: 0.4rem;
	margin-bottom: 1rem;
	margin-top: 1.5rem;
}

.form-section-title:first-child {
	margin-top: 0;
}

/* Short link display */
.short-link-badge {
	font-family: monospace;
	font-size: 0.82rem;
	background: #e9ecef;
	color: #495057;
	padding: 0.2em 0.55em;
	border-radius: 4px;
}

/* Config form */
.config-field-group {
	border: 1px solid #dee2e6;
	border-radius: 8px;
	padding: 1rem 1.25rem;
	margin-bottom: 1rem;
	background: #fff;
}

.config-field-group label {
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.config-field-group .field-desc {
	font-size: 0.8rem;
	color: #6c757d;
	margin-bottom: 0.5rem;
	display: block;
}

/* Alert area */
#alertArea {
	position: fixed;
	top: 72px;
	right: 1.25rem;
	z-index: 1060;
	width: 340px;
}

/* Impersonation banner */
.impersonation-banner {
	background: #fff3cd;
	border-bottom: 2px solid #ffc107;
	font-size: 0.9rem;
}

/* Card styling */
.card {
	border: none;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.modal-header {
	background-color: #f8f9fa;
}

/* Dashboard: stat cards */
.stat-card {
	border: none;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.stat-card .card-title {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6c757d;
	margin-bottom: 0.25rem;
}

.stat-card .stat-value {
	font-size: 1.8rem;
	font-weight: 700;
	color: #212529;
}

/* Dashboard: chart card */
.chart-card {
	border: none;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

/* Dashboard: section title */
.section-title {
	font-size: 1rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6c757d;
	margin-bottom: 1rem;
}

/* Dashboard: log table */
.table th {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6c757d;
	border-bottom-width: 1px;
}

.msg-body-cell {
	max-width: 260px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Dashboard: SMS preview */
.sms-preview-box {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 0.375rem;
	padding: 0.75rem 1rem;
	font-size: 0.9rem;
	white-space: pre-wrap;
	word-break: break-word;
	color: #495057;
}

/* Dashboard: read-only fields */
.readonly-label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6c757d;
	margin-bottom: 0.25rem;
}

.readonly-value {
	font-size: 0.95rem;
	color: #212529;
}

/* Toast container */
.toast-container {
	z-index: 1090;
}

@media (max-width: 575px) {
	.stat-value {
		font-size: 1.4rem;
	}
}

/* Placeholder text color */
.form-control::placeholder {
	color: #bbbbbb;
}

/* Help popover icon */
.help-popover {
	cursor: pointer;
	font-size: 1.1rem;
	color: #6c757d;
	user-select: none;
}
.help-popover:hover {
	color: #0d6efd;
}

/* Text Back History: conversation groups */
.history-row {
	cursor: pointer;
}

.msg-preview-text {
	display: block;
	font-weight: bold;
	max-width: 320px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.msg-preview-mobile {
	max-width: 200px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Expanded thread container */
.msg-thread {
	background: #f8f9fa;
	border-top: 1px solid #e9ecef;
}

.msg-item {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	padding: 0.5rem 1rem;
}

.msg-item + .msg-item {
	border-top: 1px solid #e9ecef;
}

.msg-outbound {
	background: #f0f5ff;
}

.msg-inbound {
	background: #e6eeff;
}

.msg-arrow {
	flex-shrink: 0;
	width: 1rem;
	text-align: center;
	font-size: 0.8rem;
	margin-top: 2px;
	color: #adb5bd;
}

.msg-outbound .msg-arrow {
	color: #6ea8fe;
}

.msg-inbound .msg-arrow {
	color: #6f42c1;
}

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

.msg-body {
	font-size: 0.95rem;
	color: #212529;
	word-break: break-word;
}

.msg-inbound .msg-body {
	font-weight: bold;
}

.msg-meta {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.2rem;
	flex-wrap: wrap;
}

.msg-time {
	font-size: 0.72rem;
	color: #888;
}

.msg-status-badge {
	font-size: 0.65rem;
}

/* ── Auth pages (login, forgot password, reset password) ─────────────────── */
body.auth-page {
	align-items: center;
	justify-content: center;
}

.login-card {
	width: 100%;
	max-width: 420px;
}

.login-logo {
	font-size: 1.6rem;
	font-weight: 700;
	color: #0d6efd;
	letter-spacing: -0.5px;
}

.login-logo span {
	color: #212529;
}

.auth-page .card {
	border: none;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}