/* ========================================================================
   Henri — App stylesheet
   Brand: forest green #1A4230 + bronze accent #A57334 + soft off-white #FAFAF7
   ======================================================================== */

:root {
  --brand:       #1A4230;
  --brand-dark:  #133225;
  --brand-mid:   #2a5a44;
  --brand-light: #e6efea;
  --brand-xlight:#f3f7f4;

  --accent:      #A57334; /* bronze — used VERY sparingly */
  --accent-soft: #f3ead9;

  --bg:          #FAFAF7;
  --surface:     #ffffff;
  --border:      #e5e7eb;
  --border-soft: #f0f0ec;

  --text-1:      #111827;
  --text-2:      #374151;
  --text-3:      #6b7280;
  --text-4:      #9ca3af;

  --success:     #059669;
  --warning:     #d97706;
  --danger:      #dc2626;

  --radius:      8px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 2px rgba(15,23,42,.05);
  --shadow:      0 4px 12px rgba(15,23,42,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: var(--text-1);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Layout ──────────────────────────────────────────────────────────── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.app-header .logo { display: flex; align-items: center; gap: 10px; }
.app-header .logo img { height: 36px; width: auto; }

.app-nav { display: flex; gap: 4px; align-items: center; }
.app-nav a {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  display: block;
  text-decoration: none;
}
.app-nav a:hover { background: var(--brand-xlight); color: var(--brand); text-decoration: none; }
.app-nav a.active { background: var(--brand); color: #fff; }

/* Dropdown groups */
.app-nav-group { position: relative; }
.app-nav-trigger {
  background: transparent;
  border: 0;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.app-nav-trigger:hover { background: var(--brand-xlight); color: var(--brand); }
.app-nav-group.active > .app-nav-trigger { background: var(--brand); color: #fff; }
.app-nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(14,42,30,.08);
  min-width: 200px;
  padding: 6px;
  margin-top: 4px;
  z-index: 200;
}
.app-nav-dropdown a {
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-2);
  white-space: nowrap;
  border-radius: 4px;
}
.app-nav-dropdown a:hover { background: var(--brand-xlight); color: var(--brand); }
.app-nav-group.open > .app-nav-dropdown { display: block; }

/* User menu dropdown */
.user-trigger {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 6px 12px !important;
}
.avatar-mini {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

.app-user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
}
.app-user-menu .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.app-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 24px;
}

.app-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 24px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}
.app-footer a { color: var(--text-3); }

/* ── Cards & sections ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--brand); }
.card-body { padding: 18px; }

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 4px;
}
.section-sub {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 18px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.2;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }

.btn-secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-xlight); text-decoration: none; }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--brand-xlight); text-decoration: none; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; text-decoration: none; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-block { width: 100%; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-label-required::after { content: " *"; color: var(--danger); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text-1);
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 66, 48, .15);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-help { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 4px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── Flash / alerts ──────────────────────────────────────────────────── */
.flash-stack { margin-bottom: 18px; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 10px;
  border: 1px solid transparent;
}
.flash-success { background: #f0fdf4; color: #065f46; border-color: #bbf7d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash-info    { background: var(--brand-xlight); color: var(--brand); border-color: var(--brand-light); }

/* ── Tables ──────────────────────────────────────────────────────────── */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--brand-xlight);
  color: var(--brand);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--brand-light);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-2);
}
.data-table tr:hover td { background: var(--brand-xlight); }
.data-table .actions {
  text-align: right;
  white-space: nowrap;
}

/* Mobile card list — render alongside data-table; CSS swaps them at narrow widths */
.m-rows { display: none; }
.m-row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.m-row-title { font-weight: 600; color: var(--brand); margin-bottom: 4px; }
.m-row-meta { font-size: 13px; color: var(--text-3); }

@media (max-width: 700px) {
  table.data-table { display: none; }
  .m-rows { display: block; }
}

/* ── Badges & pills ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--brand-light);
  color: var(--brand);
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-muted   { background: #f3f4f6; color: var(--text-3); }

/* ── Empty states ────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-state h3 {
  font-size: 18px;
  color: var(--text-2);
  margin: 12px 0 6px;
}
.empty-state p { font-size: 14px; margin-bottom: 18px; }

/* ── Auth pages (login, signup, etc.) ────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at top left, rgba(165,115,52,.06), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(26,66,48,.06), transparent 60%);
  position: relative;
}

.auth-page::before {
  /* subtle decorative cream shape behind the card */
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: #F1EEE5;
  opacity: .55;
  z-index: 0;
  filter: blur(2px);
  transform: translateY(-30px) rotate(-4deg);
}

.auth-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid #ECEAE0;
  border-radius: 20px;
  box-shadow:
    0 1px 2px rgba(14, 42, 30, .04),
    0 24px 48px -16px rgba(14, 42, 30, .12);
  padding: 44px 40px 36px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo img {
  height: 44px;
  width: auto;
  display: inline-block;
  /* No background, no padding — logo PNG is now transparent */
}

.auth-title {
  text-align: center;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: #0E2A1E;
  margin-bottom: 6px;
  line-height: 1.15;
}
.auth-sub {
  text-align: center;
  font-size: 15px;
  color: #4A5750;
  margin-bottom: 28px;
}
.auth-foot {
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
  color: #7B857F;
}
.auth-foot a {
  color: var(--brand);
  font-weight: 500;
}

/* Form polish on auth pages */
.auth-box .form-group { margin-bottom: 18px; }
.auth-box .form-label {
  font-size: 13px;
  font-weight: 600;
  color: #4A5750;
  margin-bottom: 6px;
  display: block;
}
.auth-box .form-input,
.auth-box .form-select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid #E2DFD4;
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.auth-box .form-input:focus,
.auth-box .form-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26,66,48,.1);
}
.auth-box .btn-primary {
  width: 100%;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  margin-top: 4px;
}

/* Bronze dot — subtle brand callback above the form */
.auth-box .auth-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #A57334;
  margin: 0 auto 14px;
}

/* ── Mobile nav ──────────────────────────────────────────────────────── */
.app-nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  font-size: 22px;
  color: var(--text-2);
  cursor: pointer;
}

@media (max-width: 800px) {
  .app-header { padding: 10px 16px; flex-wrap: wrap; }
  .app-nav-toggle { display: block; }
  .app-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    z-index: 100;
    gap: 0;
  }
  .app-nav.open { display: flex; }
  .app-nav.is-open { display: flex; } /* legacy */
  .app-nav a, .app-nav-trigger { padding: 12px 14px; text-align: left; width: 100%; }

  /* Inline-expand dropdowns on mobile (no absolute positioning) */
  .app-nav-group { width: 100%; }
  .app-nav-dropdown {
    position: static;
    box-shadow: none;
    border: 0;
    background: var(--paper-warm, #f3f0e6);
    border-radius: 6px;
    margin: 4px 0 8px;
    padding: 4px 6px 4px 18px;
  }

  .app-main { padding: 16px; }
  .app-user-menu .name { display: none; }
}

/* ── Utility ─────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-3); }
.text-brand  { color: var(--brand); }
.mt-1 { margin-top: 6px; }   .mt-2 { margin-top: 12px; }   .mt-3 { margin-top: 18px; }   .mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 24px; }
.flex { display: flex; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 18px; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }

/* ── Bronze accent — used VERY sparingly to match the dot-above-i in logo ── */
.brand-accent-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 4px;
}
