@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f7f5f0;
  --card: #ffffff;
  --border: #e7e2d6;
  --ink: #2a2b26;
  --ink-soft: #5b5c54;
  --ink-faint: #93948a;

  --sidebar-bg: #171a15;
  --sidebar-bg-active: #232821;
  --sidebar-text: #cbcdc3;
  --sidebar-text-dim: #888d80;
  --sidebar-border: #2a2e25;
  --gold: #b3934f;
  --gold-soft: #efe6d0;

  --green: #3f5643;
  --green-dark: #33473788;
  --green-soft: #e7ede7;
  --green-text: #3d5a45;

  --tan-bg: #f7eedd;
  --tan-border: #e3d2ab;
  --tan-text: #8a6a2f;

  --terracotta-bg: #e7a765;
  --terracotta-text: #6b3f10;

  --red-bg: #f6e4e0;
  --red-text: #a04a34;

  --blue-bg: #e6edf5;
  --blue-text: #3a5a86;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(30, 30, 20, 0.04), 0 4px 16px rgba(30, 30, 20, 0.04);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; }

a { color: inherit; }

button {
  font-family: var(--sans);
  cursor: pointer;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ============================================================
   LOGIN
   ============================================================ */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
  background-image: radial-gradient(circle at 20% 20%, #1e2318 0%, #171a15 60%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  padding: 40px 36px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
  color: var(--ink);
}

.login-logo .icon { color: var(--gold); width: 22px; height: 22px; }

.login-logo-text { text-align: left; line-height: 1.1; }
.login-logo-text .top { font-family: var(--serif); font-size: 16px; letter-spacing: 0.5px; font-weight: 600; }
.login-logo-text .bottom { font-size: 9px; letter-spacing: 1.5px; color: var(--ink-faint); }

.login-card h1 {
  font-family: var(--serif);
  font-size: 22px;
  text-align: center;
  margin: 0 0 4px;
}

.login-card .sub {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0 0 26px;
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--sans);
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--green);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn .icon { width: 15px; height: 15px; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: #344a39; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--border); }
.btn-outline:hover { background: #faf9f6; }
.btn-tan { background: var(--tan-bg); color: var(--tan-text); border-color: var(--tan-border); }
.btn-tan:hover { background: #f2e6c9; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-danger-outline { background: #fff; color: var(--red-text); border-color: #e6c9c0; }

.login-error {
  background: var(--red-bg);
  color: var(--red-text);
  font-size: 13px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 16px;
}

.demo-hint {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.7;
}
.demo-hint strong { color: var(--ink-soft); }
.demo-hint button {
  border: none; background: none; padding: 0; color: var(--green-text); font-weight: 600; cursor: pointer; text-decoration: underline;
  font-size: 12px;
}

/* ============================================================
   APP SHELL
   ============================================================ */

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

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 20px;
}
.brand .icon { color: var(--gold); width: 20px; height: 20px; }
.brand-text { line-height: 1.15; }
.brand-text .top { font-family: var(--serif); font-size: 14.5px; letter-spacing: 0.4px; color: #f1efe8; font-weight: 600; }
.brand-text .bottom { font-size: 8px; letter-spacing: 1.4px; color: var(--sidebar-text-dim); margin-top: 2px; }

.nav { list-style: none; margin: 4px 0 0; padding: 0; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sidebar-text);
  cursor: pointer;
  margin-bottom: 1px;
  transition: background 0.12s;
}
.nav-item .icon { color: var(--sidebar-text-dim); }
.nav-item:hover { background: #1e2219; }
.nav-item.active { background: var(--sidebar-bg-active); color: #fff; }
.nav-item.active .icon { color: var(--gold); }
.nav-item .badge {
  margin-left: auto;
  background: var(--gold);
  color: #201a0c;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
}

.sidebar-help {
  margin-top: 14px;
  background: #1e2219;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.sidebar-help p { font-size: 12px; color: var(--sidebar-text-dim); line-height: 1.5; margin: 0 0 10px; }
.sidebar-help strong { display: block; color: #eee; font-size: 12.5px; margin-bottom: 4px; }
.sidebar-help .btn { width: 100%; background: transparent; border: 1px solid var(--gold); color: var(--gold); }
.sidebar-help .btn:hover { background: rgba(179,147,79,0.12); }

.sidebar-user {
  margin-top: 12px;
  padding: 10px 10px 2px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 9px;
}
.sidebar-user .avatar { width: 30px; height: 30px; font-size: 12px; }
.sidebar-user-name { font-size: 12.5px; color: #eee; font-weight: 600; }
.sidebar-user-logout { font-size: 11px; color: var(--sidebar-text-dim); background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline; }
.sidebar-user-logout:hover { color: #eee; }

/* ============================================================
   MAIN
   ============================================================ */

.main {
  flex: 1;
  min-width: 0;
  padding: 32px 40px 60px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 14px;
}

.topbar h1 {
  font-family: var(--serif);
  font-size: 30px;
  margin: 0 0 6px;
  font-weight: 600;
}

.project-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--ink-soft);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.project-switcher .icon { width: 16px; height: 16px; }
.project-switcher:hover { color: var(--ink); }

.page-heading { color: var(--ink-soft); font-size: 14px; margin: -2px 0 22px; }

/* ============================================================
   CARDS / GRID
   ============================================================ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1300px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
}

.stat-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--tan-bg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.stat-icon .icon { width: 17px; height: 17px; color: var(--tan-text); }

.stat-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-title { font-family: var(--serif); font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.stat-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; margin-bottom: 12px; flex: 1; }
.stat-big { font-family: var(--serif); font-size: 32px; font-weight: 700; margin-bottom: 2px; }
.stat-caption { font-size: 12px; color: var(--ink-soft); margin-bottom: 12px; }

.progress-track { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--green); border-radius: 999px; }
.progress-pct { font-size: 11.5px; color: var(--ink-faint); margin-top: auto; }

.stat-link {
  margin-top: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green-text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}
.stat-link .icon { width: 13px; height: 13px; }
.stat-link:hover { text-decoration: underline; }

.upload-list { list-style: none; padding: 0; margin: 0 0 10px; }
.upload-list li { font-size: 12.5px; margin-bottom: 8px; }
.upload-list li .fname { display: block; font-weight: 600; color: var(--ink); }
.upload-list li .fdate { color: var(--ink-faint); font-size: 11.5px; }

/* ============================================================
   TWO COLUMN ROW
   ============================================================ */

.row-2 { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; margin-bottom: 20px; align-items: start; }
@media (max-width: 1100px) { .row-2 { grid-template-columns: 1fr; } }

.card-pad { padding: 22px 24px; }

.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.card-head-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--green-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-head-icon .icon { color: var(--green-text); width: 17px; height: 17px; }
.card-head h2 { font-family: var(--serif); font-size: 18px; margin: 0 0 2px; font-weight: 600; }
.card-head p { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.card-head-action { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--green-text); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; background: none; border: none; padding: 0; }
.card-head-action .icon { width: 13px; height: 13px; }
.card-head-action:hover { text-decoration: underline; }

.question-box textarea {
  width: 100%; min-height: 92px; resize: vertical;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 14px; font-family: var(--sans); font-size: 13.5px;
  margin-bottom: 14px;
}
.question-box textarea:focus { outline: none; border-color: var(--green); }
.question-box .actions { display: flex; gap: 10px; }
.question-box .actions .btn { flex: 1; }

.doc-table { width: 100%; border-collapse: collapse; }
.doc-table td { padding: 10px 0; font-size: 13px; border-top: 1px solid var(--border); vertical-align: middle; }
.doc-table tr:first-child td { border-top: none; }
.doc-table .doc-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.doc-table .doc-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-table .doc-icon .icon { width: 15px; height: 15px; color: var(--ink-soft); }
.doc-table .doc-meta { color: var(--ink-faint); font-size: 12px; }
.doc-table .doc-updated { color: var(--ink-soft); font-size: 12.5px; white-space: nowrap; }
.doc-table .doc-action { text-align: right; white-space: nowrap; }

/* ============================================================
   MATERIAL SELECTION CARDS
   ============================================================ */

.selection-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .selection-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .selection-grid { grid-template-columns: 1fr; } }

.selection-card { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.selection-card .swatch { height: 96px; }
.selection-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.selection-card .name { font-weight: 700; font-size: 13.5px; margin-bottom: 2px; }
.selection-card .subtitle { font-size: 11.5px; color: var(--ink-faint); margin-bottom: 12px; }
.selection-card .status-row { margin-bottom: 10px; }
.selection-card .view-details { font-size: 12px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 4px; background: none; border: none; padding: 0; margin-top: auto; }
.selection-card .view-details:hover { text-decoration: underline; }
.selection-card .view-details .icon { width: 12px; height: 12px; }

.swatch { background-size: cover; background-position: center; }
.swatch-pool-tile { background: linear-gradient(135deg, #7f9296 0%, #a7b6b6 45%, #c3cdc7 100%); }
.swatch-limestone { background: linear-gradient(135deg, #cdbd9d 0%, #e2d3b1 50%, #eee1c4 100%); }
.swatch-wood { background: linear-gradient(120deg, #7a4a26 0%, #9c6534 45%, #6b4020 100%); }
.swatch-plants { background: linear-gradient(135deg, #4b5c3f 0%, #6e7f52 50%, #93a06a 100%); }
.swatch-granite { background: linear-gradient(135deg, #4a4a48 0%, #6c6c68 55%, #86867f 100%); }
.swatch-brass { background: linear-gradient(135deg, #7a5a2e 0%, #ab8348 50%, #c9a566 100%); }

.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; border: 1px solid transparent; }
.pill .icon { width: 12px; height: 12px; }
.pill-pending { background: var(--tan-bg); color: var(--tan-text); border-color: var(--tan-border); }
.pill-approved { background: var(--green-soft); color: var(--green-text); border-color: #cfe0d0; }
.pill-needs-revision { background: var(--terracotta-bg); color: #4a2a09; }
.pill-open { background: var(--blue-bg); color: var(--blue-text); }
.pill-answered { background: var(--green-soft); color: var(--green-text); }
.pill-paid { background: var(--green-soft); color: var(--green-text); }
.pill-due { background: var(--tan-bg); color: var(--tan-text); border-color: var(--tan-border); }
.pill-overdue { background: var(--red-bg); color: var(--red-text); }
.pill-complete { background: var(--green-soft); color: var(--green-text); }
.pill-current { background: var(--blue-bg); color: var(--blue-text); }
.pill-upcoming { background: #f0efe9; color: var(--ink-faint); }
.pill-acknowledged { background: var(--green-soft); color: var(--green-text); }

.pill-btn { border: none; cursor: pointer; }

/* ============================================================
   ACTIVITY TIMELINE
   ============================================================ */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 20px 26px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--card); border: 2px solid var(--green); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 15px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .t-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.timeline .t-detail { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 3px; }
.timeline .t-meta { font-size: 11.5px; color: var(--ink-faint); }

/* ============================================================
   TEAM
   ============================================================ */

.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .team-grid { grid-template-columns: 1fr; } }
.team-card { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); align-items: flex-start; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.team-card .name { font-weight: 700; font-size: 13.5px; }
.team-card .role { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.team-card .contact { font-size: 11.5px; color: var(--ink-faint); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.team-card .contact .icon { width: 12px; height: 12px; }
.team-card .contact a { text-decoration: none; }
.team-card .contact a:hover { text-decoration: underline; }
.pm-badge { font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px; color: var(--gold); background: var(--gold-soft); padding: 1px 6px; border-radius: 999px; margin-left: 6px; text-transform: uppercase; }

/* ============================================================
   GENERIC PAGE LIST/TABLE PATTERNS
   ============================================================ */

.section-card { margin-bottom: 20px; }

.filter-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-tab {
  border: 1px solid var(--border); background: #fff; color: var(--ink-soft);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-weight: 600;
}
.filter-tab.active { background: var(--green); color: #fff; border-color: var(--green); }

.list-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 0; border-top: 1px solid var(--border);
}
.list-row:first-child { border-top: none; padding-top: 4px; }
.list-row-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.list-row-icon .icon { color: var(--ink-soft); width: 17px; height: 17px; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-row-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 6px; }
.list-row-meta { font-size: 11.5px; color: var(--ink-faint); }
.list-row-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.list-row-amount { font-family: var(--serif); font-weight: 700; font-size: 15px; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-faint); }
.empty-state .icon { width: 30px; height: 30px; margin-bottom: 10px; opacity: 0.5; }
.empty-state p { font-size: 13.5px; margin: 0; }

/* thread / message styles */
.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.msg-client { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 4px; }
.msg-staff { align-self: flex-start; background: var(--bg); color: var(--ink); border-bottom-left-radius: 4px; }
.msg-meta { font-size: 10.5px; opacity: 0.75; margin-bottom: 3px; font-weight: 600; }

.reply-box { display: flex; gap: 8px; }
.reply-box textarea { flex: 1; min-height: 44px; resize: vertical; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-family: var(--sans); font-size: 13.5px; }

/* photo gallery */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 22px; }
.photo-tile { aspect-ratio: 4/3; border-radius: var(--radius-sm); overflow: hidden; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; cursor: pointer; }

/* invoice summary */
.invoice-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 700px) { .invoice-summary { grid-template-columns: 1fr; } }
.invoice-summary .card { padding: 18px 20px; }
.invoice-summary .label { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.invoice-summary .value { font-family: var(--serif); font-size: 26px; font-weight: 700; }

/* schedule */
.phase-row { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--border); }
.phase-row:first-child { border-top: none; }
.phase-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; border: 3px solid var(--border); }
.phase-dot.complete { border-color: var(--green); background: var(--green); }
.phase-dot.current { border-color: var(--green); background: #fff; }
.phase-main { flex: 1; min-width: 0; }
.phase-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.phase-dates { font-size: 11.5px; color: var(--ink-faint); margin-bottom: 6px; }

/* modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,17,12,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); max-width: 520px; width: 100%;
  max-height: 86vh; overflow-y: auto; padding: 26px 28px; box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.modal-wide { max-width: 880px; }

.photo-modal-viewer { display: flex; align-items: center; gap: 12px; }
.photo-modal-img { max-width: 100%; max-height: 75vh; width: auto; height: auto; display: block; margin: 0 auto; border-radius: 12px; flex: 1; min-width: 0; object-fit: contain; }
.photo-nav {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; display: flex; align-items: center; justify-content: center; color: var(--ink-soft);
}
.photo-nav:hover { background: var(--bg); }
.photo-nav .icon { width: 18px; height: 18px; }
.photo-nav-prev .icon { transform: rotate(180deg); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.modal-head h3 { font-family: var(--serif); font-size: 19px; margin: 0; }
.modal-close { background: none; border: none; color: var(--ink-faint); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); color: var(--ink); }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: var(--radius-md); font-size: 13.5px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25); z-index: 200; display: flex; align-items: center; gap: 8px;
  animation: toast-in 0.2s ease-out;
}
.toast .icon { color: #8fd19e; width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* settings toggle */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--border); }
.toggle-row:first-child { border-top: none; }
.toggle-row .label { font-size: 13.5px; font-weight: 600; }
.toggle-row .desc { font-size: 12px; color: var(--ink-faint); }
.toggle {
  width: 38px; height: 22px; border-radius: 999px; background: var(--border); position: relative; border: none; cursor: pointer; flex-shrink: 0;
}
.toggle.on { background: var(--green); }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle.on::after { transform: translateX(16px); }

.text-muted { color: var(--ink-faint); }
.mb-0 { margin-bottom: 0 !important; }

.admin-form-row {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px;
}
.admin-form-row .field { flex: 1; min-width: 160px; margin-bottom: 0; }
.admin-form-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; margin-bottom: 16px;
}
.admin-form-grid .field { margin-bottom: 0; }
@media (max-width: 700px) { .admin-form-grid { grid-template-columns: 1fr; } }
.admin-group-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--ink-faint); margin: 16px 0 6px;
}
.admin-photo-tile-wrap { position: relative; }
.admin-photo-delete { position: absolute; bottom: 6px; right: 6px; background: #fff; }
.admin-project-select {
  width: 100%; margin-top: 8px; padding: 7px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-border); background: #1e2219; color: #eee; font-size: 12.5px;
}

.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

code {
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; font-size: 12px;
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .main { padding: 24px 18px 50px; }
}
