/* Cincinnati Clean — Design System
   Cafecito AI × Cintas Corporation Demo
   Built for a 55-year-old Ohio executive. White. Professional. Readable.
   Google Workspace meets Salesforce.
*/

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

/* ── CSS Custom Properties ─────────────────────────────────────────────────── */

:root {
  /* Backgrounds */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-tertiary: #F1F5F9;
  --bg-nav: #1E293B;

  /* Brand */
  --brand-primary: #1E40AF;
  --brand-secondary: #3B82F6;
  --brand-accent: #7C3AED;

  /* Signals */
  --signal-critical: #DC2626;
  --signal-warning: #D97706;
  --signal-caution: #2563EB;
  --signal-healthy: #059669;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;

  /* Borders & Shadows */
  --border-light: #E5E7EB;
  --border-medium: #D1D5DB;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ── Base Reset ────────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  background: var(--bg-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Typography ────────────────────────────────────────────────────────────── */

h1 {
  font-family: 'Inter', sans-serif;
  font-size: 2rem;        /* 32px */
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;      /* 24px */
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;     /* 20px */
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

h4 {
  font-family: 'Inter', sans-serif;
  font-size: 1.125rem;    /* 18px */
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}

small {
  font-size: 0.875rem;
  color: var(--text-muted);
}

code,
pre {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.875rem;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */

.page-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: 240px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  background: white;
  border-right: 1px solid var(--border-light);
  padding: 1rem 0;
  z-index: 100;
}

.main-content {
  grid-column: 2;
  padding: 56px 2rem 2rem;
  max-width: 1400px;
  width: 100%;
}

/* ── Top Bar ───────────────────────────────────────────────────────────────── */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-nav);
  color: white;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  justify-content: space-between;
  grid-column: 1 / -1;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.top-bar .brand {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  letter-spacing: -0.01em;
}

.top-bar .brand-sub {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 0.5rem;
  font-family: 'Inter', sans-serif;
}

/* ── Sidebar Navigation ────────────────────────────────────────────────────── */

.nav-section-label {
  padding: 0.375rem 1rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  margin-top: 0.5rem;
}

.nav-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0.5rem 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  transition: all 200ms ease;
  border-left: 3px solid transparent;
  line-height: 1.4;
}

.nav-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item.active {
  border-left: 3px solid var(--brand-primary);
  background: #EFF6FF;
  color: var(--brand-primary);
  padding-left: calc(1rem - 3px);
  font-weight: 600;
}

