/* =====================================================================
   SIDADU - Sistem Informasi Pendataan Terpadu
   Tema Komersial : Kombinasi Biru & Hijau
   ===================================================================== */

:root {
	--sd-blue-900: #07275c;
	--sd-blue-800: #0b3b7f;
	--sd-blue-700: #0f4c9e;
	--sd-blue-600: #1565d8;
	--sd-blue-500: #2e86e8;
	--sd-blue-100: #e7f0fd;

	--sd-green-700: #0a7f45;
	--sd-green-600: #0fa958;
	--sd-green-500: #22b573;
	--sd-green-100: #e4f7ed;

	--sd-gradient: linear-gradient(135deg, #0b3b7f 0%, #0f4c9e 45%, #0fa958 100%);
	--sd-gradient-green: linear-gradient(135deg, #0fa958 0%, #22b573 100%);
	--sd-gradient-blue: linear-gradient(135deg, #0b3b7f 0%, #1565d8 100%);

	--sd-body: #eef3f9;
	--sd-text: #1e2a3a;
	--sd-muted: #6b7c93;
	--sd-border: #e3eaf3;

	--sd-radius: 16px;
	--sd-radius-sm: 10px;
	--sd-shadow: 0 8px 26px rgba(11, 59, 127, .08);
	--sd-shadow-lg: 0 18px 50px rgba(7, 39, 92, .18);

	--sd-sidebar-w: 264px;
}

* { -webkit-font-smoothing: antialiased; }

body {
	background: var(--sd-body);
	color: var(--sd-text);
	font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: .90rem;
}

a { text-decoration: none; }

/* ---------------------------------------------------------------
   Scrollbar
   --------------------------------------------------------------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c4d3e6; border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: #9fb6d2; }

/* ---------------------------------------------------------------
   BRAND
   --------------------------------------------------------------- */
.sd-brand {
	display: flex;
	align-items: center;
	gap: .7rem;
}

.sd-brand-logo {
	width: 44px;
	height: 44px;
	border-radius: 13px;
	background: var(--sd-gradient-green);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 1.35rem;
	box-shadow: 0 6px 16px rgba(15, 169, 88, .35);
	flex: 0 0 auto;
}

.sd-brand-text { line-height: 1.1; }
.sd-brand-text strong { display: block; font-size: 1.15rem; letter-spacing: .6px; font-weight: 800; }
.sd-brand-text span { font-size: .74rem; opacity: .88; letter-spacing: .4px; }

/* ---------------------------------------------------------------
   LOGIN / REGISTER (Halaman Depan)
   --------------------------------------------------------------- */
.sd-auth {
	min-height: 100vh;
	background: var(--sd-body);
	display: flex;
}

.sd-auth-visual {
	flex: 1 1 46%;
	background: var(--sd-gradient);
	position: relative;
	overflow: hidden;
	color: #fff;
	padding: 3.2rem 3rem;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.sd-auth-visual::before,
.sd-auth-visual::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, .07);
}
.sd-auth-visual::before { width: 460px; height: 460px; right: -160px; top: -140px; }
.sd-auth-visual::after { width: 320px; height: 320px; left: -120px; bottom: -120px; }

.sd-auth-visual > * { position: relative; z-index: 2; }

.sd-auth-title { font-size: 2.1rem; font-weight: 800; line-height: 1.25; margin-bottom: .9rem; }
.sd-auth-sub { opacity: .9; font-size: .95rem; max-width: 460px; }

.sd-auth-feature {
	display: flex;
	gap: .8rem;
	align-items: flex-start;
	margin-top: 1.1rem;
}

.sd-auth-feature i {
	width: 38px; height: 38px;
	border-radius: 11px;
	background: rgba(255, 255, 255, .16);
	display: flex; align-items: center; justify-content: center;
	font-size: 1.05rem;
	flex: 0 0 auto;
}

.sd-auth-feature div strong { display: block; font-size: .90rem; }
.sd-auth-feature div small { opacity: .82; font-size: .78rem; }

.sd-auth-form {
	flex: 1 1 54%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2.5rem 1.5rem;
}

.sd-auth-card {
	width: 100%;
	max-width: 470px;
	background: #fff;
	border-radius: 22px;
	box-shadow: var(--sd-shadow-lg);
	padding: 2.2rem 2.1rem;
}

.sd-auth-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.4rem; }
.sd-auth-brand .sd-brand-logo { width: 50px; height: 50px; font-size: 1.5rem; }
.sd-auth-brand h5 { margin: 0; font-weight: 800; color: var(--sd-blue-800); font-size: 1.15rem; }
.sd-auth-brand small { color: var(--sd-muted); font-size: .74rem; }

.sd-tabs {
	display: flex;
	background: var(--sd-blue-100);
	border-radius: 12px;
	padding: 5px;
	margin-bottom: 1.5rem;
}

.sd-tabs a {
	flex: 1;
	text-align: center;
	padding: .6rem .5rem;
	border-radius: 9px;
	color: var(--sd-blue-700);
	font-weight: 600;
	font-size: .86rem;
	transition: .2s;
}

.sd-tabs a.active {
	background: #fff;
	color: var(--sd-blue-800);
	box-shadow: 0 3px 10px rgba(11, 59, 127, .12);
}

.sd-hero-badge {
	display: inline-flex; align-items: center; gap: .45rem;
	background: rgba(255, 255, 255, .16);
	padding: .35rem .85rem;
	border-radius: 50px;
	font-size: .74rem;
	font-weight: 600;
	letter-spacing: .4px;
	margin-bottom: 1.4rem;
	width: fit-content;
}

@media (max-width: 991.98px) {
	.sd-auth-visual { display: none; }
}

/* ---------------------------------------------------------------
   LAYOUT PANEL
   --------------------------------------------------------------- */
.sd-sidebar {
	position: fixed;
	top: 0; left: 0; bottom: 0;
	width: var(--sd-sidebar-w);
	background: var(--sd-gradient);
	color: #fff;
	z-index: 1040;
	display: flex;
	flex-direction: column;
	box-shadow: 4px 0 24px rgba(7, 39, 92, .16);
	transition: transform .28s ease;
}

.sd-sidebar-head {
	padding: 1.25rem 1.15rem;
	border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.sd-sidebar-head .sd-brand-text strong { color: #fff; font-size: .98rem; }

.sd-sidebar-user {
	margin: 1rem 1.15rem 0;
	padding: .8rem;
	border-radius: 14px;
	background: rgba(255, 255, 255, .10);
	display: flex;
	align-items: center;
	gap: .7rem;
}

.sd-avatar {
	width: 40px; height: 40px;
	border-radius: 12px;
	object-fit: cover;
	border: 2px solid rgba(255, 255, 255, .55);
	background: #fff;
	flex: 0 0 auto;
}

.sd-sidebar-user strong { display: block; font-size: .85rem; }
.sd-sidebar-user small { font-size: .70rem; opacity: .8; }

.sd-nav {
	flex: 1;
	overflow-y: auto;
	padding: 1.1rem .85rem 1.5rem;
}

.sd-nav-label {
	font-size: .66rem;
	text-transform: uppercase;
	letter-spacing: 1.1px;
	opacity: .55;
	margin: 1rem .6rem .5rem;
	font-weight: 700;
}

.sd-nav a {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .68rem .8rem;
	border-radius: 11px;
	color: rgba(255, 255, 255, .86);
	font-weight: 500;
	font-size: .87rem;
	margin-bottom: .18rem;
	transition: .18s;
}

.sd-nav a i { font-size: 1.05rem; width: 22px; text-align: center; }

.sd-nav a:hover { background: rgba(255, 255, 255, .13); color: #fff; }

.sd-nav a.active {
	background: rgba(255, 255, 255, .20);
	color: #fff;
	font-weight: 650;
	box-shadow: inset 3px 0 0 #7ef0b3;
}

.sd-nav a .badge { margin-left: auto; }

.sd-sidebar-foot {
	padding: 1rem 1.15rem;
	border-top: 1px solid rgba(255, 255, 255, .12);
	font-size: .72rem;
	opacity: .75;
}

/* Main */
.sd-main {
	margin-left: var(--sd-sidebar-w);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.sd-topbar {
	background: #fff;
	height: 68px;
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0 1.5rem;
	border-bottom: 1px solid var(--sd-border);
	position: sticky;
	top: 0;
	z-index: 1030;
}

.sd-topbar h5 { margin: 0; font-weight: 750; color: var(--sd-blue-800); font-size: 1.02rem; }
.sd-topbar .sd-crumb { font-size: .74rem; color: var(--sd-muted); }

.sd-icon-btn {
	width: 42px; height: 42px;
	border-radius: 12px;
	border: 1px solid var(--sd-border);
	background: #fff;
	color: var(--sd-blue-700);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.05rem;
	position: relative;
	transition: .18s;
}

.sd-icon-btn:hover { background: var(--sd-blue-100); border-color: #cfe0f7; }

.sd-bell-dot {
	position: absolute;
	top: -6px; right: -6px;
	min-width: 20px; height: 20px;
	border-radius: 50px;
	background: #ef4444;
	color: #fff;
	font-size: .66rem;
	font-weight: 700;
	display: flex; align-items: center; justify-content: center;
	padding: 0 5px;
	box-shadow: 0 0 0 3px #fff;
	animation: sdPulse 1.8s infinite;
}

@keyframes sdPulse {
	0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); }
	70%  { box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); }
	100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.sd-content { padding: 1.5rem; flex: 1; }

.sd-footer { padding: 1rem 1.5rem; color: var(--sd-muted); font-size: .76rem; }

/* Sidebar toggle (mobile) */
.sd-burger { display: none; }
@media (max-width: 991.98px) {
	.sd-sidebar { transform: translateX(-100%); }
	.sd-sidebar.show { transform: translateX(0); }
	.sd-main { margin-left: 0; }
	.sd-burger { display: inline-flex; }
	.sd-backdrop {
		position: fixed; inset: 0; background: rgba(7, 39, 92, .45);
		z-index: 1035; display: none;
	}
	.sd-backdrop.show { display: block; }
}

/* ---------------------------------------------------------------
   CARD
   --------------------------------------------------------------- */
.sd-card {
	background: #fff;
	border: 1px solid var(--sd-border);
	border-radius: var(--sd-radius);
	box-shadow: var(--sd-shadow);
	overflow: hidden;
}

.sd-card-head {
	padding: 1.05rem 1.25rem;
	border-bottom: 1px solid var(--sd-border);
	display: flex;
	align-items: center;
	gap: .75rem;
	flex-wrap: wrap;
}

.sd-card-head h6 { margin: 0; font-weight: 750; color: var(--sd-blue-800); font-size: .95rem; }
.sd-card-head small { color: var(--sd-muted); font-size: .75rem; }
.sd-card-body { padding: 1.25rem; }

.sd-page-title { font-weight: 800; color: var(--sd-blue-800); font-size: 1.35rem; margin-bottom: .15rem; }
.sd-page-sub { color: var(--sd-muted); font-size: .82rem; }

/* ---------------------------------------------------------------
   STAT CARD
   --------------------------------------------------------------- */
.sd-stat {
	position: relative;
	background: #fff;
	border: 1px solid var(--sd-border);
	border-radius: var(--sd-radius);
	box-shadow: var(--sd-shadow);
	padding: 1.15rem 1.25rem;
	overflow: hidden;
	height: 100%;
}

.sd-stat::after {
	content: "";
	position: absolute;
	right: -28px; top: -28px;
	width: 110px; height: 110px;
	border-radius: 50%;
	background: var(--sd-blue-100);
	opacity: .75;
}

.sd-stat.green::after { background: var(--sd-green-100); }
.sd-stat.amber::after { background: #fdf3e2; }
.sd-stat.red::after { background: #fdeaea; }

.sd-stat-icon {
	width: 48px; height: 48px;
	border-radius: 14px;
	display: flex; align-items: center; justify-content: center;
	font-size: 1.35rem;
	color: #fff;
	background: var(--sd-gradient-blue);
	position: relative;
	z-index: 2;
	margin-bottom: .85rem;
}

.sd-stat.green .sd-stat-icon { background: var(--sd-gradient-green); }
.sd-stat.amber .sd-stat-icon { background: linear-gradient(135deg, #d97706, #f59e0b); }
.sd-stat.red .sd-stat-icon { background: linear-gradient(135deg, #b91c1c, #ef4444); }

.sd-stat-label {
	font-size: .74rem;
	text-transform: uppercase;
	letter-spacing: .8px;
	color: var(--sd-muted);
	font-weight: 700;
	position: relative;
	z-index: 2;
}

.sd-stat-value {
	font-size: 1.85rem;
	font-weight: 800;
	color: var(--sd-blue-800);
	line-height: 1.1;
	position: relative;
	z-index: 2;
	font-variant-numeric: tabular-nums;
}

.sd-stat-value.small { font-size: 1.35rem; }
.sd-stat-desc { font-size: .75rem; color: var(--sd-muted); position: relative; z-index: 2; }

/* ---------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------- */
.btn { font-size: .85rem; font-weight: 600; border-radius: 10px; }

.btn-sd {
	background: var(--sd-gradient-blue);
	color: #fff;
	border: none;
	padding: .55rem 1.05rem;
	box-shadow: 0 6px 16px rgba(21, 101, 216, .28);
}
.btn-sd:hover { color: #fff; filter: brightness(1.07); }

.btn-sd-green {
	background: var(--sd-gradient-green);
	color: #fff;
	border: none;
	padding: .55rem 1.05rem;
	box-shadow: 0 6px 16px rgba(15, 169, 88, .28);
}
.btn-sd-green:hover { color: #fff; filter: brightness(1.07); }

.btn-sd-red {
	background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
	color: #fff;
	border: none;
	padding: .55rem 1.05rem;
	box-shadow: 0 6px 16px rgba(220, 38, 38, .28);
}
.btn-sd-red:hover { color: #fff; filter: brightness(1.07); }

.btn-sd-soft {
	background: var(--sd-blue-100);
	color: var(--sd-blue-700);
	border: 1px solid #d6e5fa;
}
.btn-sd-soft:hover { background: #d9e8fb; color: var(--sd-blue-800); }

/* ---------------------------------------------------------------
   FORM
   --------------------------------------------------------------- */
.form-label { font-size: .78rem; font-weight: 700; color: #40566f; margin-bottom: .32rem; }
.form-label .req { color: #ef4444; }

.form-control, .form-select {
	border-radius: 10px;
	border: 1px solid #d9e3ef;
	padding: .55rem .8rem;
	font-size: .86rem;
	background-color: #fbfdff;
}

.form-control:focus, .form-select:focus {
	border-color: var(--sd-blue-500);
	box-shadow: 0 0 0 .18rem rgba(46, 134, 232, .16);
	background-color: #fff;
}

.input-group-text {
	background: var(--sd-blue-100);
	border: 1px solid #d9e3ef;
	color: var(--sd-blue-700);
	border-radius: 10px;
	font-size: .85rem;
}

.sd-search .form-control { padding-left: 2.3rem; }
.sd-search { position: relative; }
.sd-search > i {
	position: absolute;
	left: .8rem; top: 50%;
	transform: translateY(-50%);
	color: var(--sd-muted);
	font-size: .95rem;
	z-index: 5;
}

.form-check-input:checked { background-color: var(--sd-green-600); border-color: var(--sd-green-600); }

/* ---------------------------------------------------------------
   TABLE
   --------------------------------------------------------------- */
.table-sd { margin: 0; }
.table-sd thead th {
	background: #f4f8fd;
	color: var(--sd-blue-800);
	font-size: .73rem;
	text-transform: uppercase;
	letter-spacing: .6px;
	font-weight: 800;
	border-bottom: 1px solid var(--sd-border);
	padding: .78rem .9rem;
	white-space: nowrap;
}
.table-sd tbody td {
	padding: .72rem .9rem;
	border-bottom: 1px solid #eef3f9;
	vertical-align: middle;
	font-size: .85rem;
}
.table-sd tbody tr:hover { background: #f8fbff; }
.table-sd tbody tr:last-child td { border-bottom: none; }

.sd-avatar-sm {
	width: 38px; height: 38px;
	border-radius: 11px;
	object-fit: cover;
	border: 1px solid var(--sd-border);
	background: #fff;
}

.sd-avatar-lg {
	width: 108px; height: 108px;
	border-radius: 18px;
	object-fit: cover;
	border: 3px solid #fff;
	box-shadow: var(--sd-shadow);
	background: #fff;
}

/* Badge */
.badge-soft { font-size: .72rem; font-weight: 700; padding: .38rem .65rem; border-radius: 8px; }
.badge-soft-green  { background: var(--sd-green-100); color: var(--sd-green-700); }
.badge-soft-blue   { background: var(--sd-blue-100);  color: var(--sd-blue-700); }
.badge-soft-amber  { background: #fdf3e2; color: #b45309; }
.badge-soft-red    { background: #fdeaea; color: #b91c1c; }
.badge-soft-gray   { background: #eef2f7; color: #64748b; }

/* Action buttons */
.sd-action { display: inline-flex; gap: .3rem; }
.sd-action .btn {
	width: 33px; height: 33px;
	padding: 0;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 9px;
	font-size: .85rem;
}

/* Empty state */
.sd-empty { text-align: center; padding: 3rem 1rem; color: var(--sd-muted); }
.sd-empty i { font-size: 3rem; opacity: .35; display: block; margin-bottom: .7rem; }

/* Modal */
.modal-content { border: none; border-radius: var(--sd-radius); overflow: hidden; }
.modal-header {
	background: var(--sd-gradient-blue);
	color: #fff;
	border: none;
	padding: 1rem 1.25rem;
}
.modal-header .btn-close { filter: invert(1) grayscale(1) brightness(2); opacity: .85; }
.modal-title { font-size: .98rem; font-weight: 700; }
.modal-body { padding: 1.25rem; }

/* Detail list */
.sd-detail { display: grid; grid-template-columns: 150px 1fr; gap: .35rem 1rem; font-size: .87rem; }
.sd-detail dt { color: var(--sd-muted); font-weight: 600; }
.sd-detail dd { margin: 0; font-weight: 600; color: var(--sd-text); }

.sd-file-thumb {
	width: 100%;
	height: 128px;
	object-fit: cover;
	border-radius: 12px;
	border: 1px solid var(--sd-border);
	background: #f7fafd;
	cursor: pointer;
	transition: .2s;
}
.sd-file-thumb:hover { transform: translateY(-2px); box-shadow: var(--sd-shadow); }

.sd-file-box { text-align: center; }
.sd-file-box small { display: block; margin-top: .35rem; font-size: .72rem; color: var(--sd-muted); font-weight: 600; }

/* Notification */
.sd-notif-item {
	display: flex;
	gap: .8rem;
	padding: .85rem 1rem;
	border-bottom: 1px solid #eef3f9;
	cursor: pointer;
	transition: .15s;
}
.sd-notif-item:hover { background: #f8fbff; }
.sd-notif-item.unread { background: #f2f9ff; }
.sd-notif-ico {
	width: 38px; height: 38px;
	border-radius: 11px;
	background: var(--sd-blue-100);
	color: var(--sd-blue-700);
	display: flex; align-items: center; justify-content: center;
	font-size: 1rem;
	flex: 0 0 auto;
}
.sd-notif-item.unread .sd-notif-ico { background: var(--sd-gradient-green); color: #fff; }
.sd-notif-item strong { font-size: .84rem; display: block; font-weight: 650; }
.sd-notif-item small { font-size: .72rem; color: var(--sd-muted); }

.sd-notif-panel {
	width: 380px;
	max-height: 460px;
	overflow-y: auto;
	padding: 0;
	border-radius: 14px;
	border: 1px solid var(--sd-border);
	box-shadow: var(--sd-shadow-lg);
}

/* Chart wrapper */
.sd-chart-wrap { position: relative; width: 100%; }
.sd-chart-h260 { height: 260px; }
.sd-chart-h300 { height: 300px; }

.dropdown-menu { border: 1px solid var(--sd-border); border-radius: 12px; box-shadow: var(--sd-shadow); font-size: .86rem; }
.dropdown-item { padding: .5rem .9rem; }
.dropdown-item:active { background: var(--sd-blue-600); }

/* Utilities */
.text-sd-blue { color: var(--sd-blue-700) !important; }
.text-sd-green { color: var(--sd-green-600) !important; }
.bg-sd-gradient { background: var(--sd-gradient) !important; }
.fs-7 { font-size: .80rem !important; }
.fs-8 { font-size: .74rem !important; }
.fw-650 { font-weight: 650 !important; }

.sd-divider { height: 1px; background: var(--sd-border); margin: 1.1rem 0; }

@media print {
	.sd-sidebar, .sd-topbar, .sd-footer, .no-print { display: none !important; }
	.sd-main { margin-left: 0; }
}
