/* Portal Aplikasi Shopee v2
   Token: Astryx Neutral Meta. Aksen oranye Shopee hanya untuk logo dan keadaan aktif.
   Warna kategori membawa informasi kelompok: oranye Trainer, biru Eskalasi, violet Ekstensi.
   Alasan desain: hierarki tegas untuk pemindaian cepat, kartu setara agar status dan
   kesehatan link terbaca sekilas, rel berlabel agar navigasi tidak perlu ditebak. */

:root {
  --bg: #f1f1f1;
  --card: #ffffff;
  --card-hover: #fbfbfb;
  --text: #1c1c1c;
  --muted: #565b61;
  --line: #e2e2e2;
  --line-strong: #c4c4c4;
  --primary-bg: #111111;
  --primary-text: #ffffff;
  --ghost-hover: #ececec;
  --focus: #005fb8;
  --shopee: #ee4d2d;
  --danger-bg: #b3261e;
  --danger-text: #ffffff;
  --input-bg: #ffffff;
  --scrim: rgba(18, 18, 18, 0.45);
  --shadow-drawer: -12px 0 32px rgba(0, 0, 0, 0.16);
  --shadow-modal: 0 18px 48px rgba(0, 0, 0, 0.22);
  --shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.06);

  --accent-orange: #b23a17;
  --accent-orange-bg: rgba(238, 77, 45, 0.12);
  --accent-blue: #005fb8;
  --accent-blue-bg: rgba(0, 116, 226, 0.12);
  --accent-violet: #6d28d9;
  --accent-violet-bg: rgba(124, 58, 237, 0.12);
  --accent-green: #137333;
  --accent-green-bg: rgba(26, 127, 55, 0.12);
  --accent-teal: #0b6e63;
  --accent-teal-bg: rgba(13, 148, 136, 0.12);
  --accent-gray: #565b61;
  --accent-gray-bg: rgba(95, 99, 104, 0.12);

  --status-live: #137333;
  --status-live-bg: rgba(26, 127, 55, 0.12);
  --status-wait: #8a3d08;
  --status-wait-bg: rgba(217, 119, 6, 0.14);
  --status-ext: #6d28d9;
  --status-ext-bg: rgba(124, 58, 237, 0.12);
  --status-off: #565b61;
  --status-off-bg: rgba(95, 99, 104, 0.12);

  --radius-card: 16px;
  --radius-input: 10px;
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #1b1b1b;
  --card: #262626;
  --card-hover: #2b2b2b;
  --text: #f5f5f5;
  --muted: #b8b8b8;
  --line: #383838;
  --line-strong: #4d4d4d;
  --primary-bg: #ffffff;
  --primary-text: #111111;
  --ghost-hover: #333333;
  --focus: #5cb3ff;
  --input-bg: #1f1f1f;
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow-drawer: -12px 0 32px rgba(0, 0, 0, 0.45);
  --shadow-modal: 0 18px 48px rgba(0, 0, 0, 0.55);
  --shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.35);

  --accent-orange: #ff8a5c;
  --accent-orange-bg: rgba(238, 77, 45, 0.2);
  --accent-blue: #5cb3ff;
  --accent-blue-bg: rgba(0, 116, 226, 0.22);
  --accent-violet: #b79bff;
  --accent-violet-bg: rgba(124, 58, 237, 0.24);
  --accent-green: #5fd68b;
  --accent-green-bg: rgba(26, 127, 55, 0.24);
  --accent-teal: #4fd1c5;
  --accent-teal-bg: rgba(13, 148, 136, 0.22);
  --accent-gray: #b8b8b8;
  --accent-gray-bg: rgba(176, 176, 176, 0.16);

  --status-live: #5fd68b;
  --status-live-bg: rgba(26, 127, 55, 0.24);
  --status-wait: #fbbf24;
  --status-wait-bg: rgba(217, 119, 6, 0.22);
  --status-ext: #b79bff;
  --status-ext-bg: rgba(124, 58, 237, 0.24);
  --status-off: #b8b8b8;
  --status-off-bg: rgba(176, 176, 176, 0.16);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, a, select, label, [role="radio"], [role="button"] { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] { display: none !important; }

