/* Helpdesk BP3IP — mobile-first.
   Palet maritim: navy laut dalam, teal dinas, amber pelampung untuk aksi. */
:root {
  --ink: #122c40;
  --ink-soft: #43596b;
  --sea: #0e5e6f;
  --sea-deep: #0a4552;
  --sea-mist: #e8f1f2;
  --buoy: #e8930c;
  --buoy-soft: #fdf1dc;
  --paper: #f7f8f6;
  --card: #ffffff;
  --line: #dde4e6;
  --danger: #b3382c;
  --danger-soft: #fbeae8;
  --ok: #2e7d4f;
  --ok-soft: #e6f2ea;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(18, 44, 64, .08);
  font-size: 16px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sea); }
h1, h2, h3 { line-height: 1.25; font-weight: 700; }

/* ---------------------------------------------------------------- kerangka */
.topbar {
  background: var(--sea-deep);
  color: #fff;
  padding: .65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.topbar .brand { font-weight: 800; letter-spacing: .02em; color: #fff; text-decoration: none; }
.topbar .brand small { display: block; font-weight: 500; font-size: .68rem; opacity: .75; letter-spacing: .06em; }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.topbar nav a {
  color: #dbe9ec; text-decoration: none; padding: .35rem .7rem;
  border-radius: 999px; font-size: .85rem; font-weight: 600;
}
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.topbar form { margin: 0; }
.topbar button.linklike {
  background: none; border: none; color: #dbe9ec; font: inherit;
  font-size: .85rem; font-weight: 600; cursor: pointer; padding: .35rem .7rem;
}

.wave { height: 6px; background:
  repeating-linear-gradient(-45deg, var(--buoy) 0 14px, var(--sea) 14px 28px); }

.container { max-width: 880px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.container.narrow { max-width: 560px; }

/* ---------------------------------------------------------------- kartu & form */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem; margin-bottom: 1rem;
}
.card h2 { margin-top: 0; }

label { display: block; font-weight: 700; font-size: .88rem; margin: 1rem 0 .3rem; }
.helptext, .hint { font-size: .8rem; color: var(--ink-soft); }
input[type=text], input[type=password], input[type=number], input[type=email],
select, textarea {
  width: 100%; padding: .7rem .8rem; font: inherit; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: #fff;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 3px solid rgba(14, 94, 111, .3); border-color: var(--sea);
}
input[type=file] { font-size: .85rem; }
.errorlist { color: var(--danger); font-size: .85rem; margin: .25rem 0 0; padding-left: 1.1rem; }

.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 700; border-radius: var(--radius);
  padding: .75rem 1.4rem; text-align: center;
}
.btn-primary { background: var(--buoy); color: #3a2503; }
.btn-primary:hover { background: #d6860a; }
.btn-sea { background: var(--sea); color: #fff; }
.btn-sea:hover { background: var(--sea-deep); }
.btn-ghost { background: transparent; color: var(--sea); border: 1.5px solid var(--sea); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border: 1.5px solid var(--danger); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: .4rem .9rem; font-size: .85rem; }

/* pilihan prioritas sebagai kartu radio */
.priority-set { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.priority-set label {
  margin: 0; border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: .6rem .4rem; text-align: center; cursor: pointer; font-size: .85rem;
  background: #fff;
}
.priority-set input { position: absolute; opacity: 0; }
.priority-set label:has(input:checked) {
  border-color: var(--sea); background: var(--sea-mist); color: var(--sea-deep);
}
.priority-set label:has(input:focus-visible) { outline: 3px solid rgba(14,94,111,.3); }

/* ---------------------------------------------------------------- autocomplete */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1.5px solid var(--sea); border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(18,44,64,.15); max-height: 260px; overflow: auto;
  margin: 0; padding: .25rem; list-style: none;
}
.ac-list li { padding: .55rem .7rem; border-radius: 6px; cursor: pointer; }
.ac-list li:hover, .ac-list li[aria-selected=true] { background: var(--sea-mist); }
.ac-list li .u { display: block; font-size: .78rem; color: var(--ink-soft); }
.ac-empty { padding: .55rem .7rem; color: var(--ink-soft); font-size: .85rem; }
.ac-chosen {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  background: var(--ok-soft); border: 1.5px solid var(--ok); color: var(--ok);
  border-radius: var(--radius); padding: .55rem .8rem; font-weight: 600;
}
.ac-chosen button { background: none; border: none; color: inherit; font-weight: 700; cursor: pointer; }

/* ---------------------------------------------------------------- tiket */
.ticket-stub {
  border: 2px dashed var(--sea); background: var(--sea-mist);
  border-radius: var(--radius); text-align: center; padding: 1rem;
}
.ticket-stub .no { font-size: 1.6rem; font-weight: 800; letter-spacing: .04em; color: var(--sea-deep); }

.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  padding: .15rem .6rem; border-radius: 999px; white-space: nowrap;
}
.badge.st-open { background: var(--buoy-soft); color: #8a5a06; }
.badge.st-on_process { background: #e3edf8; color: #1d5a96; }
.badge.st-pending { background: #efe8f8; color: #6b3fa0; }
.badge.st-resolved { background: var(--ok-soft); color: var(--ok); }
.badge.st-closed { background: #e9ecee; color: #5b6770; }
.badge.pr-normal { background: #e9ecee; color: #5b6770; }
.badge.pr-mendesak { background: var(--buoy-soft); color: #8a5a06; }
.badge.pr-urgent { background: var(--danger-soft); color: var(--danger); }
.badge.overdue { background: var(--danger); color: #fff; }

.ticket-row {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem 1rem; margin-bottom: .6rem; box-shadow: var(--shadow);
}
.ticket-row:hover { border-color: var(--sea); }
.ticket-row .top { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; align-items: center; }
.ticket-row .no { font-weight: 800; color: var(--sea-deep); }
.ticket-row .desc { margin: .25rem 0; font-size: .92rem; }
.ticket-row .meta { font-size: .78rem; color: var(--ink-soft); display: flex; gap: .8rem; flex-wrap: wrap; }

.tabs { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .75rem; }
.tabs a {
  white-space: nowrap; text-decoration: none; font-size: .85rem; font-weight: 700;
  padding: .4rem .8rem; border-radius: 999px; border: 1.5px solid var(--line);
  color: var(--ink-soft); background: #fff;
}
.tabs a.active { background: var(--sea); border-color: var(--sea); color: #fff; }
.tabs .count { opacity: .75; font-weight: 600; }

/* linimasa riwayat */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--line); margin-left: .4rem; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: .3rem; width: 12px; height: 12px;
  border-radius: 50%; background: var(--sea); border: 2px solid #fff;
}
.timeline li:last-child { border-color: transparent; }
.timeline .when { font-size: .75rem; color: var(--ink-soft); }
.timeline .what { font-weight: 700; font-size: .9rem; }
.timeline .note { font-size: .85rem; }

/* rating bintang */
.stars { display: flex; gap: .35rem; justify-content: center; margin: .5rem 0; }
.stars input { position: absolute; opacity: 0; }
.stars label { font-size: 1.9rem; margin: 0; cursor: pointer; color: #c9d2d6; }
.stars label.on { color: var(--buoy); }

/* ---------------------------------------------------------------- dashboard */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem 1rem; box-shadow: var(--shadow);
}
.stat .v { font-size: 1.7rem; font-weight: 800; color: var(--sea-deep); line-height: 1.1; }
.stat .k { font-size: .78rem; color: var(--ink-soft); font-weight: 600; }

table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th, table.data td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
table.data th { font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.table-scroll { overflow-x: auto; }

.alert { border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: .75rem; font-size: .9rem; font-weight: 600; }
.alert.success { background: var(--ok-soft); color: var(--ok); }
.alert.error, .alert.warning { background: var(--danger-soft); color: var(--danger); }

.detail-grid dt { font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; margin-top: .8rem; }
.detail-grid dd { margin: 0; }

details.action { border: 1.5px solid var(--line); border-radius: var(--radius); margin-bottom: .6rem; background: #fff; }
details.action summary { cursor: pointer; font-weight: 700; padding: .7rem 1rem; }
details.action .inner { padding: 0 1rem 1rem; }

@media (min-width: 700px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; align-items: start; }
}
@media (prefers-reduced-motion: no-preference) {
  .ticket-row, .btn { transition: background .15s ease, border-color .15s ease; }
}
