/* assets/css/main.css — CSS Variables, Reset & Layout Dasar */

/* =============================================================================
   CSS VARIABLES
   ============================================================================= */

:root {
	/* Palet warna tema pernikahan */
	--color-primary: #b85f7f; /* dusty rose utama */
	--color-primary-light: #d99ab0;
	--color-primary-dark: #8f415d;
	--color-primary-soft: #f8e2ea;
	--color-accent: #d4af7a; /* emas muda */
	--color-accent-soft: #f3e6d3;
	--color-bg: #fcf6f4; /* krem-blush lembut */
	--color-surface: #fffdfb;
	--color-border: #ead9da;
	--color-text: #3b2925;
	--color-text-muted: #6f5752; /* tetap kontras di atas cream/blush */
	--color-success: #4caf50;
	--color-warning: #ff9800;
	--color-danger: #e53935;
	--color-info: #1e88e5;

	/* Spacing */
	--sp-xs: 4px;
	--sp-sm: 8px;
	--sp-md: 16px;
	--sp-lg: 24px;
	--sp-xl: 32px;
	--sp-2xl: 48px;

	/* Border Radius */
	--radius-sm: 4px;
	--radius-md: 8px;
	--radius-lg: 16px;

	/* Shadows */
	--shadow-sm: 0 8px 24px rgba(110, 73, 67, 0.08);
	--shadow-md: 0 14px 32px rgba(110, 73, 67, 0.12);
	--shadow-lg: 0 22px 48px rgba(92, 58, 62, 0.16);

	/* Typography */
	--font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
	--font-size-sm: 13px;
	--font-size-base: 15px;
	--font-size-lg: 18px;
	--font-size-xl: 22px;
	--font-size-2xl: 28px;

	/* Sidebar width */
	--sidebar-width: 240px;

	/* Transitions */
	--transition-fast: 150ms ease;
	--transition-base: 250ms ease;
}

/* =============================================================================
   RESET & BASE
   ============================================================================= */

*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	scroll-behavior: smooth;
}

body {
	font-family: var(--font-sans);
	font-size: var(--font-size-base);
	background:
		radial-gradient(
			circle at top left,
			rgba(217, 154, 176, 0.18),
			transparent 32%
		),
		radial-gradient(
			circle at top right,
			rgba(212, 175, 122, 0.12),
			transparent 26%
		),
		linear-gradient(180deg, #fffdfa 0%, var(--color-bg) 100%);
	color: var(--color-text);
	line-height: 1.6;
	min-height: 100vh;
}

a {
	color: var(--color-primary);
	text-decoration: none;
	transition: color var(--transition-fast);
}

a:hover {
	color: var(--color-primary-dark);
}

img {
	max-width: 100%;
	display: block;
}

ul,
ol {
	list-style: none;
}

button {
	cursor: pointer;
	font-family: inherit;
	font-size: inherit;
}

input,
select,
textarea {
	font-family: inherit;
	font-size: inherit;
}

/* =============================================================================
   APP LAYOUT
   ============================================================================= */

.app-shell {
	display: grid;
	grid-template-columns: var(--sidebar-width) 1fr;
	min-height: 100vh;
}

/* --- SIDEBAR --- */

.sidebar {
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 22%),
		linear-gradient(
			165deg,
			#6f3449 0%,
			var(--color-primary-dark) 38%,
			var(--color-primary) 100%
		);
	color: #fff;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
}

.sidebar-brand {
	padding: var(--sp-lg) var(--sp-md);
	font-size: var(--font-size-lg);
	font-weight: 700;
	border-bottom: 1px solid rgba(255, 255, 255, 0.16);
	letter-spacing: 0.02em;
	background: linear-gradient(
		90deg,
		rgba(255, 255, 255, 0.12),
		transparent 75%
	);
}

.sidebar nav {
	padding: var(--sp-md) 0;
	flex: 1;
}

.sidebar-footer {
	padding: var(--sp-md);
	border-top: 1px solid rgba(255, 255, 255, 0.16);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-sm);
	font-size: var(--font-size-sm);
}

.sidebar-footer #user-name {
	opacity: 0.85;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* --- MAIN CONTENT --- */

.main-content {
	padding: var(--sp-xl);
	overflow-y: auto;
	background: transparent;
}

/* Anchor for page-loader-overlay */
#page-content {
	position: relative;
}

/* --- PAGE HEADER --- */

.page-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--sp-xl);
	gap: var(--sp-md);
	flex-wrap: wrap;
}

.page-header h1 {
	font-size: var(--font-size-xl);
	font-weight: 700;
	color: var(--color-primary-dark);
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

/* Hamburger toggle (hidden on desktop) */
.hamburger {
	display: none;
	background: none;
	border: none;
	font-size: 22px;
	color: var(--color-primary-dark);
	padding: var(--sp-sm);
	line-height: 1;
}

/* Mobile overlay backdrop */
.sidebar-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 99;
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--transition-base);
}

.sidebar-overlay.visible {
	opacity: 1;
	pointer-events: all;
}

@media (max-width: 768px) {
	.app-shell {
		grid-template-columns: 1fr;
	}

	.sidebar {
		position: fixed;
		top: 0;
		left: 0;
		width: var(--sidebar-width);
		z-index: 100;
		transform: translateX(-100%);
		visibility: hidden;
		transition:
			transform var(--transition-base),
			visibility var(--transition-base);
	}

	.sidebar.open {
		transform: translateX(0);
		visibility: visible;
	}

	.hamburger {
		display: inline-flex;
	}

	.main-content {
		padding: var(--sp-md);
	}

	.page-header {
		margin-bottom: var(--sp-lg);
	}

	.page-header h1 {
		font-size: var(--font-size-lg);
	}
}

/* =============================================================================
   UTILITY
   ============================================================================= */

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.text-muted {
	color: var(--color-text-muted);
}
.text-success {
	color: var(--color-success);
}
.text-warning {
	color: var(--color-warning);
}
.text-danger {
	color: var(--color-danger);
}
.text-right {
	text-align: right;
}
.text-center {
	text-align: center;
}

.mt-sm {
	margin-top: var(--sp-sm);
}
.mt-md {
	margin-top: var(--sp-md);
}
.mt-lg {
	margin-top: var(--sp-lg);
}
.mb-md {
	margin-bottom: var(--sp-md);
}
.mb-lg {
	margin-bottom: var(--sp-lg);
}

.flex {
	display: flex;
}
.flex-center {
	display: flex;
	align-items: center;
	justify-content: center;
}
.flex-between {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.gap-sm {
	gap: var(--sp-sm);
}
.gap-md {
	gap: var(--sp-md);
}
