:root {
  --blue:    #2563eb;
  --navy:    #1e3a5f;
  --red:     #dc2626;
  --green:   #16a34a;
  --gray-50: #f8fafc;
  --gray-100:#f1f5f9;
  --gray-200:#e2e8f0;
  --gray-400:#94a3b8;
  --gray-600:#475569;
  --gray-700:#374151;
  --text:    #1e293b;
  --radius:  6px;
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--gray-50);
  line-height: 1.5;
}

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--navy);
  padding: 0 24px;
  display: flex; align-items: center;
  height: 52px; gap: 32px;
  position: sticky; top: 0; z-index: 100;
}
.nav-brand {
  color: white; font-weight: 700; font-size: 15px;
  text-decoration: none; white-space: nowrap;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
}
.nav-links a:hover { background: rgba(255,255,255,0.12); color: white; }

/* ── Layout ──────────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
}

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-header h1 { font-size: 22px; margin: 0 0 2px; }
.subtitle { color: var(--gray-600); margin: 0; font-size: 13px; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.card-header h2 { margin: 0; font-size: 15px; }
.card-body { padding: 16px 20px; }
.form-divider { border-top: 1px dashed var(--gray-200); margin: 12px 0; }

/* ── Table ──────────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 9px 20px; text-align: left;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gray-600); background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.table td {
  padding: 10px 20px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.empty-state {
  text-align: center;
  color: var(--gray-400);
  padding: 32px 20px !important;
  font-style: italic;
}
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.btn-sm { padding: 4px 10px; font-size: 12px; }

.btn-primary { background: var(--blue); color: white; border-color: var(--blue); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.btn-outline { background: white; color: var(--text); border-color: var(--gray-200); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-ghost { background: transparent; color: var(--gray-600); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--text); }

.btn-danger { background: #fee2e2; color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: #fecaca; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px 20px;
}
.form-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.form-grid.three-col { grid-template-columns: repeat(3, 1fr); }

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.span2 { grid-column: span 2; }
.form-full { grid-column: 1 / -1; }

label {
  font-size: 12px; font-weight: 600; color: var(--gray-700);
}
label small { font-weight: 400; color: var(--gray-600); margin-left: 4px; }

input[type=text],
input[type=email],
input[type=number],
select,
textarea {
  padding: 7px 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: white;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
textarea { resize: vertical; min-height: 72px; }

.hint {
  font-size: 12px; color: var(--gray-600); margin: 0 0 12px;
  font-style: italic;
}

/* ── Dynamic rows ────────────────────────────────────────────────────────────── */
.dyn-row {
  position: relative;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 8px;
  padding-bottom: 4px;
}
.dyn-remove {
  position: absolute !important;
  top: 8px; right: 8px;
}

/* ── Business item rows ──────────────────────────────────────────────────────── */
.biz-row {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 8px;
  padding-bottom: 4px;
}
.biz-row-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 4px;
}
.biz-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gray-600);
}

/* ── Settings grid ──────────────────────────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.settings-card {
  display: flex; align-items: center; gap: 16px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none; color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.settings-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(37,99,235,0.1);
}
.settings-card-icon { font-size: 28px; flex-shrink: 0; }
.settings-card h3 { margin: 0 0 2px; font-size: 14px; }
.settings-card p  { margin: 0; font-size: 12px; color: var(--gray-600); }

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert-success {
  background: #dcfce7; border: 1px solid #86efac;
  color: #166534; padding: 12px 16px;
  border-radius: var(--radius); margin-bottom: 20px;
  font-size: 13px;
}

/* ── Form actions bar ──────────────────────────────────────────────────────── */
.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 4px 0 20px;
}