svg { display: block; }

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

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn-primary { background: var(--primary-bg); color: var(--primary-text); }
.btn-primary:hover { opacity: 0.88; }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--ghost-hover); }
.btn-danger { background: var(--danger-bg); color: var(--danger-text); }
.btn-danger:hover { opacity: 0.9; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-accent-outline {
  background: var(--card);
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-accent-outline:hover { border-color: var(--shopee); color: var(--accent-orange); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.icon-btn:hover { background: var(--ghost-hover); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.98); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.is-danger:hover { color: var(--danger-bg); border-color: var(--danger-bg); }
.icon-btn .spin { animation: spin 0.9s linear infinite; }

/* Tooltip untuk tombol ikon */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translateX(-50%) translateY(2px);
  padding: 5px 10px;
  border-radius: 8px;
  background: #111111;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 80;
}
[data-theme="dark"] [data-tip]::after { background: #f5f5f5; color: #111111; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (hover: none) {
  [data-tip]::after { display: none; }
}

/* ---------- Logo ---------- */
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  background: var(--shopee);
  color: #ffffff;
}
.logo-mark svg { width: 25px; height: 25px; }
.logo-mark-small { width: 40px; height: 40px; border-radius: 12px; }
.logo-mark-small svg { width: 22px; height: 22px; }

/* ---------- Layar masuk ---------- */
.login-view {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 30px 26px;
}
.login-brand { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px; }
.login-title { font-size: 21px; font-weight: 800; margin: 2px 0 4px; letter-spacing: -0.01em; }
.login-sub { margin: 0; color: var(--muted); font-size: 14px; }
.login-note { margin: 18px 0 0; color: var(--muted); font-size: 13px; }
.login-card .btn-block { margin-top: 18px; }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 52px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}
.password-toggle:hover { background: var(--ghost-hover); color: var(--text); }
.password-toggle svg { width: 21px; height: 21px; }

/* ---------- Formulir umum ---------- */
.form-group {
  border: 0;
  margin: 0;
  padding: 0;
}
.form-group + .form-group {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.form-group legend {
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field-label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin: 16px 0 7px;
}
.form-group .field-label:first-of-type { margin-top: 12px; }
.req { color: var(--accent-orange); }
.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
.textarea { resize: vertical; min-height: 76px; }
.field-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.host-preview {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--status-live);
  overflow-wrap: anywhere;
}
.field-warning { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--status-wait); }
.form-error {
  margin: 14px 0 0;
  padding: 10px 13px;
  border-radius: var(--radius-input);
  background: rgba(179, 38, 30, 0.1);
  color: var(--danger-bg);
  font-size: 13.5px;
  font-weight: 600;
}
[data-theme="dark"] .form-error { color: #ff9d97; background: rgba(179, 38, 30, 0.22); }
.check-result { margin: 8px 0 0; font-size: 13px; font-weight: 600; }
.check-result.ok { color: var(--status-live); }
.check-result.bad { color: var(--danger-bg); }
[data-theme="dark"] .check-result.bad { color: #ff9d97; }
.check-result.wait { color: var(--muted); }

.field-row { display: flex; gap: 14px; }
.field-col { flex: 1; min-width: 0; }
.field-col .field-label { margin-top: 16px; }

.segmented {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-input);
  overflow: hidden;
}
.seg-btn {
  flex: 1;
  min-height: 44px;
  border: 0;
  background: var(--input-bg);
  color: var(--muted);
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn[aria-checked="true"] { background: var(--primary-bg); color: var(--primary-text); }

.url-row { display: flex; gap: 10px; }
.url-row .input { flex: 1; min-width: 0; }
.url-row .btn { flex: none; }

.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.08s ease;
}
.icon-pick svg { width: 22px; height: 22px; }
.icon-pick:hover { border-color: var(--line-strong); background: var(--ghost-hover); }
.icon-pick:active { transform: scale(0.98); }
.icon-pick[aria-checked="true"] { border-color: var(--shopee); background: var(--accent-orange-bg); color: var(--accent-orange); }

.accent-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.accent-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.accent-pick .swatch { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.accent-pick:hover { border-color: var(--line-strong); }
.accent-pick[aria-checked="true"] { border-color: var(--text); background: var(--ghost-hover); }

/* ---------- Kerangka aplikasi ---------- */
.app-shell { min-height: 100dvh; }

.rail {
  position: fixed;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  z-index: 40;
}
.rail-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2px 0 14px;
  border-bottom: 1px solid var(--line);
}
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding-top: 14px;
}
.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.rail-btn svg { width: 22px; height: 22px; flex: none; }
.rail-btn .rail-label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.rail-btn:hover { background: var(--ghost-hover); }
.rail-btn:active { transform: scale(0.98); }
.rail-btn.is-active { background: var(--accent-orange-bg); color: var(--accent-orange); border-color: var(--shopee); }
.rail-btn.is-active svg { color: var(--shopee); }
.rail-btn-add { background: var(--primary-bg); color: var(--primary-text); }
.rail-btn-add:hover { background: var(--primary-bg); opacity: 0.88; }
.rail-foot { margin-top: auto; width: 100%; padding-top: 12px; border-top: 1px solid var(--line); }

