:root {
  --bg: #f1f4f8;
  --panel: #ffffff;
  --ink: #1d2733;
  --muted: #6b7a8c;
  --line: #dde4ec;
  --accent: #1565c0;
  --accent-dark: #0d47a1;
  --danger: #c62828;
  --ok: #2e7d32;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.hidden { display: none !important; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0d47a1, #1976d2 60%, #42a5f5);
}

.login-card {
  background: var(--panel);
  padding: 36px 32px;
  border-radius: 12px;
  width: 340px;
  box-shadow: 0 16px 40px rgba(13, 38, 76, .35);
}

.login-logo {
  display: block;
  width: 190px;
  max-width: 80%;
  margin: 0 auto 18px;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
  text-align: center;
  color: var(--accent-dark);
}

.login-card .sub {
  margin: 0 0 22px;
  text-align: center;
  color: var(--muted);
}

.login-card label {
  display: block;
  margin-bottom: 14px;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.login-card input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-card input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.login-card button[type=submit] {
  width: 100%;
  margin-top: 6px;
  padding: 11px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.login-card button[type=submit]:hover { background: var(--accent-dark); }
.login-card button[disabled] { opacity: .6; cursor: wait; }

.error {
  margin-top: 14px;
  padding: 9px 12px;
  background: #fdecea;
  color: var(--danger);
  border-radius: 8px;
  font-size: 13px;
}

/* ---------- app shell ---------- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
}

.brand img { height: 28px; display: block; }

.user-box { display: flex; align-items: center; gap: 12px; }
#whoami { font-weight: 600; }

main {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  align-items: flex-start;
  max-width: 1280px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  flex: 1;
  min-width: 0;
}

.panel.wide { flex: 2; }

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-head h2 { margin: 0; font-size: 15px; flex: 0 0 auto; }

#accountSelect {
  flex: 1;
  padding: 7px 10px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.filter {
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

/* ---------- lists ---------- */
.list {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 52vh;
  overflow-y: auto;
}

.list .row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.list .row:last-child { border-bottom: 0; }
.list.checkable .row { cursor: pointer; }
.list.checkable .row:hover { background: #f4f8fd; }
.list .row.checked { background: #e8f1fc; }

.row .plate { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { color: var(--muted); font-size: 12px; flex-shrink: 0; }

.list .nothing {
  padding: 18px;
  text-align: center;
  color: var(--muted);
}

.panel-foot { margin-top: 8px; color: var(--muted); font-size: 12.5px; }

/* ---------- target columns ---------- */
.target-cols { display: flex; gap: 16px; }
.target-cols .col { flex: 1; min-width: 0; }
.target-cols h3 { margin: 4px 0 8px; font-size: 13.5px; color: var(--muted); }
.acct-name { color: var(--ink); }

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.select-all { color: var(--muted); font-size: 12.5px; user-select: none; cursor: pointer; }

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

/* ---------- buttons ---------- */
button { font: inherit; cursor: pointer; }

button.primary, button.danger {
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
}

button.primary { background: var(--accent); }
button.primary:hover:not([disabled]) { background: var(--accent-dark); }
button.danger { background: var(--danger); }
button.danger:hover:not([disabled]) { background: #9b1c1c; }
button[disabled] { opacity: .45; cursor: not-allowed; }

button.ghost {
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 8px;
  padding: 6px 12px;
  color: inherit;
}

header button.ghost { color: var(--accent-dark); }
.panel button.ghost { color: var(--muted); }
button.ghost.small { padding: 4px 9px; font-size: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  padding: 11px 22px;
  border-radius: 10px;
  color: #fff;
  background: var(--ok);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  font-weight: 600;
  z-index: 10;
}

.toast.err { background: var(--danger); }

@media (max-width: 900px) {
  main { flex-direction: column; }
  .panel { width: 100%; }
}
