/* EV Chargers BD — app.css
   Lemcon house style. The tokens, the type scale, the shapes and the
   breakpoints are the ones measured out of lemcon.asia and written down in
   the Lemcon Web Handbook. Token names are kept even where this application
   uses them for something else, so any snippet borrowed from the other site
   still works here. */

:root {
  --navy:      #10233f;
  --navy-2:    #1b3a68;
  --accent:    #2e8fe0;
  --ink:       #16202e;
  --muted:     #66748a;
  --line:      #e2e7ef;
  --bg:        #f4f6fa;
  --card:      #ffffff;
  --radius:    14px;
  --shadow:    0 1px 2px rgba(16,35,63,.06), 0 8px 24px rgba(16,35,63,.06);
  --shadow-lg: 0 12px 40px rgba(16,35,63,.16);
  /* On lemcon.asia these two are the region accents. Here they are the two
     card edge colours: t7 for a confirmed record, t8 for the default. */
  --t7:        #2e75b6;
  --t8:        #bf8f00;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a.link, .body a.link { color: var(--accent); }
a.link:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 600; }

/* ---------------------------------------------------------------
   Top bar
   --------------------------------------------------------------- */
.topbar {
  background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 6px 20px rgba(16,35,63,.18);
}
.brand { display: flex; flex-direction: column; line-height: 1.15; flex: none; }
.brand .bname  { font-size: 15.5px; font-weight: 700; letter-spacing: .2px; }
.brand .bstrap { font-size: 11px; opacity: .7; }

.nav {
  display: flex; gap: 2px; margin-left: 8px;
  min-width: 0; flex: 0 1 auto;
  overflow-x: auto; scrollbar-width: thin;
}
.nav a {
  color: rgba(255,255,255,.78);
  padding: 8px 11px; border-radius: 9px;
  font-size: 13px; font-weight: 500;
  flex: none; white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.10); color: #fff; }
