:root {
  --primary: #0d6e6e;
  --primary-dark: #095656;
  --primary-light: #e6f4f4;
  --accent: #d4a017;
  --gray-900: #1a2332;
  --gray-700: #3d4a5c;
  --gray-500: #6b7787;
  --gray-300: #d4dae1;
  --gray-100: #f4f6f8;
  --red: #c0392b;
  --green: #1e8e5a;
  --yellow: #b8860b;
  --blue: #2563a8;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20,30,50,0.08), 0 1px 2px rgba(20,30,50,0.06);
  --shadow-md: 0 4px 12px rgba(20,30,50,0.10);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 620px; margin: 0 auto; padding: 0 20px; }

/* ---------- Topbar ---------- */
.topbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 16px 0;
  box-shadow: var(--shadow);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-badge {
  width: 42px; height: 42px; border-radius: 10px; background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.brand-text .brand-title { font-weight: 700; font-size: 17px; letter-spacing: 0.5px; }
.brand-text .brand-sub { font-size: 12px; opacity: 0.85; }
.topbar-nav { display: flex; gap: 18px; align-items: center; font-size: 14px; }
.topbar-nav a { color: #fff; opacity: 0.9; }
.topbar-nav a:hover { opacity: 1; text-decoration: none; }
.pill { background: rgba(255,255,255,0.15); padding: 6px 14px; border-radius: 999px; font-size: 13px; }

/* ---------- Cards ---------- */
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 20px; border: 1px solid var(--gray-300);
}
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; color: var(--gray-900); }
.card-sub { color: var(--gray-500); font-size: 13.5px; margin: 0 0 18px; }

