/* ─── APP SHELL ─────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ──────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .wordmark {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--bg);
  text-decoration: none;
  letter-spacing: -0.02em;
  margin-bottom: 36px;
  display: block;
}
.sidebar .wordmark span { color: var(--accent); }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.nav-link {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(245, 240, 232, 0.6);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: var(--bg); }
.nav-link.active { background: rgba(255,107,53,0.15); color: var(--accent); }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.text-muted { color: rgba(245, 240, 232, 0.35) !important; font-size: 0.8rem; }

/* ─── MAIN CONTENT ─────────────────────────── */
.main-content {
  flex: 1;
  padding: 36px 40px;
  max-width: 900px;
}
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.content-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--fg);
}

/* ─── BUTTONS ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--surface); color: var(--fg); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; background: var(--surface); color: var(--fg); border: 1px solid var(--border); text-decoration: none; display: inline-block; border-radius: 6px; }
.btn-sm:hover { background: var(--bg); }

/* ─── FILTER BAR ─────────────────────────── */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-input, .filter-select {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--fg);
}
.filter-input { flex: 1; min-width: 180px; }
.filter-select { min-width: 140px; }

/* ─── PERMIT GRID ────────────────────────── */
.permit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.permit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.permit-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }
.permit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}
.permit-address {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.3;
}
.permit-card-body { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.permit-meta { font-size: 0.82rem; color: var(--muted); }
.permit-expiry { font-size: 0.82rem; font-weight: 600; }
.permit-card-footer { display: flex; justify-content: flex-end; }

/* ─── STATUS BADGES ──────────────────────── */
.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-submitted    { background: #DBEAFE; color: #1D4ED8; }
.status-in-review    { background: #FEF3C7; color: #92400E; }
.status-approved     { background: #D1FAE5; color: #065F46; }
.status-expired      { background: #FEE2E2; color: #991B1B; }
.status-renewal-due  { background: #FFEDD5; color: #9A3412; }

/* ─── FORM LAYOUT ────────────────────────── */
.form-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  align-items: start;
}
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.form-fieldset legend { font-weight: 700; font-size: 0.9rem; padding: 0 6px; color: var(--muted); }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; }

label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
}
input, select, textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--fg);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

/* ─── ACTION SIDEBAR ─────────────────────── */
.action-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: sticky;
  top: 24px;
}
.action-sidebar h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 14px;
}
.action-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.action-list li {
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}
.action-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ─── PROFILE FORM ──────────────────────── */
.profile-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  max-width: 600px;
}

/* ─── EMPTY STATE ────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state a { color: var(--accent); font-weight: 600; }

/* ─── ALERTS ────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }

/* ─── TOAST ──────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 1000;
  transition: opacity 0.25s, transform 0.25s;
  max-width: 320px;
}
.toast.hidden { opacity: 0; transform: translateY(10px); pointer-events: none; }
.toast.success { background: var(--fg); color: var(--bg); }
.toast.error { background: #FEE2E2; color: #991B1B; }

/* ─── SIGNUP STEPER ─────────────────────── */
.signup-page { min-height: 100vh; display: flex; flex-direction: column; }
.signup-wrap { max-width: 540px; margin: 0 auto; padding: 48px 24px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.step-indicator { display: flex; gap: 10px; justify-content: center; margin-bottom: 32px; }
.step-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); transition: background 0.2s; }
.step-dot.active { background: var(--accent); }
.signup-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px 36px; }
.signup-card h2 { font-family: 'Playfair Display', serif; font-size: 1.8rem; margin-bottom: 6px; }
.step-subtitle { font-size: 0.9rem; color: var(--muted); margin-bottom: 28px; }
#card-element { padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: white; margin-bottom: 12px; }
.card-errors { font-size: 0.82rem; color: #DC2626; margin-bottom: 12px; min-height: 18px; }
.trial-notice { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); margin-bottom: 20px; }
.trial-notice svg { color: var(--signal-green); flex-shrink: 0; }
.btn-full { width: 100%; justify-content: center; }
.hidden { display: none; }

/* ─── SUCCESS PAGE ─────────────────────── */
.success-page { min-height: 100vh; display: flex; flex-direction: column; }
.success-wrap { text-align: center; padding: 80px 24px; max-width: 600px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.success-icon { margin-bottom: 28px; }
.success-wrap h1 { font-family: 'Playfair Display', serif; font-size: 2.5rem; margin-bottom: 16px; line-height: 1.2; }
.success-wrap p { color: var(--muted); margin-bottom: 40px; line-height: 1.7; max-width: 440px; }
.btn-large { display: inline-block; padding: 16px 36px; background: var(--accent); color: white; border-radius: 12px; font-weight: 700; font-size: 1.05rem; text-decoration: none; transition: background 0.2s; }
.btn-large:hover { background: var(--accent-dark); }

/* ─── RESPONSIVE ─────────────────────────── */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    gap: 0;
  }
  .sidebar .wordmark { margin-bottom: 0; margin-right: auto; }
  .sidebar-nav { flex-direction: row; gap: 0; }
  .nav-link { padding: 8px 10px; font-size: 0.82rem; }
  .sidebar-footer { display: none; }
  .main-content { padding: 20px 16px; }
  .permit-grid { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .action-sidebar { position: static; }
  .form-row { grid-template-columns: 1fr; }
}
