/* =====================================================================
   AduanIT@JKSTR - tema halaman pengguna (dibina oleh Unit ICT JKSTR)
   Dimuatkan SELEPAS css asal osTicket. Semua warna, font, bucu dan
   bayang datang dari token dalam tema.css (data-tema / data-font pada
   <html>). Jangan tulis warna hex terus di sini.
   ===================================================================== */

/* ---------- Asas ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-b);
  font-size: 15px;
  line-height: 1.55;
}
h1, h2, h3, h4 {
  font-family: var(--font-d);
  font-weight: var(--d-weight);
  letter-spacing: var(--d-track);
  color: var(--fg);
  line-height: 1.25;
}
a { color: var(--accent); }
a:hover { color: var(--fg); }
img { max-width: 100%; height: auto; }
/* Penanda fokus: --highlight (oren) tidak cukup kontras atas putih, guna --accent */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.jk-kepala :focus-visible, .jk-hero :focus-visible { outline-color: var(--accent-fg); }
.jk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* osTicket asal mengehadkan lebar 840px - buang */
#container { width: auto; max-width: none; margin: 0; padding: 0; background: transparent; box-shadow: none; }
#content { width: auto; min-height: 0; }
#content.jk-utama-penuh { margin: 0; padding: 0; }

/* Neutralkan peraturan lama theme.css yang bertembung */
#header.jk-kepala { height: auto; padding: 0; position: static; }
#clientLogin { margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none; }

/* ---------- Kepala ---------- */
.jk-jalur { height: 6px; background: var(--highlight); }
.jk-kepala { background: var(--accent); color: var(--accent-fg); }
.jk-kepala-dalam {
  max-width: 1080px; margin: 0 auto; padding: 14px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
}
.jk-jenama { display: flex; align-items: center; gap: 12px; color: var(--accent-fg); text-decoration: none; flex: 1 1 260px; min-width: 0; }
.jk-jenama:hover { color: var(--accent-fg); }
.jk-tanda {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 999px;
  background: var(--surface); color: var(--accent);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.jk-tanda img { max-width: 40px; max-height: 40px; }
.jk-jenama-teks { display: flex; flex-direction: column; min-width: 0; }
.jk-jenama-teks small { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jk-jenama-teks strong { font-family: var(--font-d); font-size: 19px; font-weight: 600; }

.jk-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.jk-nav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius-sm); color: var(--accent-fg); text-decoration: none; font-size: 15px;
  border: 1px solid transparent;
}
.jk-nav a:hover { border-color: currentColor; color: var(--accent-fg); }
.jk-nav a.active { background: var(--surface); color: var(--accent); font-weight: 600; }
.jk-nav a.jk-nav-masuk { border-color: var(--accent-fg); }
.jk-akaun { font-size: 13px; opacity: .9; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.jk-akaun a { color: var(--accent-fg); }

/* ---------- Kandungan ---------- */
.jk-utama, #content.jk-utama { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; box-sizing: border-box; }
.jk-kad {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px;
}
.jk-kad + .jk-kad { margin-top: 16px; }
.jk-tajuk-halaman { margin: 0 0 6px; font-size: 24px; }
.jk-subtajuk { margin: 0 0 20px; color: var(--muted); }

/* Mesej sistem osTicket */
#msg_error, #msg_notice, #msg_warning, .error_bar, .warning_bar, .notice_bar {
  margin: 0 0 16px; padding: 14px 16px 14px 44px; border-radius: var(--radius-sm);
  font-size: 15px; position: relative; background-image: none;
}
.jk-utama-penuh > #msg_error, .jk-utama-penuh > #msg_notice, .jk-utama-penuh > #msg_warning {
  max-width: 1048px; margin: 16px auto; box-sizing: border-box;
}
#msg_error, .error_bar { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
#msg_notice, .notice_bar { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); }
#msg_warning, .warning_bar { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
#msg_error::before, #msg_notice::before, #msg_warning::before,
.error_bar::before, .warning_bar::before, .notice_bar::before {
  font-family: FontAwesome; position: absolute; left: 16px; top: 14px; font-size: 18px;
}
#msg_error::before, .error_bar::before { content: "\f071"; }
#msg_notice::before, .notice_bar::before { content: "\f058"; }
#msg_warning::before, .warning_bar::before { content: "\f06a"; }
.error, font.error, span.error { color: var(--bad); }

