/* ===== Dashboard V2 ===== */

/* Flatpickr size override for dashboard */
.flatpickr-calendar {
	font-size: 12px !important;
	width: 240px !important;
}

.flatpickr-months .flatpickr-month {
	height: 32px !important;
}

.flatpickr-current-month {
	font-size: 13px !important;
	padding-top: 6px !important;
}

.flatpickr-current-month select {
	font-size: 12px !important;
}

.flatpickr-weekdays {
	height: 26px !important;
}

.flatpickr-weekday {
	font-size: 11px !important;
}

span.flatpickr-day,
.flatpickr-day {
	font-size: 11px !important;
	height: 28px !important;
	line-height: 28px !important;
	max-width: 28px !important;
}

.flatpickr-days .dayContainer {
	min-width: 220px !important;
	max-width: 220px !important;
	width: 220px !important;
}

/* Page Title */
.dashboard-page-title {
	font-size: 18px;
	font-weight: 700;
	color: #14479B;
	padding: 14px 0 12px 0;
	letter-spacing: 0.5px;
	position: relative;
	display: inline-block;
}

.dashboard-page-title::after {
	content: '';
	position: absolute;
	bottom: 6px;
	left: 0;
	width: 40px;
	height: 3px;
	background: linear-gradient(90deg, #14479B, #3B82F6);
	border-radius: 2px;
}

/* Grid Layout: Row 1 = 3 cols, Row 2 = full width */
.dashboard-grid-v2 {
	display: grid;
	grid-template-columns: 2fr 1fr 2fr;
	grid-template-rows: 38vh 1fr;
	gap: 14px;
	height: calc(100vh - 100px);
	overflow: hidden;
}

/* Doanh thu — same width as ICD */
.revenue-card-full {
	grid-column: 1 / 3;
}

/* ICD chart — same span */
.icd-chart-card {
	grid-column: 1 / 3;
}


/* Card */
.dashboard-card {
	background: #fff;
	border: 1px solid #E8ECF1;
	border-radius: 12px;
	padding: 16px 18px;
	min-width: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.dashboard-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
	transform: translateY(-1px);
}

.card-header-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid #F1F5F9;
}

.card-title {
	font-size: 14px;
	font-weight: 700;
	color: #1E293B;
	letter-spacing: 0.2px;
}

.card-subtitle {
	font-size: 12px;
	color: #94A3B8;
}

/* Revenue Controls */
.revenue-controls {
	display: flex;
	align-items: center;
	gap: 8px;
}


.rev-toggle-btn {
	padding: 4px 10px;
	font-size: 12px;
	border: 1px solid #D1D5DB;
	background: #fff;
	color: #64748B;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
}

.rev-toggle-btn:hover {
	border-color: #14479B;
	color: #14479B;
}

.rev-toggle-btn.active {
	background: #14479B;
	border-color: #14479B;
	color: #fff;
	font-weight: 500;
}

.year-input {
	width: 80px;
	padding: 4px 8px;
	border: 1px solid #D1D5DB;
	border-radius: 6px;
	font-size: 13px;
	text-align: center;
	outline: none;
}

.year-input:focus {
	border-color: #14479B;
}

.btn-icon {
	background: none;
	border: 1px solid #D1D5DB;
	border-radius: 6px;
	padding: 4px 8px;
	cursor: pointer;
	color: #64748B;
	transition: all 0.2s;
}

.btn-icon:hover {
	border-color: #14479B;
	color: #14479B;
}

/* Chart */
.chart-legend {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #64748B;
	margin-bottom: 8px;
}

.legend-dot {
	width: 12px;
	height: 12px;
	border-radius: 3px;
	display: inline-block;
}

.legend-dot.revenue {
	background: #3B82F6;
}

.chart-wrapper {
	flex: 1;
	min-height: 0;
	position: relative;
}

/* ===== Appointment List V2 ===== */
.appointment-list-v2 {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	justify-content: space-evenly;
}

.apt-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid #F1F5F9;
}

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

.apt-time {
	font-size: 13px;
	font-weight: 600;
	color: #1E293B;
	min-width: 52px;
}

.apt-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}

.apt-dot.confirmed {
	background: #14479B;
}

.apt-dot.pending {
	background: #F59E0B;
}

.apt-info {
	flex: 1;
	font-size: 13px;
	color: #334155;
	min-width: 0;
	word-break: break-word;
}

.apt-status {
	font-size: 13px;
	color: #64748B;
	white-space: nowrap;
}

.apt-status.confirmed {
	color: #14479B;
}

.apt-status.pending {
	color: #F59E0B;
}

.apt-countdown {
	font-size: 11px;
	color: #94A3B8;
	margin-top: 2px;
}

/* ===== ICD List ===== */
.icd-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.icd-item {
	display: flex;
	align-items: center;
	gap: 12px;
}

