@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Mono:wght@400;500&family=Spectral:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  /* troopplan.com Design System Tokens */
  --ink: #1A1410;
  --stone: #3D332A;
  --bark: #6B5040;
  --sand: #C4A882;
  --cream: #F5EDD8;
  --bg: #F0E8D5;
  
  --sage: #7C9070;
  --sky: #4A7C9A;
  --gold: #C8A028;
  --ember: #C84820;
  --accent: var(--gold);
  --border-color: var(--border);
  --bg-input: var(--cream);
  --text-main: var(--ink);
  --text-muted: var(--bark);
  --text-disabled: #A69285;
  --success: var(--sage);
  --warning: var(--gold);
  
  --border: rgba(100, 80, 50, 0.18);
  --border-focus: #C8A028;
  
  --font-heading: 'Bebas Neue', sans-serif;
  --font-body: 'Spectral', Georgia, serif;
  --font-mono: 'DM Mono', monospace;
  
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Page grid texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(100, 80, 50, 0.06) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(100, 80, 50, 0.04) 40px);
  background-size: 40px 40px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--stone);
  letter-spacing: 0.02em;
}

/* App Layout */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* Top Navigation Bar */
nav.app-nav {
  background: var(--ink);
  padding: 0.55rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 0 -1.5rem 2rem;
  border-bottom: 2px solid var(--border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

nav.app-nav .nav-title {
  color: var(--gold);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

nav.app-nav .nav-sep {
  color: #3D332A;
  font-size: 0.5rem;
}

nav.app-nav .nav-btn {
  background: transparent;
  border: none;
  color: var(--sand);
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  transition: color var(--transition-fast);
}

nav.app-nav .nav-btn:hover {
  color: var(--gold);
}

nav.app-nav .nav-btn.active {
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.1rem;
}

/* ── HERO ── */
.hero {
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--border);
  margin: -2rem -1.5rem 3rem -1.5rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(175deg, #1A2830 0%, #2D4030 30%, #3D5040 60%, var(--bg) 100%);
}

.hero-topo {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cellipse cx='200' cy='200' rx='180' ry='120' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Cellipse cx='200' cy='200' rx='150' ry='95' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Cellipse cx='200' cy='200' rx='120' ry='70' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Cellipse cx='200' cy='200' rx='90' ry='48' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Cellipse cx='200' cy='200' rx='60' ry='28' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Cellipse cx='200' cy='200' rx='30' ry='12' fill='none' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 400px 400px;
  background-position: 75% 45%;
  background-repeat: no-repeat;
}

.hero-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: 0.8rem;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 8vw, 6rem);
  line-height: 0.9;
  color: #fff;
  text-shadow: 3px 4px 0 rgba(0, 0, 0, 0.25);
  margin-bottom: 0.8rem;
}

.hero h1 span {
  color: var(--gold);
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  color: var(--sand);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-left: 2px solid var(--gold);
  padding-left: 1rem;
  margin-top: 0.5rem;
}

/* Section Header styling */
.section-header {
  margin-bottom: 2.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.75rem;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  color: var(--stone);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.section-header p {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bark);
}

/* Glassmorphism -> Warm Paper Cards */
.card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  margin-bottom: 2rem;
}

/* Roster list, tables, editor layout, etc. styled to match cards */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--bark);
  transition: background var(--transition-fast);
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title-bar h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--stone);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.1;
}

/* Dynamic Views */
.view-panel {
  display: none;
  animation: fadeUp 0.35s ease both;
}

.view-panel.active {
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Retro Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  background: transparent;
  color: var(--bark);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:hover {
  background: var(--stone);
  color: var(--cream);
  border-color: var(--stone);
}

.btn-primary {
  background: var(--sage);
  color: #fff;
  border-color: var(--sage);
}

.btn-primary:hover {
  background: #5a7050;
  border-color: #5a7050;
  color: #fff;
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

.btn-accent:hover {
  background: var(--stone);
  color: var(--cream);
  border-color: var(--stone);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--bark);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--ember);
  color: var(--ember);
}

.btn-danger:hover {
  background: var(--ember);
  color: #fff;
  border-color: var(--ember);
}

.btn-sm {
  font-size: 0.6rem;
  padding: 0.4rem 0.8rem;
}

/* Dashboard Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--bark);
}

.stat-card.accent-widget::before {
  background: var(--gold);
}

.stat-icon {
  background-color: rgba(100, 80, 50, 0.05);
  color: var(--bark);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid var(--border);
}

.stat-info h3 {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 0.25rem;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 1;
  color: var(--stone);
}

/* Outings Grid */
.outings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.outing-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.outing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  border-color: var(--gold);
}

.outing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--bark);
  transition: background 0.2s;
}

.outing-card:hover::before {
  background: var(--gold);
}

.outing-card-header {
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.outing-card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  line-height: 1.1;
}

