/*
Copyright (C) AirWorks Solutions, Inc - All Rights Reserved
DO NOT REDISTRIBUTE
PROPRIETARY AND CONFIDENTIAL

Deliberately plain, per the prototype house style: default controls, no
theming beyond the AirWorks brand colours.
*/

:root {
  /* AirWorks brand, taken from cloud.airworks.io: the navy is the logo and
     favicon, the cyan is the app theme's own secondary colour
     (primary:{main:"#FFFFFF"}, secondary:{main:"#01a1dd"}). */
  --brand-navy: #021e40;
  --brand-navy-light: #1e3f58;
  --brand-cyan: #01a1dd;
  --brand-cyan-dark: #0186b9;

  --ink: #263238;
  --muted: #78909c;
  --rule: #e0e0e0;
}

* { box-sizing: border-box; }

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

#layout { display: flex; height: 100vh; }

#panel {
  width: 340px;
  flex: none;
  overflow-y: auto;
  padding: 0 0 32px;
  border-right: 1px solid #cfd8dc;
  background: #fafafa;
}

#panel > section { padding: 12px 14px; }

/* Brand bar */
#brand {
  background: var(--brand-navy);
  color: #fff;
  padding: 12px 14px;
}
#brand .wordmark {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
}
#brand .wordmark .works { color: var(--brand-cyan); }
#brand h1 { font-size: 13px; font-weight: 500; margin: 2px 0 0; opacity: .92; }
#brand .muted, #brand a { color: #cfd8dc; }
#brand a { color: #fff; }
#brand img { height: 26px; display: block; margin-bottom: 8px; }

#map { flex: 1; }

h1 { font-size: 16px; margin: 0 0 2px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px; color: var(--brand-navy); }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 4px; color: #546e7a; }

section { border-top: 1px solid var(--rule); }

label { display: block; margin: 8px 0 2px; font-size: 12px; color: #546e7a; }

input[type="text"], input[type="number"], input[type="email"],
input[type="password"], input[type="file"], select, textarea {
  width: 100%;
  margin-bottom: 6px;
  font: inherit;
  padding: 4px;
}

button { font: inherit; padding: 4px 10px; cursor: pointer; }

/* Primary actions carry the brand cyan. */
#build, #cog-load, #roads-load, .card button {
  background: var(--brand-cyan);
  border: 1px solid var(--brand-cyan-dark);
  color: #fff;
  font-weight: 600;
}
#build:hover, #cog-load:hover, #roads-load:hover, .card button:hover {
  background: var(--brand-cyan-dark);
}

.muted { color: #78909c; font-size: 12px; margin: 0; }
.hint { color: #78909c; font-size: 11px; margin: 6px 0; }
.error { color: #c62828; font-size: 12px; }

.status { font-size: 12px; margin-top: 6px; min-height: 1em; white-space: pre-line; }
.status.ok { color: #2e7d32; }
.status.fail { color: #c62828; }
.status.warn { color: #ef6c00; }
.status.busy { color: #546e7a; }

#palette { display: flex; gap: 4px; flex-wrap: wrap; }
.swatch { border: 2px solid transparent; }
/* Grade colours come from grades.py via the template -- never hard-code them
   here, or the buttons drift from the map and the report. */
.swatch kbd { font: 11px/1 monospace; opacity: .75; border: 1px solid currentColor;
              border-radius: 2px; padding: 1px 3px; margin-left: 3px; }
.swatch.active { border-color: #000; font-weight: 700; }

#totals { margin-top: 8px; font-size: 12px; }
#totals div { display: flex; justify-content: space-between; }

dl { margin: 0; font-size: 12px; }
dl div { display: flex; justify-content: space-between; gap: 8px; }
dt { color: #78909c; }
dd { margin: 0; }

.history { margin: 0; padding-left: 18px; font-size: 11px; color: #455a64; max-height: 190px; overflow-y: auto; }
.history li { margin-bottom: 3px; }

.row { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; }

/* Login page */
body.centered { display: flex; align-items: center; justify-content: center; height: 100vh; background: #eceff1; }
.card { background: #fff; padding: 0 0 24px; border: 1px solid #cfd8dc; width: 340px; }
.card > * { margin-left: 24px; margin-right: 24px; }
.card .brand-bar img { height: 30px; display: block; margin-bottom: 6px; }
.card .brand-bar {
  background: var(--brand-navy);
  color: #fff;
  margin: 0 0 18px;
  padding: 18px 24px;
}
.card .brand-bar .wordmark { font-size: 20px; font-weight: 700; }
.card .brand-bar .wordmark .works { color: var(--brand-cyan); }
.card .brand-bar p { margin: 4px 0 0; font-size: 12px; color: #cfd8dc; }
.card input, .card button { width: calc(100% - 48px); }
.card button { margin-top: 14px; padding: 7px; }

/* PASER guide popup */
#paser { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex;
         align-items: center; justify-content: center; z-index: 10; }
#paser[hidden] { display: none; }
#paser .modal { background: #fff; padding: 20px 24px; max-width: 540px; width: 90%; }
#paser table { border-collapse: collapse; width: 100%; margin-bottom: 12px; }
#paser th, #paser td { text-align: left; padding: 5px 8px; border-bottom: 1px solid #e0e0e0; }
#paser thead th { font-size: 11px; text-transform: uppercase; color: #546e7a; }
.swatch-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; }
.linkish { background: none; border: none; color: #1565c0; text-decoration: underline;
           padding: 0; font: inherit; cursor: pointer; }

label.inline { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
label.inline input { width: auto; margin: 0; }

#config-editor summary { cursor: pointer; font-size: 12px; color: var(--brand-navy); }
#config-editor textarea { font: 11px/1.4 ui-monospace, Menlo, monospace; }

/* Tabs, in the style of the AirWorks 2D viewer: flat, underlined when active */
#tabs {
  display: flex;
  border-bottom: 1px solid #cfd8dc;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}
#tabs .tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #6e7f8d;
  cursor: pointer;
}
#tabs .tab:hover { color: var(--brand-navy); }
#tabs .tab.active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-cyan);
}

/* The per-file list in the Layers tab */
.filelist { list-style: none; margin: 6px 0 0; padding: 0; font-size: 11px;
            max-height: 260px; overflow-y: auto; }
.filelist li { display: flex; justify-content: space-between; gap: 8px;
               padding: 3px 0; border-bottom: 1px solid #eceff1; }
#imagery-files summary { cursor: pointer; font-size: 12px; color: var(--brand-navy);
                         margin-top: 8px; }