.main-col { margin-left: 124px; padding: 0 28px 8px; max-width: 1480px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(min-content, 1fr);
  grid-template-areas:
    "search title actions";
  align-items: center;
  gap: 16px;
  padding: 18px 0 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand-mobile { display: none; }
.title-block { grid-area: title; text-align: center; }
.page-title { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.page-subtitle { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.search-box {
  grid-area: search;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 350px;
  min-height: 44px;
  padding: 0 14px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.search-box:focus-within { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
.search-icon { display: inline-flex; color: var(--muted); flex: none; }
.search-icon svg { width: 19px; height: 19px; }
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  outline: none;
}
.search-box input::placeholder { color: var(--muted); }
.topbar-actions { grid-area: actions; display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.topbar-actions .btn { white-space: nowrap; flex: none; }
.topbar-actions .icon-btn { flex: none; }

/* Chip akun aktif: nama dan email sesi terlihat tanpa hover */
.user-chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 9px;
  min-height: 48px;
  padding: 5px 13px 5px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font);
  text-align: left;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.user-chip:hover { background: var(--ghost-hover); border-color: var(--line-strong); }
.user-chip:active { transform: scale(0.98); }
.user-chip .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--shopee);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  flex: none;
}
.user-chip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.user-chip-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.user-chip-email {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 205px;
}
.role-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-orange-bg);
  color: var(--accent-orange);
  font-size: 11.5px;
  font-weight: 800;
  flex: none;
}
.role-pill.role-editor { background: var(--accent-blue-bg); color: var(--accent-blue); }
.role-pill.role-demo { background: var(--accent-gray-bg); color: var(--accent-gray); }

.account-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(340px, calc(100vw - 28px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-modal);
  padding: 18px;
  z-index: 60;
  animation: pop-in 0.16s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.pop-head { display: flex; gap: 12px; align-items: center; }
.pop-head .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--shopee);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  flex: none;
}
.pop-name { margin: 0; font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.pop-email { margin: 2px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.pop-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.session-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--status-live); flex: none; }
.pop-actions { margin-top: 16px; }
.pop-actions .btn { width: 100%; }
.pop-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* Strip demo ramping */
.demo-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  margin-top: 14px;
  padding: 6px 8px 6px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.demo-strip p { margin: 0; flex: 1; min-width: 0; }
