/* =====================================================================
   LBN System — perbaikan UI/UX
   Dimuat SETELAH app.css, jadi hanya menimpa yang perlu.
   Tidak ada berkas lama yang diubah — aman dikembalikan kapan saja.
   ===================================================================== */

/* ---------------------------------------------------------- 1. HEADER
   Sebelumnya nama brand terpotong di layar sempit karena tidak boleh
   menyusut. Sekarang boleh menyusut dan dipotong rapi dengan elipsis. */
.top {
  gap: 14px;
}
.brand {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}
#userBox {
  flex: 0 0 auto;
}

/* ----------------------------------------------------- 2. HALAMAN LOGIN
   Masalah lama: `.login form{display:flex}` membuat email & password
   berjajar ke samping sehingga sempit. Sekarang ditumpuk ke bawah. */

body:has(#login:not([hidden])) {
  background:
    radial-gradient(1100px 520px at 12% -10%, #eef3fb 0%, transparent 60%),
    radial-gradient(900px 500px at 105% 5%, #f2f7f4 0%, transparent 55%),
    #f6f8fb;
}

.login.panel {
  max-width: 430px;
  margin: 64px auto;
  padding: 34px 32px 30px;
  border-radius: 20px;
  border: 1px solid #e6eaf1;
  box-shadow: 0 20px 55px -28px rgba(16, 24, 40, 0.3);
}

/* Lencana gembok di atas judul — penanda visual bahwa ini area terkunci. */
.login-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #101827;
  color: #e2b84a;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.login-badge svg {
  width: 22px;
  height: 22px;
}

.login.panel h1 {
  font-size: 25px;
  letter-spacing: -0.5px;
  margin: 0;
}
.login.panel .subhead {
  margin: 7px 0 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.55;
}

/* Susun vertikal, bukan berjajar. */
.login form {
  display: grid;
  gap: 15px;
  margin-top: 24px;
}

.login-field {
  display: grid;
  gap: 7px;
}
.login-field > label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #475467;
  text-transform: uppercase;
}
.login form input {
  width: 100%;
  min-width: 0;
  flex: none;
  font-size: 14px;
  padding: 12px 13px;
  border-radius: 11px;
  border: 1px solid #dbe1ea;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login form input:focus {
  border-color: #8fb2f0;
  box-shadow: 0 0 0 3px #eaf1fd;
}

/* Kotak password + tombol lihat/sembunyikan */
.login-password {
  position: relative;
}
.login-password input {
  padding-right: 74px;
}
.login-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  padding: 7px 10px;
  border-radius: 8px;
  background: #f2f4f7;
  color: #475467;
  border: 1px solid #e4e8ee;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.login-toggle:hover {
  background: #e9edf3;
}

.login form button[type="submit"] {
  width: 100%;
  padding: 13px;
  font-size: 14px;
  border-radius: 11px;
  background: #101827;
  color: #fff;
  transition: transform 0.12s ease, opacity 0.15s ease;
}
.login form button[type="submit"]:hover:not(:disabled) {
  background: #1b2537;
}
.login form button[type="submit"]:active:not(:disabled) {
  transform: translateY(1px);
}
.login form button[type="submit"]:disabled {
  opacity: 0.62;
  cursor: progress;
}

/* Pesan: error merah, proses netral. Sebelumnya hanya teks merah polos. */
.login-error {
  margin-top: 16px;
  font-size: 12.5px;
  line-height: 1.5;
}
.login-error:not(:empty) {
  padding: 12px 14px;
  border-radius: 11px;
  background: #fef3f2;
  border: 1px solid #fcd9d3;
  color: #b42318;
}
.login-error.is-pending:not(:empty) {
  background: #f5f7fa;
  border-color: #e4e8ee;
  color: #475467;
}

.login-help {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid #eef1f5;
  font-size: 11px;
  color: #98a2b3;
  line-height: 1.6;
}

/* ------------------------------------------------- 3. AKSESIBILITAS
   Cincin fokus yang terlihat jelas saat navigasi memakai keyboard. */
:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid #4f80df;
  outline-offset: 2px;
}

/* ------------------------------------------------------ 4. SIDEBAR
   Item aktif dan hover sebelumnya kurang jelas bedanya. */
aside button[data-page] {
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}
aside button[data-page]:hover {
  background: #f2f5f9;
}
aside button[data-page].active {
  background: #eef3fb;
  color: #1d3f7a;
  font-weight: 800;
}

/* ------------------------------------------- 5. TOMBOL & KEADAAN SIBUK */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ------------------------------------------------- 6. LAYAR SEMPIT */
@media (max-width: 520px) {
  .login.panel {
    margin: 28px 14px;
    padding: 26px 20px 24px;
    border-radius: 16px;
  }
  .login.panel h1 {
    font-size: 22px;
  }
}

/* Hormati pengguna yang mematikan animasi di sistemnya. */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* =====================================================================
   TEMA SEGAR — perombakan tampilan agar tidak terasa kaku
   ===================================================================== */

