﻿:root {
  --bg: #071018;
  --bg-2: #0c1822;
  --panel: #11202b;
  --panel-2: #173041;
  --line: rgba(255, 144, 0, 0.18);
  --text: #eef4f7;
  --muted: #9bb0bd;
  --accent: #ff9000;
  --accent-2: #ffb454;
  --ink: #08141c;
  --danger: #e07a6a;
  --ok: #6ec89a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "IBM Plex Sans", sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(255, 144, 0, 0.16), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(70, 140, 160, 0.12), transparent 50%),
    var(--bg);
  color: var(--text);
}

h1, h2, .brand-word { font-family: Syne, sans-serif; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.login-card {
  width: min(440px, 100%);
  background: linear-gradient(180deg, rgba(23, 48, 65, 0.92), rgba(17, 32, 43, 0.96));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

/* The wordmark has black glyphs, so it sits on a light chip over the dark UI. */
.logo-chip {
  display: inline-grid;
  place-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
.logo-chip img { display: block; width: auto; }

.login-mark {
  margin-bottom: 20px;
  padding: 10px 16px;
  border-radius: 16px;
}
.login-mark img { height: 40px; }

.login-card h1 {
  margin: 0 0 6px;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.login-card p {
  margin: 0 0 28px;
  color: var(--muted);
}

.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field span { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  background: #0b161f;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 144, 0, 0.18);
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--ink);
  width: 100%;
  padding: 13px;
}
.btn-ghost {
  background: transparent;
  color: var(--accent-2);
  border: 1px solid var(--line);
}
.btn-soft {
  background: var(--panel-2);
  color: var(--text);
}
.btn-danger {
  background: rgba(224, 122, 106, 0.16);
  color: #ffc4bb;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.app-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(7, 16, 24, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 8px;
  text-decoration: none;
  color: inherit;
}
.brand .logo-chip img { height: 24px; }
.brand-word { font-weight: 800; letter-spacing: -0.03em; }
.brand small { display: block; color: var(--muted); font-family: "IBM Plex Sans", sans-serif; font-weight: 400; font-size: 11px; }

.nav-link {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
}
.nav-link.active, .nav-link:hover {
  color: var(--ink);
  background: var(--accent);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
.page-head h1 { margin: 0; font-size: 34px; letter-spacing: -0.04em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar input {
  flex: 1;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 32, 43, 0.8);
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; white-space: nowrap; }
th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #0e1c26;
  position: sticky;
  top: 0;
}
tbody tr { border-top: 1px solid rgba(255,255,255,0.04); }
tbody tr:hover { background: rgba(255, 144, 0, 0.06); }
.actions { display: flex; gap: 6px; }

.plate {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  background: #f7f8fa;
  color: #111827;
  border: 1.5px solid #1f2937;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px #d1d5db;
  min-height: 28px;
}
.plate-eu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 22px;
  padding: 2px 0 3px;
  background: #003399;
  color: #fff;
  font: 700 8px/1 "IBM Plex Sans", sans-serif;
  letter-spacing: 0.04em;
}
.plate-eu::before {
  content: "";
  flex: 1;
  width: 14px;
  min-height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='5.6' fill='none' stroke='%23fc0' stroke-width='1.1'/%3E%3Cg fill='%23fc0'%3E%3Ccircle cx='12' cy='6.4' r='.7'/%3E%3Ccircle cx='16.8' cy='8' r='.7'/%3E%3Ccircle cx='17.6' cy='12' r='.7'/%3E%3Ccircle cx='15.2' cy='15.6' r='.7'/%3E%3Ccircle cx='10.8' cy='16.4' r='.7'/%3E%3Ccircle cx='7.2' cy='14' r='.7'/%3E%3Ccircle cx='6.4' cy='10' r='.7'/%3E%3Ccircle cx='8.8' cy='6.8' r='.7'/%3E%3C/g%3E%3C/svg%3E") center / 14px 14px no-repeat;
}
.plate-eu::after { content: "CY"; }
.plate-reg {
  display: inline-flex;
  align-items: center;
  padding: 0 8px 0 7px;
  font: 800 13px/1 Syne, "Arial Narrow", sans-serif;
  letter-spacing: 0.12em;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
}
.badge-on { background: rgba(110, 200, 154, 0.16); color: var(--ok); }
.badge-off { background: rgba(155, 176, 189, 0.12); color: var(--muted); }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 14, 0.72);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 16px;
}
.modal {
  width: min(560px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 16px; font-size: 26px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }

.modal-copy {
  color: var(--muted);
  line-height: 1.55;
  margin: -8px 0 18px;
}

.import-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.import-steps div {
  display: grid;
  gap: 6px;
  align-content: start;
  background: #0b161f;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.import-steps strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
}
.import-steps span { color: var(--muted); font-size: 12px; line-height: 1.35; }

.template-link { width: 100%; margin-bottom: 12px; }

.upload-zone {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 22px;
  background: rgba(255, 144, 0, 0.05);
  border: 1px dashed rgba(255, 144, 0, 0.5);
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
}
.upload-zone:hover { background: rgba(255, 144, 0, 0.09); }
.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.upload-title { font-weight: 600; color: var(--accent-2); }
.upload-zone small { color: var(--muted); }
.file-name {
  max-width: 100%;
  margin-top: 5px;
  padding: 5px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--panel-2);
  border-radius: 999px;
  font-size: 12px;
}

.import-errors,
.import-result {
  margin-top: 12px;
  border-radius: 12px;
  padding: 12px;
}
.import-errors {
  border: 1px solid rgba(224, 122, 106, 0.45);
  background: rgba(224, 122, 106, 0.1);
  color: #ffc4bb;
  max-height: 210px;
  overflow: auto;
}
.import-errors ul { margin: 8px 0 0; padding-left: 20px; }
.import-errors li { margin: 4px 0; }
.import-result {
  border: 1px solid rgba(110, 200, 154, 0.4);
  background: rgba(110, 200, 154, 0.08);
}
.import-result h3 { margin: 0 0 10px; color: var(--ok); }
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.result-grid div {
  display: grid;
  gap: 2px;
  background: rgba(7, 16, 24, 0.5);
  border-radius: 9px;
  padding: 8px;
}
.result-grid strong { font: 700 20px Syne, sans-serif; }
.result-grid span { color: var(--muted); font-size: 11px; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #173041;
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 12px;
  z-index: 50;
}
.toast.error { border-color: var(--danger); }

.view-list { display: grid; gap: 10px; margin-bottom: 16px; }
.view-list div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 8px; }
.view-list span { color: var(--muted); }

.suggest { position: relative; }
.customer-picker #customer-select {
  margin-top: 8px;
  min-height: 168px;
}
.customer-picker #customer-search {
  background-image: none;
}
.suggest-list {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  background: #0b161f;
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 220px;
  overflow: auto;
  z-index: 5;
}
.suggest-list button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 12px;
  color: var(--text);
}
.suggest-list button:hover { background: rgba(255, 144, 0, 0.1); }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .page-head, .grid-2 { grid-template-columns: 1fr; display: grid; }
  .import-steps, .result-grid { grid-template-columns: 1fr 1fr; }
  .brand-word { font-size: 15px; }
}
