/* =====================================================================
   Sociomile Threads — dasar tampilan (dipakai semua halaman)
   Arah: meja kerja CS yang tenang dan rapi. Putih sebagai warna utama, hitam untuk aksi utama,
   biru = Komentar, ungu = Mention. Gradien hanya ada di logo.
   ===================================================================== */

@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("/assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("/assets/fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Warna (Bagian 17 brief) */
    --white: #FFFFFF;
    --bg-2: #F6F6F7;           /* latar sekunder: kolom daftar, hover, isi tabel */
    --bg-3: #EEEEF0;           /* hover di atas latar sekunder */
    --line: #E6E6E8;           /* garis 1px */
    --line-strong: #D6D6DA;
    --text: #1B1B1F;
    --muted: #6B6B73;
    --black: #000000;          /* tombol utama, menu aktif, angka penting */
    --purple: #884394;         /* aksen merek, Mention, fokus & tautan */
    --purple-soft: #F4ECF5;
    --blue: #4399D3;           /* Komentar, grafik seri kedua (jangan untuk teks kecil) */
    --blue-text: #2A73A8;      /* teks biru kecil, kontras 5,1:1 */
    --blue-soft: #EAF3FA;
    --green: #2E7D4F;
    --green-soft: #E9F4EE;
    --yellow: #B7791F;
    --yellow-soft: #FBF3E6;
    --red: #C0392B;
    --red-soft: #FBECEA;

    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --radius: 8px;             /* kontrol */
    --radius-lg: 12px;         /* panel */
    --shadow-float: 0 8px 28px rgba(27, 27, 31, .12), 0 1px 3px rgba(27, 27, 31, .08); /* hanya lapisan melayang */
    --focus: 0 0 0 3px rgba(136, 67, 148, .28);
}

/* ---------- Dasar ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--white);
    color: var(--text);
    font: 400 14px/1.5 var(--font);
    word-spacing: 0.04em;      /* spasi antarkata Plus Jakarta Sans sedikit dilonggarkan supaya mudah dibaca */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; color: var(--black); }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: var(--purple); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 100;
    padding: 8px 12px; border-radius: var(--radius);
    background: var(--black); color: var(--white); text-decoration: none;
}
.skip-link:focus { top: 12px; }

