/*
  LeRiche job portal: shared styles
  LeRiche Ltd, company number 17291284

  Palette and serif pulled directly from brand/LeRiche_Logo_Primary.svg and
  LeRiche_Monogram.svg (ink #23191B, gold #B8924F, oxblood #6E1F2E) plus the
  cream paper tone from the favicon SVG (#FAFAF6). Georgia is the primary
  logo's own font choice, used here rather than loading an external
  webfont, so the installed app works fully offline and the brand mark and
  the app chrome share one typeface family without a network dependency.

  Restrained, not loud: generous whitespace, thin borders, no heavy shadows
  or gradients. See brand/LeRiche_Brand_Voice_and_Story.md.
*/

:root {
  --ink: #23191b;
  --ink-soft: #4a3f41;
  --gold: #b8924f;
  --gold-soft: #a88b5f;
  --oxblood: #6e1f2e;
  --cream: #faf9f6;
  --paper: #ffffff;
  --border: #e6ded0;
  --border-soft: #f0ebe0;
  --success: #3f6b4a;
  --warning: #966a2d;
  --danger: #6e1f2e;
  --muted: #8a7f73;

  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;

  --radius: 6px;
  --shadow-card: 0 1px 2px rgba(35, 25, 27, 0.06), 0 1px 1px rgba(35, 25, 27, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 0.75em; }

a { color: var(--oxblood); text-decoration: none; }
a:hover { text-decoration: underline; }

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

img { max-width: 100%; display: block; }

/* ---------------------------------------------------------------- layout */

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img { height: 28px; width: 28px; }

.brand-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.brand-role {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 6px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.topbar-user .name { font-weight: 600; }

.main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px;
}

.footer-space { height: 72px; } /* clears the mobile bottom nav */

/* ------------------------------------------------------------------ nav */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab {
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab.active {
  color: var(--ink);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: none;
  background: var(--paper);
  border-top: 1px solid var(--border);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  z-index: 20;
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 6px 0;
}

.bottom-nav a.active { color: var(--oxblood); font-weight: 600; }

@media (max-width: 720px) {
  .bottom-nav { display: flex; }
  .main { padding: 16px; padding-bottom: 80px; }
}

/* --------------------------------------------------------------- cards */

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px;
  margin-bottom: 16px;
}

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.job-card {
  display: block;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.job-card:hover { border-color: var(--gold); text-decoration: none; }

.job-card .address {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.job-card .service { font-size: 0.9rem; color: var(--ink-soft); }
.job-card .meta { font-size: 0.78rem; color: var(--muted); margin-top: 6px; }

/* ----------------------------------------------------------- status pills */

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-requested, .status-quoted { background: #f3ece0; color: var(--warning); }
.status-approved, .status-scheduled { background: #eaeef0; color: #3a5566; }
.status-in_progress { background: #eef2ea; color: var(--success); }
.status-complete { background: #e7efe9; color: var(--success); }
.status-flagged { background: #f5e6e3; color: var(--danger); }
.status-cancelled { background: #ece9e6; color: var(--muted); }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover:not(:disabled) { background: #362a2c; text-decoration: none; }

.btn-gold { background: var(--gold); color: var(--paper); }
.btn-gold:hover:not(:disabled) { background: #a17f43; text-decoration: none; }

.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--gold); text-decoration: none; }

.btn-ghost { background: none; color: var(--ink-soft); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); text-decoration: none; }

.btn-danger { background: var(--paper); color: var(--danger); border-color: #e2c9c5; }
.btn-danger:hover:not(:disabled) { background: #fbf3f2; text-decoration: none; }

.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- forms */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

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

input[type="text"], input[type="email"], input[type="number"], input[type="month"],
input[type="date"], input[type="file"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
}

textarea { resize: vertical; min-height: 80px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* --------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

th { color: var(--muted); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; }

tr:last-child td { border-bottom: none; }

td.money, th.money { text-align: right; font-variant-numeric: tabular-nums; }

tfoot td { font-weight: 700; border-top: 2px solid var(--ink); }

/* ---------------------------------------------------------------- misc */

.muted { color: var(--muted); }
.money { font-variant-numeric: tabular-nums; }
.center { text-align: center; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

.banner {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.86rem;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  background: var(--paper);
}

.banner-error { background: #fbf3f2; border-color: #e2c9c5; color: var(--danger); }
.banner-info { background: #f3ece0; border-color: #e6d9bd; color: var(--warning); }
.banner-success { background: #eef2ea; border-color: #cfe0d3; color: var(--success); }

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

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

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------- photos */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--border-soft);
}

.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.photo-thumb .tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(35, 25, 27, 0.72);
  color: #fff;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 6px;
  text-align: center;
}

/* ------------------------------------------------------------- sign-in */

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

.signin-card { max-width: 360px; }
.signin-card img { height: 56px; width: 56px; margin: 0 auto 18px; }
.signin-card .motto { font-family: var(--font-serif); font-style: italic; color: var(--gold); margin-top: 18px; font-size: 0.92rem; }

/* --------------------------------------------------------- price note */

.price-provisional {
  font-size: 0.72rem;
  color: var(--warning);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-left: 6px;
}
