:root {
  --navy: #1c2b3a;
  --navy-light: #24384a;
  --cream: #f7f5f0;
  --orange: #c1502e;
  --orange-light: #f5c9b8;
  --green: #4f6f5f;
  --green-light: #dfe9e2;
  --text: #1c2b3a;
  --muted: #6b7684;
  --border: #e3e0d8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--text); }
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ---------- Console shell (admin / staff / vendor) ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--navy); color: #fff; padding: 24px 16px;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar .brand { font-weight: 700; font-size: 1.1rem; margin-bottom: 24px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav a { padding: 10px 12px; border-radius: 8px; color: #cdd6de; }
.sidebar nav a.active { background: var(--orange); color: #fff; font-weight: 600; }
.sidebar nav a:hover:not(.active) { background: var(--navy-light); }
.logout-form { margin-top: auto; }
.link-btn { background: none; border: none; color: #e6b3a3; cursor: pointer; padding: 10px 12px; }
.main { flex: 1; padding: 32px 40px; max-width: 1200px; }

/* ---------- Tenant phone-style shell ---------- */
.phone { max-width: 420px; margin: 0 auto; min-height: 100vh; background: var(--cream); padding: 24px 20px 90px; }

/* ---------- Shared bits ---------- */
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .05em; font-size: 0.75rem; font-weight: 700; color: var(--orange); }

.card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.card-dark { background: var(--navy); color: #fff; border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.card-green { border: 1px solid var(--green); background: var(--green-light); }
.card-orange { border: 1px solid var(--orange); background: #fdf1ec; }

.btn { display: inline-block; width: 100%; text-align: center; padding: 14px; border-radius: 10px; border: none; cursor: pointer; font-weight: 700; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-secondary { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-success { background: var(--green); color: #fff; }
.btn-small { width: auto; padding: 8px 16px; font-size: 0.85rem; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.badge-emergency, .badge-urgent { background: var(--orange-light); color: var(--orange); }
.badge-next_available, .badge-low_priority { background: #eee; color: var(--muted); }
.badge-new { background: var(--orange-light); color: var(--orange); }
.badge-scheduled, .badge-assigned_super, .badge-assigned_vendor { background: #d9e4ee; color: #2c4a63; }
.badge-completed { background: var(--green-light); color: var(--green); }
.badge-denied, .badge-pending_approval { background: #eee; color: var(--muted); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=date], .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: #fbfaf8;
}
.field textarea { min-height: 90px; resize: vertical; }

.radio-option, .checkbox-option {
  display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
}
.radio-option.selected, .checkbox-option.selected { border-color: var(--orange); background: #fdf1ec; }
.radio-option input, .checkbox-option input { margin-top: 3px; }

.pill-toggle { display: inline-flex; border-radius: 999px; background: #e9e6de; padding: 3px; }
.pill-toggle a { padding: 6px 16px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; }
.pill-toggle a.active { background: var(--navy); color: #fff; }

.top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.bell { position: relative; width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; }
.bell .dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }

.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border);
  display: flex; max-width: 420px; margin: 0 auto; }
.bottom-nav a { flex: 1; text-align: center; padding: 14px 0; font-size: 0.8rem; color: var(--muted); }
.bottom-nav a.active { color: var(--orange); font-weight: 700; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; text-transform: uppercase; font-size: 0.72rem; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); }

.stat-grid { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-box { flex: 1; min-width: 140px; border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: #fff; }
.stat-box .value { font-size: 1.8rem; font-weight: 700; }

.stepper { display: flex; align-items: center; margin-bottom: 20px; }
.stepper .dot { width: 14px; height: 14px; border-radius: 50%; background: #ddd; }
.stepper .dot.done { background: var(--orange); }
.stepper .line { flex: 1; height: 2px; background: #ddd; }
.stepper .line.done { background: var(--orange); }
.stepper-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--muted); margin-bottom: 20px; }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); font-size: 0.85rem; }
.tabs a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.board { display: flex; gap: 14px; overflow-x: auto; }
.board-col { min-width: 220px; }
.board-col .head { padding: 8px 12px; border-radius: 8px 8px 0 0; font-weight: 700; font-size: 0.8rem; color: #fff; }
.board-col .items { border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; padding: 10px; min-height: 60px; background: #fff; }
.board-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; font-size: 0.85rem; }

.auth-page { max-width: 420px; margin: 0 auto; padding: 40px 24px; min-height: 100vh; background: var(--navy); color: #fff; }
.auth-page.light { background: var(--cream); color: var(--text); }
.auth-page .field label { color: #b9c2cc; }
.auth-page.light .field label { color: var(--muted); }
.auth-page .field input { background: #24384a; border-color: #33465a; color: #fff; }
.auth-page.light .field input { background: #fff; border-color: var(--border); color: var(--text); }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 0.8rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #33465a; }
.auth-page.light .divider::before, .auth-page.light .divider::after { background: var(--border); }

.error-msg { background: #fdf1ec; color: var(--orange); border: 1px solid var(--orange); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 0.9rem; }

.photo-thumb { width: 64px; height: 64px; border-radius: 10px; background: #e6e2d8; display: inline-block; margin-right: 8px; object-fit: cover; }

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 12px 16px; }
  .sidebar nav { flex-direction: row; overflow-x: auto; }
  .logout-form { margin-top: 0; }
  .main { padding: 20px; }
}