.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon {
    width: 18px; height: 18px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.small { font-size: 12px; }
.text-error { color: var(--red); }
.js .js-hide { display: none !important; }
.strong { font-weight: 600; }

/* ---------- Merek ---------- */

.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { height: 20px; width: auto; }
.brand-product { font-weight: 600; font-size: 15px; color: var(--black); letter-spacing: -0.01em; line-height: 1; }

/* ---------- Tombol ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 36px; padding: 0 14px;
    border: 1px solid transparent; border-radius: var(--radius);
    font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap;
    text-decoration: none; cursor: pointer;
    transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }

.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: #26262B; }
.btn-secondary { background: var(--white); border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-2); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-2); }
.btn-danger { background: var(--white); border-color: #E7B7B1; color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px; padding: 0;
    border: 0; border-radius: var(--radius);
    background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; }

.link-btn { border: 0; padding: 0; background: none; color: var(--purple); font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* Tombol Google mengikuti panduan merek Google (logo resmi di kiri, teks "Masuk dengan Google"). */
.btn-google { background: var(--white); border-color: var(--line-strong); color: var(--text); gap: 10px; }
.btn-google:hover { background: var(--bg-2); }
.btn-google img { width: 18px; height: 18px; }

/* ---------- Formulir ---------- */

.field { display: grid; gap: 6px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span:not(.field-hint):not(.field-error), .field-label { font-size: 13px; font-weight: 600; color: var(--text); }
.field-hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 12px; color: var(--red); }

.input, .select, .textarea {
    width: 100%; min-height: 36px; padding: 7px 10px;
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: var(--white); color: var(--text);
    transition: border-color .12s, box-shadow .12s;
}
.textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6B73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; }
.input:hover, .select:hover, .textarea:hover { border-color: #C2C2C8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--purple); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: #9A9AA2; }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--black); flex: none; }

.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Badge ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px;
    border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
    background: var(--bg-2); color: var(--text);
}
.badge .icon { width: 13px; height: 13px; stroke-width: 2; }
.badge-comment { background: var(--blue-soft); color: var(--blue-text); }
.badge-mention { background: var(--purple-soft); color: var(--purple); }
.status-open { background: var(--yellow-soft); color: #8A5A12; }
.status-replied { background: var(--blue-soft); color: var(--blue-text); }
.status-solved { background: var(--green-soft); color: var(--green); }
.status-closed { background: var(--bg-2); color: var(--muted); }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-warning { background: var(--yellow-soft); color: #8A5A12; }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-dark { background: var(--black); color: var(--white); }
.badge-outline { background: var(--white); border: 1px solid var(--line-strong); color: var(--muted); }

/* ---------- Pemberitahuan ---------- */

.notice {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 12px; border-radius: var(--radius);
    font-size: 13px; line-height: 1.5;
    background: var(--bg-2); color: var(--text);
}
.notice .icon { width: 16px; height: 16px; margin-top: 1px; }
.notice-success { background: var(--green-soft); color: var(--green); }
.notice-error { background: var(--red-soft); color: var(--red); }
.notice-warning { background: var(--yellow-soft); color: #7A4F10; }
.notice-info { background: var(--blue-soft); color: #1F5C88; }
.notice-locked { background: var(--bg-2); color: var(--muted); }
.notice a { color: inherit; font-weight: 600; }

/* ---------- Avatar ---------- */

.avatar { flex: none; border-radius: 50%; object-fit: cover; background: var(--bg-2); }
.avatar-xs { width: 20px; height: 20px; font-size: 10px; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-md { width: 36px; height: 36px; font-size: 14px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-initial { display: inline-grid; place-items: center; font-weight: 700; color: var(--muted); border: 1px solid var(--line); }

/* ---------- Tabel ---------- */

.table-wrap { position: relative; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); }
.table { width: 100%; font-size: 13px; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { position: sticky; top: 0; z-index: 1; background: var(--bg-2); font-weight: 600; color: var(--muted); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FBFBFC; }
.table .num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Keadaan kosong & panel ---------- */

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-title { color: var(--text); font-weight: 600; margin-bottom: 4px; }
.empty-text { max-width: 46ch; margin: 0 auto 14px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; }
.panel-body { padding: 16px; }

/* ---------- Dropdown (details/summary) ---------- */

.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-panel {
    position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
    min-width: 240px; padding: 6px;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float);
}
.dropdown-label { padding: 6px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.dropdown-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
    padding: 8px 10px; border: 0; border-radius: var(--radius);
    background: transparent; color: var(--text); font-size: 13px; text-align: left; text-decoration: none;
}
.dropdown-item:hover { background: var(--bg-2); text-decoration: none; }
.dropdown-item.is-current { font-weight: 600; background: var(--bg-2); }
.dropdown-item .icon { width: 16px; height: 16px; }

/* ---------- Toast ---------- */

.toast {
    position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%);
    max-width: min(480px, calc(100vw - 32px));
    padding: 10px 14px; border-radius: var(--radius-lg);
    background: var(--black); color: var(--white); font-size: 13px;
    box-shadow: var(--shadow-float);
}

/* ---------- Modal (<dialog>) ---------- */

dialog.modal {
    width: min(560px, calc(100vw - 32px)); padding: 0;
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    color: var(--text); box-shadow: var(--shadow-float);
}
dialog.modal::backdrop { background: rgba(27, 27, 31, .32); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 18px 20px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* ---------- Tab & segmented ---------- */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
    padding: 9px 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
    background: none; color: var(--muted); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active, .tab[aria-selected="true"] { color: var(--black); border-bottom-color: var(--black); }
.tab .count { margin-left: 4px; color: var(--muted); font-weight: 500; }

/* ---------- Halaman bernomor ---------- */

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; font-size: 13px; }
.page-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-weight: 600; text-decoration: none; }
.page-link.is-disabled { color: #B5B5BB; }
.page-link .icon { width: 16px; height: 16px; }
.page-info { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
