/* ShedBoard — Shared Shed Inventory Board */
:root {
  --green-900: #1b4332;
  --green-700: #2d6a4f;
  --green-500: #40916c;
  --green-300: #74c69d;
  --green-100: #d8f3dc;
  --amber-100: #fef3c7;
  --amber-700: #b45309;
  --red-100: #fee2e2;
  --red-700: #b91c1c;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--gray-900); background: var(--gray-50); line-height: 1.6; }

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

/* Header */
.site-header { background: var(--green-900); color: #fff; padding: 0 1.5rem; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { display: flex; align-items: center; gap: .5rem; }
.logo-text { font-size: 1.2rem; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.site-nav { display: flex; gap: 1.25rem; }
.site-nav a { color: rgba(255,255,255,.85); font-size: .9rem; font-weight: 500; }
.site-nav a:hover { color: #fff; text-decoration: none; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 100%); color: #fff; padding: 4rem 1.5rem; }
.hero-content { max-width: 1100px; margin: 0 auto; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.2; margin-bottom: .75rem; letter-spacing: -.02em; }
.hero-sub { font-size: 1.1rem; opacity: .9; max-width: 560px; margin-bottom: 1.5rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-stats { max-width: 1100px; margin: 0 auto; display: flex; gap: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.15); }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.8rem; font-weight: 800; }
.stat span { font-size: .8rem; opacity: .7; text-transform: uppercase; letter-spacing: .05em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .6rem 1.25rem; border-radius: var(--radius); font-size: .9rem; font-weight: 600; cursor: pointer; border: 2px solid transparent; transition: all .15s; font-family: var(--font); text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--green-500); color: #fff; border-color: var(--green-500); }
.btn-primary:hover { background: var(--green-700); border-color: var(--green-700); }
.btn-ghost { background: transparent; color: var(--green-700); border-color: var(--green-300); }
.btn-ghost:hover { background: var(--green-100); }
.btn-danger { background: transparent; color: var(--red-700); border-color: #fca5a5; }
.btn-danger:hover { background: var(--red-100); }
.btn-sm { padding: .4rem .85rem; font-size: .82rem; }
.btn-xs { padding: .25rem .6rem; font-size: .75rem; }

/* Sections */
.section { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem; }
.section-header { margin-bottom: 1.5rem; }
.section-header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .35rem; }
.section-header p { color: var(--gray-500); }

/* Presets */
.preset-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.preset-label { font-size: .85rem; color: var(--gray-500); font-weight: 500; }
.preset-bar .btn-ghost { color: var(--gray-700); border-color: var(--gray-300); }
.preset-bar .btn-ghost:hover { background: var(--gray-100); }

/* Form */
.add-form { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.form-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: .25rem; flex: 1; min-width: 140px; }
.field label { font-size: .8rem; font-weight: 600; color: var(--gray-700); }
.field input, .field select { padding: .5rem .75rem; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: .9rem; font-family: var(--font); background: #fff; }
.field input:focus, .field select:focus { outline: 2px solid var(--green-300); outline-offset: 0; border-color: var(--green-500); }
.field-actions { flex: 0; }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); margin-bottom: 1rem; }
#inventory-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
#inventory-table th { background: var(--gray-100); padding: .65rem .75rem; text-align: left; font-weight: 600; color: var(--gray-700); border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
#inventory-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
#inventory-table tr:last-child td { border-bottom: none; }
#inventory-table tr.checked-out { background: var(--amber-100); }
#inventory-table tr.checked-out td { color: var(--amber-700); }
.col-actions { text-align: right; }
.col-actions .btn { margin-left: .25rem; }

.empty-state { text-align: center; padding: 2rem; color: var(--gray-500); font-style: italic; display: none; }
.empty-state.visible { display: block; }

/* Board actions */
.board-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Print section */
#print-board { background: var(--gray-100); }
.print-layout { display: grid; grid-template-columns: 1fr 280px; gap: 1.5rem; align-items: start; }
.print-preview { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.print-header { text-align: center; margin-bottom: 1rem; }
.print-header h3 { font-size: 1.25rem; font-weight: 700; }
.print-sub { font-size: .8rem; color: var(--gray-500); }
.print-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.print-table th { border: 2px solid var(--gray-700); padding: .4rem .5rem; text-align: left; background: var(--gray-100); }
.print-table td { border: 1px solid var(--gray-300); padding: .4rem .5rem; height: 1.8rem; }
.print-controls { display: flex; flex-direction: column; gap: 1rem; }
.qr-wrap { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1rem; text-align: center; box-shadow: var(--shadow); }
#qr-code { display: flex; justify-content: center; margin-bottom: .5rem; }
#qr-code svg { max-width: 140px; }
.qr-label { font-size: .75rem; color: var(--gray-500); }
.print-buttons { display: flex; flex-direction: column; gap: .5rem; }
.print-hint { font-size: .78rem; color: var(--gray-500); line-height: 1.5; }

/* Guide */
#guide { padding-bottom: 4rem; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; margin-bottom: 2.5rem; }
.guide-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.guide-step { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--green-700); color: #fff; border-radius: 50%; font-weight: 700; font-size: .85rem; margin-bottom: .75rem; }
.guide-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .35rem; }
.guide-card p { font-size: .88rem; color: var(--gray-500); line-height: 1.55; }

.guide-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.guide-block { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.guide-block h3 { font-size: 1rem; font-weight: 700; margin-bottom: .6rem; }
.guide-block ul { padding-left: 1.1rem; }
.guide-block li { font-size: .88rem; color: var(--gray-700); margin-bottom: .4rem; line-height: 1.5; }
.guide-block dl { font-size: .88rem; }
.guide-block dt { font-weight: 600; margin-top: .6rem; }
.guide-block dd { color: var(--gray-500); margin-left: 0; line-height: 1.5; }

/* Footer */
.site-footer { background: var(--gray-900); color: rgba(255,255,255,.7); padding: 2rem 1.5rem; font-size: .85rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-nav { display: flex; gap: 1rem; margin: .75rem 0; }
.footer-nav a { color: rgba(255,255,255,.85); }
.footer-nav a:hover { color: #fff; }
.footer-meta { color: rgba(255,255,255,.4); font-size: .78rem; }
.footer-meta a { color: rgba(255,255,255,.6); }

/* Print styles */
@media print {
  body * { visibility: hidden; }
  #print-preview, #print-preview * { visibility: visible; }
  #print-preview { position: absolute; top: 0; left: 0; width: 100%; border: none; box-shadow: none; padding: 0; }
  .site-header, .site-footer, .hero, .site-nav, .preset-bar, .add-form, .board-actions, .print-controls, #guide, .section-header, .hero-actions, .hero-stats { display: none !important; }
  .print-table th { border: 2px solid #000; }
  .print-table td { border: 1px solid #333; }
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: .5rem 0; gap: .5rem; }
  .site-nav { width: 100%; justify-content: flex-start; gap: 1rem; }
  .hero { padding: 2.5rem 1rem; }
  .hero-stats { gap: 1rem; }
  .stat strong { font-size: 1.4rem; }
  .form-row { flex-direction: column; }
  .field { min-width: 100%; }
  .print-layout { grid-template-columns: 1fr; }
  .print-controls { flex-direction: row; flex-wrap: wrap; }
  .guide-grid { grid-template-columns: 1fr 1fr; }
  .guide-details { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .guide-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .preset-bar { flex-direction: column; align-items: flex-start; }
}

/* Toast */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--gray-900); color: #fff; padding: .75rem 1.25rem; border-radius: var(--radius); font-size: .85rem; box-shadow: var(--shadow-lg); z-index: 999; opacity: 0; transform: translateY(10px); transition: all .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Focus styles */
:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
