/* GrowPocket Admin — minimal earthy palette matching the app. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
               "Hiragino Sans", "Noto Sans CJK TC", sans-serif;
  color: #3d2c1d;
  background: linear-gradient(180deg, #fdf6ee 0%, #f8eedb 100%);
  min-height: 100vh;
}

.screen { min-height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }

#login, #forbidden {
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  text-align: center;
}
.logo { font-size: 48px; margin-bottom: 8px; }
.logo.error { color: #c44; }
.card h1 { margin: 8px 0; font-size: 22px; font-weight: 700; }
.muted { color: #8a7a68; font-size: 14px; }
.hint { font-size: 12px; color: #8a7a68; margin-top: 20px; }

.btn-primary {
  background: #b8865c;
  color: white;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin: 16px 0;
  width: 100%;
  transition: background 0.15s;
}
.btn-primary:hover { background: #a37a52; }
.btn-primary:disabled { background: #c4b6a3; cursor: not-allowed; }

.btn-secondary {
  background: white;
  color: #5d4a35;
  border: 1px solid #d4c4af;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-secondary:hover { background: #f5ebd9; }

.btn-link {
  background: none;
  border: none;
  color: #b8865c;
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
}

.g-icon {
  display: inline-block;
  background: white;
  color: #4285f4;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  text-align: center;
  line-height: 22px;
  font-weight: 700;
  margin-right: 8px;
}

.user-line { margin-top: 16px; font-size: 14px; }

.login-form {
  text-align: left;
  margin-top: 16px;
}
.login-form .field { margin-bottom: 12px; }

.divider {
  position: relative;
  margin: 24px 0 16px;
  text-align: center;
  color: #8a7a68;
  font-size: 12px;
}
.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: #ebd9b8;
  z-index: 0;
}
.divider span {
  position: relative;
  z-index: 1;
  background: white;
  padding: 0 12px;
}

/* Dashboard */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: white;
  border-bottom: 1px solid #ebd9b8;
}
.brand { font-weight: 700; font-size: 16px; }
.who { font-size: 14px; }
#who-username { color: #5d4a35; margin-right: 12px; font-weight: 500; }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
  flex: 1;
}
.container h2 { font-size: 20px; margin: 0 0 16px; }

.form-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field { display: block; }
.field .lbl {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: #3d2c1d;
}
.field .lbl small {
  display: block;
  font-weight: 400;
  color: #8a7a68;
  font-size: 12px;
  margin-top: 2px;
}
.field input[type=text],
.field input[type=number],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #d4c4af;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: white;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: #b8865c;
  box-shadow: 0 0 0 2px rgba(184, 134, 92, 0.2);
}
.field textarea { resize: vertical; min-height: 120px; font-family: ui-monospace, Menlo, monospace; }

fieldset.field {
  border: 1px solid #d4c4af;
  border-radius: 10px;
  padding: 12px 16px;
}
fieldset.field legend {
  padding: 0 6px;
  font-weight: 600;
  font-size: 14px;
}
.radio {
  display: block;
  margin: 8px 0;
  font-size: 14px;
  cursor: pointer;
}
.radio input { margin-right: 8px; }
.radio small {
  display: block;
  font-size: 12px;
  color: #8a7a68;
  margin-left: 24px;
  margin-top: 2px;
}

.status { font-size: 13px; margin: 0; min-height: 18px; }
.status.error { color: #c44; }
.status.ok { color: #2a8c4a; }

/* Results */
.results {
  margin-top: 24px;
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.results h3 { margin: 0 0 12px; font-size: 16px; }
.result-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.result-meta .actions { display: flex; gap: 8px; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #f0e1c8;
  font-family: ui-monospace, Menlo, monospace;
}
th {
  background: #fdf6ee;
  font-weight: 600;
  color: #5d4a35;
  font-family: inherit;
}
.copy-btn {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid #d4c4af;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  color: #5d4a35;
}
.copy-btn:hover { background: #fdf6ee; }
.copy-btn.copied { background: #d4ecd9; border-color: #2a8c4a; color: #2a8c4a; }

.footer-note {
  margin-top: 24px;
  font-size: 12px;
  color: #8a7a68;
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .container { padding: 16px; }
  .form-card { padding: 16px; }
  th, td { padding: 6px 8px; font-size: 12px; }
}