/* ---------- Landing (linktree style) ---------- */
.hero { text-align: center; padding: 48px 0 24px; }
.hero h1 { font-size: 26px; margin-bottom: 6px; color: var(--gray-900); }
.hero p { color: var(--gray-500); font-size: 14.5px; }
.link-list { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.link-btn {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--gray-300); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
  color: var(--gray-900);
}
.link-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.link-icon {
  width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0; color: #fff;
}
.link-btn .link-text strong { display: block; font-size: 15px; }
.link-btn .link-text span { font-size: 12.5px; color: var(--gray-500); }
.ic-form { background: var(--primary); }
.ic-status { background: var(--blue); }
.ic-ig { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.ic-tiktok { background: #010101; }
.ic-web { background: var(--accent); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: 13.5px; margin: 16px 0 6px; color: var(--gray-700); }
label.required::after { content: " *"; color: var(--red); }
input[type=text], input[type=tel], input[type=email], input[type=password],
input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--gray-300); border-radius: 8px;
  font-size: 14.5px; font-family: inherit; background: #fff; color: var(--gray-900);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 8px; font-size: 14.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-outline { background: #fff; border-color: var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a3291d; text-decoration: none; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-gray { background: #eceff2; color: var(--gray-700); }
.badge-blue { background: #e2ecf9; color: var(--blue); }
.badge-yellow { background: #fbf0d9; color: var(--yellow); }
.badge-green { background: #dff3e8; color: var(--green); }
.badge-red { background: #fbe2df; color: var(--red); }

/* ---------- Alerts ---------- */
.alert { padding: 13px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: #dff3e8; border-color: #b8e2ca; color: #1c6b47; }
.alert-error { background: #fbe2df; border-color: #f3bdb6; color: #9c2c1f; }
.alert-info { background: var(--primary-light); border-color: #bfe0e0; color: var(--primary-dark); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--gray-300); vertical-align: top; }
th { background: var(--gray-100); font-weight: 700; color: var(--gray-700); white-space: nowrap; }
tr:hover td { background: #fafcfd; }
.ticket-code { font-family: 'Consolas', monospace; font-weight: 700; color: var(--primary-dark); }

/* ---------- Layout: dashboard shell ---------- */
.dash-wrap { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; background: var(--gray-900); color: #fff; flex-shrink: 0;
  padding: 20px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand-side { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 12px; }
.sidebar .brand-side .brand-title { color: #fff; font-weight: 700; font-size: 16px; }
.sidebar .brand-side .brand-sub { color: rgba(255,255,255,0.6); font-size: 11.5px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: rgba(255,255,255,0.75);
  font-size: 13.8px; border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,0.08); border-left-color: var(--accent); color: #fff; font-weight: 600; }
.sidebar .nav-group-title {
  padding: 16px 20px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4); font-weight: 700;
}
.main-content { flex: 1; min-width: 0; }
.main-header {
  background: #fff; border-bottom: 1px solid var(--gray-300); padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5;
}
.main-header h1 { font-size: 19px; margin: 0; }
.main-body { padding: 24px 28px 60px; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -232px; z-index: 50; transition: left .2s; box-shadow: var(--shadow-md); }
  .sidebar.open { left: 0; }
  .main-content { width: 100%; }
  .main-header { padding: 14px 16px; }
  .main-body { padding: 16px; }
}

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stat-grid { grid-template-columns: 1fr; } }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--gray-300); }
.stat-card .stat-label { font-size: 12.5px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; margin: 6px 0 2px; color: var(--gray-900); }
.stat-card .stat-note { font-size: 12px; color: var(--gray-500); }

.chart-box { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--gray-300); margin-bottom: 20px; }

/* ---------- Filters bar ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.filter-bar .fgroup { display: flex; flex-direction: column; gap: 4px; }
.filter-bar label { margin: 0; font-size: 12px; }
.filter-bar select, .filter-bar input { padding: 8px 10px; font-size: 13.5px; }

/* ---------- Misc ---------- */
.text-muted { color: var(--gray-500); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.footer-note { text-align: center; color: var(--gray-500); font-size: 12.5px; padding: 30px 0; }
hr.sep { border: none; border-top: 1px solid var(--gray-300); margin: 20px 0; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--gray-500); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 22px; border-left: 2px solid var(--gray-300); position: relative; margin-left: 6px; }
.timeline li::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); position: absolute; left: -6px; top: 14px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline .tl-time { font-size: 12px; color: var(--gray-500); }

/* ---------- Rincian laporan per aduan (cetak) ---------- */
.report-detail-item {
  border: 1px solid var(--gray-300); border-radius: 8px;
  padding: 14px 16px; margin-top: 12px; page-break-inside: avoid; break-inside: avoid;
}

/* ---------- Print (Cetak Laporan) ---------- */
.print-header { display: none; }
@media print {
  @page { margin: 14mm 12mm; }
  html, body { background: #fff; }
  .sidebar, .main-header, .filter-bar, .no-print,
  .btn, .footer-note, form button, a.btn { display: none !important; }
  .main-content { width: 100% !important; }
  .main-body { padding: 0 !important; }
  .card { box-shadow: none !important; border: none !important; padding: 0 !important; margin-bottom: 14px !important; }
  .report-detail-item { border: 1px solid #999 !important; page-break-inside: avoid; break-inside: avoid; }
  .table-wrap { overflow: visible !important; }
  table { width: 100% !important; border-collapse: collapse !important; font-size: 11.5px; }
  th, td { border: 1px solid #999 !important; padding: 5px 7px !important; }
  .badge { border: 1px solid #999 !important; background: #fff !important; color: #000 !important; padding: 2px 6px !important; }
  .print-header {
    display: block !important; text-align: center; margin-bottom: 16px;
    border-bottom: 2px solid #000; padding-bottom: 10px;
  }
  .print-header .ph-rs { font-size: 15px; font-weight: 800; letter-spacing: 0.5px; }
  .print-header .ph-title { font-size: 13.5px; font-weight: 700; margin-top: 4px; text-transform: uppercase; }
  .print-header .ph-period { font-size: 12px; margin-top: 2px; color: #333; }
  .print-footer { display: block !important; margin-top: 24px; font-size: 11px; color: #333; }
}
.print-footer { display: none; }
