/* =====================================================
   LeaseCompany Portal - Stylesheet
   ===================================================== */
:root {
  --blue:        #00aee6;
  --blue-dark:   #0090c2;
  --blue-soft:   #e2f6fd;
  --ink:         #1e2733;
  --grey-600:    #5b6577;
  --grey-400:    #8a94a6;
  --grey-200:    #e4e8ef;
  --grey-100:    #f2f5f8;
  --bg:          #f5f7fa;
  --white:       #ffffff;
  --green:       #22b573;
  --red:         #e8493a;
  --orange:      #f5a623;
  --radius:      14px;
  --shadow:      0 1px 3px rgba(20,34,60,.06), 0 8px 24px rgba(20,34,60,.05);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }

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

.sidebar {
  width: 264px;
  background: var(--white);
  border-right: 1px solid var(--grey-200);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 24px 22px;
}
.brand-mark {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--blue); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px; letter-spacing: -.5px;
}
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.brand-name span { color: var(--blue); }
.brand-logo { max-width: 180px; max-height: 48px; object-fit: contain; display: block; }

.nav { padding: 6px 14px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 10px;
  color: var(--grey-600); font-weight: 500; font-size: 15px;
  margin-bottom: 2px; transition: background .15s, color .15s;
}
.nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav a:hover { background: var(--grey-100); color: var(--ink); }
.nav a.active { background: var(--blue); color: #fff; }

.nav-foot { padding: 14px; border-top: 1px solid var(--grey-200); }
.nav-foot a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 10px; color: var(--grey-600); font-weight: 500; font-size: 15px; transition: background .15s, color .15s; }
.nav-foot a:hover { background: var(--grey-100); color: var(--ink); }
.nav-foot a svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 40px 8px;
}
.topbar h1 { font-size: 30px; font-weight: 800; letter-spacing: -.6px; }
.topbar .sub { color: var(--grey-600); font-size: 15px; margin-top: 4px; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.bell { position: relative; color: var(--grey-400); }
.bell .count {
  position: absolute; top: -6px; right: -6px;
  background: var(--blue); color: #fff; font-size: 11px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
}
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}

.content { padding: 22px 40px 48px; }

/* ---------- KPI cards ---------- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px;
  margin-bottom: 26px;
}
@media (max-width: 1400px){ .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
.kpi {
  background: var(--white); border: 1px solid var(--grey-200);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.kpi-top { display: flex; align-items: center; gap: 16px; }
.kpi-icon {
  width: 56px; height: 56px; border-radius: 14px; background: var(--blue-soft);
  color: var(--blue); display: grid; place-items: center; flex-shrink: 0;
}
.kpi-icon svg { width: 26px; height: 26px; }
.kpi-num { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.kpi-num.orange { color: var(--orange); }
.kpi-num.red { color: var(--red); }
.kpi-label { color: var(--grey-600); font-size: 14px; margin-top: 4px; }
.kpi-link { color: var(--blue); font-weight: 600; font-size: 14px; margin-top: 16px; display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Layout split ---------- */
.split { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
@media (max-width: 1100px){ .split { grid-template-columns: 1fr; } .kpi-grid { grid-template-columns: repeat(2,1fr);} }

/* ---------- Panel / card ---------- */
.panel {
  background: var(--white); border: 1px solid var(--grey-200);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 22px 24px; flex-wrap: wrap;
}
.panel-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.panel-body { padding: 0 24px 20px; }

/* ---------- Search + buttons ---------- */
.search {
  position: relative; flex: 1; max-width: 340px;
}
.search input {
  width: 100%; padding: 12px 42px 12px 16px;
  border: 1px solid var(--grey-200); border-radius: 10px;
  font-size: 14px; font-family: var(--font); background: var(--grey-100);
}
.search svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--grey-400); width: 18px; height: 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; border: none;
  font-family: var(--font); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: var(--grey-100); color: var(--ink); }