.nav-item .nav-icon {
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */

.card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.card-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Signal border variants */
.card-critical {
  border-left: 4px solid var(--signal-critical);
}

.card-warning {
  border-left: 4px solid var(--signal-warning);
}

.card-caution {
  border-left: 4px solid var(--signal-caution);
}

.card-healthy {
  border-left: 4px solid var(--signal-healthy);
}

.card-ai {
  border-left: 4px solid var(--brand-accent);
  background: #F5F3FF;
}

.card-info {
  border-left: 4px solid var(--brand-secondary);
  background: #EFF6FF;
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-critical {
  background: #FEE2E2;
  color: #991B1B;
}

.badge-high {
  background: #FEF3C7;
  color: #92400E;
}

.badge-medium {
  background: #DBEAFE;
  color: #1E40AF;
}

.badge-low {
  background: #D1FAE5;
  color: #065F46;
}

.badge-demo {
  background: #FEF3C7;
  color: #92400E;
}

.badge-healthy {
  background: #D1FAE5;
  color: #065F46;
}

.badge-warning {
  background: #FEF3C7;
  color: #92400E;
}

.badge-ai,
.ai-badge {
  background: #EDE9FE;
  color: #5B21B6;
}

.badge-info {
  background: #DBEAFE;
  color: #1E40AF;
}

/* ── Hero Metrics ────────────────────────────────────────────────────────────── */

.metric-hero {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.metric-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.metric-sublabel {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

.metric-danger {
  color: var(--signal-critical);
}

.metric-warning {
  color: var(--signal-warning);
}

.metric-success {
  color: var(--signal-healthy);
}

.metric-caution {
  color: var(--signal-caution);
}

/* ── Data Table ──────────────────────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
}

.data-table th {
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-light);
  white-space: nowrap;
  background: var(--bg-primary);
}

.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--bg-secondary);
  cursor: pointer;
}

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

.data-table .td-primary {
  font-weight: 600;
  color: var(--text-primary);
}

.data-table .td-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  transition: all 200ms ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-primary {
  background: var(--brand-primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #1e3a8a;
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background: white;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
}

.btn-danger {
  background: var(--signal-critical);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  color: white;
  text-decoration: none;
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ── Form Elements ─────────────────────────────────────────────────────────── */

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: white;
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* ── Progress / Risk Bar ──────────────────────────────────────────────────── */

.risk-bar-track {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 9999px;
  overflow: hidden;
}

.risk-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 600ms ease;
}

.risk-bar-critical { background: var(--signal-critical); }
.risk-bar-high     { background: var(--signal-warning); }
.risk-bar-medium   { background: var(--signal-caution); }
.risk-bar-low      { background: var(--signal-healthy); }

/* ── Utility Classes ─────────────────────────────────────────────────────── */

/* Text colors */
.text-muted    { color: var(--text-muted); }
.text-primary  { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-critical { color: var(--signal-critical); }
.text-warning  { color: var(--signal-warning); }
.text-healthy  { color: var(--signal-healthy); }
.text-brand    { color: var(--brand-primary); }
.text-accent   { color: var(--brand-accent); }

/* Font families */
.font-inter  { font-family: 'Inter', sans-serif; }
.font-sans   { font-family: 'Source Sans 3', sans-serif; }
.font-mono   { font-family: 'JetBrains Mono', monospace; }

/* Font weights */
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* Text sizes */
.text-xs  { font-size: 0.75rem; }
.text-sm  { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg  { font-size: 1.125rem; }
.text-xl  { font-size: 1.25rem; }

/* Display */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; justify-content: center; align-items: center; }
.flex-end     { display: flex; justify-content: flex-end; align-items: center; }
.flex-start   { display: flex; justify-content: flex-start; align-items: center; }
.items-start  { align-items: flex-start; }
.items-center { align-items: center; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* Gap */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Margin bottom */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

/* Margin top */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

/* Padding */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* Text alignment */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Width / Height */
.w-full  { width: 100%; }
.h-full  { height: 100%; }

/* Border radius */
.rounded    { border-radius: 4px; }
.rounded-md { border-radius: 6px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-full { border-radius: 9999px; }

/* Backgrounds */
.bg-white     { background: white; }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary  { background: var(--bg-tertiary); }

/* Borders */
.border        { border: 1px solid var(--border-light); }
.border-medium { border: 1px solid var(--border-medium); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Visibility */
.hidden          { display: none; }
.invisible       { visibility: hidden; }
.relative        { position: relative; }
.absolute        { position: absolute; }
.fixed           { position: fixed; }
.inset-0         { top: 0; right: 0; bottom: 0; left: 0; }

/* ── Animations ──────────────────────────────────────────────────────────── */

.animate-fade-in {
  animation: fadeIn 300ms ease;
}

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

.animate-pulse-subtle {
  animation: pulseSub 2s ease-in-out infinite;
}

@keyframes pulseSub {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

.animate-slide-in {
  animation: slideIn 250ms ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Skeleton Loading ────────────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5rem;
}

.skeleton-text-sm {
  height: 0.75em;
  width: 60%;
  margin-bottom: 0.375rem;
}

.skeleton-card {
  height: 120px;
}

.skeleton-row {
  height: 48px;
  margin-bottom: 1px;
  border-radius: 0;
}

.skeleton-circle {
  border-radius: 9999px;
}

/* ── Watermark ───────────────────────────────────────────────────────────── */

.watermark-synthetic {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 4rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.05);
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.1em;
  user-select: none;
  text-transform: uppercase;
}

/* ── Demo Footer ─────────────────────────────────────────────────────────── */

.demo-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2rem;
  border-top: 1px solid var(--border-light);
  margin-top: 3rem;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
}

/* ── Alert / Banner ──────────────────────────────────────────────────────── */

.alert {
  padding: 0.875rem 1rem;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.alert-critical {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  border-left: 4px solid var(--signal-critical);
}

.alert-warning {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  border-left: 4px solid var(--signal-warning);
}

.alert-info {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
  border-left: 4px solid var(--brand-secondary);
}

.alert-success {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #065F46;
  border-left: 4px solid var(--signal-healthy);
}

/* ── Tooltip ─────────────────────────────────────────────────────────────── */

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-nav);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  padding: 0.375rem 0.625rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 500;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ── Divider ─────────────────────────────────────────────────────────────── */

.divider {
  height: 1px;
  background: var(--border-light);
  margin: 1.5rem 0;
}

/* ── Section Header ──────────────────────────────────────────────────────── */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Loading Spinner ─────────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border-light);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

.spinner-lg {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
}

/* ── Empty State ─────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.empty-state-title {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.empty-state-message {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto;
}

/* ── Mobile Overlay ──────────────────────────────────────────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

body.sidebar-open .sidebar-overlay {
  display: block;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Hide sidebar by default on mobile */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 250ms ease;
    z-index: 150;
  }

  /* Show sidebar when body has sidebar-open class */
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  /* Main content takes full width */
  .page-layout {
    grid-template-columns: 1fr;
  }

  .main-content {
    grid-column: 1;
    padding: 1rem;
    padding-top: calc(56px + 1rem);
  }

  /* Stack hero metrics vertically */
  .grid-3,
  .grid-4,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .metric-hero {
    font-size: 2rem;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .top-bar {
    padding: 0 1rem;
  }

  /* Show hamburger button */
  #sidebar-toggle {
    display: block !important;
  }

  /* Hide nav items text on very small screens if needed */
  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
  }

  .btn {
    padding: 0.45rem 0.875rem;
    font-size: 0.8rem;
  }

  .card {
    padding: 1rem;
  }

  .metric-hero {
    font-size: 1.75rem;
  }
}

/* ── Map Marker Pulse ─────────────────────────────────────────────────── */

.pulse-marker {
  animation: markerPulse 2s ease-in-out infinite;
}

@keyframes markerPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.5; }
}

/* ── Print Styles ─────────────────────────────────────────────────────────── */

@media print {
  .sidebar,
  .top-bar,
  #sidebar-toggle,
  .watermark-synthetic,
  .btn,
  .demo-footer {
    display: none !important;
  }

  .main-content {
    grid-column: 1;
    padding: 1rem !important;
    padding-top: 1rem !important;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  body {
    font-size: 12px;
  }
}
