:root {
  --primary: #6d1b3b;
  --primary-light: #8f2a4d;
  --accent: #c9a227;
  --accent-dark: #8a6c17;
  --danger: #a13345;
  --bg: #faf6ec;
  --card: #fffdf8;
  --text: #2b1c1f;
  --muted: #7d6f5f;
  --border: #e6dcc3;
  font-size: 17px;
}

/* The admin uses the app on a bigger screen and needs more information
   visible at once, so it keeps a normal (not enlarged) text size. */
html.role-admin {
  font-size: 15px;
}

* { box-sizing: border-box; }

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

button {
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

.topbar {
  background: var(--primary);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .brand {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.topbar .user-info {
  font-size: 0.9rem;
  opacity: 0.9;
  text-align: right;
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  margin-top: 4px;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}

.card h2 {
  margin-top: 0;
  font-size: 1.25rem;
  color: var(--primary);
}

.card h3 {
  font-size: 1.05rem;
  color: var(--primary-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 1.05rem;
  width: 100%;
  margin-top: 8px;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-outline { background: var(--card); color: var(--primary); border: 2px solid var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-small { width: auto; padding: 10px 14px; font-size: 0.95rem; }

.btn:disabled { opacity: 0.5; }

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.field .hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}

.field textarea { min-height: 100px; resize: vertical; }

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 18px;
  padding-bottom: 2px;
}

.tab {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.progress-bar {
  background: #e6e9ee;
  border-radius: 999px;
  overflow: hidden;
  height: 14px;
  margin: 8px 0;
}

.progress-bar-fill {
  background: var(--accent);
  height: 100%;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 0.9rem;
  color: var(--muted);
}

table.simple {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

table.simple th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }

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

.badge-green { background: #f6ecc4; color: var(--accent-dark); }
.badge-gray { background: #eceff2; color: var(--muted); }

.error-msg {
  background: #fdecea;
  color: var(--danger);
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.success-msg {
  background: #f6ecc4;
  color: var(--accent-dark);
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--card);
  border-radius: 18px;
  padding: 36px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  text-align: center;
}

.login-card .login-logo {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
  margin: 0 auto 12px;
}

.login-card .tagline {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.contact-card {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--card);
}

.contact-card.done {
  background: #faf3dc;
  border-color: #e6d191;
}

.contact-card .contact-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phone-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.phone-number {
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.call-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.whatsapp-btn {
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 10px 0;
}

.list-select {
  margin-bottom: 10px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.top-actions .btn { margin-top: 0; width: auto; flex: 1 1 auto; }

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

.row-inline {
  display: flex;
  gap: 10px;
}

.row-inline > * { flex: 1; }

.filter-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
