/* =========================================================
DAR-UL-SUFFAH — MASTER STYLESHEET
========================================================= */

:root {
	--primary: #4f46e5;
	--primary-dark: #4338ca;
	--secondary: #10b981;
	--sidebar-bg: #0a0a4a;
	--sidebar-text: #ffffff;
	--sidebar-hover: rgba(255, 255, 255, 0.1);

	--danger: #ef4444;
	--warning: #f59e0b;
	--info: #3b82f6;
	--dark: #111827;
	--gray: #6b7280;
	--light: #f3f4f6;
	--bg-body: #f5f7fb;
	--border: #e5e7eb;

	--sidebar-width: 260px;
	--topbar-height: 64px;
	--font: 'Poppins', sans-serif;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: var(--font);
	background: var(--bg-body);
	color: var(--dark);
	font-size: 13px;
	line-height: 1.5;
}

a {
	text-decoration: none;
	color: var(--primary);
}
a:hover {
	text-decoration: underline;
}

/* ── SIDEBAR ── */
.sidebar {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: var(--sidebar-width);
	background: var(--sidebar-bg) !important;
	color: var(--sidebar-text) !important;
	display: flex;
	flex-direction: column;
	z-index: 1000;
	box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}
.sb-brand {
	padding: 20px;
	background: rgba(0,0,0,0.15);
	display: flex;
	align-items: center;
	gap: 12px;
	border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sb-brand-logo {
	width: 36px;
	height: 36px;
	background: rgba(255,255,255,0.1);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	color: var(--sidebar-text);
}
.sb-brand-text {
	flex: 1;
	min-width: 0;
}
.sb-brand-name {
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.sb-brand-sub {
	font-size: 10px;
	opacity: 0.6;
	text-transform: uppercase;
	margin-top: 2px;
}

.sb-nav {
	flex: 1;
	overflow-y: auto;
	padding: 10px 0 20px;
}
.sb-section {
	padding: 14px 20px 6px;
	font-size: 10px;
	text-transform: uppercase;
	font-weight: 700;
	opacity: 0.5;
}

.sb-group {
	margin-bottom: 2px;
}
.sb-parent {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 20px;
	color: var(--sidebar-text);
	opacity: 0.8;
	background: transparent;
	border: none;
	border-left: 3px solid transparent;
	width: 100%;
	text-align: left;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	font-family: inherit;
	transition: all 0.15s;
}
.sb-parent:hover, .sb-parent.has-active {
	background: var(--sidebar-hover);
	opacity: 1;
	border-left-color: var(--primary);
}
.sb-caret {
	margin-left: auto;
	font-size: 10px;
	transition: transform 0.2s;
}
.sb-parent.open .sb-caret {
	transform: rotate(180deg);
}

.sb-children {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease;
	background: rgba(0,0,0,0.15);
}
.sb-sublink {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 20px 9px 50px;
	color: var(--sidebar-text);
	opacity: 0.7;
	font-size: 12.5px;
	border-left: 3px solid transparent;
	transition: all 0.15s;
}
.sb-sublink:hover, .sb-sublink.active {
	background: var(--sidebar-hover);
	opacity: 1;
	border-left-color: var(--primary);
}
.sb-link-external {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	opacity: 0.6;
	font-style: italic;
}
.sb-link-external:hover {
	background: var(--sidebar-hover);
	opacity: 1;
}

.sb-footer {
	padding: 15px 20px;
	border-top: 1px solid rgba(255,255,255,0.1);
	background: rgba(0,0,0,0.1);
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.sb-user {
	display: flex;
	align-items: center;
	gap: 10px;
}
.sb-user-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 12px;
}
.sb-user-name {
	font-size: 12px;
	font-weight: 600;
	color: var(--sidebar-text);
}
.sb-user-role {
	font-size: 10px;
	opacity: 0.7;
	color: var(--sidebar-text);
}
.sb-logout {
	color: var(--sidebar-text);
	opacity: 0.6;
	transition: 0.2s;
}
.sb-logout:hover {
	color: #ef4444 !important;
	opacity: 1;
}

/* ── TOPBAR ── */
.sa-header {
	position: fixed;
	top: 0;
	left: var(--sidebar-width);
	right: 0;
	height: var(--topbar-height);
	background: #fff;
	border-bottom: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 24px;
	z-index: 100;
}
.sa-switch {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #eef2ff;
	color: #4338ca;
	padding: 8px 14px;
	border-radius: 10px;
	border: 1px solid #e0e7ff;
	font-size: 13px;
	font-weight: 500;
}
.sa-switch select {
	border: none;
	background: transparent;
	font-family: inherit;
	font-size: 13px;
	color: inherit;
	font-weight: 600;
	outline: none;
	cursor: pointer;
	max-width: 250px;
}
.sa-user {
	display: flex;
	align-items: center;
	gap: 10px;
}
.sa-user-name {
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}
.sa-user-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 13px;
}
.sa-logout {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: #fee2e2;
	color: #991b1b;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	margin-left: 10px;
}

/* ── MAIN CONTENT ── */
.app-main {
	margin-left: var(--sidebar-width);
	margin-top: var(--topbar-height);
	padding: 24px;
	min-height: calc(100vh - var(--topbar-height));
}

/* ── KPI CARDS (Sharp Corners) ── */
.kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 22px;
}
.kpi {
	background: #fff;
	border-radius: 0 !important;
	padding: 18px 20px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.06);
	border-left: 4px solid var(--primary);
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.kpi-label {
	font-size: 11px;
	color: var(--gray);
	text-transform: uppercase;
	font-weight: 600;
	margin-bottom: 6px;
}
.kpi-value {
	font-size: 26px;
	font-weight: 700;
	color: var(--dark);
	line-height: 1.1;
}

