/* ====================================================================
   STEIGERBOUWER.NL — Design System
   ==================================================================== */

:root {
  --primary: #FF6B1A;
  --primary-dark: #E55A0F;
  --primary-light: #FFE6D6;
  --ink: #1A1A1A;
  --ink-50: #FAFAF7;
  --ink-100: #F5F5F1;
  --ink-200: #E5E5E2;
  --ink-300: #D4D4D0;
  --ink-500: #888880;
  --ink-700: #444441;
  --ink-900: #1A1A1A;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--ink-100);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.25; color: var(--ink-900); }
h1 { font-size: 28px; margin-bottom: 16px; }
h2 { font-size: 22px; margin-bottom: 12px; }
h3 { font-size: 18px; margin-bottom: 8px; }
h4 { font-size: 16px; }
p { margin-bottom: 12px; }

/* ----- Forms ----- */
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; color: var(--ink-700); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="password"], input[type="date"], input[type="search"],
select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ink-300);
  border-radius: var(--radius);
  font: inherit;
  background: white;
  color: var(--ink-900);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary-light);
  border-color: var(--primary);
}
.field { margin-bottom: 14px; }
.fields-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.fields-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.fields-grid > .field, .fields-grid-3 > .field { margin-bottom: 0; }

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--ink-200);
  color: var(--ink-900);
  text-decoration: none;
  transition: all 0.15s;
}
.btn:hover { background: var(--ink-300); text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { background: transparent; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }

/* ----- Cards ----- */
.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-200);
  padding: 20px;
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink-200);
}
.card-header h2, .card-header h3 { margin: 0; }

/* ----- Tables ----- */
.table {
  width: 100%;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--ink-200);
}
.table th {
  background: var(--ink-100);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-700);
}
.table tr:hover td { background: var(--ink-50); }
.table tr:last-child td { border-bottom: none; }

/* ----- Status badges ----- */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-neutral { background: var(--ink-200); color: var(--ink-700); }

/* ----- Layout: marketing ----- */
.mkt-nav {
  background: white;
  border-bottom: 1px solid var(--ink-200);
  padding: 16px 0;
}
.mkt-nav .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mkt-logo {
  font-weight: 800;
  font-size: 18px;
  color: var(--ink-900);
  text-decoration: none;
}
.mkt-logo .dot { color: var(--primary); }
.mkt-nav ul {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
}
.mkt-nav ul a { color: var(--ink-700); font-weight: 500; }

.mkt-hero {
  padding: 80px 20px;
  text-align: center;
  background: linear-gradient(180deg, white 0%, var(--ink-50) 100%);
}
.mkt-hero h1 {
  font-size: 48px;
  max-width: 720px;
  margin: 0 auto 16px;
}
.mkt-hero h1 .accent { color: var(--primary); }
.mkt-hero p {
  font-size: 18px;
  color: var(--ink-700);
  max-width: 580px;
  margin: 0 auto 32px;
}

.mkt-section { padding: 80px 20px; }
.mkt-section .container { max-width: 1100px; margin: 0 auto; }

.mkt-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.mkt-feature {
  padding: 24px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  background: white;
}
.mkt-feature .icon {
  width: 48px; height: 48px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

/* ----- Pricing ----- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}
.pricing-card {
  padding: 32px 24px;
  border: 2px solid var(--ink-200);
  border-radius: var(--radius-lg);
  background: white;
  position: relative;
}
.pricing-card.featured {
  border-color: var(--primary);
  transform: scale(1.04);
}
.pricing-card .label { font-size: 13px; font-weight: 600; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.05em; }
.pricing-card .prijs { font-size: 36px; font-weight: 800; margin: 12px 0; }
.pricing-card .prijs span { font-size: 14px; color: var(--ink-500); font-weight: 400; }
.pricing-card ul { list-style: none; padding: 0; margin: 16px 0 24px; }
.pricing-card li { padding: 6px 0; color: var(--ink-700); }
.pricing-card li::before { content: '✓ '; color: var(--success); font-weight: bold; }

/* ----- Footer ----- */
.mkt-footer {
  background: var(--ink-900);
  color: var(--ink-300);
  padding: 40px 20px;
  text-align: center;
  font-size: 13px;
}

/* ----- Layout: tenant app ----- */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.app-sidebar {
  background: var(--ink-900);
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.app-sidebar .brand {
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 24px;
}
.app-sidebar .brand .dot { color: var(--primary); }
.app-sidebar nav { flex: 1; }
.app-sidebar nav ul { list-style: none; }
.app-sidebar nav li { margin-bottom: 2px; }
.app-sidebar nav a {
  display: block;
  padding: 9px 12px;
  color: var(--ink-300);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
}
.app-sidebar nav a:hover { background: rgba(255,255,255,0.06); color: white; }
.app-sidebar nav a.active { background: var(--primary); color: white; }
.app-sidebar .user-block {
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-300);
}
.app-sidebar .user-block strong { color: white; display: block; }

.app-main { padding: 24px; }
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* ----- KPI cards ----- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-200);
  padding: 20px;
}
.kpi .label {
  font-size: 12px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.kpi .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink-900);
}
.kpi .sub {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 4px;
}

/* ----- Layout: auth ----- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--ink-100) 0%, white 100%);
}
.auth-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-200);
  padding: 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
}
.auth-card h1 { text-align: center; margin-bottom: 24px; font-size: 24px; }

/* ----- Flash messages ----- */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-weight: 500;
}
.flash-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.flash-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.flash-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #93C5FD; }

/* ----- Subdomein checker ----- */
.subdomein-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--ink-300);
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
}
.subdomein-input input {
  border: none;
  flex: 1;
  padding: 10px 12px;
}
.subdomein-input input:focus { outline: none; }
.subdomein-input .suffix {
  background: var(--ink-100);
  padding: 10px 12px;
  color: var(--ink-700);
  font-weight: 500;
  border-left: 1px solid var(--ink-200);
}
.check-result {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
}
.check-result.ok { color: var(--success); }
.check-result.fail { color: var(--danger); }

/* ----- Tenant detail header ----- */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding: 20px;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-200);
}
.detail-header h1 { margin-bottom: 4px; }
.detail-header .meta { color: var(--ink-500); font-size: 14px; }

/* ----- Scaffold tag (printbaar) ----- */
.scaffold-tag {
  width: 210mm;
  min-height: 297mm;
  padding: 30mm 25mm;
  background: white;
  margin: 20px auto;
  box-shadow: var(--shadow-lg);
  font-family: var(--font);
}
.scaffold-tag .tag-header {
  border: 4px solid var(--primary);
  padding: 16px;
  text-align: center;
  margin-bottom: 24px;
}
.scaffold-tag .tag-header h1 { font-size: 32px; margin: 0; color: var(--primary); }
.scaffold-tag .tag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.scaffold-tag .field-row { padding: 8px 0; border-bottom: 1px solid var(--ink-200); }
.scaffold-tag .field-row .label { font-size: 11px; color: var(--ink-500); text-transform: uppercase; }
.scaffold-tag .field-row .value { font-size: 16px; font-weight: 600; }
.scaffold-tag .signature-area { margin-top: 40px; padding-top: 20px; border-top: 2px solid var(--ink-900); }

/* ----- Responsive ----- */
@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .mkt-features, .pricing-grid { grid-template-columns: 1fr; }
  .fields-grid, .fields-grid-3 { grid-template-columns: 1fr; }
  .mkt-hero h1 { font-size: 32px; }
}

/* ----- Utilities ----- */
.text-muted { color: var(--ink-500); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; } .gap-4 { gap: 16px; }
