:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary2: #4338ca;
  --accent: #10b981;
  --line: #f1f5f9;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 20px;
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.02), 0 8px 10px -6px rgba(15, 23, 42, 0.02);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 24px;
}

/* Nav is handled by modern Tailwind header.php, but keep legacy support */
.nav {
  height: 78px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.02em;
  font-family: 'Outfit', sans-serif;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
}

.btn, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
  transition: all 0.2s ease;
}
.btn:hover {
  background: var(--primary2);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.2);
}
.btn.secondary {
  background: #e0e7ff;
  color: var(--primary);
  box-shadow: none;
}
.btn.secondary:hover {
  background: #c7d2fe;
}
.btn.ghost {
  background: white;
  color: var(--ink);
  border: 1px solid #e2e8f0;
  box-shadow: none;
}
.btn.ghost:hover {
  background: #f8fafc;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
}

h1 {
  font-size: 48px;
  line-height: 1.1;
  margin: 0 0 20px;
  letter-spacing: -1.5px;
}
h2 {
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 16px;
  letter-spacing: -0.8px;
}
h3 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.5px;
}

.lead {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.6;
}

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

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

/* Stat Panels */
.stat {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
}
.stat strong {
  font-size: 32px;
  display: block;
  letter-spacing: -1px;
  color: var(--ink);
  font-family: 'Outfit', sans-serif;
}
.stat span {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
  display: inline-block;
}

/* Form Controls */
.form {
  display: grid;
  gap: 14px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
label {
  font-weight: 700;
  font-size: 13px;
  color: #475569;
}
input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}
input:focus, select:focus, textarea:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
textarea {
  min-height: 110px;
}

/* Status Badges / Pills */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #eef2ff;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pill.green {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #d1fae5;
}
.pill.amber {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fef3c7;
}
.pill.red {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fee2e2;
}

/* Table styling for CRM listings */
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.table th, .table td {
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 14px;
}
.table th {
  background: #f8fafc;
  font-size: 11px;
  color: #64748b;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid var(--line);
}
.table tr:last-child td {
  border-bottom: 0;
}

/* Progress bar inside matching tables */
.progress {
  height: 8px;
  background: #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.small {
  font-size: 13px;
  color: var(--muted);
}

/* Responsive Overrides */
@media(max-width:980px) {
  .hero-grid, .grid-3, .grid-2, .split-section, .mini-grid, .layout, .form-row {
    grid-template-columns: 1fr;
  }
  .table {
    display: block;
    overflow-x: auto;
  }
}