.btn-ghost:hover { background: var(--grey-200); }
.btn-danger { background: #fdeceb; color: var(--red); }
.btn-danger:hover { background: #fbdcd9; }
.btn svg { width: 17px; height: 17px; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 13px; font-weight: 600; color: var(--grey-400);
  padding: 14px 12px; border-bottom: 1px solid var(--grey-200); text-transform: none;
}
.table td { padding: 16px 12px; border-bottom: 1px solid var(--grey-100); font-size: 14.5px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.clickable:hover { background: var(--grey-100); cursor: pointer; }

/* ---------- Voertuig foto's ---------- */
.auto-thumb {
  width: 68px; height: 44px; border-radius: 8px; object-fit: cover;
  background: var(--grey-100); border: 1px solid var(--grey-200); display: block;
}
.auto-hero {
  width: 100%; max-width: 460px; aspect-ratio: 16/10; object-fit: cover;
  border-radius: 12px; background: var(--grey-100); border: 1px solid var(--grey-200);
}
.detail-top { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 22px; }
.detail-top .detail-grid { flex: 1; min-width: 280px; margin: 0; }
.file-input { padding: 10px 0; }
.file-preview { margin-top: 10px; }
.file-preview img { width: 120px; height: 76px; object-fit: cover; border-radius: 8px; border: 1px solid var(--grey-200); }

.plate {
  display: inline-flex; align-items: center;
  background: #ffcc00; border: 1px solid #e0b400; border-radius: 6px;
  font-weight: 700; letter-spacing: .5px; overflow: hidden; font-size: 14px;
}
.plate .nl { background: #003399; color: #ffcc00; font-size: 9px; font-weight: 700; padding: 4px 5px; align-self: stretch; display: grid; place-items: center; }
.plate .num { padding: 5px 10px; color: #1a2233; }

.merk-model .m1 { font-weight: 600; }
.merk-model .m2 { color: var(--grey-400); font-size: 13px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 20px;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; }
.badge-green  { background: #e5f7ef; color: #12945c; }
.badge-green .dot { background: var(--green); }
.badge-red    { background: #fdeceb; color: var(--red); }
.badge-red .dot { background: var(--red); }
.badge-orange { background: #fff4e0; color: #b6790a; }
.badge-orange .dot { background: var(--orange); }
.badge-grey   { background: var(--grey-100); color: var(--grey-600); }
.badge-grey .dot { background: var(--grey-400); }

/* ---------- Side list (contracten) ---------- */
.side-list .item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 8px; border-bottom: 1px solid var(--grey-100);
}
.side-list .item:last-child { border-bottom: none; }
.side-list .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--grey-100); color: var(--blue); display: grid; place-items: center; flex-shrink: 0; }
.side-list .ico svg { width: 20px; height: 20px; }
.side-list .txt { flex: 1; }
.side-list .txt b { font-size: 14.5px; }
.side-list .txt small { display: block; color: var(--grey-400); font-size: 13px; }
.side-list .chev { color: var(--grey-400); }

.accountcard {
  border: 1.5px solid var(--blue-soft); border-radius: var(--radius);
  padding: 22px; margin-top: 22px; background: var(--white); box-shadow: var(--shadow);
}
.accountcard .role { color: var(--blue); font-weight: 600; font-size: 14px; }
.accountcard .name { font-size: 19px; font-weight: 700; margin-top: 2px; }
.accountcard .fn { color: var(--grey-600); font-size: 14px; }
.accountcard .row { display: flex; align-items: center; gap: 10px; color: var(--grey-600); font-size: 14px; margin-top: 12px; }
.accountcard .row svg { width: 17px; height: 17px; color: var(--blue); }
.accountcard .amhead { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.accountcard .amhead .info { flex: 1; }

/* Accountmanager avatar (foto of initialen) */
.am-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.am-avatar-fallback { width: 60px; height: 60px; border-radius: 50%; flex-shrink: 0; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.am-avatar-sm { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.am-avatar-fallback-sm { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }

/* Manager-lijst op instellingenpagina */
.manager-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--grey-100); }
.manager-row:last-child { border-bottom: none; }
.manager-row .info { flex: 1; min-width: 0; }
.manager-row .info b { font-size: 15px; }
.manager-row .info small { display: block; color: var(--grey-400); font-size: 13px; }
.manager-row .acts { display: flex; gap: 8px; }

/* Instellingen: logo-voorbeeld */
.logo-preview { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo-preview .box { background: var(--grey-100); border: 1px solid var(--grey-200); border-radius: 10px; padding: 20px 26px; min-width: 200px; display: grid; place-items: center; }
.logo-preview .box img { max-width: 200px; max-height: 60px; object-fit: contain; }

.section-title { font-size: 16px; font-weight: 700; margin: 4px 0 4px; }
.section-sub { color: var(--grey-600); font-size: 14px; margin-bottom: 16px; }

/* ---------- Footer ---------- */
.foot { padding: 22px 40px; border-top: 1px solid var(--grey-200); color: var(--grey-400); font-size: 13px; display: flex; justify-content: space-between; }
.foot a { color: var(--grey-600); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 700px){ .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--grey-600); }
.field input, .field select {
  padding: 12px 14px; border: 1px solid var(--grey-200); border-radius: 10px;
  font-size: 14.5px; font-family: var(--font); background: var(--white); color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.form-actions { display: flex; gap: 12px; margin-top: 26px; }

/* ---------- Detail view ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--grey-200); border-radius: 12px; overflow: hidden; border: 1px solid var(--grey-200); }
@media (max-width: 800px){ .detail-grid { grid-template-columns: repeat(2,1fr);} }
.detail-cell { background: var(--white); padding: 18px 20px; }
.detail-cell .k { font-size: 13px; color: var(--grey-400); margin-bottom: 4px; }
.detail-cell .v { font-size: 15.5px; font-weight: 600; }

.alert { padding: 14px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; font-weight: 500; }
.alert-ok { background: #e5f7ef; color: #12945c; }
.alert-err { background: #fdeceb; color: var(--red); }

.back-link { color: var(--blue); font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 16px; }

.empty { text-align: center; padding: 40px; color: var(--grey-400); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #eaf3ff, #f6f8fb 60%); padding: 20px; }
.login-card { background: var(--white); border-radius: 18px; box-shadow: 0 12px 40px rgba(20,34,60,.12); padding: 40px; width: 100%; max-width: 400px; }
.login-card .brand { padding: 0 0 20px; justify-content: center; }
.login-card .brand-logo { max-width: 240px; max-height: 64px; }
.login-card h2 { font-size: 22px; font-weight: 700; text-align: center; }
.login-card p.sub { text-align: center; color: var(--grey-600); font-size: 14px; margin: 6px 0 26px; }
.login-card .field { margin-bottom: 18px; }
.login-card .btn { width: 100%; justify-content: center; padding: 14px; }
.login-hint { text-align: center; color: var(--grey-400); font-size: 13px; margin-top: 18px; }

/* mobile nav toggle */
.menu-toggle { display: none; }
@media (max-width: 900px){
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--white); border: 1px solid var(--grey-200); cursor: pointer; }
  .kpi-grid { grid-template-columns: 1fr; }
}