/* Same dark/gold palette as android/.../ui/theme/Color.kt, so the web app
   reads as the same product rather than a re-skin. */
:root {
  --bg: #0d1117;
  --card: #161b22;
  --card-alt: #1b2230;
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #eef1f5;
  --text-secondary: #8b96a5;
  --text-muted: #5b6472;
  --gold: #c9a463;
  --danger: #fca5a5;
  --status-submitted: #93c5fd;
  --status-pending: #fbbf24;
  --status-approved: #6ee7b7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#app { min-height: 100vh; }

a { color: inherit; }

.serif { font-family: Georgia, "Times New Roman", serif; }

button {
  font: inherit;
  cursor: pointer;
}

input, select, textarea {
  font: inherit;
  color: var(--text-primary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
}
label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field { margin-bottom: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
}
.btn-primary { background: var(--gold); color: #0d1117; }
.btn-secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.btn-danger { background: rgba(252, 165, 165, 0.1); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 12.5px; border-radius: 10px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.link-gold { color: var(--gold); font-weight: 600; cursor: pointer; }

/* --- Auth screen --- */
.auth-shell {
  max-width: 420px;
  margin: 0 auto;
  padding: 48px 24px;
}
.auth-logo { display: block; width: 88px; height: 88px; border-radius: 20px; margin: 0 auto 16px; }
.auth-title { text-align: center; font-size: 24px; font-weight: 600; margin: 0 0 4px; }
.auth-subtitle { text-align: center; font-size: 13px; color: var(--text-secondary); margin: 0 0 32px; }
.auth-error { background: rgba(252, 165, 165, 0.1); color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-secondary); margin-top: 20px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  border-radius: 20px; padding: 7px 13px; font-size: 12.5px; font-weight: 600;
  background: var(--card); color: var(--text-primary); cursor: pointer; border: none;
}
.chip.selected { background: var(--gold); color: #0d1117; }

/* --- App shell --- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.app-header .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.app-header .brand img { width: 28px; height: 28px; border-radius: 7px; }
.tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  background: none; border: none; color: var(--text-muted); padding: 12px 14px;
  font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.content { flex: 1; padding: 20px; max-width: 900px; width: 100%; margin: 0 auto; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.page-title { font-size: 24px; font-weight: 600; margin: 0; }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin: 4px 0 20px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.row-card {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border-radius: 14px; padding: 14px; cursor: pointer;
}
.row-card:hover { background: var(--card-alt); }
.row-thumb {
  width: 52px; height: 52px; border-radius: 10px; background: var(--card-alt);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pill { border-radius: 20px; padding: 3px 8px; font-size: 10.5px; font-weight: 600; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

.detail-card { background: var(--card); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.kv-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.kv-row:last-child { border-bottom: none; }
.kv-key { color: var(--text-muted); font-size: 12px; }
.kv-val { color: var(--text-primary); }

.back-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.back-btn { background: none; border: none; color: var(--text-primary); font-size: 20px; padding: 4px; }
.back-title { font-size: 19px; font-weight: 600; flex: 1; }
.icon-btn { background: none; border: none; color: var(--gold); font-size: 18px; padding: 4px 8px; }
.icon-btn.danger { color: var(--danger); }

.hero-photo {
  width: 100%; height: 180px; border-radius: 14px; background: var(--card-alt);
  display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 16px;
  color: var(--text-muted); font-size: 13px;
}
.hero-photo img { width: 100%; height: 100%; object-fit: contain; }
.hero-photo.clickable { cursor: zoom-in; }

.lightbox-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.95);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; cursor: zoom-out;
}
.lightbox-backdrop img { max-width: 92vw; max-height: 92vh; object-fit: contain; cursor: default; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px; background: none; border: none;
  color: #fff; font-size: 22px; line-height: 1; padding: 8px 10px; cursor: pointer;
}

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-end; justify-content: center; z-index: 100;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
}
.modal {
  background: var(--bg); border-radius: 20px 20px 0 0; width: 100%; max-width: 520px;
  max-height: 92vh; overflow-y: auto; overflow-x: hidden; padding: 20px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
@media (min-width: 640px) {
  .modal { border-radius: 16px; max-height: 88vh; }
}
.modal::-webkit-scrollbar { width: 8px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background-color: var(--border); border-radius: 8px; }
.modal:hover::-webkit-scrollbar-thumb { background-color: var(--gold); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { font-size: 16px; font-weight: 600; }

.file-drop {
  border: 1.5px dashed var(--border); border-radius: 12px; padding: 20px; text-align: center;
  cursor: pointer; color: var(--gold); font-size: 13px; font-weight: 600;
}
.file-ready { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 10px; padding: 12px 14px; font-size: 13px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--card-alt); color: var(--text-primary); padding: 12px 18px;
  border-radius: 12px; font-size: 13px; z-index: 200; box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.toast.error { color: var(--danger); }

.spinner-overlay {
  position: fixed; inset: 0; background: rgba(13, 17, 23, 0.7);
  display: flex; align-items: center; justify-content: center; z-index: 300; color: var(--text-secondary); font-size: 13px;
}

.checklist-row {
  display: flex; align-items: center; justify-content: space-between; background: var(--card);
  border-radius: 10px; padding: 12px 14px; cursor: pointer; margin-bottom: 8px;
}
.checklist-row.selected { background: rgba(201, 164, 99, 0.12); }
