/* KraamMarkt CMS - app.css */

:root {
  --pink:       #c084b8;
  --pink-dark:  #a066a0;
  --pink-light: #f5e6f5;
  --green:      #10b981;
  --blue:       #3b82f6;
  --amber:      #f59e0b;
  --red:        #ef4444;
  --purple:     #8b5cf6;
  --gray:       #6b7280;
  --dark:       #1f2937;
  --bg:         #f8f7fa;
  --white:      #ffffff;
  --border:     #e5e7eb;
  --text:       #111827;
  --text-light: #6b7280;
  --sidebar-w:  220px;
  --radius:     8px;
  --shadow:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
}

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

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }

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

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

/* ── Sidebar ─────────────────────────────────────────*/
.sidebar {
  width: var(--sidebar-w); min-height: 100vh;
  background: var(--dark); color: #e5e7eb;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 20px 16px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo-icon { font-size: 22px; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; color: #9ca3af;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(192,132,184,.15); color: #e8b4e3; border-left-color: var(--pink); }
.nav-icon { width: 20px; text-align: center; font-size: 16px; }
.nav-divider { height: 1px; background: rgba(255,255,255,.08); margin: 8px 16px; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--pink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: #9ca3af; }
.logout-btn { margin-left: auto; font-size: 18px; color: #6b7280; cursor: pointer; }
.logout-btn:hover { color: #ef4444; text-decoration: none; }

/* ── Main Content ────────────────────────────────────*/
.main-content { margin-left: var(--sidebar-w); flex: 1; padding: 24px; max-width: 1200px; }

/* ── Alerts ──────────────────────────────────────────*/
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 16px; font-size: 14px; font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Page Header ─────────────────────────────────────*/
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title  { font-size: 22px; font-weight: 700; }
.page-title small { font-size: 14px; font-weight: 400; color: var(--text-light); margin-left: 8px; }

/* ── Cards ───────────────────────────────────────────*/
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
  border: 1px solid var(--border);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title  { font-size: 15px; font-weight: 600; }

/* ── Stat cards ──────────────────────────────────────*/
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card  {
  background: var(--white); border-radius: var(--radius);
  padding: 16px; border: 1px solid var(--border);
  border-left: 4px solid var(--gray); box-shadow: var(--shadow);
}
.stat-n     { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-l     { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ── Buttons ─────────────────────────────────────────*/
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(.95); }
.btn-primary   { background: var(--pink); color: #fff; border-color: var(--pink-dark); }
.btn-secondary { background: var(--white); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-sm        { padding: 5px 10px; font-size: 12px; }
.btn-success   { background: var(--green); color: #fff; }

/* ── Table ───────────────────────────────────────────*/
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--border); background: var(--bg); }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fdf4ff; }

/* ── Status badges ───────────────────────────────────*/
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-nieuw              { background: #dbeafe; color: #1d4ed8; }
.badge-in_behandeling     { background: #fef3c7; color: #92400e; }
.badge-wacht_documenten   { background: #fee2e2; color: #991b1b; }
.badge-contract_verstuurd { background: #ede9fe; color: #5b21b6; }
.badge-actief             { background: #d1fae5; color: #065f46; }
.badge-on_hold            { background: #f3f4f6; color: #374151; }
.badge-gestopt            { background: #111827; color: #e5e7eb; }
.badge-concept            { background: #f3f4f6; color: #374151; }
.badge-verzonden          { background: #dbeafe; color: #1d4ed8; }
.badge-betaald            { background: #d1fae5; color: #065f46; }
.badge-verlopen           { background: #fee2e2; color: #991b1b; }
.badge-geannuleerd        { background: #111827; color: #e5e7eb; }

/* ── Forms ───────────────────────────────────────────*/
.form-grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.form-group  { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label        { font-size: 12px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .04em; }
input, select, textarea {
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px;
  background: var(--white); width: 100%;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(192,132,184,.15);
}
textarea { resize: vertical; min-height: 80px; }

/* ── Search / filter bar ─────────────────────────────*/
.filter-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap;
}
.filter-bar input[type=search] { max-width: 280px; }
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab {
  padding: 5px 12px; border-radius: 99px; font-size: 12px;
  font-weight: 500; cursor: pointer; border: 1px solid var(--border);
  background: var(--white); color: var(--text);
  text-decoration: none; transition: all .15s;
}
.filter-tab:hover { border-color: var(--pink); color: var(--pink); text-decoration: none; }
.filter-tab.active { background: var(--pink); color: #fff; border-color: var(--pink-dark); }

/* ── Pagination ──────────────────────────────────────*/
.pagination { display: flex; gap: 4px; margin-top: 16px; align-items: center; }
.page-link {
  padding: 5px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; color: var(--text);
  text-decoration: none;
}
.page-link.active { background: var(--pink); color: #fff; border-color: var(--pink-dark); }
.page-link:hover  { background: var(--bg); text-decoration: none; }

/* ── Detail page ─────────────────────────────────────*/
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.detail-field { margin-bottom: 12px; }
.detail-field dt { font-size: 11px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; }
.detail-field dd { font-size: 14px; margin-top: 2px; }

/* ── Login ───────────────────────────────────────────*/
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}
.login-box {
  background: var(--white); border-radius: 12px;
  padding: 40px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 26px; font-weight: 800; }
.login-logo p  { color: var(--text-light); font-size: 14px; }

/* ── Invoice print ───────────────────────────────────*/
.invoice-header { display: flex; justify-content: space-between; margin-bottom: 32px; }
.invoice-table th { background: var(--pink-light); }
.invoice-total-row td { font-weight: 700; background: var(--bg); }

/* ── Chart ───────────────────────────────────────────*/
.chart-bar-wrap { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin-top: 8px; }
.chart-bar-col  { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart-bar      { width: 100%; background: var(--pink); border-radius: 4px 4px 0 0; min-height: 4px; transition: height .3s; }
.chart-label    { font-size: 10px; color: var(--text-light); }

/* ── Misc ────────────────────────────────────────────*/
.text-muted  { color: var(--text-light); }
.text-sm     { font-size: 12px; }
.mt-4        { margin-top: 16px; }
.mb-4        { margin-bottom: 16px; }
.flex        { display: flex; }
.gap-2       { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2      { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3      { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; padding: 16px; }
  .detail-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