:root {
  --ui-bg: #f7f8fc;
  --ui-surface: #ffffff;
  --ui-line: #e9edf4;
  --ui-ink: #131a2b;
  --ui-soft: #6b7688;
  --ui-accent: #3b6fe0;
  --ui-accent-soft: #eef3fd;
  --ui-gold: #e2b84a;
  --ui-radius: 16px;
  --ui-shadow: 0 4px 16px -6px rgba(19, 26, 43, .08);
  --ui-shadow-lg: 0 18px 44px -24px rgba(19, 26, 43, .28);
}

body {
  background: var(--ui-bg);
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ HEADER */
.top {
  height: auto;
  min-height: 66px;
  padding: 12px 24px;
  background: linear-gradient(100deg, #0d1424 0%, #182236 62%, #1d2942 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 0 1px 0 rgba(16, 24, 40, .04);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  letter-spacing: .01em;
}
/* Titik emas jadi lencana kecil, bukan sekadar karakter. */
.brand span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ui-gold);
  box-shadow: 0 0 0 3px rgba(226, 184, 74, .18);
  font-size: 0;
  flex: 0 0 auto;
}
.brand small {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #c8d2e2;
  font-size: 9px;
  letter-spacing: .12em;
}

/* Identitas pengguna jadi "chip" bulat. */
#userBox > div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .09);
}
.user-email { font-size: 12px; font-weight: 650; }
.user-role {
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ui-gold);
}

/* ----------------------------------------------------------- SIDEBAR */
aside {
  background: var(--ui-surface);
  border-right: 1px solid var(--ui-line);
  padding: 16px 12px;
  gap: 3px;
}
.nav-label {
  font-size: 9px;
  letter-spacing: .16em;
  color: #9aa4b6;
  font-weight: 800;
  padding: 4px 12px 10px;
}
aside button[data-page],
aside button#logout {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 650;
  color: #4b566b;
  transition: background .16s ease, color .16s ease;
}
aside button[data-page]:hover,
aside button#logout:hover {
  background: #f3f5f9;
  color: var(--ui-ink);
}
/* Pil aktif dengan penanda di sisi kiri. */
aside button[data-page].active {
  position: relative;
  background: var(--ui-accent-soft);
  color: #1e3f86;
  font-weight: 800;
}
aside button[data-page].active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--ui-accent);
}
aside button#logout {
  margin-top: auto;
  color: #b4483f;
}
aside button#logout:hover { background: #fdf1f0; }

/* Wadah ikon SVG. */
.nav-icon {
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 19px;
  color: #8d97a8;
}
aside button.active .nav-icon { color: var(--ui-accent); }
aside button:hover .nav-icon { color: #5c6678; }
.nav-icon svg { width: 100%; height: 100%; }

/* -------------------------------------------------------- PERMUKAAN */
.panel,
.dash-card,
.premium-panel,
.summary-card,
.hero-stat,
.client-section-card,
.leads-filter-panel,
.leads-table-panel {
  border-radius: var(--ui-radius);
  border-color: var(--ui-line);
  box-shadow: var(--ui-shadow);
}

.hero-stat,
.summary-card,
.pipeline-card,
.field-project-card {
  transition: transform .16s ease, box-shadow .16s ease;
}
.hero-stat:hover,
.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(19, 26, 43, .3);
}

/* Garis warna di kartu statistik dibuat lebih lembut. */
.hero-stat:before { width: 4px; opacity: .9; }

/* --------------------------------------------------- TOMBOL & BADGE */
button {
  border-radius: 11px;
  font-weight: 700;
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
button:active:not(:disabled) { transform: translateY(1px); }

.soft-action, .link-btn, .icon-btn {
  border-radius: 10px;
  transition: background .15s ease, border-color .15s ease;
}
.soft-action:hover, .icon-btn:hover {
  background: #eef1f6;
  border-color: #dbe1ea;
}

.badge {
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 10px;
  letter-spacing: .01em;
}

/* -------------------------------------------------------- TABEL */
.clean-table th {
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 9.5px;
  color: #8d97a8;
}
.clean-table tbody tr { transition: background .13s ease; }
.clean-table tbody tr:hover td { background: #f8faff; }

/* ------------------------------------------------------- FORMULIR */
input, select, textarea {
  border-radius: 11px;
  border-color: #dde3ec;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: #9dbaf3;
  box-shadow: 0 0 0 3px var(--ui-accent-soft);
}

/* ---------------------------------------------------------- KONTEN */
#content { padding: 28px 32px 64px; }

/* Bilah progres dibulatkan penuh di mana pun. */
.progress-track, .client-progress-bar, .detail-progress,
.funnel-bar, .cashflow-bar, .health-track, .progress-hero-bar {
  border-radius: 999px;
}

/* ------------------------------------------------------ LAYAR HP */
@media (max-width: 900px) {
  aside {
    padding: 8px 10px;
    gap: 6px;
    border-right: 0;
    border-bottom: 1px solid var(--ui-line);
  }
  aside button[data-page],
  aside button#logout {
    padding: 9px 13px;
    border-radius: 999px;
    font-size: 12px;
  }
  aside button[data-page].active::before { display: none; }
  .nav-label { display: none; }
  aside button#logout { margin-top: 0; }
  #content { padding: 20px 16px 48px; }
}