/* ── CARDS & TABLES ── */
.card, .table-wrap {
	background: #fff;
	border-radius: 0 !important;
	box-shadow: 0 1px 3px rgba(0,0,0,0.06);
	margin-bottom: 20px;
	overflow: hidden;
}
.card-header {
	padding: 16px 20px;
	border-bottom: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.card-header h3 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	display: flex;
	gap: 8px;
	align-items: center;
}
.card-body {
	padding: 20px;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
th, td {
	padding: 11px 20px;
	text-align: left;
	border-bottom: 1px solid var(--border);
}
th {
	background: #f9fafb;
	font-weight: 600;
	color: var(--gray);
	font-size: 11px;
	text-transform: uppercase;
}
tr:hover td {
	background: #fafbfc;
}

/* ── FORMS ── */
.form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
.form-group {
	margin-bottom: 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
label {
	font-size: 11px;
	font-weight: 600;
	color: var(--gray);
	text-transform: uppercase;
}
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--border);
	border-radius: 0;
	font-size: 13px;
	font-family: inherit;
	background: #fff;
	color: var(--dark);
}
.input:focus, input:focus, select:focus, textarea:focus {
	outline: none;
	border-color: var(--primary);
}

/* ── BUTTONS ── */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 18px;
	border-radius: 0;
	font-size: 13px;
	font-weight: 500;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	font-family: inherit;
	transition: 0.15s;
}
.btn-primary {
	background: var(--primary);
	color: #fff;
}
.btn-primary:hover {
	opacity: 0.9;
}
.btn-outline {
	background: #fff;
	border-color: var(--border);
	color: var(--dark);
}
.btn-outline:hover {
	background: var(--light);
}
.btn-danger {
	background: var(--danger);
	color: #fff;
}
.btn-sm {
	padding: 6px 12px;
	font-size: 11.5px;
}

/* ── UTILITIES ── */
.flex {
	display: flex;
} .justify-between {
	justify-content: space-between;
} .items-center {
	align-items: center;
}
.gap-2 {
	gap: 8px;
} .gap-4 {
	gap: 16px;
}
.mt-2 {
	margin-top: 8px;
} .mt-4 {
	margin-top: 16px;
}
.mb-2 {
	margin-bottom: 8px;
} .mb-4 {
	margin-bottom: 16px;
}
.text-right {
	text-align: right;
} .text-center {
	text-align: center;
}
.text-muted {
	color: var(--gray);
} .text-sm {
	font-size: 12px;
}

/* ── MOBILE ── */
@media (max-width: 900px) {
	.sidebar {
		transform: translateX(-100%);
	transition: transform 0.3s;
	}
	.sidebar.open {
		transform: translateX(0);
	}
	.sa-header {
		display: none;
	}
	.app-main {
		margin-left: 0;
	margin-top: 0;
	padding: 14px;
	padding-bottom: 80px;
	}
	.sb-toggle {
		display: flex;
	position: fixed;
	top: 14px;
	left: 14px;
	z-index: 1100;
		width: 40px;
	height: 40px;
	background: var(--primary);
	color: #fff;
		border: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	}
	.mobile-topbar {
		display: flex;
	justify-content: space-between;
	align-items: center;
		position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 56px;
		background: #fff;
	padding: 0 16px;
	border-bottom: 1px solid var(--border);
	z-index: 100;
	}
}
@media (min-width: 901px) {
	.sb-toggle, .mobile-topbar {
		display: none !important;
	}
}
/* GLOBAL SHARP CORNERS */
.card, .btn, .input, .badge, .kpi, .alert, .sidebar, .sb-brand-logo, .sb-user-avatar, .sb-logout, .form-group input, .form-group select, .form-group textarea, .table-wrap table {
	border-radius: 0 !important;
}