/* ---------- Butang ---------- */
.jk-btn, .button, a.button, input[type="submit"], input[type="button"], input[type="reset"], button.btn, input.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius-sm);
  font-family: var(--font-b); font-size: 16px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; text-shadow: none; box-shadow: none;
  background: var(--accent); color: var(--accent-fg); border: 2px solid var(--accent);
  -webkit-appearance: none; appearance: none;
}
.jk-btn:hover, .button:hover, input[type="submit"]:hover, input[type="button"]:hover, input.btn:hover {
  background: var(--fg); border-color: var(--fg); color: var(--accent-fg);
}
/* theme.css lama ada "#ticketForm div input { background:#fff }" (spesifisiti ID) -
   butang dalam borang perlu pemilih ID juga supaya teks tidak hilang */
#ticketForm input[type="submit"], #clientLogin input[type="submit"] {
  background: var(--accent); color: var(--accent-fg); border: 2px solid var(--accent); width: auto;
}
#ticketForm input[type="submit"]:hover, #clientLogin input[type="submit"]:hover {
  background: var(--fg); border-color: var(--fg); color: var(--accent-fg);
}
/* theme.css: ".error { color:#f00 }" boleh mewarnakan teks butang merah selepas ralat pengesahan */
#ticketForm input[type="submit"], #ticketForm input[type="submit"]:hover, #ticketForm input[type="submit"]:focus,
#ticketForm input[type="submit"]:active, #clientLogin input[type="submit"], .error input[type="submit"] {
  color: var(--accent-fg) !important;
}
#ticketForm p.buttons { margin-top: 20px; }
#ticketForm input[type="reset"], #ticketForm input[type="button"] { width: auto; }
.jk-btn-garis, input[type="reset"], input[type="button"][name="cancel"] {
  background: var(--surface); color: var(--accent); border-color: var(--line);
}
.jk-btn-garis:hover, input[type="reset"]:hover, input[type="button"][name="cancel"]:hover {
  background: var(--accent-soft); color: var(--accent); border-color: var(--accent);
}
.jk-btn-besar { min-height: 56px; font-size: 17px; border-radius: var(--radius); width: 100%; }

/* ---------- Medan borang ---------- */
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
  box-sizing: border-box; max-width: 100%;
  font-family: var(--font-b); font-size: 16px; color: var(--fg);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 14px; min-height: 48px; box-shadow: none;
}
textarea { min-height: 120px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); outline-offset: 0; }
label { font-weight: 500; }
em, .hint { color: var(--muted); }

/* Borang aduan & semak status: jadual osTicket dijadikan susunan menegak */
#ticketForm table, #ticketForm tbody, #ticketForm tr, #ticketForm td,
#clientLogin table, #clientLogin tbody, #clientLogin tr, #clientLogin td { display: block; width: 100% !important; box-sizing: border-box; }
#ticketForm td { padding: 0 !important; }
#ticketForm tr { margin-bottom: 18px; }
#ticketForm hr { display: none; }
#ticketForm label { display: block; font-size: 15px; }
#ticketForm label br { display: none; }
#ticketForm label > span { display: block; margin-bottom: 6px; }
#ticketForm label em { display: block !important; font-weight: 400; font-size: 14px; margin: -2px 0 6px; }
#ticketForm input[type="text"], #ticketForm input[type="email"], #ticketForm input[type="tel"],
#ticketForm select, #ticketForm textarea { width: 100% !important; }
#ticketForm input[type="tel"] { max-width: 280px; }
/* theme.css: "#ticketForm div select {float:left}" - medan terapung tidak dikira dalam tinggi
   baris, jadi label/tajuk seterusnya bertindih rapat. Pemilih sama spesifisiti, dimuat kemudian. */
