/* Dashboard shell (my-dashboard.php) — sidebar, layout, subscription card */

body.dashboard-body {
	margin: 0;
	padding: 0;
	overflow: hidden;
}

.dashboard-navbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 60px;
	background: #ffffff;
	border-bottom: 1px solid #e9ecef;
	z-index: 1050;
	display: flex;
	align-items: left;
	justify-content: left;
}

.nav-container {
	display: flex;
	align-items: center;
	height: 100%;
	gap: 2px;
	max-width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.nav-container::-webkit-scrollbar {
	display: none;
}

/* Active state for nav buttons (btn-outline-primary) */
.nav-container button.active {
	background: var(--app-primary);
	color: #fff;
	border-color: var(--app-primary);
}

.nav-tab {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 16px;
	height: 100%;
	border: none;
	background: transparent;
	color: #6c757d;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
	min-width: fit-content;
	position: relative;
}

.nav-tab:hover {
	background: #f8f9fa;
	color: var(--app-primary);
}

.nav-tab.active {
	color: var(--app-primary);
	background: #f8f9fa;
}

.nav-tab.active::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--app-primary);
}

.nav-tab i {
	font-size: 14px;
}

.nav-tab span {
	font-size: 13px;
}

.dashboard-content {
	margin-top: 48px;
	height: calc(100vh - 48px);
	height: calc(100svh - 48px);
	width: 100%;
}

/* --- Dashboard with left sidebar (my-dashboard.php) --- */
.dashboard-with-sidebar .dashboard-content {
	margin-top: 0;
	height: 100%;
	flex: 1;
	min-width: 0;
	background: var(--sidebar-bg);
}