.outing-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--sage);
  color: #fff;
  border: 1px solid var(--sage);
}

.outing-card-body {
  padding: 1.25rem 1.5rem;
  flex-grow: 1;
}

.outing-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--stone);
  margin-bottom: 0.4rem;
}

.outing-meta-item strong {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--bark);
  text-transform: uppercase;
  font-weight: 500;
  width: 85px;
}

.outing-card-footer {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Forms & Constraints */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 0.4rem;
  cursor: pointer;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background-color: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  min-height: 42px;
  outline: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  background-color: #fff;
}

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

input:invalid:user-invalid,
select:invalid:user-invalid,
textarea:invalid:user-invalid {
  border-color: var(--ember);
  background-color: rgba(200, 72, 32, 0.03);
}

.field-hint {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--bark);
  opacity: 0.8;
  margin-top: 0.25rem;
}

/* Custom Fieldset */
fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: rgba(100, 80, 50, 0.02);
}

legend {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 500;
  padding: 0 0.5rem;
  color: var(--stone);
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.checkbox-item input[type="checkbox"] {
  accent-color: var(--sage);
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  cursor: pointer;
}

/* Itinerary Details list */
.itinerary-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.itinerary-item {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background-color: #fff;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.itinerary-item input {
  min-height: 34px;
  padding: 0.4rem;
  font-size: 0.85rem;
}

.itinerary-item .time-field {
  width: 90px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.itinerary-item .activity-field {
  flex-grow: 1;
}

.itinerary-item .notes-field {
  width: 38%;
}

/* SPL Matchmaker Roster list card styles */
.scout-match-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.scout-match-card:hover, .scout-match-card.active {
  border-color: var(--gold);
  background-color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.scout-match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.rank-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  background-color: rgba(100, 80, 50, 0.05);
  color: var(--bark);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.requirement-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.req-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  background-color: var(--cream);
  border: 1px solid var(--border);
  color: var(--stone);
}

.req-pill.needed {
  background-color: rgba(200, 72, 32, 0.08);
  border-color: var(--ember);
  color: var(--ember);
}

.req-pill.completed {
  background-color: rgba(124, 144, 112, 0.08);
  border-color: var(--sage);
  color: var(--sage);
}

.scout-gender-age {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background-color: rgba(100, 80, 50, 0.05);
  border: 1px solid var(--border);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  color: var(--bark);
}

/* Assignments Grid */
.assignment-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.assignment-info h4 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--stone);
  line-height: 1.1;
  margin-bottom: 0.2rem;
}

.assignment-info p {
  font-size: 0.85rem;
  color: var(--bark);
  line-height: 1.4;
}

.assigned-scout-info {
  text-align: right;
}

.assigned-scout-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: 500;
}

.assigned-scout-req {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--sage);
  display: block;
}

/* Tenting layout */
.tent-card {
  background: var(--cream);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  transition: all var(--transition-normal);
}

.tent-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--bark);
}

.tent-card.violation {
  border-color: var(--ember);
  box-shadow: 0 4px 15px rgba(200, 72, 32, 0.08);
}

.tent-card.violation::before {
  background: var(--ember);
}

.tent-card.compliant {
  border-color: var(--sage);
}

.tent-card.compliant::before {
  background: var(--sage);
}

.tent-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.5rem;
}

.tent-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--bark);
}

.tent-card-scouts {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 40px;
}

.tent-scout-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.tent-scout-info strong {
  color: var(--stone);
}

.tent-scout-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--bark);
  display: block;
}

.ypt-status-banner {
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-align: center;
}

.ypt-status-banner.ypt-ok {
  background-color: rgba(124, 144, 112, 0.08);
  color: var(--sage);
  border: 1px solid rgba(124, 144, 112, 0.2);
}

.ypt-status-banner.ypt-warn {
  background-color: rgba(200, 72, 32, 0.08);
  color: var(--ember);
  border: 1px solid rgba(200, 72, 32, 0.2);
  text-align: left;
}

.ypt-reasons {
  margin-top: 0.25rem;
  padding-left: 1.1rem;
}

.ypt-reasons li {
  font-size: 0.65rem;
  margin-bottom: 0.15rem;
}

/* Toast Alerts */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--sage);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(100px);
  opacity: 0;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  z-index: 1000;
  border: 1px solid #5a7050;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-error {
  background-color: var(--ember);
  border-color: #a03010;
}

/* Table Roster Styles */
table th {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--bark);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem;
}

table td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

/* Floating helper link */
.source-sheets-link {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  background-color: var(--cream);
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--bark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.source-sheets-link:hover {
  background: var(--stone);
  color: var(--cream);
  border-color: var(--stone);
}

/* Footer Section */
footer.app-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--bark);
  letter-spacing: 0.05em;
}

.footer-note {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--bark);
  opacity: 0.6;
  letter-spacing: 0.08em;
}
