:root {
  --bg0: #06080f;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e8edf7;
  --muted: #8b95a8;
  --accent: #34d399;
  --accent2: #818cf8;
  --danger: #fb7185;
  --radius: 14px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --font: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(52, 211, 153, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(129, 140, 248, 0.14), transparent 50%), var(--bg0);
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: 520px;
  height: 520px;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 120deg, rgba(52, 211, 153, 0.15), rgba(129, 140, 248, 0.2), rgba(52, 211, 153, 0.12));
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

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

.sm {
  font-size: 0.92rem;
}

.xs {
  font-size: 0.75rem;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.login-card {
  width: min(420px, 100%);
  padding: 2rem 2.1rem 1.75rem;
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: rise 0.7s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand-mark {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.brand-mark h1 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #04120a;
  font-size: 1.25rem;
  box-shadow: 0 12px 40px rgba(52, 211, 153, 0.35);
}

.brand-icon.sm {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

.domain-hint {
  font-size: 0.85rem;
  margin: 0 0 1.25rem;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.login-form input {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form input:focus {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}

.form-error.settings-msg--ok {
  color: #6ee7b7;
}

.fine-print {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  text-align: center;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: 11px;
  border: 1px solid transparent;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(120deg, #34d399, #22d3ee);
  color: #03140f;
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-block {
  width: 100%;
  padding: 0.85rem 1rem;
}

.btn-shine {
  position: absolute;
  inset: 0;
  translate: -120% 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shine 2.8s ease-in-out infinite;
}

@keyframes shine {
  0% {
    translate: -120% 0;
  }
  55%,
  100% {
    translate: 120% 0;
  }
}

.btn-ghost {
  background: transparent;
  border-color: var(--card-border);
}

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
}

/* Wrapper: desktop = hanya grid; mobile = top/bottom bar + grid (lihat bar.txt) */
.app-root-wrap {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 1.5rem 1.1rem;
  border-right: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-brand {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.sidebar-brand strong {
  display: block;
  font-size: 1rem;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-link {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.main {
  padding: 1.75rem 2rem 3rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 220px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.topbar h2 {
  margin: 0 0 0.25rem;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.pill {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  font-size: 0.78rem;
}

.view {
  animation: fade 0.35s ease both;
}

@keyframes fade {
  from {
    opacity: 0;
    translate: 0 6px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.badge {
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  background: rgba(129, 140, 248, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #c7d2fe;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.task-card {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.task-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  width: fit-content;
}

.status.Aktif {
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
}
.status.Dijadwalkan,
.status.Menunggu {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}
.status.Error {
  background: rgba(251, 113, 133, 0.12);
  color: #fda4af;
}
.status.Dihentikan {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

.task-meta {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.panel {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  max-width: 880px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: var(--font);
  outline: none;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: rgba(129, 140, 248, 0.55);
}

.checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}

.form-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.5rem;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  z-index: 50;
  max-width: min(420px, 92vw);
  font-size: 0.9rem;
}

/* Referensi bar.txt: mobile navbar + bottom nav (ikon SVG, tanpa Font Awesome) */
.mobile-navbar,
.mobile-bottom-nav {
  display: none;
}

.mobile-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 45%, #7c3aed 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.mobile-navbar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.mobile-navbar-logo {
  flex-shrink: 0;
}

.mobile-navbar-text {
  min-width: 0;
}

.mobile-navbar-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
}

.mobile-navbar-title-a {
  color: #fff;
}

.mobile-navbar-title-b {
  color: #fde047;
  text-shadow: 0 0 20px rgba(253, 224, 71, 0.35);
  margin-left: 0.15rem;
}

.mobile-navbar-sub {
  color: rgba(255, 255, 255, 0.85) !important;
  margin-top: 0.1rem;
}

.mobile-navbar-time {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.02em;
}

.mobile-navbar-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.mobile-navbar-user {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  padding: 0.25rem 0.45rem;
  border-color: rgba(255, 255, 255, 0.25);
  color: #e0e7ff;
  background: rgba(0, 0, 0, 0.15);
}

.mobile-navbar-user.hidden {
  display: none;
}

.mobile-logout-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}

.mobile-logout-btn:hover {
  background: rgba(251, 113, 133, 0.35);
  border-color: rgba(251, 113, 133, 0.6);
}

.mobile-logout-btn:active {
  transform: scale(0.96);
}

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: none;
  justify-content: space-around;
  align-items: stretch;
  padding: 0.35rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #111827 0%, #1f2937 50%, #111827 100%);
  border-top: 1px solid rgba(250, 204, 21, 0.28);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
}

.mobile-bottom-nav::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(250, 204, 21, 0.45), transparent);
  opacity: 0.85;
  pointer-events: none;
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-height: 48px;
  min-width: 0;
  padding: 0.25rem 0.12rem;
  text-decoration: none;
  color: #9ca3af;
  font-size: 0.56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 10px;
  transition:
    color 0.15s,
    transform 0.15s,
    background 0.15s;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: #fde047;
  background: rgba(250, 204, 21, 0.1);
  transform: translateY(-2px);
}

.mobile-nav-icon {
  display: grid;
  place-items: center;
  opacity: 0.95;
}

.mobile-nav-item.active .mobile-nav-icon {
  filter: drop-shadow(0 0 6px rgba(253, 224, 71, 0.45));
}

.mobile-nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .mobile-navbar,
  .mobile-bottom-nav {
    display: flex;
  }

  .sidebar {
    display: none !important;
  }

  .app-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
    padding-top: 72px;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  .main {
    padding: 1rem 1rem 1.5rem;
  }

  .topbar-actions .pill {
    display: none;
  }

  .toast {
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 900px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Halaman /settings */
.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 720px;
}

.settings-card .settings-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.settings-form label,
.settings-card label.full {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
}

.settings-pre {
  margin: 0.5rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--card-border);
  font-size: 0.78rem;
  line-height: 1.45;
  overflow: auto;
  max-height: min(420px, 55vh);
  white-space: pre-wrap;
  word-break: break-word;
}

.settings-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.settings-inline .grow {
  flex: 1 1 200px;
  min-width: 0;
}

.settings-card-danger {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(127, 29, 29, 0.12);
}

/* Halaman /profile */
.profile-intro-copy {
  margin: 0 0 0.85rem;
}

.profile-connect-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.profile-connect-hint {
  flex: 1 1 180px;
  min-width: 0;
  line-height: 1.35;
}

.profile-channel-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.profile-loading {
  margin: 0;
}

.profile-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.profile-empty-copy {
  margin: 0;
}

.profile-channel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.profile-channel-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1 1 200px;
}

.profile-channel-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--card-border);
}

.profile-channel-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.35);
}

.profile-channel-text {
  min-width: 0;
}

.profile-channel-name {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  line-height: 1.25;
  word-break: break-word;
}

.profile-channel-id {
  margin: 0;
  word-break: break-all;
}

.profile-channel-actions {
  flex-shrink: 0;
}