.nav a.on    { background: rgba(255,255,255,.16); color: #fff; }

.spacer { margin-left: auto; }

.switch {
  display: flex; gap: 2px;
  background: rgba(255,255,255,.14);
  border-radius: 14px; padding: 2px; margin-right: 10px;
  flex: none;
}
.switch a {
  color: rgba(255,255,255,.72);
  font-size: 12px; font-weight: 500;
  padding: 3px 12px; border-radius: 12px; white-space: nowrap;
}
.switch a.on { background: #fff; color: var(--navy); }

.who { display: flex; flex-direction: column; line-height: 1.2; flex: none; }
.who .wname { font-size: 13px; font-weight: 600; }
.who .wrole { font-size: 11px; opacity: .7; }
.who .wrole a { text-decoration: underline; }

.wrap { max-width: 1360px; margin: 0 auto; padding: 22px 22px 60px; }
.wrap.wide { max-width: none; }

/* ---------------------------------------------------------------
   Page head
   --------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; gap: 16px;
             margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; letter-spacing: -.3px; font-weight: 600; }
.page-head p  { color: var(--muted); font-size: 13px; margin: 0; }
.page-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------
   Cards, KPIs
   --------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted); padding: 16px 18px 0; font-weight: 600;
}
.card .body { padding: 16px 18px 18px; }
.card .body.flush { padding: 0; }
.card .body.empty h3 { font-size: 15px; margin-bottom: 6px; }
.card .body.empty p  { color: var(--muted); font-size: 13px; margin: 0; }

.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.kpi {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--accent);
}
.kpi.green::after { background: #00B050; }
.kpi.amber::after { background: #FFC000; }
.kpi.grey::after  { background: #98a3b5; }
.kpi.red::after   { background: #b0231f; }
.kpi .label { font-size: 11.5px; text-transform: uppercase;
              letter-spacing: .7px; color: var(--muted); }
.kpi .value { font-size: 30px; font-weight: 700;
              letter-spacing: -1px; margin-top: 4px;
              font-variant-numeric: tabular-nums; }
.kpi .sub   { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------
   Tables
   --------------------------------------------------------------- */
.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2; background: var(--card);
  box-shadow: 0 1px 0 var(--line); white-space: nowrap;
}
table.data th a { color: var(--muted); }
table.data th a:hover { color: var(--accent); }
table.data td { padding: 8px 10px; border-bottom: 1px solid #f0f3f8; vertical-align: top; }
table.data tr:hover td { background: #f8fafd; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.tight { white-space: nowrap; }
table.data td.name { font-weight: 600; }

/* ---------------------------------------------------------------
   Chips and pills
   --------------------------------------------------------------- */
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.modelchip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; color: #fff;
}
.confchip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; cursor: default;
}
.confchip.no  { background: #eef2f8; color: #4a5262; }
.confchip.yes { background: #e4f4e9; color: #1c6b34; }
.licensechip {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  background: #eef2f8; color: #4a5262; cursor: default;
}
.mustflag {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: #8f1c18; background: #fdeeea; border: 1px solid #eab5ad;
  padding: 1px 7px; border-radius: 999px;
}
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ro { font-size: 13.5px; }

/* ---------------------------------------------------------------
   Buttons and inputs
   --------------------------------------------------------------- */
.btn {
  display: inline-block; border: none; border-radius: 10px; padding: 10px 18px;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  background: var(--navy); color: #fff; transition: background .15s ease;
}
.btn:hover    { background: var(--navy-2); }
.btn:disabled { background: #c3cbd8; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn.ghost:hover { background: #eef2f8; }
.btn.small { padding: 7px 13px; font-size: 12.5px; }
.btn.warn { background: #E8710A; box-shadow: 0 2px 10px rgba(232,113,10,.38); }
.btn.warn:hover { background: #cf6408; }

.input, select.input {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 9px 12px; font: inherit; font-size: 13.5px; color: var(--ink);
  min-width: 150px; outline: none; max-width: 100%;
}
.input:focus, .remarks:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46,143,224,.15);
}
.remarks {
  width: 100%; min-height: 84px; border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; font: inherit;
  font-size: 13.5px; resize: vertical; outline: none;
}
/* A field being saved and a field just saved are shown by border colour,
   never by a message that moves the layout under the hands of the person
   typing. */
.saving { border-color: #EF9F27 !important; }
.saved  { border-color: #639922 !important; }
.savefail { border-color: #b0231f !important; }

/* ---------------------------------------------------------------
   Filter bar
   --------------------------------------------------------------- */
.filters { padding: 12px 14px; }
.fgroups { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.gpill {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px; font-size: 12.5px; font-weight: 500; color: var(--muted);
  background: #fff;
}
.gpill b { font-variant-numeric: tabular-nums; color: var(--ink); }
.gpill:hover { background: #eef2f8; }
.gpill.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.gpill.on b { color: #fff; }
.frow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.frow .input { min-width: 132px; font-size: 13px; padding: 7px 10px; }

.pager { display: flex; gap: 10px; align-items: center; justify-content: center;
         padding: 14px 0 4px; }
.pager .pinfo { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------
   Pipeline board
   --------------------------------------------------------------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.bcol { flex: 0 0 258px; background: #eaeef5; border-radius: 12px; padding: 8px; }
.bcol .bhead {
  display: flex; align-items: baseline; gap: 8px;
  background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; border-radius: 10px; padding: 7px 12px; margin-bottom: 9px;
}
.bcol .bhead .code { font-size: 13px; font-weight: 700; letter-spacing: .4px; }
.bcol .bhead .meta { font-size: 12px; opacity: .8; margin-left: auto;
                     font-variant-numeric: tabular-nums; }
.bcol .more { display: block; text-align: center; font-size: 12px;
              color: var(--muted); padding: 8px 0 4px; }

.dealcard {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.dealcard::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--edge, var(--t8));
}
.dealcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #cfd8e6; }
.dealcard .dname { font-size: 13.6px; font-weight: 700; letter-spacing: -.2px; line-height: 1.25; }
.dealcard .dmeta { font-size: 11.8px; color: var(--muted); margin: 2px 0 7px; }
.dealcard .drow  { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.dealcard .dcust { font-size: 12px; color: var(--ink); }
.dealcard .dfoot { display: flex; align-items: center; gap: 8px; }
.dealcard .downer { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.dealcard.must { border-color: #eab5ad; }
.mletter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  color: #fff; font-size: 10.5px; font-weight: 700; flex: none;
}

/* ---------------------------------------------------------------
   Record head
   --------------------------------------------------------------- */
.sitehead {
  background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; border-radius: var(--radius); padding: 20px 24px;
  display: flex; flex-wrap: wrap; gap: 10px 34px; align-items: center;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.sitehead .pla { font-size: 30px; font-weight: 700; letter-spacing: -.6px; line-height: 1.1; }
.sitehead .sub { font-size: 12.5px; opacity: .75; margin-top: 2px; }
.sitehead .kv  { font-size: 11.5px; opacity: .7;
                 text-transform: uppercase; letter-spacing: .7px; }
.sitehead .kv b { display: block; font-size: 14px; opacity: 1;
                  text-transform: none; letter-spacing: 0; font-weight: 600; }
.sitehead .right { margin-left: auto; text-align: right; display: flex;
                   flex-direction: column; gap: 6px; align-items: flex-end; }

.fieldgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.fieldgrid .f { display: flex; flex-direction: column; gap: 4px; }
.fieldgrid .f label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); font-weight: 600;
}
.fieldgrid .f .input, .fieldgrid .f select.input { width: 100%; min-width: 0; }
.fieldgrid .f.wide { grid-column: 1 / -1; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 2px solid var(--line); padding: 0 0 14px 14px; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 4px;
  width: 8px; height: 8px; border-radius: 50%; background: #c3cbd8;
}
.timeline li.act::before { background: var(--accent); }
.timeline .twhen { font-size: 11px; text-transform: uppercase;
                   letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.timeline .twhat { font-size: 13.5px; }
.timeline .tnote { font-size: 12.5px; color: var(--muted); white-space: pre-wrap; }

.warnband {
  background: #fff8e6; border: 1px solid #f0d089; color: #6b4e05;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}
.warnband.overdue { background: #fdeeea; border-color: #eab5ad; color: #8f1c18; }
.dangerpanel {
  background: #fdf1f0; border: 1px solid #f0cbc8; color: #b0231f;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}
.okband {
  background: #eef7f0; border: 1px solid #bcdfc6; color: #1c6b34;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}

.bar { display: flex; height: 15px; border-radius: 5px; overflow: hidden; background: #eef1f6; }
.bar span { display: block; transition: width .4s ease; }
.minibar { height: 6px; border-radius: 3px; background: #eef1f6; overflow: hidden; min-width: 70px; }
.minibar span { display: block; height: 100%; background: #00B050; }

/* ---------------------------------------------------------------
   Sign in
   --------------------------------------------------------------- */
.loginwrap { max-width: 380px; margin: 8vh auto; }
.loginwrap .card { padding: 0; }
.loginwrap .brandline {
  background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; border-radius: var(--radius) var(--radius) 0 0; padding: 18px 22px;
}
.loginwrap .brandline .bname { font-size: 17px; font-weight: 700; }
.loginwrap .brandline .bstrap { font-size: 11.5px; opacity: .75; }
.loginwrap .body { padding: 18px 22px 22px; }
.loginwrap .f { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.loginwrap .f label { font-size: 10.5px; text-transform: uppercase;
                      letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.loginwrap .input { width: 100%; }

/* ---------------------------------------------------------------
   Map
   --------------------------------------------------------------- */
#deal-map { width: 100%; height: 70vh; border-radius: var(--radius);
            border: 1px solid var(--line); box-shadow: var(--shadow); }
#site-map { width: 100%; height: 220px; border-radius: 12px; border: 1px solid var(--line); }
.mappanel {
  position: absolute; top: 12px; left: 12px; z-index: 500;
  background: rgba(255,255,255,.96); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px;
  max-width: 260px; font-size: 12.5px;
}
.mappanel h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .7px;
               color: var(--muted); margin-bottom: 6px; }
.maprow { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.maprow .swatch { width: 14px; height: 14px; border-radius: 50%;
                  border: 2.5px solid; display: inline-flex;
                  align-items: center; justify-content: center;
                  font-size: 8px; font-weight: 700; }
.mapholder { position: relative; }
.site-pin span {
  display: flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  border-width: 2.5px; border-style: solid;
  box-shadow: 0 0 0 1.5px rgba(11,11,11,.55);
  font-size: 8px; font-weight: 700; line-height: 1;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  user-select: none;
}

/* ---------------------------------------------------------------
   Site lookup. Four thousand sites never go into a select, so the
   search box holds a hidden id and shows the chosen name.
   --------------------------------------------------------------- */
.sitesearch { position: relative; }
.sitesearch .sitesearch-input { width: 100%; }
.sitesearch-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto;
  margin-top: 4px;
}
.sitesearch-list:empty { display: none; }
.sitehit { display: block; padding: 7px 11px; font-size: 13px; border-bottom: 1px solid #f0f3f8; }
.sitehit:hover { background: #f8fafd; }

/* ---------------------------------------------------------------
   Breakpoints. Things give up room in the order of how little they are
   needed. The navigation is the last thing asked to shrink, because it
   is how people move around.
   --------------------------------------------------------------- */
@media (max-width: 1560px) {
  .brand .bstrap { display: none; }
  .topbar { gap: 10px; }
}
@media (max-width: 1499px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 9px 16px 7px; row-gap: 5px; }
  .nav { order: 3; flex: 0 0 100%; width: 100%; margin-left: 0; }
}
@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .topbar { padding: 8px 12px 6px; }
  .nav a { padding: 7px 9px; }
  .wrap { padding: 14px 14px 50px; }
  .switch a { padding: 3px 9px; }
}
