:root {
  --ink: #102124;
  --muted: #687579;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --line: #d7ded8;
  --tejo: #0d626c;
  --tile: #e24d35;
  --danger: #d71920;
  --danger-bg: #fff1ef;
  --olive: #647b45;
  --gold: #c48938;
  --drone-green: #168545;
  --drone-yellow: #c28a10;
  --drone-red: #d71920;
  --drone-gray: #6f7b80;
  --shadow: 0 18px 50px rgba(16, 33, 36, .13);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(226,77,53,.08), transparent 34%),
    linear-gradient(220deg, rgba(13,98,108,.10), transparent 38%),
    var(--paper);
  font-family: Candara, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }

.hidden { display: none !important; }

.app-shell {
  width: min(100%, 760px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.topbar, .brand-lockup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar > div:first-child,
.brand-lockup > div {
  min-width: 0;
}

.brand-lockup { justify-content: flex-start; margin: 16svh 0 22px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--tejo), var(--tile));
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.45rem; letter-spacing: 0; overflow-wrap: anywhere; }
h2 { margin-bottom: 6px; font-size: 1.22rem; letter-spacing: 0; }

.login-panel, .status-panel, .day-summary, .timeline-item {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(16,33,36,.10);
  box-shadow: var(--shadow);
}

.login-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
}

label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; }

input, select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--tejo);
  color: #fff;
  font-weight: 800;
}

.icon-button {
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 1.25rem;
  background: var(--ink);
}

.top-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.text-button {
  min-height: 44px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.message { min-height: 1.2em; margin: 0; color: var(--tile); }

.status-panel {
  margin: 18px 0 12px;
  padding: 16px;
  border-radius: 8px;
  border-left: 5px solid var(--tejo);
}

.status-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.updated-text {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(13,98,108,.12);
  color: var(--tejo);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.clock {
  display: grid;
  gap: 1px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

.day-summary {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.summary-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  font-size: .94rem;
}

.summary-row strong { color: var(--tejo); }

.timeline {
  position: relative;
  display: grid;
  gap: 10px;
  padding-left: 13px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 21px;
  width: 2px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  padding: 12px 48px 12px 12px;
  border-radius: 8px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  border: 3px solid var(--paper);
}

.timeline-item.now {
  border-color: rgba(226,77,53,.55);
  border-left: 5px solid var(--tile);
}

.timeline-item.next { border-left: 5px solid var(--gold); }
.timeline-item.critical {
  background:
    linear-gradient(90deg, rgba(215,25,32,.13), rgba(255,255,255,.96) 42%),
    var(--danger-bg);
  border-color: rgba(215,25,32,.45);
}

.timeline-item.critical::before {
  background: var(--danger);
}

.timeline-item.critical:not(.now):not(.next) {
  border-left: 5px solid var(--danger);
}

.timeline-item.critical .item-time,
.timeline-item.critical .item-title {
  color: var(--danger);
}

.timeline-item.done { opacity: .66; }
.timeline-item.done .item-title { text-decoration: line-through; }

.drone-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid currentColor;
  box-shadow: 0 8px 18px rgba(16, 33, 36, .14);
}

.drone-badge svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drone-badge-allowed { color: var(--drone-green); }
.drone-badge-restricted { color: var(--drone-yellow); }
.drone-badge-denied { color: var(--drone-red); }
.drone-badge-pending { color: var(--drone-gray); }

.timeline-item.drone-allowed { border-right: 4px solid rgba(22, 133, 69, .7); }
.timeline-item.drone-restricted { border-right: 4px solid rgba(194, 138, 16, .78); }
.timeline-item.drone-denied { border-right: 4px solid rgba(215, 25, 32, .72); }
.timeline-item.drone-pending { border-right: 4px solid rgba(111, 123, 128, .68); }

.check {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--tejo);
}

.item-time {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
  font-weight: 900;
  color: var(--tejo);
}

.br-time {
  color: var(--muted);
  font-size: .83rem;
  font-weight: 800;
}

.item-title {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 900;
}

.critical-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
  text-decoration: none;
  vertical-align: 1px;
  white-space: nowrap;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 5px;
  color: var(--olive);
  font-size: .88rem;
  font-weight: 900;
}

.item-notes { margin: 0; color: var(--muted); font-size: .92rem; }

@media (min-width: 620px) {
  .app-shell { padding-top: 28px; }
  .controls { grid-template-columns: 1.35fr .9fr; }
  .day-summary { grid-template-columns: 1fr 1fr; }
  .summary-row { grid-template-columns: 96px 1fr; }
}