.icd-bar-wrap {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.icd-label {
	font-size: 12px;
	color: #334155;
	font-weight: 500;
}

.icd-bar-bg {
	height: 8px;
	background: #F1F5F9;
	border-radius: 4px;
	overflow: hidden;
}

.icd-bar {
	height: 100%;
	border-radius: 4px;
	transition: width 0.6s ease;
}

.icd-count {
	font-size: 12px;
	color: #64748B;
	min-width: 90px;
	text-align: right;
	white-space: nowrap;
}

/* Color palette for ICD bars */
.icd-bar.c0 {
	background: #3B82F6;
}

.icd-bar.c1 {
	background: #10B981;
}

.icd-bar.c2 {
	background: #F59E0B;
}

.icd-bar.c3 {
	background: #EF4444;
}

.icd-bar.c4 {
	background: #8B5CF6;
}

/* ===== Donut Chart ===== */

.donut-legend {
	display: flex;
	flex-direction: row;
	gap: 16px;
	justify-content: center;
}

.donut-legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #334155;
}

.donut-legend-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}

.donut-legend-dot.examined {
	background: #10B981;
}

.donut-legend-dot.not-examined {
	background: #F59E0B;
}

.donut-legend-count {
	font-weight: 600;
	margin-left: auto;
}

/* ===== Footer ===== */
.footer-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 0;
	font-size: 12px;
	color: #94A3B8;
	border-top: 1px solid #E5E7EB;
}

.footer-bar .contact {
	display: flex;
	gap: 16px;
}

/* ===== Responsive ===== */

/* Tablet landscape — tighten spacing */
@media (max-width: 1200px) {
	.dashboard-grid-v2 {
		grid-template-columns: 2fr 1fr 2fr;
		gap: 12px;
	}

	.dashboard-card {
		padding: 12px;
	}

	.donut-wrapper {
		width: 120px;
		height: 120px;
	}
}

/* Tablet — single column */
@media (max-width: 992px) {
	.dashboard-grid-v2 {
		grid-template-columns: 1fr;
		height: auto;
	}

	.icd-chart-card {
		grid-column: 1;
	}

	.chart-wrapper {
		height: 250px;
		flex: none;
	}

	.appointment-list-v2 {
		max-height: 250px;
		flex: none;
	}
}

/* Small tablet */
@media (max-width: 768px) {
	.dashboard-page-title {
		font-size: 16px;
		padding: 14px 0 12px 0;
	}

	.dashboard-card {
		padding: 12px;
	}

	.card-title {
		font-size: 14px;
	}

	.donut-wrapper {
		width: 110px;
		height: 110px;
	}

	.footer-bar {
		flex-direction: column;
		gap: 8px;
		text-align: center;
	}
}

/* Mobile */
@media (max-width: 576px) {
	.dashboard-card {
		padding: 10px;
		border-radius: 8px;
	}

	.card-header-row {
		flex-direction: column;
		gap: 8px;
	}


	.donut-legend {
		flex-direction: row;
		gap: 16px;
	}
}

/* ===== Empty state ===== */
.empty-state {
	text-align: center;
	padding: 24px;
	color: #94A3B8;
	font-size: 13px;
}

.empty-state i {
	font-size: 28px;
	display: block;
	margin-bottom: 8px;
}

/* ===== Staff Online Card ===== */
.staff-online-list {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.staff-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 8px;
	transition: background 0.2s ease;
}

.staff-item:hover {
	background: #F8FAFC;
}

.staff-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: linear-gradient(135deg, #6366F1, #8B5CF6);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	letter-spacing: 0.5px;
}

.staff-avatar-img {
	object-fit: cover;
	background: #E0E7FF;
}

.staff-info {
	flex: 1;
	min-width: 0;
}

.staff-name {
	font-size: 13px;
	font-weight: 600;
	color: #1E293B;
	line-height: 1.3;
}

.staff-role {
	font-size: 11px;
	color: #94A3B8;
	line-height: 1.3;
}

.staff-status {
	display: flex;
	align-items: center;
	gap: 5px;
	flex-shrink: 0;
}

.status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.status-dot.online {
	background: #10B981;
	box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
	animation: pulse-green 2s infinite;
}

@keyframes pulse-green {

	0%,
	100% {
		box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
	}

	50% {
		box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.08);
	}
}

.status-dot.offline {
	background: #CBD5E1;
}

.status-text {
	font-size: 11px;
	white-space: nowrap;
}

.status-text.online {
	color: #10B981;
	font-weight: 600;
}

.status-text.offline {
	color: #B0B8C4;
}

.online-badge {
	font-size: 11px;
	font-weight: 600;
	color: #94A3B8;
	padding: 3px 12px;
	border-radius: 20px;
	background: #F1F5F9;
	letter-spacing: 0.3px;
}

.online-badge.has-online {
	color: #059669;
	background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
}