#ticketForm div select, #ticketForm div input, #ticketForm div textarea { float: none; }
#ticketForm div select { display: block; }
#ticketForm .form-header { margin: 8px 0 4px !important; }
#ticketForm .form-header h3 { margin: 12px 0 0; font-size: 18px; }
#ticketForm .form-header div { color: var(--muted); font-size: 14px; }
/* clear: elemen terapung dalam borang osTicket boleh menolak butang ke tepi (flex = BFC) */
#ticketForm .buttons, p.buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-start !important; margin: 8px 0 0; clear: both; width: 100%; box-sizing: border-box; }

/* Penyunting teks (Redactor) dan muat naik fail */
.redactor-box, .redactor_box { border: 1.5px solid var(--line) !important; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.redactor-toolbar, .redactor_toolbar { background: var(--surface-2) !important; box-shadow: none !important; border-bottom: 1px solid var(--line); }
.redactor-editor, .redactor_editor { min-height: 140px; font-family: var(--font-b) !important; font-size: 16px !important; color: var(--fg); }
.filedrop .dropzone {
  border: 2px dashed var(--line) !important; border-radius: var(--radius-sm) !important;
  background: var(--surface-2) !important; color: var(--muted); padding: 18px !important; text-align: center;
}
.filedrop .dropzone a { color: var(--accent); font-weight: 600; }

/* Pilihan kategori (help topic) sebagai kad */
.jk-topik { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; }
.jk-topik legend { font-family: var(--font-d); font-weight: 600; font-size: 18px; margin-bottom: 4px; padding: 0; }
.jk-topik-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.jk-topik-pilih { position: relative; display: block; }
/* Radio tersembunyi mesti mengisi seluruh kad (input tidak meregang dengan inset sahaja) */
.jk-topik-pilih input { position: absolute; opacity: 0; top: 0; left: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.jk-topik-pilih span {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  font-weight: 500; font-size: 15px; cursor: pointer;
}
/* "#ticketForm label > span {display:block}" turut kena kad kategori - pulihkan flex & jarak ikon */
#ticketForm .jk-topik-pilih > span { display: flex; align-items: center; gap: 14px; margin-bottom: 0; }
.jk-topik-pilih span i { margin-right: 2px; }
.jk-topik-pilih span i { width: 36px; height: 36px; flex-shrink: 0; border-radius: 999px; background: var(--surface-2); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.jk-topik-pilih input:checked + span { border: 2px solid var(--accent); background: var(--accent-soft); font-weight: 600; }
.jk-topik-pilih input:checked + span i { background: var(--accent); color: var(--accent-fg); }
.jk-topik-pilih input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Halaman utama ---------- */
.jk-hero { background: var(--accent); color: var(--accent-fg); }
.jk-hero-dalam { max-width: 1080px; margin: 0 auto; padding: 8px 16px 88px; }
.jk-hero h1 { color: var(--accent-fg); font-size: clamp(24px, 4vw, 34px); margin: 8px 0 10px; max-width: 18em; }
.jk-hero p { margin: 0; max-width: 40em; font-size: 16px; opacity: .92; }
.jk-tindakan { max-width: 1080px; margin: -64px auto 0; padding: 0 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.jk-tindakan .jk-kad + .jk-kad { margin-top: 0; }
.jk-tindakan a.jk-kad { display: flex; gap: 16px; align-items: flex-start; text-decoration: none; color: var(--fg); transition: border-color .15s; }
.jk-tindakan a.jk-kad:hover { border-color: var(--accent); color: var(--fg); }
.jk-tindakan .jk-ikon { width: 56px; height: 56px; flex-shrink: 0; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.jk-tindakan .jk-utama-ikon .jk-ikon { background: var(--accent); color: var(--accent-fg); }
.jk-tindakan h2 { margin: 2px 0 4px; font-size: 20px; }
.jk-tindakan p { margin: 0; color: var(--muted); font-size: 15px; }
.jk-tindakan .jk-anak-panah { margin-left: auto; align-self: center; color: var(--accent); font-size: 20px; }

.jk-seksyen { margin-top: 36px; }
.jk-seksyen > h2 { font-size: 21px; margin: 0 0 14px; }
.jk-langkah { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: langkah; padding: 0; margin: 0; list-style: none; }
.jk-langkah li { counter-increment: langkah; display: flex; gap: 14px; }
.jk-langkah li::before {
  content: counter(langkah); width: 36px; height: 36px; flex-shrink: 0; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.jk-langkah strong { display: block; }
.jk-langkah span { color: var(--muted); font-size: 15px; }
.jk-cip { display: flex; flex-wrap: wrap; gap: 8px; }
.jk-cip a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); color: var(--fg); text-decoration: none; font-size: 15px; }
.jk-cip a:hover { border-color: var(--accent); color: var(--accent); }
.jk-nota-halaman { color: var(--muted); font-size: 15px; }
.jk-nota-halaman hr { display: none; }

/* Dua kad bersebelahan (log masuk) - bertindan di telefon */
.jk-tindakan-dua { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.jk-tindakan-dua .jk-kad + .jk-kad { margin-top: 0; }

/* ---------- Halaman terima kasih ---------- */
.jk-terima-kasih { max-width: 720px; }
.jk-no-tiket {
  display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; margin-bottom: 18px;
  background: var(--accent-soft); border: 1.5px solid var(--accent); border-radius: var(--radius-sm);
}
.jk-no-tiket span { font-size: 14px; color: var(--muted); }
.jk-no-tiket strong { font-family: var(--font-d); font-size: 32px; color: var(--accent); letter-spacing: .02em; }
.jk-no-tiket small { font-size: 14px; color: var(--fg); }

/* ---------- Senarai tiket / paparan tiket ---------- */
.jk-skrol { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list, #ticketTable { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.list th, #ticketTable th { background: var(--surface-2); color: var(--muted); font-weight: 500; text-align: left; padding: 10px 12px; border: 0; }
table.list td, #ticketTable td { padding: 10px 12px; border-top: 1px solid var(--line); }
#ticketInfo, .infoTable { width: 100% !important; }
#ticketInfo td, .infoTable td, .infoTable th { padding: 6px 8px; vertical-align: top; }
.thread-entry .header { background: var(--surface-2) !important; border-color: var(--line) !important; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.thread-entry.response .header { background: var(--accent-soft) !important; }
.thread-entry .thread-body { border-color: var(--line) !important; background: var(--surface) !important; }
.thread-body img { max-width: 100% !important; height: auto !important; }

/* Status pill */
.jk-pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.jk-pill-buka { background: var(--warn-soft); color: var(--warn); }
.jk-pill-tutup { background: var(--ok-soft); color: var(--ok); }

/* ---------- Kaki ---------- */
.jk-kaki { border-top: 1px solid var(--line); background: var(--surface); }
.jk-kaki-dalam { max-width: 1080px; margin: 0 auto; padding: 20px 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 14px; color: var(--muted); }
.jk-kaki-dalam p { margin: 0; }
#footer, #poweredBy { display: none; }

/* Lapisan "Sila tunggu" osTicket */
#loading { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); color: var(--fg); }

/* ---------- Telefon ---------- */
@media (max-width: 640px) {
  #content.jk-utama { padding-top: 16px; }
  .jk-kepala-dalam { padding: 12px 16px; }
  .jk-nav { width: 100%; }
  .jk-nav li { flex: 1 1 auto; }
  .jk-nav a { justify-content: center; width: 100%; box-sizing: border-box; padding: 0 10px; font-size: 14px; }
  .jk-akaun { width: 100%; }
  .jk-kad { padding: 18px 16px; }
  .jk-utama { padding-top: 16px; }
  .jk-tajuk-halaman { font-size: 22px; }
  .jk-topik-grid { grid-template-columns: 1fr; }
  #ticketForm .buttons input, p.buttons input { flex: 1 1 100%; }
  #ticketForm input[type="tel"] { max-width: 100%; }
}

@media print {
  .jk-jalur, .jk-kepala, .jk-kaki, .jk-tindakan { display: none; }
  .jk-kad { box-shadow: none; border: 0; }
}
