:root {
	--hd-sidebar: #14213d;
	--hd-sidebar-hover: #1f3160;
	--hd-accent: #2563eb;
	--hd-bg: #f4f6fb;
	--hd-border: #e5e8f0;
}

body {
	background: var(--hd-bg);
	font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	font-size: .925rem;
	color: #1f2937;
}

a { text-decoration: none; }

/* ---------- Layout ---------- */
.hd-sidebar {
	width: 250px;
	background: var(--hd-sidebar);
	min-height: 100vh;
	position: fixed;
	inset: 0 auto 0 0;
	z-index: 1040;
	display: flex;
	flex-direction: column;
	transition: transform .2s ease;
}
.hd-brand {
	padding: 1.25rem 1.25rem;
	color: #fff;
	font-weight: 700;
	font-size: 1.05rem;
	display: flex;
	align-items: center;
	gap: .6rem;
	border-bottom: 1px solid rgba(255,255,255,.08);
}
.hd-brand .logo {
	width: 34px; height: 34px;
	border-radius: 8px;
	background: var(--hd-accent);
	display: grid; place-items: center;
	font-size: 1.1rem;
}
.hd-nav { padding: 1rem .75rem; flex: 1; overflow-y: auto; }
.hd-nav .nav-section {
	color: rgba(255,255,255,.4);
	font-size: .7rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	padding: 1rem .75rem .4rem;
}
.hd-nav .nav-link {
	color: rgba(255,255,255,.75);
	border-radius: 8px;
	padding: .55rem .75rem;
	display: flex; align-items: center; gap: .65rem;
	margin-bottom: 2px;
}
.hd-nav .nav-link:hover { background: var(--hd-sidebar-hover); color: #fff; }
.hd-nav .nav-link.active { background: var(--hd-accent); color: #fff; }
.hd-nav .nav-link i { font-size: 1.05rem; }

.hd-main { margin-left: 250px; min-height: 100vh; display: flex; flex-direction: column; }
.hd-topbar {
	background: #fff;
	border-bottom: 1px solid var(--hd-border);
	padding: .75rem 1.5rem;
	display: flex; align-items: center; gap: 1rem;
	position: sticky; top: 0; z-index: 1030;
}
.hd-content { padding: 1.5rem; flex: 1; }
.hd-footer { padding: 1rem 1.5rem; color: #9ca3af; font-size: .8rem; }

.hd-backdrop { display: none; }

@media (max-width: 991.98px) {
	.hd-sidebar { transform: translateX(-100%); }
	.hd-sidebar.show { transform: none; }
	.hd-main { margin-left: 0; }
	.hd-backdrop.show {
		display: block; position: fixed; inset: 0;
		background: rgba(0,0,0,.4); z-index: 1035;
	}
	.hd-content { padding: 1rem; }
	.hd-topbar { padding: .75rem 1rem; }
}

/* ---------- Komponen ---------- */
.card { border: 1px solid var(--hd-border); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--hd-border); font-weight: 600; padding: .9rem 1.25rem; }
.card-header:first-child { border-radius: 12px 12px 0 0; }

.stat-card { padding: 1.1rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.stat-card .icon {
	width: 46px; height: 46px; border-radius: 10px;
	display: grid; place-items: center; font-size: 1.35rem;
}
.stat-card .value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-card .label { color: #6b7280; font-size: .8rem; margin-top: .25rem; }

.avatar {
	width: 36px; height: 36px; border-radius: 50%;
	display: inline-grid; place-items: center;
	font-weight: 600; font-size: .8rem; color: #fff;
	background: #64748b; flex-shrink: 0;
}
.avatar.staff { background: var(--hd-accent); }
.avatar.client { background: #0d9488; }
.avatar.sm { width: 28px; height: 28px; font-size: .7rem; }

.table > :not(caption) > * > * { padding: .75rem 1rem; }
.table thead th {
	font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
	color: #6b7280; font-weight: 600; background: #f9fafb; white-space: nowrap;
}
.table-hover tbody tr { cursor: pointer; }
.ticket-subject { font-weight: 600; color: #111827; }
.ticket-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; color: #6b7280; }

/* ---------- Thread tiket ---------- */
.thread-item { display: flex; gap: .9rem; margin-bottom: 1.25rem; }
.thread-bubble {
	flex: 1; min-width: 0;
	background: #fff; border: 1px solid var(--hd-border); border-radius: 12px;
}
.thread-bubble.from-staff { border-left: 3px solid var(--hd-accent); }
.thread-bubble.from-client { border-left: 3px solid #0d9488; }
.thread-bubble.internal { background: #fffbeb; border-color: #fde68a; border-left: 3px solid #f59e0b; }
.thread-head {
	padding: .65rem 1rem; border-bottom: 1px solid var(--hd-border);
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .85rem;
}
.thread-bubble.internal .thread-head { border-color: #fde68a; }
.thread-body { padding: 1rem; white-space: pre-wrap; word-wrap: break-word; line-height: 1.6; }
.thread-files { padding: 0 1rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.file-chip {
	display: inline-flex; align-items: center; gap: .4rem;
	border: 1px solid var(--hd-border); border-radius: 8px;
	padding: .35rem .65rem; font-size: .8rem; color: #374151; background: #f9fafb;
}
.file-chip:hover { border-color: var(--hd-accent); color: var(--hd-accent); }

.meta-list dt { font-size: .75rem; color: #6b7280; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.meta-list dd { margin-bottom: .9rem; }

.timeline { list-style: none; padding: 0; margin: 0; font-size: .82rem; }
.timeline li { position: relative; padding: 0 0 .9rem 1.1rem; border-left: 2px solid var(--hd-border); margin-left: .3rem; }
.timeline li::before {
	content: ''; position: absolute; left: -6px; top: 3px;
	width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1;
}
.timeline li:last-child { padding-bottom: 0; }

/* ---------- Login ---------- */
.auth-wrap {
	min-height: 100vh; display: grid; place-items: center; padding: 1rem;
	background: linear-gradient(135deg, #14213d 0%, #1e3a8a 100%);
}
.auth-card { width: 100%; max-width: 420px; border: 0; border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }

.form-label { font-weight: 500; font-size: .85rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #9ca3af; }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
