:root {
  --teal: #0f8b8d;
  --teal-dark: #0b6b6c;
  --bg: #f4f7f7;
  --card-bg: #ffffff;
  --text: #1f2b2b;
  --muted: #5f7373;
  --border: #dbe6e6;
  --error-bg: #fdecec;
  --error-text: #a12b2b;
  --info-bg: #e8f4f4;
  --info-text: #0b6b6c;
}

* { box-sizing: border-box; }

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

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}

.card-narrow {
  max-width: 360px;
  margin: 80px auto 0;
  text-align: center;
}

h1 {
  margin: 0 0 8px;
  color: var(--teal-dark);
}

.subtitle {
  color: var(--muted);
  margin: 0 0 20px;
}

label {
  display: block;
  text-align: left;
  font-size: 0.9em;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="password"], input[type="text"] {
  width: 100%;
  padding: 12px;
  font-size: 1.1em;
  letter-spacing: 4px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}

button {
  width: 100%;
  padding: 12px;
  font-size: 1em;
  font-weight: 600;
  color: #fff;
  background: var(--teal);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

button:hover { background: var(--teal-dark); }

.pilih-nama-form {
  display: flex;
  gap: 12px;
}

.btn-pilih { flex: 1; }

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9em;
  margin-bottom: 16px;
}

.alert-error { background: var(--error-bg); color: var(--error-text); }
.alert-info { background: var(--info-bg); color: var(--info-text); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}

.topbar-right { display: flex; align-items: center; gap: 16px; color: var(--muted); }

.link-logout { color: var(--teal-dark); text-decoration: none; font-weight: 600; }
.link-logout:hover { text-decoration: underline; }

.link-back { color: var(--muted); text-decoration: none; font-size: 0.9em; }
.link-back:hover { color: var(--teal-dark); }

/* --- Form input (Fase 3) --- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.field { text-align: left; }
.field-wide { grid-column: 1 / -1; }

select {
  width: 100%;
  padding: 12px;
  font-size: 1em;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

input[type="text"], input[type="number"], input[type="date"] {
  letter-spacing: normal;
  text-align: left;
}

.error-list { margin: 0; padding-left: 20px; }
.error-list li { margin-bottom: 4px; }

/* --- Preview (Fase 3) --- */
.preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.preview-table th, .preview-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.preview-table th {
  color: var(--muted);
  font-weight: 600;
  width: 140px;
}

.preview-table .nominal { font-weight: 700; font-size: 1.1em; color: var(--teal-dark); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: 600;
}

.badge-masuk { background: var(--info-bg); color: var(--info-text); }
.badge-keluar { background: var(--error-bg); color: var(--error-text); }
.badge-transfer { background: #f0ead8; color: #8a6d1a; }

.preview-actions {
  display: flex;
  gap: 12px;
}

.preview-actions form { flex: 1; }

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg); }

.check-icon {
  font-size: 2.5em;
  color: var(--teal);
  margin: 0 0 8px;
}

.btn-link {
  display: block;
  padding: 12px;
  margin-top: 12px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.btn-link:hover { background: var(--teal-dark); }

.btn-link-secondary {
  background: #fff;
  color: var(--teal-dark);
  border: 1px solid var(--border);
}
