/* Pangaji dashboard — minimal, mobile-first. Shared by login.html and index.html. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  color: #1a1a1a;
  background: #f7f7f7;
  -webkit-font-smoothing: antialiased;
}
a { color: #0f7b3f; }
button { font-family: inherit; cursor: pointer; }

/* Layout */
:root { --sidebar-w: 240px; --topbar-h: 56px; }
.container { max-width: 960px; margin: 0 auto; padding: 1rem; }
.center-card { max-width: 420px; margin: 6vh auto; padding: 1.5rem; }

/* Topbar */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e6e6e6;
  padding: 0.6rem 1rem;
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
}
.topbar-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
}
.topbar-left { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.logo { font-weight: 800; font-size: 1.15rem; color: #0f7b3f; letter-spacing: -0.02em; text-decoration: none; }
.hamburger {
  background: transparent; border: none; cursor: pointer;
  padding: 0.4rem 0.6rem; margin-left: -0.4rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.hamburger:hover { background: #f1faf3; }
.hamburger svg { display: block; }
.user-chip { font-size: 0.9rem; color: #555; min-width: 0; text-align: right; }
.user-chip strong { color: #1a1a1a; }
.user-chip .logout {
  margin-left: 0.75rem; color: #555; text-decoration: none; font-weight: 500;
  border-left: 1px solid #ddd; padding-left: 0.75rem;
}
.user-chip .logout:hover { color: #c0392b; }
@media (max-width: 640px) {
  .user-chip .phone-or-email { display: none; }
  .user-chip strong { font-size: 0.85rem; }
}

/* App shell with sidebar */
.app-shell { position: relative; min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
  position: fixed; left: 0; top: var(--topbar-h);
  bottom: 0; width: var(--sidebar-w);
  background: #fff; border-right: 1px solid #e6e6e6;
  padding: 1rem 0; overflow-y: auto;
  z-index: 25;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}
.sidebar.open { transform: translateX(0); box-shadow: 4px 0 12px rgba(0,0,0,0.08); }

.sidebar-backdrop {
  position: fixed; inset: var(--topbar-h) 0 0 0;
  background: rgba(0,0,0,0.35);
  z-index: 24;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

.main-content { padding: 1rem; max-width: 960px; margin: 0 auto; }

@media (min-width: 900px) {
  .sidebar { transform: translateX(0); border-right: 1px solid #ececec; }
  .sidebar-backdrop { display: none; }
  .hamburger { display: none; }
  .main-content { margin-left: var(--sidebar-w); max-width: none; padding: 1.5rem 2rem; }
  .main-content > .container-inner { max-width: 880px; margin: 0 auto; }
}

.nav-item {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem; font-weight: 500;
  color: #555; cursor: pointer;
  border-left: 3px solid transparent;
  font-family: inherit;
}
.nav-item:hover { background: #f8f8f8; color: #1a1a1a; }
.nav-item.active {
  color: #0f7b3f; background: #f1faf3;
  border-left-color: #0f7b3f; font-weight: 600;
}
.sidebar-section-label {
  font-size: 0.72rem; font-weight: 700; color: #999;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.5rem 1.25rem; margin-top: 0.5rem;
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 1rem;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 12px;
  padding: 1.5rem; max-width: 520px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.modal h3 { font-size: 1.1rem; margin-bottom: 0.85rem; color: #1a1a1a; }
.modal .hint { color: #666; font-size: 0.88rem; margin-bottom: 0.85rem; }
.modal-close {
  position: absolute; top: 0.4rem; right: 0.4rem;
  width: 32px; height: 32px; border: none; background: transparent;
  font-size: 1.6rem; cursor: pointer; color: #888; line-height: 1; padding: 0;
}
.modal-close:hover { color: #1a1a1a; }

/* Bug-report list (admin) */
.report-row { display: flex; gap: 0.85rem; align-items: flex-start; padding: 0.85rem; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.report-row:hover { background: #fafafa; }
.report-row:last-child { border-bottom: none; }
.report-row .title { font-weight: 600; color: #1a1a1a; }
.report-row .meta { font-size: 0.82rem; color: #777; margin-top: 0.15rem; }
.report-detail .body { white-space: pre-wrap; background: #fafafa; border-radius: 8px; padding: 0.85rem; font-size: 0.92rem; }
.report-detail .reply { border-left: 3px solid #0f7b3f; padding: 0.5rem 0.85rem; margin: 0.6rem 0; background: #f6f6f6; border-radius: 0 6px 6px 0; }
.report-detail .reply.internal { border-left-color: #b16800; background: #fff8eb; }
.attachment-link { display: inline-block; padding: 0.25rem 0.6rem; margin: 0.15rem 0.25rem 0.15rem 0; background: #f0f0f0; border-radius: 6px; font-size: 0.85rem; color: #1a1a1a; text-decoration: none; }
.attachment-link:hover { background: #e8e8e8; }

/* Small inline buttons in table rows */
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; border-radius: 6px; }

/* Password input with eye toggle */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 2.5rem !important; }
.pwd-toggle {
  position: absolute; right: 0.4rem; top: 50%;
  transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  padding: 0.35rem; color: #888; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
.pwd-toggle:hover { color: #1a1a1a; background: #f5f5f5; }
.pwd-toggle svg { display: block; }

/* Google OAuth button */
.btn-google {
  background: #fff; color: #1a1a1a; border: 1px solid #d8d8d8;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  text-decoration: none;
}
.btn-google:hover:not(:disabled) { background: #f8f8f8; border-color: #999; }
.btn-google svg { width: 18px; height: 18px; }

/* Divider with "or" between OAuth and email/password forms */
.divider-or {
  display: flex; align-items: center; gap: 0.85rem;
  margin: 1.25rem 0; color: #888; font-size: 0.82rem;
}
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: #e6e6e6; }

/* Sections */
.panel {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.panel h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}
.panel .hint { color: #777; font-size: 0.88rem; margin-bottom: 0.85rem; }

/* Stat grid */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.stat {
  background: #fafafa;
  border: 1px solid #ececec;
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.stat-label { font-size: 0.78rem; color: #666; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 0.25rem; text-transform: uppercase; }
.stat-value { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; color: #1a1a1a; }
.stat-value.muted { color: #999; }

/* Forms */
.field { margin-bottom: 0.85rem; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; color: #333; margin-bottom: 0.3rem; }
.field input, .field select {
  width: 100%; padding: 0.65rem 0.8rem; font-size: 0.98rem; font-family: inherit;
  border: 1px solid #d8d8d8; border-radius: 8px; background: #fff;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: #0f7b3f; box-shadow: 0 0 0 3px rgba(15, 123, 63, 0.12);
}
.field-row { display: flex; gap: 0.6rem; }
.field-row .field { flex: 1; min-width: 0; }

.btn {
  display: inline-block; padding: 0.7rem 1.2rem;
  border-radius: 8px; font-weight: 600; font-size: 0.95rem;
  border: none; cursor: pointer; text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: #0f7b3f; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #0a5a2d; }
.btn-secondary { background: #fff; color: #1a1a1a; border: 1px solid #d8d8d8; }
.btn-secondary:hover:not(:disabled) { border-color: #999; }
.btn-danger { background: #fff; color: #c0392b; border: 1px solid #ecc; font-weight: 500; }
.btn-danger:hover:not(:disabled) { background: #fff5f5; }
.btn-block { width: 100%; }

.form-msg { margin-top: 0.7rem; font-size: 0.92rem; min-height: 1.2rem; }
.form-msg.success { color: #0f7b3f; font-weight: 600; }
.form-msg.error { color: #c0392b; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td {
  text-align: left; padding: 0.55rem 0.65rem; border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}
.table th { font-weight: 600; color: #555; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; background: #fafafa; }
.table tr:last-child td { border-bottom: none; }
.table .muted { color: #999; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.74rem; font-weight: 600; }
.pill.green { background: #e8f5e9; color: #0f7b3f; }
.pill.amber { background: #fff4e0; color: #b16800; }
.pill.red { background: #fde8e8; color: #c0392b; }
.pill.grey { background: #f0f0f0; color: #666; }

.empty-state { text-align: center; padding: 1.5rem 1rem; color: #999; font-size: 0.92rem; }

/* Login page */
.center-card {
  background: #fff; border: 1px solid #e6e6e6; border-radius: 14px;
}
.center-card h1 { font-size: 1.4rem; letter-spacing: -0.02em; margin-bottom: 0.5rem; color: #0f7b3f; }
.center-card .sub { color: #555; font-size: 0.95rem; margin-bottom: 1.5rem; }
.toggle-link {
  background: none; border: none; color: #0f7b3f; cursor: pointer;
  font-family: inherit; font-size: 0.92rem; padding: 0;
  text-decoration: underline; text-underline-offset: 2px;
}

/* Section header with action button */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.85rem; }
.section-head h2 { margin-bottom: 0; }

/* Collapsible inline form */
details.add { margin-bottom: 0.8rem; }
details.add > summary {
  cursor: pointer; padding: 0.55rem 0.8rem; background: #fafafa;
  border: 1px dashed #cfcfcf; border-radius: 8px; font-size: 0.92rem; color: #0f7b3f; font-weight: 600;
  list-style: none;
}
details.add[open] > summary { background: #e8f5e9; border-color: #0f7b3f; border-style: solid; }
details.add summary::-webkit-details-marker { display: none; }
details.add .form-body { padding: 0.85rem 0.4rem 0.2rem; }