.demo-strip-icon { display: inline-flex; color: var(--accent-blue); flex: none; }
.demo-strip-icon svg { width: 18px; height: 18px; }
.demo-strip .btn { flex: none; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0 0;
}
.filter-bar {
  display: flex;
  gap: 9px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.chip:hover { background: var(--ghost-hover); }
.chip:active { transform: scale(0.98); }
.chip .count {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ghost-hover);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.chip.is-active { background: var(--primary-bg); color: var(--primary-text); border-color: var(--primary-bg); }
.chip.is-active .count { background: rgba(128, 128, 128, 0.35); color: var(--primary-text); }

.sort-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.sort-select {
  min-height: 40px;
  padding: 0 34px 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
}

.summary-line {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Konten dan kartu ---------- */
.content { padding-bottom: 10px; }
.cat-section { margin-top: 26px; scroll-margin-top: 120px; }
.cat-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.cat-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.cat-head .cat-count { font-size: 13px; color: var(--muted); font-weight: 600; }
.cat-head .cat-rule { flex: 1; border-top: 1px solid var(--line); transform: translateY(-4px); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.project-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.project-card:hover {
  border-color: var(--line-strong);
  background: var(--card-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}
.card-top { display: flex; align-items: flex-start; gap: 13px; }
.card-heading { flex: 1; min-width: 0; }
.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 13px;
}
.icon-tile svg { width: 24px; height: 24px; }
.accent-orange { background: var(--accent-orange-bg); color: var(--accent-orange); }
.accent-blue { background: var(--accent-blue-bg); color: var(--accent-blue); }
.accent-violet { background: var(--accent-violet-bg); color: var(--accent-violet); }
.accent-green { background: var(--accent-green-bg); color: var(--accent-green); }
.accent-teal { background: var(--accent-teal-bg); color: var(--accent-teal); }
.accent-gray { background: var(--accent-gray-bg); color: var(--accent-gray); }

.pin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.pin-btn svg { width: 20px; height: 20px; }
.pin-btn:hover { background: var(--ghost-hover); color: var(--text); border-color: var(--line); }
.pin-btn:active { transform: scale(0.98); }
.pin-btn.is-pinned { color: var(--shopee); background: var(--accent-orange-bg); border-color: var(--shopee); }
.pin-btn.is-pinned svg { fill: currentColor; }

.card-title { margin: 1px 0 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
.card-host {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  min-width: 0;
}
.card-host svg { width: 14px; height: 14px; flex: none; }
.card-host span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.45em);
}
.card-health {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  min-height: 26px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  flex: none;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status-live { background: var(--status-live-bg); color: var(--status-live); }
.status-wait { background: var(--status-wait-bg); color: var(--status-wait); }
.status-ext { background: var(--status-ext-bg); color: var(--status-ext); }
.status-off { background: var(--status-off-bg); color: var(--status-off); }

.health-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status-off); flex: none; }
.health-text.ok { color: var(--status-live); }
.health-text.ok .health-dot { background: var(--status-live); }
.health-text.bad { color: var(--danger-bg); }
.health-text.bad .health-dot { background: var(--danger-bg); }
[data-theme="dark"] .health-text.bad { color: #ff9d97; }
[data-theme="dark"] .health-text.bad .health-dot { background: #ff9d97; }
.health-text .spin { animation: spin 0.9s linear infinite; }
.health-text svg { width: 15px; height: 15px; flex: none; }

.card-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.card-actions .btn { flex: 1; min-height: 42px; white-space: nowrap; }
.card-actions .icon-btn { width: 42px; height: 42px; }
.action-divider {
  width: 1px;
  align-self: stretch;
  margin: 4px 0;
  background: var(--line);
  flex: none;
}

.state-box {
  margin-top: 28px;
  padding: 36px 24px;
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
}
.state-box h2 { margin: 0 0 8px; font-size: 17px; font-weight: 800; }
.state-box p { margin: 0 auto 16px; max-width: 480px; color: var(--muted); font-size: 14px; }
.state-error { border-style: solid; border-color: var(--danger-bg); }
.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--ghost-hover);
  color: var(--muted);
}
.empty-icon svg { width: 26px; height: 26px; }

/* Kerangka muat */
.skeleton-grid { margin-top: 26px; }
.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.sk {
  display: block;
  border-radius: 8px;
  background: var(--ghost-hover);
  animation: sk-pulse 1.4s ease-in-out infinite;
}
.sk-tile { width: 46px; height: 46px; border-radius: 13px; }
.sk-line { height: 14px; width: 100%; }
.sk-line.w60 { width: 60%; }
.sk-line.w80 { width: 80%; }
.sk-btn { height: 42px; border-radius: 999px; margin-top: 10px; }
@keyframes sk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes spin { to { transform: rotate(360deg); } }

.page-foot { padding: 22px 0 26px; color: var(--muted); font-size: 13px; }
.page-foot p { margin: 0; }

/* ---------- Drawer dan modal ---------- */
.scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: 90;
  animation: fade-in 0.18s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-drawer);
  z-index: 100;
  animation: slide-in 0.22s ease;
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.drawer-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 26px; }
.drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-modal);
  padding: 26px 26px 22px;
  z-index: 110;
  animation: modal-in 0.18s ease;
}
.modal-team { width: min(520px, calc(100vw - 32px)); }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -48%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.modal h2 { margin: 0 0 10px; font-size: 18px; font-weight: 800; }
.modal p { margin: 0; color: var(--muted); font-size: 14.5px; }
.team-steps {
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--text);
  font-size: 14.5px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-actions-split { justify-content: space-between; flex-wrap: wrap; }