.dashboard-content.dashboard-content--with-fy {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.dashboard-fy-bar {
	flex-shrink: 0;
	z-index: 2;
	background-color: #ffffff;
}

.dashboard-iframe-wrap {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.dashboard-iframe-wrap iframe {
	flex: 1;
	min-height: 0;
	width: 100%;
	border: 0;
}

.dashboard-layout {
	display: flex;
	height: 100vh;
	height: 100svh;
	overflow: hidden;
}

.dashboard-sidebar {
	width: 260px;
	min-width: 260px;
	min-height: 0;
	background: var(--sidebar-bg, #0f1f1f);
	border-right: 1px solid rgba(36, 59, 58, 0.14);
	display: flex;
	flex-direction: column;
	transition: width 0.2s ease, min-width 0.2s ease;
	flex-shrink: 0;
	z-index: 1050;
	font-family: "DM Sans", sans-serif;
}

.dashboard-sidebar.collapsed {
	width: 52px;
	min-width: 52px;
}

.dashboard-sidebar.collapsed .sidebar-brand,
.dashboard-sidebar.collapsed .nav-label {
	opacity: 0;
	width: 0;
	overflow: hidden;
	white-space: nowrap;
	padding: 0;
	margin: 0;
}

.dashboard-sidebar.collapsed .sidebar-brand-wrap .sidebar-brand {
	display: none;
}

/* Collapsed header: stack logo and toggle vertically so they don’t merge */
.dashboard-sidebar.collapsed .sidebar-header {
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	padding: 12px 8px;
	min-height: 0;
}

.dashboard-sidebar.collapsed .sidebar-brand-wrap {
	justify-content: center;
	width: 100%;
}

.dashboard-sidebar.collapsed .sidebar-logo-mark {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	font-size: 11px;
}

.dashboard-sidebar.collapsed .sidebar-toggle {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	min-width: 36px;
	min-height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-size: 12px;
}

.sidebar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border-bottom: 1px solid rgba(36, 59, 58, 0.14);
	min-height: 60px;
}

.sidebar-logo-mark {
	width: 32px;
	height: 32px;
	border-radius: var(--radius, 8px);
	background: var(--accent);
	color: var(--sidebar-bg);
	font-size: 12px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	letter-spacing: -0.02em;
}

.sidebar-header-logo {
	width: 32px;
	height: 32px;
	object-fit: contain;
	border-radius: 4px;
	flex-shrink: 0;
}

.sidebar-brand-wrap {
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
}

.sidebar-brand {
	font-size: 15px;
	font-weight: 600;
	color: var(--sidebar-text);
	white-space: nowrap;
	transition: opacity 0.2s ease;
}

.sidebar-toggle {
	color: var(--sidebar-text);
	background: rgba(36, 59, 58, 0.08);
	border: 1px solid rgba(36, 59, 58, 0.18);
	padding: 6px 10px;
	border-radius: var(--radius, 8px);
	cursor: pointer;
	transition: color 0.15s, background 0.15s;
}

.sidebar-toggle:hover {
	color: var(--text-dark);
	background: rgba(36, 59, 58, 0.14);
}

.sidebar-user {
	flex-shrink: 0;
	padding: 12px;
}

.sidebar-user-card {
	background: rgba(36, 59, 58, 0.04);
	border: 1px solid rgba(36, 59, 58, 0.14);
	border-radius: var(--radius, 12px);
	padding: 12px;
}

.sidebar-welcome {
	font-size: 14px;
	font-weight: 600;
	color: var(--sidebar-text);
}

.sidebar-subscription {
	font-size: 13px;
	color: var(--sidebar-text);
}

.subscription-pill {
	font-size: 11px;
	min-height: 22px;
	background: rgba(36, 59, 58, 0.1);
	border-radius: 999px;
	padding: 4px 10px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.subscription-pill-success { color: #7dd3a8; }
.subscription-pill-warning { color: #f0c14b; }
.subscription-pill-danger { color: #f28b82; }
.subscription-pill .nav-label { color: inherit; }

/* Track: grey full width. Fill is right-aligned so as days_left drops, green shrinks from the left toward the right edge. */
.subscription-progress-bar {
	display: flex;
	flex-direction: row;
	justify-content: flex-end;
	align-items: stretch;
	width: 100%;
	height: 4px;
	min-width: 0;
	box-sizing: border-box;
	background: rgba(36, 59, 58, 0.15);
	border-radius: 999px;
	overflow: hidden;
	flex-shrink: 0;
}

.subscription-progress-fill {
	flex: 0 0 auto;
	max-width: 100%;
	height: 100%;
	min-width: 0;
	border-radius: 999px;
	transition: width 0.25s ease;
	transform-origin: right center;
}

.subscription-pill-success,
.subscription-progress-fill-success { color: #1d7f5f; }
.subscription-pill-warning,
.subscription-progress-fill-warning { color: #9a6700; }
.subscription-pill-danger,
.subscription-progress-fill-danger { color: #b42318; }

.subscription-progress-fill-success { background: #22a06b; }
.subscription-progress-fill-warning { background: #d97706; }
.subscription-progress-fill-danger { background: #dc2626; }

.subscription-progress-wrap {
	display: flex;
	flex-direction: column;
	gap: 6px;
	direction: ltr;
	width: 100%;
	min-width: 0;
}

.subscription-progress-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-size: 11px;
}

.subscription-progress-label {
	color: var(--sidebar-text);
	opacity: 0.85;
	font-weight: 600;
}

.subscription-progress-value {
	color: var(--text-dark);
	font-weight: 700;
}

.subscription-days {
	color: var(--sidebar-text);
	font-weight: 600;
}

.subscription-warning-icon {
	color: #f0c14b;
	font-size: 12px;
	line-height: 1;
	display: inline-block;
}

.sidebar-user-card .btn-outline-danger {
	background: rgba(220, 53, 69, 0.2);
	border-color: rgba(220, 53, 69, 0.4);
	color: #f28b82;
}

.sidebar-user-card .btn-outline-danger:hover {
	background: rgba(220, 53, 69, 0.35);
	border-color: rgba(220, 53, 69, 0.5);
	color: #fff;
}

.sidebar-logout-link {
	color: #b42318;
}

.sidebar-logout-link:hover,
.sidebar-logout-link:focus-visible {
	color: #912018;
	background: rgba(220, 53, 69, 0.12);
}

/* Collapsed: hide subscription duration and pill entirely */
.dashboard-sidebar.collapsed .subscription-pill .nav-label,
.dashboard-sidebar.collapsed .subscription-days {
	display: none !important;
}

.dashboard-sidebar.collapsed .subscription-pill-wrap {
	display: none !important;
	height: 0;
	min-height: 0;
	padding: 0;
	margin: 0;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
}

.dashboard-sidebar.collapsed .subscription-pill {
	display: none !important;
}

/* Collapsed: hide text in user card, keep only icon buttons */
.dashboard-sidebar.collapsed .sidebar-user .sidebar-welcome,
.dashboard-sidebar.collapsed .sidebar-user .sidebar-subscription,
.dashboard-sidebar.collapsed .sidebar-user .nav-label,
.dashboard-sidebar.collapsed .sidebar-user-card .sidebar-welcome,
.dashboard-sidebar.collapsed .sidebar-user-card .subscription-pill-wrap,
.dashboard-sidebar.collapsed .sidebar-user-card .subscription-progress-wrap,
.dashboard-sidebar.collapsed .sidebar-user-card .btn .nav-label {
	opacity: 0;
	width: 0;
	overflow: hidden;
	white-space: nowrap;
	padding: 0;
	margin: 0;
	display: none !important;
}

/* Collapsed: user block clearly separated from header (no merging with logo/toggle) */
.dashboard-sidebar.collapsed .sidebar-user {
	padding: 10px 8px;
	margin-top: 4px;
	display: flex;
	justify-content: center;
	align-items: center;
	border-top: 1px solid rgba(36, 59, 58, 0.2);
	flex-shrink: 0;
}

.dashboard-sidebar.collapsed .sidebar-user-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 8px;
	width: 100%;
	min-height: 0;
}

.dashboard-sidebar.collapsed .sidebar-user .btn,
.dashboard-sidebar.collapsed .sidebar-user-card .btn {
	padding: 8px;
	min-width: 36px;
	width: 36px;
	justify-content: center;
	align-items: center;
}

.dashboard-sidebar.collapsed .sidebar-user .btn .nav-label,
.dashboard-sidebar.collapsed .sidebar-user-card .btn .nav-label {
	display: none !important;
}

.dashboard-sidebar.collapsed .sidebar-user-card .btn i {
	margin: 0 !important;
}

.sidebar-nav {
	display: flex;
	flex-direction: column;
	padding: 0;
	gap: 0;
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

.sidebar-nav-scroll {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	overscroll-behavior: contain;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding: 4px 0 6px;
}

.sidebar-nav-scroll::-webkit-scrollbar {
	display: none;
}

.sidebar-nav-group-label {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--sidebar-text);
	opacity: 0.7;
	padding: 10px 16px 4px;
	margin: 0 8px;
	text-transform: uppercase;
}

.sidebar-nav-divider {
	height: 1px;
	background: rgba(36, 59, 58, 0.14);
	margin: 6px 12px;
	flex-shrink: 0;
}

/* Nav row visuals: assets/css/sidebar-unified.css (.osinv-nav-link + .sidebar-nav-item hook for JS) */

.dashboard-sidebar.collapsed .sidebar-nav-group-label {
	opacity: 0;
	width: 0;
	overflow: hidden;
	padding: 0;
	margin: 0;
}

.dashboard-sidebar.collapsed .sidebar-nav-divider {
	margin: 6px 8px;
}

.nav-label {
	white-space: nowrap;
	transition: opacity 0.2s ease;
}

@media (max-width: 768px) {
	.dashboard-sidebar {
		width: 52px;
		min-width: 52px;
	}

	.dashboard-sidebar .sidebar-brand,
	.dashboard-sidebar .nav-label {
		opacity: 0;
		width: 0;
		overflow: hidden;
		white-space: nowrap;
		padding: 0;
		margin: 0;
	}

	.dashboard-sidebar .sidebar-header {
		justify-content: center;
		padding-left: 0;
		padding-right: 0;
	}

	.dashboard-sidebar .osinv-nav-group-summary {
		justify-content: center;
		padding-left: 0.15rem;
		padding-right: 0.15rem;
	}

	.dashboard-sidebar .osinv-nav-group-chevron {
		display: none !important;
	}

	.dashboard-sidebar .osinv-nav-group-links {
		padding-left: 0;
	}

	.dashboard-sidebar .osinv-nav-link {
		justify-content: center;
		padding-left: 0;
		padding-right: 0;
		margin: 0 6px;
	}
}

/* Mobile optimizations */
@media (max-width: 768px) {
	.dashboard-navbar {
		height: 44px;
	}

	.dashboard-content {
		margin-top: 44px;
		height: calc(100vh - 44px);
		height: calc(100svh - 44px);
	}

	.nav-tab {
		padding: 6px 12px;
		font-size: 12px;
		gap: 4px;
	}

	.nav-tab i {
		font-size: 13px;
	}

	.nav-tab span {
		font-size: 12px;
	}
}

@media (max-width: 575.98px) {
	.nav-tab span {
		display: none;
	}

	.nav-tab {
		padding: 8px 16px;
		min-width: 48px;
	}

	.nav-tab i {
		font-size: 16px;
	}
}