/* ============================================================
   Proline Afbouw — temiz, tek dosya stil
   Marka rengi tek bir değişkenden değiştirilebilir.
   ============================================================ */

:root {
  --brand: #1f4d3a;
  --brand-dark: #163528;
  --brand-light: #e8f1ec;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6eb;
  --border-strong: #c9cdd5;

  --text: #1a1d22;
  --text-muted: #6b7280;
  --text-soft: #9aa0a6;

  --danger: #c0392b;
  --success: #2e7d4f;
  --warning: #b07d12;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 14px rgba(20,30,40,0.06);

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

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Layout ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--brand);
}
.topbar .brand .dot {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--brand); display: inline-block;
}
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  padding: 8px 14px; border-radius: 8px; color: var(--text);
  font-weight: 500;
}
.topbar nav a.active, .topbar nav a:hover {
  background: var(--brand-light); color: var(--brand-dark); text-decoration: none;
}
.topbar .user {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 13px;
}

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

/* ---------- Cards / sections ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 {
  margin: 0 0 14px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.card h2 .accent {
  width: 4px; height: 16px; background: var(--brand); border-radius: 2px;
}

/* ---------- Forms ---------- */
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.field input, .field select, .field textarea {
  font: inherit;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31,77,58,0.12);
}
.field textarea { resize: vertical; min-height: 90px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn:hover { background: #f0f2f5; }
.btn-primary {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #962d22; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: #f0f2f5; color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ---------- Tables ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.table th {
  background: #fafbfc;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table tr:hover td { background: #fafbfc; }
.table input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 8px;
  border-radius: 4px;
  font: inherit;
}
.table input:focus { background: #fff; border-color: var(--brand); outline: none; }
.table .num { text-align: right; }
.table .actions { width: 1%; white-space: nowrap; }

/* ---------- Status badges ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
}
.badge-concept       { background: #eef0f3; color: #4a5260; }
.badge-verzonden     { background: #e3f0ff; color: #1c5aa8; }
.badge-geaccepteerd  { background: #e0f3e7; color: #1f6f3f; }
.badge-geweigerd     { background: #fce6e3; color: #962d22; }

/* ---------- Sticky totals bar ---------- */
.totals-bar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 0;
  margin: 24px -24px 0 -24px;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -4px 14px rgba(20,30,40,0.05);
  z-index: 40;
}
.totals-bar .totals { display: flex; gap: 28px; align-items: center; }
.totals-bar .totals div { font-size: 13px; color: var(--text-muted); }
.totals-bar .totals strong {
  display: block; color: var(--text); font-size: 18px; font-weight: 600;
  margin-top: 2px;
}
.totals-bar .totals .total-row strong { color: var(--brand); font-size: 22px; }
.totals-bar .actions { display: flex; gap: 8px; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  padding: 24px;
}
.login-card {
  background: var(--surface);
  width: 100%;
  max-width: 400px;
  padding: 36px 32px;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}
.login-card .logo {
  text-align: center;
  margin-bottom: 24px;
}
.login-card .logo .dot {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--brand); display: inline-block;
  margin-bottom: 12px;
}
.login-card h1 {
  margin: 0 0 4px 0; font-size: 22px; text-align: center;
}
.login-card .subtitle {
  text-align: center; color: var(--text-muted); margin-bottom: 24px; font-size: 13px;
}
.login-card .field { margin-bottom: 14px; }
.login-card .row { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 18px; font-size: 13px; color: var(--text-muted); }
.login-card .row label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.login-card .error {
  display: none;
  background: #fce6e3; color: #962d22;
  padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; font-size: 13px;
}
.login-card .error.show { display: block; }

/* ---------- Helpers ---------- */
.row-flex { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--text-muted); }
.right { text-align: right; }
.search {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.search input, .search select {
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
}
.search input { flex: 1; min-width: 220px; }

.logo-preview {
  display: flex; align-items: center; gap: 12px;
}
.logo-preview img {
  max-width: 120px; max-height: 60px;
  border: 1px solid var(--border); border-radius: 6px; padding: 4px;
  background: #fff;
}

.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--text); color: #fff;
  padding: 10px 16px; border-radius: 8px; font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px);
  transition: opacity .2s, transform .2s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ---------- Print ---------- */
@media print {
  .topbar, .totals-bar, .no-print { display: none !important; }
  body { background: #fff; }
  .container { max-width: none; padding: 0; }
  .card { border: none; box-shadow: none; padding: 8px 0; margin: 0; }
}