/* Modal akses tamu (v5): gembok menandai link yang terkunci */
.modal-access-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.modal-access-head h2 { margin: 0; }
.modal-access-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-orange-bg);
  color: var(--accent-orange);
  flex: none;
}
.modal-access-icon svg { width: 22px; height: 22px; }
.modal-access-close { margin-left: auto; flex: none; }
.modal-actions-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.modal-actions-stack .text-link { text-align: center; }

/* Mode tamu (v5) */
.role-pill.role-guest { background: var(--accent-gray-bg); color: var(--accent-gray); }
.avatar-guest svg { width: 18px; height: 18px; }
.guest-request-link { min-height: 44px; white-space: nowrap; }
.state-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.auth-back-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin-top: 6px;
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 130;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-modal);
  animation: toast-in 0.2s ease;
}
[data-theme="dark"] .toast { background: #f5f5f5; color: #111111; }
.toast svg { width: 18px; height: 18px; flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Akses: minta akses, daftar, kelola akses (v4) ---------- */
.login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 16px;
}
.text-link {
  border: 0;
  background: transparent;
  padding: 6px 2px;
  min-height: 36px;
  color: var(--accent-blue);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
}
.text-link:hover { text-decoration: underline; }
.auth-panel { margin-top: 4px; }
.auth-panel-title { margin: 0; font-size: 17px; font-weight: 800; }
.auth-panel-sub { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.auth-back { margin-top: 10px; }
.form-success {
  margin: 14px 0 0;
  padding: 10px 13px;
  border-radius: var(--radius-input);
  background: var(--status-live-bg);
  color: var(--status-live);
  font-size: 13.5px;
  font-weight: 600;
}
.radio-cards { display: flex; flex-direction: column; gap: 9px; }
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.radio-card:hover { border-color: var(--line-strong); background: var(--ghost-hover); }
.radio-card:has(input:checked) { border-color: var(--shopee); background: var(--accent-orange-bg); }
.radio-card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.radio-card input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--shopee); }
.radio-card-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.radio-card-body strong { font-size: 14.5px; font-weight: 700; }
.radio-card-body small { font-size: 13px; color: var(--muted); font-weight: 600; }
.noaccess-email {
  margin: 12px 0 0;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: var(--ghost-hover);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.noaccess-actions { display: flex; gap: 10px; margin-top: 14px; }
.noaccess-actions .btn { flex: 1; }

.role-pill.role-viewer { background: var(--accent-teal-bg); color: var(--accent-teal); }
.pop-role-preview { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pop-role-preview .field-label { margin-top: 0; }
.pop-role-preview .input { min-height: 42px; }

.rail-btn-access { position: relative; margin-bottom: 6px; }
.rail-badge {
  position: absolute;
  top: 5px;
  right: 8px;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--shopee);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

.access-view { padding-bottom: 10px; }
.access-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
}
.access-title { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.access-sub { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.access-section { margin-top: 28px; }
.access-list { display: flex; flex-direction: column; gap: 10px; }
.access-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.access-row-main { flex: 1; min-width: 0; }
.access-row-name { margin: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.access-row-email { margin: 1px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.access-row-meta { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.access-row-note { margin: 5px 0 0; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.access-row-controls { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.role-select {
  min-height: 42px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
}
.role-select:disabled { opacity: 0.55; cursor: not-allowed; }
.access-empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
}
.access-add-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.access-add-form .field-col { min-width: 200px; }
.access-add-form .field-col-role { flex: 0 1 170px; min-width: 150px; }
.access-add-form .field-label { margin-top: 0; }
.access-add-form .btn { flex: none; }
.history-status { font-weight: 800; }
.history-status.is-approved { color: var(--status-live); }
.history-status.is-rejected { color: var(--danger-bg); }
[data-theme="dark"] .history-status.is-rejected { color: #ff9d97; }
.self-note { font-size: 12px; color: var(--muted); font-weight: 600; }
.card-link-unavailable {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}
.card-link-unavailable svg { width: 17px; height: 17px; flex: none; }

/* ---------- Layar sempit ---------- */
@media (max-width: 1320px) {
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { padding: 0 13px; }
}

@media (max-width: 1100px) {
  .user-chip-name { max-width: 140px; }
  .user-chip-email { max-width: 170px; }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "brand title actions"
      "search search search";
    gap: 12px;
    padding-top: 14px;
  }
  .brand-mobile {
    grid-area: brand;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
  }
  .title-block {
    grid-area: title;
    position: static;
    transform: none;
    text-align: left;
    pointer-events: auto;
  }
  .page-title { font-size: 19px; }
  .page-subtitle { display: none; }
  .search-box { max-width: none; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { padding: 0 13px; }
  .user-chip { padding: 5px 10px 5px 5px; min-height: 46px; }
  .user-chip-name { display: none; }
  .user-chip-email { max-width: 120px; }
  .role-pill { display: none; }
  .filter-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .sort-box { justify-content: flex-end; }
  .summary-line { overflow-wrap: anywhere; }
}

@media (max-width: 880px) {
  .rail {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: stretch;
    margin: 12px 12px 0;
    padding: 8px;
    border-radius: 18px;
  }
  .rail-brand { width: auto; border-bottom: 0; padding: 0 2px 0 0; }
  .rail-brand .logo-mark { width: 36px; height: 36px; border-radius: 11px; }
  .rail-brand .logo-mark svg { width: 20px; height: 20px; }
  .rail-nav {
    flex-direction: row;
    width: auto;
    flex: 1;
    min-width: 0;
    gap: 3px;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .rail-nav::-webkit-scrollbar { display: none; }
  .rail-btn { width: auto; min-width: 54px; min-height: 52px; padding: 6px 5px; flex: none; }
  .rail-foot { margin-top: 0; width: auto; padding: 0 0 0 6px; border-top: 0; display: flex; gap: 3px; }
  .rail-btn-access { margin-bottom: 0; }
  .rail-foot .rail-btn { min-width: 54px; }
  .main-col { margin-left: 0; padding: 0 14px 8px; }
  .cat-section { scroll-margin-top: 170px; }
  .account-popover { right: 0; }
  .pin-btn { width: 44px; height: 44px; }
  .icon-btn { width: 44px; height: 44px; min-width: 44px; }
  .chip { min-height: 44px; }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "search search";
  }
  .title-block { display: none; }
  .brand-mobile-text { display: inline; }
  .card-grid { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
  .url-row { flex-direction: column; }
  .url-row .btn { width: 100%; }
  .drawer-foot .btn { flex: 1; }
  .demo-strip { border-radius: 16px; align-items: flex-start; }
  .login-card { padding: 26px 20px 22px; }
  .page-title { white-space: normal; }
  .modal-actions-split .btn { flex: 1; }
  .access-head { flex-direction: column; }
  .access-head .btn { width: 100%; }
  .access-row { flex-direction: column; align-items: stretch; }
  .access-row-controls { justify-content: flex-start; }
  .access-row-controls .btn { flex: 1; }
  .access-add-form { flex-direction: column; align-items: stretch; }
  .access-add-form .btn { width: 100%; }
  .noaccess-actions { flex-direction: column; }
  /* Kepala tamu di layar sempit: Minta akses tetap ada di modal dan layar masuk */
  .guest-request-link { display: none; }
  body.is-guest .brand-mobile-text { display: none; }
  .user-chip-email { max-width: 86px; }
  .modal-actions-stack .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .health-text .spin { animation: none; }
  .sk { animation: none; }
  .project-card:hover { transform: none; }
  .btn:active, .chip:active, .rail-btn:active, .icon-btn:active, .pin-btn:active, .user-chip:active { transform: none; }
}
