/* shell.css: header aplikasi, kotak pencarian global, dan navbar melayang. */

/* ── Header ────────────────────────────────────────────────────────────── */

.app-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.app-header__text { flex: 1; min-width: 0; }

.app-header__greet {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.app-header__title {
  font-size: var(--text-2xl);
  margin-top: 2px;
}

.app-header__date {
  margin-top: 4px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.app-header__actions { display: flex; align-items: center; gap: var(--sp-1); }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--ink-text);
  font-weight: 800;
  font-size: var(--text-base);
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-1);
}

/* Header modul (bukan Beranda): tombol kembali + judul. */
.view-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.view-header__text { flex: 1; min-width: 0; }
.view-header__text h1 { font-size: var(--text-xl); }
.view-header__text p { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }

/* ── Kotak pencarian ───────────────────────────────────────────────────── */

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-4);
  min-height: 52px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-fast) linear;
}

.search:focus-within { border-color: var(--brand); }

.search__icon { color: var(--text-muted); }

.search__input {
  flex: 1;
  min-width: 0;
  height: 50px;
  border: none;
  background: none;
  font-size: var(--text-base);
}

.search__input:focus { outline: none; box-shadow: none; }
.search__input::placeholder { color: var(--text-muted); opacity: 0.8; }
.search__input::-webkit-search-cancel-button { display: none; }

.search__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: -6px;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  background: var(--surface-sunk);
}

.search__clear:hover { color: var(--text); }

/* ── Navbar melayang ───────────────────────────────────────────────────── */

.navbar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 2px;
  padding: 6px;
  width: min(calc(100vw - 32px), 420px);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow-float);
}

@supports (backdrop-filter: blur(1px)) {
  .navbar {
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
  }
}

.navbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color var(--dur-fast) linear, background-color var(--dur-base) var(--ease-out);
}

.navbar__item .icn { width: 20px; height: 20px; }

.navbar__item:active { transform: scale(0.95); }

.navbar__item[data-active="true"] {
  background: var(--ink);
  color: var(--ink-text);
}

.navbar__item[data-active="true"] .icn { stroke-width: 1.85; }

/* Denyut singkat saat tujuan berganti. */
@keyframes nav-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.07); }
  100% { transform: scale(1); }
}

.navbar__item--popped { animation: nav-pop var(--dur-base) var(--ease-out); }

/* ── Daftar menu di dalam sheet ────────────────────────────────────────── */

.menu-list { display: grid; gap: var(--sp-2); }

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  text-align: left;
  transition: background-color var(--dur-fast) linear;
}

.menu-item:hover { background: var(--surface-sunk); }
.menu-item:active { transform: scale(0.99); }

.menu-item__text { flex: 1; min-width: 0; }
.menu-item__text strong { display: block; font-weight: 700; font-size: var(--text-base); }
.menu-item__text span { font-size: var(--text-xs); color: var(--text-muted); }
.menu-item > .icn:last-child { color: var(--text-muted); }

.menu-sep {
  height: 1px;
  margin: var(--sp-3) 0;
  background: var(--border);
  border: none;
}

/* ── Penanda tarik-untuk-menyegarkan ───────────────────────────────────── */

.ptr {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  color: var(--text-muted);
  transition: opacity var(--dur-fast) linear;
}

.ptr .icn { width: 20px; height: 20px; }

.ptr--spinning { opacity: 1 !important; }
.ptr--spinning .icn { animation: ptr-spin 0.7s linear infinite; }

@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ── Pengaturan notifikasi ─────────────────────────────────────────────── */

.notif-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.notif-row .icn { margin-top: 1px; color: var(--text-muted); }

.notif-row--ok { background: var(--tint-mint-bg); border-color: transparent; color: var(--tint-mint-fg); }
.notif-row--ok .icn { color: currentColor; }

.notif-row--warn { background: var(--tint-yellow-bg); border-color: transparent; color: var(--tint-yellow-fg); }
.notif-row--warn .icn { color: currentColor; }

.notif-steps p { font-size: var(--text-sm); line-height: 1.6; }

.notif-steps .guide-list {
  margin: var(--sp-3) 0 0;
  padding-left: var(--sp-5);
  font-size: var(--text-sm);
  line-height: 1.7;
}

.notif-devices { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }

.notif-device {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-sunk);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
}

.notif-schedule { margin-top: var(--sp-3); }

.notif-schedule__row {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.notif-schedule__row:first-child { border-top: none; }

.notif-schedule__when {
  flex-shrink: 0;
  width: 92px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--brand-ink);
}

/* ── Kartu ajakan pasang di Beranda ────────────────────────────────────── */

.install-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  margin-top: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--tint-blue-bg);
  color: var(--tint-blue-fg);
}

.install-card__text { flex: 1; min-width: 0; }
.install-card__text strong { display: block; font-size: var(--text-sm); font-weight: 750; }
.install-card__text span { font-size: var(--text-xs); opacity: 0.85; }

.install-card__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  color: currentColor;
  opacity: 0.7;
}
