:root {
  --bg: #f3f7f8;
  --panel: #ffffff;
  --line: #dce6e9;
  --text: #102435;
  --muted: #647b87;
  --accent: #08a99e;
  --accent-dark: #07877f;
  --danger: #b42318;
  --success: #067647;
  --marine: #061b2b;
  --marine-2: #0a3041;
  --aqua: #27d3c2;
  --shadow: 0 18px 48px rgba(6, 35, 52, .09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #101828;
  color: white;
}
.brand {
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #2dd4bf;
  color: #062b2d;
  font-size: 13px;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar nav a,
.topbar nav button {
  color: white;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.topbar nav .nav-login {
  padding: 9px 15px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 7px;
}
.topbar nav .nav-login:hover { background: rgba(255,255,255,.1); }
main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
h1, h2 { margin: 0 0 8px; }
p { color: var(--muted); }
.button, button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  background: white;
  text-decoration: none;
  cursor: pointer;
}
.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.primary:hover { background: var(--accent-dark); }
.flash {
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  background: #eef4ff;
}
.flash.error { color: var(--danger); background: #fffbfa; border: 1px solid #fecdca; }
.flash.success { color: var(--success); background: #ecfdf3; border: 1px solid #abefc6; }
.login-panel {
  max-width: 420px;
  margin: 7vh auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, .10);
}
.login-panel h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.08; margin-top: 10px; }
.login-back { display: inline-block; margin-bottom: 28px; color: var(--muted); text-decoration: none; font-size: 14px; }
.login-form { display: grid; gap: 17px; margin-top: 24px; }
.login-form button { margin-top: 4px; padding: 13px; font-weight: 700; }
.eyebrow {
  color: #087f7a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 58px;
  min-height: 620px;
  align-items: center;
  padding: 66px 6vw 80px;
  margin: -24px;
  color: white;
  background:
    radial-gradient(circle at 78% 22%, rgba(45,212,191,.18), transparent 27%),
    linear-gradient(135deg, #071c2c 0%, #0b3040 57%, #0b4650 100%);
  overflow: hidden;
}
.hero h1 { max-width: 700px; margin: 13px 0 20px; font-size: clamp(46px, 6vw, 82px); line-height: .98; letter-spacing: -.045em; }
.hero .eyebrow { color: #5eead4; }
.hero-lead { max-width: 650px; color: #c9d8df; font-size: 19px; line-height: 1.65; }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.button-large { padding: 14px 21px; border-radius: 8px; font-weight: 700; }
.button-ghost { color: white; border-color: rgba(255,255,255,.4); background: transparent; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 34px; color: #b8d2d8; font-size: 14px; }
.hero-visual {
  position: relative;
  min-height: 430px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px;
  background:
    linear-gradient(28deg, transparent 48%, rgba(45,212,191,.18) 49%, rgba(45,212,191,.18) 51%, transparent 52%),
    radial-gradient(circle at 50% 48%, #155e68 0 7%, transparent 7.5%),
    linear-gradient(145deg, #173d4c, #0c2938);
  box-shadow: 0 35px 90px rgba(0,0,0,.3);
  overflow: hidden;
}
.hero-visual::before,
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size: 42px 42px;
}
.radar-ring { position: absolute; left: 50%; top: 48%; border: 1px solid rgba(94,234,212,.38); border-radius: 50%; transform: translate(-50%,-50%); }
.radar-ring-one { width: 180px; height: 180px; }
.radar-ring-two { width: 330px; height: 330px; }
.map-pin { position: absolute; z-index: 2; left: 50%; top: 48%; transform: translate(-50%,-50%); display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; background: white; box-shadow: 0 0 0 12px rgba(45,212,191,.18), 0 18px 35px rgba(0,0,0,.28); }
.map-pin img { width: 55px; height: 55px; }
.location-card { position: absolute; z-index: 3; left: 24px; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(4,24,35,.84); backdrop-filter: blur(10px); }
.location-card div { display: grid; gap: 3px; }
.location-card small { color: #9fb9c2; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: #2dd4bf; box-shadow: 0 0 0 6px rgba(45,212,191,.14); }
.home-section, .how-section { padding: 100px 4vw; }
.section-intro { max-width: 720px; margin-bottom: 42px; }
.section-intro h2, .cta-section h2 { margin-top: 10px; font-size: clamp(32px, 4vw, 50px); line-height: 1.08; letter-spacing: -.03em; }
.section-intro p { font-size: 17px; line-height: 1.6; }
.offer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.offer-card { position: relative; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.offer-card.featured { border-color: #5eead4; box-shadow: 0 18px 45px rgba(8,127,122,.10); }
.offer-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 22px; border-radius: 13px; background: #e8fbf8; font-size: 26px; }
.offer-label { position: absolute; top: 20px; right: 20px; padding: 6px 9px; border-radius: 20px; color: #087f7a; background: #e8fbf8; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.offer-card h3, .steps-grid h3 { font-size: 22px; margin: 0 0 10px; }
.offer-card p { min-height: 70px; line-height: 1.55; }
.offer-card ul { display: grid; gap: 10px; min-height: 125px; padding-left: 20px; color: #344054; }
.offer-card a { color: #087f7a; font-weight: 800; text-decoration: none; }
.how-section { border-radius: 24px; background: #eef8f7; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.steps-grid article > span { display: inline-block; margin-bottom: 24px; color: #0d9488; font-size: 35px; font-weight: 800; }
.steps-grid p { line-height: 1.6; }
.cta-section { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin: 30px 4vw; padding: 48px; border-radius: 20px; color: white; background: #0b3040; }
.cta-section .eyebrow { color: #5eead4; }
.cta-section p { max-width: 700px; color: #c9d8df; }
.button-light { flex: 0 0 auto; color: #082b34; background: #5eead4; border-color: #5eead4; }
.home-footer { display: flex; justify-content: space-between; margin: 70px 4vw 20px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); }
.home-footer a { text-decoration: none; }
label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
}
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  background: white;
}
textarea { resize: vertical; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.full, .actions { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; }
.actions-inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}
.checkbox input { width: auto; }
.icon-picker {
  margin: 0;
  padding: 0;
  border: 0;
}
.icon-picker legend {
  margin-bottom: 8px;
  font-weight: 700;
}
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
}
.icon-picker-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.icon-picker-grid.tight {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.icon-option {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.icon-option.small {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 6px;
  min-height: 40px;
  padding: 5px;
  font-size: 12px;
}
.icon-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.icon-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .14);
}
.icon-option-preview {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eef4ff;
}
.icon-option-preview img {
  width: 34px;
  height: 34px;
}
.icon-option.small .icon-option-preview {
  width: 30px;
  height: 30px;
}
.icon-option.small .icon-option-preview img {
  width: 24px;
  height: 24px;
}
.current-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.current-icon img {
  width: 54px;
  height: 54px;
}
.current-icon.small {
  margin-bottom: 10px;
  padding: 7px;
}
.current-icon.small img {
  width: 36px;
  height: 36px;
}
.icon-panel-small {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}
#map, .detail-map {
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9eef5;
}
.detail-map { min-height: 440px; }
.history-map { min-height: 680px; }
.device-list {
  display: grid;
  gap: 10px;
  align-content: start;
}
.device-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}
.device-card span,
.device-card small { color: var(--muted); }
.alert-strip {
  margin-bottom: 18px;
}
.alert-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.alert-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: white;
}
.alert-card.danger {
  border-left-color: var(--danger);
}
.alert-card small {
  color: var(--muted);
}
.muted { opacity: .6; }
.empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  margin-bottom: 24px;
}
.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-bottom: 24px;
}
.history-toolbar {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.history-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.day-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
}
.day-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  text-decoration: none;
}
.day-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.day-pill span {
  color: var(--muted);
  font-size: 12px;
}
.route-summary {
  display: grid;
  gap: 10px;
}
.route-summary div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.route-summary span {
  color: var(--muted);
  font-size: 13px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  align-self: start;
}
code {
  display: block;
  overflow-wrap: anywhere;
  padding: 10px;
  border-radius: 6px;
  background: #eef2f7;
}
.hint { font-size: 14px; }
.compact-form {
  display: grid;
  gap: 10px;
}
.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
th {
  background: #f8fafc;
  font-size: 13px;
  color: var(--muted);
}
.packet {
  max-width: 520px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-family: Arial, sans-serif;
}
.packet-details summary {
  cursor: pointer;
  color: var(--muted);
}
.packet-details summary span {
  color: var(--accent);
  font-weight: 700;
}
.packet-details[open] summary {
  margin-bottom: 8px;
}
.packet-details div {
  white-space: normal;
  overflow-wrap: anywhere;
}
.command-response {
  white-space: pre-line;
}
.danger-command {
  background: #b91c1c;
  border-color: #991b1b;
  color: #ffffff;
}
.danger-command:hover {
  background: #991b1b;
}
.hidden { display: none; }
.table-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}
.section-heading-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.system-zone-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #9b1c1c;
  background: #fff1f0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.legal-page {
  max-width: 820px;
  margin: 35px auto;
  padding: 36px;
}
.legal-page h2 { margin-top: 28px; }
.legal-page p { line-height: 1.7; }
@media (max-width: 900px) {
  .topbar { height: auto; align-items: flex-start; padding: 14px; }
  .topbar, .page-heading, .topbar nav { flex-direction: column; }
  .section-heading-inline { align-items: flex-start; flex-direction: column; }
  main { padding: 14px; }
  .map-layout, .split, .form-grid, .history-layout, .history-toolbar, .history-form { grid-template-columns: 1fr; }
  .icon-picker-grid.compact { grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); }
  .icon-picker-grid.tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #map, .detail-map, .history-map { min-height: 420px; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 55px 24px; margin: -14px; }
  .hero-visual { min-height: 340px; }
  .offer-grid, .steps-grid { grid-template-columns: 1fr; }
  .home-section, .how-section { padding: 70px 10px; }
  .cta-section { align-items: flex-start; flex-direction: column; margin: 20px 0; padding: 30px; }
  .offer-card p, .offer-card ul { min-height: auto; }
}

#zone-map {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9eef5;
}
.zone-map-tools {
  display: grid;
  gap: 10px;
}
@media (max-width: 900px) {
  #zone-map { min-height: 420px; }
}

.zone-builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin-bottom: 24px;
}
#zones-map {
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9eef5;
}
.zone-builder-panel {
  display: grid;
  gap: 12px;
}
@media (max-width: 900px) {
  .zone-builder-layout { grid-template-columns: 1fr; }
  #zones-map { min-height: 460px; }
}

/* Panel aplikacji — spójny wizualnie ze stroną GdzieJacht.pl */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0, rgba(39, 211, 194, .06), transparent 24rem),
    var(--bg);
}

.app-page :focus-visible {
  outline: 3px solid rgba(39, 211, 194, .55);
  outline-offset: 2px;
}

.app-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  height: 72px;
  color: #fff;
  background: rgba(6, 27, 43, .97);
  border-bottom: 1px solid rgba(132, 240, 229, .12);
  box-shadow: 0 8px 28px rgba(2, 20, 31, .15);
  backdrop-filter: blur(16px);
}

.app-header-inner {
  display: flex;
  align-items: center;
  width: min(1440px, calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  gap: 36px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.03em;
  text-decoration: none;
  white-space: nowrap;
}

.app-brand > span:last-child > span {
  color: var(--aqua);
}

.app-brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid rgba(132, 240, 229, .4);
  border-radius: 50%;
  background: rgba(39, 211, 194, .1);
}

.app-brand-mark::before,
.app-brand-mark::after,
.app-brand-mark span {
  content: "";
  position: absolute;
  background: var(--aqua);
}

.app-brand-mark::before {
  width: 3px;
  height: 16px;
  border-radius: 3px;
}

.app-brand-mark::after {
  width: 17px;
  height: 3px;
  bottom: 9px;
  border-radius: 3px;
}

.app-brand-mark span {
  width: 11px;
  height: 11px;
  bottom: 5px;
  border: 2px solid var(--aqua);
  border-top: 0;
  border-left: 0;
  background: transparent;
  transform: rotate(45deg);
}

.app-navigation {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 5px;
}

.app-navigation > a {
  position: relative;
  padding: 10px 12px;
  border-radius: 9px;
  color: #bcd0d9;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}

.app-navigation > a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .06);
}

.app-navigation > a.active {
  color: #fff;
  background: rgba(39, 211, 194, .12);
}

.app-navigation > a.active::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 4px;
  left: 12px;
  height: 2px;
  border-radius: 3px;
  background: var(--aqua);
}

.app-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.app-nav-actions form {
  margin: 0;
}

.app-nav-actions button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px;
  color: #dce8ed;
  background: rgba(255, 255, 255, .04);
  font-size: 12px;
  font-weight: 650;
}

.app-nav-actions button:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .08);
}

.notification-button span {
  margin-right: 5px;
  color: var(--aqua);
  font-size: 9px;
}

.app-menu-toggle {
  display: none;
}

.app-page main {
  width: min(1440px, 100%);
  max-width: none;
  padding: 34px clamp(20px, 3vw, 44px) 52px;
}

.app-page .page-heading {
  align-items: center;
  margin-bottom: 26px;
}

.app-page .page-heading h1 {
  margin: 5px 0 5px;
  color: var(--text);
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.app-page .page-heading p {
  margin: 0;
  font-size: 15px;
}

.app-eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #07877f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.app-eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 0 5px rgba(39, 211, 194, .12);
}

.heading-actions,
.fleet-summary {
  display: flex;
  align-items: center;
}

.heading-actions {
  gap: 12px;
}

.fleet-summary {
  gap: 10px;
  min-height: 48px;
  padding: 7px 16px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(7, 43, 56, .04);
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #087f78;
  background: #e6f8f5;
  font-size: 20px;
}

.fleet-summary > span:last-child {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 5px;
}

.fleet-summary strong {
  font-size: 20px;
}

.fleet-summary small {
  color: var(--muted);
  font-size: 11px;
}

.app-page .button,
.app-page button {
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.app-page .button:hover,
.app-page button:hover {
  transform: translateY(-1px);
}

.app-page .primary {
  color: #062d31;
  border-color: var(--aqua);
  background: var(--aqua);
  box-shadow: 0 8px 20px rgba(19, 175, 162, .16);
}

.app-page .primary:hover {
  border-color: #65eadc;
  background: #65eadc;
}

.button-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px !important;
}

.button-add span {
  font-size: 18px;
  font-weight: 400;
}

.alert-strip {
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid #ffd8c9;
  border-radius: 16px;
  background: #fffaf7;
}

.section-title-row,
.device-list-header,
.map-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-title-row {
  margin-bottom: 13px;
}

.section-title-row h2,
.device-list-header h2,
.map-card-header h2 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: -.025em;
}

.count-badge {
  display: grid;
  place-items: center;
  min-width: 29px;
  height: 29px;
  padding: 0 8px;
  border-radius: 999px;
  color: #087f78;
  background: #e6f8f5;
  font-size: 12px;
  font-weight: 800;
}

.alert-count {
  color: #a43a1e;
  background: #fee7dc;
}

.alert-list {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.alert-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid #f2d5ca;
  border-left: 1px solid #f2d5ca;
  border-radius: 11px;
  box-shadow: 0 6px 18px rgba(100, 45, 23, .04);
}

.alert-card .alert-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  color: #b44120;
  background: #fee8de;
  font-size: 14px;
  font-weight: 900;
}

.alert-card > div {
  display: grid;
  gap: 2px;
}

.alert-card > div span {
  color: #6d5148;
  font-size: 12px;
}

.alert-card form button {
  min-height: 34px;
  padding: 7px 10px;
  color: #8f351e;
  border-color: #efc9bb;
  background: #fff;
  font-size: 11px;
}

.map-layout {
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: stretch;
}

.map-card,
.device-sidebar {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-card {
  padding: 8px;
}

.map-card-header {
  min-height: 68px;
  padding: 10px 12px 13px;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #55717a;
  background: #eef7f6;
  font-size: 10px;
  font-weight: 700;
}

.live-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #19bba9;
  box-shadow: 0 0 0 4px rgba(25, 187, 169, .11);
  animation: app-pulse 2s infinite;
}

.map-card #map {
  min-height: 640px;
  border: 0;
  border-radius: 12px;
}

.map-card .leaflet-control-zoom a,
.map-card .leaflet-control-layers-toggle {
  border: 0;
}

.map-card .leaflet-control-zoom,
.map-card .leaflet-control-layers {
  border: 1px solid rgba(11, 48, 64, .14) !important;
  border-radius: 9px !important;
  box-shadow: 0 8px 22px rgba(6, 35, 52, .13) !important;
  overflow: hidden;
}

.device-sidebar {
  display: flex;
  flex-direction: column;
  max-height: 726px;
}

.device-list-header {
  flex: 0 0 auto;
  min-height: 84px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid #e8eef0;
}

.device-list {
  display: grid;
  gap: 9px;
  padding: 11px;
  overflow-y: auto;
  scrollbar-color: #b9d6d4 transparent;
  scrollbar-width: thin;
}

.device-card {
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 11px;
  padding: 12px;
  border-color: transparent;
  border-radius: 12px;
  background: #f7fafb;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.device-card:hover {
  transform: translateY(-1px);
  border-color: #bce7e2;
  background: #fff;
  box-shadow: 0 9px 24px rgba(6, 43, 57, .09);
}

.device-card-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid #dce8e9;
  border-radius: 13px;
  background: linear-gradient(145deg, #eef7f6, #fff);
}

.device-card-icon img {
  width: 40px;
  height: 40px;
}

.device-card-icon i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #9aaeb6;
}

.device-card-icon i.online {
  background: #18b8a7;
  box-shadow: 0 0 0 3px rgba(24, 184, 167, .1);
}

.device-card-content,
.device-title-row,
.device-telemetry,
.device-telemetry small {
  display: grid;
}

.device-card-content {
  min-width: 0;
  gap: 3px;
}

.device-title-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.device-title-row strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-arrow {
  color: #8aa1aa;
  transition: transform .18s ease, color .18s ease;
}

.device-card:hover .device-arrow {
  color: #07877f;
  transform: translateX(2px);
}

.device-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-telemetry {
  grid-template-columns: .8fr 1.2fr;
  gap: 9px;
  margin-top: 7px;
  padding-top: 8px;
  border-top: 1px solid #e2eaec;
}

.device-telemetry small {
  gap: 2px;
}

.device-telemetry b {
  color: #82969f;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.device-telemetry span {
  overflow: hidden;
  color: #294450;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-coordinates {
  margin-top: 4px;
  color: #8ba0a8 !important;
  font: 9px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.no-position {
  display: inline-flex;
  align-items: center;
  align-self: start;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #7a6060;
  background: #f5eded;
  font-size: 10px;
}

.device-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 48px 24px;
}

.device-empty > span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 5px;
  border-radius: 14px;
  color: #07877f;
  background: #e5f8f5;
  font-size: 27px;
}

.device-empty p {
  max-width: 240px;
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.5;
}

.app-page .panel,
.app-page .form-grid,
.app-page .table-wrap,
.app-page .history-form {
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(6, 35, 52, .055);
}

.app-page .form-grid,
.app-page .panel {
  padding: 22px;
}

.app-page input,
.app-page textarea,
.app-page select {
  min-height: 42px;
  border-color: #cfdbdf;
  border-radius: 9px;
  background: #fff;
}

.app-page input:focus,
.app-page textarea:focus,
.app-page select:focus {
  border-color: #29bdb1;
  outline: 3px solid rgba(39, 211, 194, .12);
}

.app-page th {
  padding-block: 13px;
  color: #627985;
  background: #f1f7f7;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.app-page td {
  padding-block: 13px;
  font-size: 13px;
}

.app-page tbody tr:hover {
  background: #f8fbfb;
}

@keyframes app-pulse {
  70% { box-shadow: 0 0 0 8px rgba(25, 187, 169, 0); }
  100% { box-shadow: 0 0 0 0 rgba(25, 187, 169, 0); }
}

@media (max-width: 1120px) {
  .app-header-inner {
    gap: 18px;
  }

  .app-navigation > a {
    padding-inline: 8px;
    font-size: 11px;
  }

  .notification-button {
    width: 39px;
    overflow: hidden;
    color: transparent !important;
    white-space: nowrap;
  }

  .notification-button span {
    display: inline-block;
    margin-right: 20px;
  }

  .map-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

@media (max-width: 900px) {
  .app-header {
    height: 64px;
  }

  .app-header-inner {
    width: calc(100% - 28px);
  }

  .app-brand {
    font-size: 17px;
  }

  .app-menu-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    margin-left: auto;
    padding: 9px;
    border: 0;
    background: transparent;
  }

  .app-menu-toggle i {
    display: block;
    width: 22px;
    height: 2px;
    margin: 2px auto;
    background: #fff;
  }

  .app-navigation {
    position: absolute;
    top: 64px;
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    padding: 12px 15px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    background: #061b2b;
    box-shadow: 0 18px 30px rgba(2, 18, 29, .25);
  }

  .app-navigation.open {
    display: grid;
  }

  .app-navigation > a {
    padding: 11px 12px;
    font-size: 14px;
  }

  .app-navigation > a.active::after {
    top: 11px;
    right: auto;
    bottom: 11px;
    left: 3px;
    width: 2px;
    height: auto;
  }

  .app-nav-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 8px 0 0;
  }

  .app-nav-actions button,
  .notification-button {
    width: 100%;
    color: #dce8ed !important;
  }

  .notification-button span {
    margin-right: 5px;
  }

  .app-page main {
    padding: 24px 14px 38px;
  }

  .app-page .page-heading {
    align-items: stretch;
  }

  .dashboard-heading {
    flex-direction: row;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .device-sidebar {
    max-height: none;
  }

  .device-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .map-card #map {
    min-height: 480px;
  }
}

@media (max-width: 620px) {
  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .heading-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .fleet-summary,
  .button-add {
    justify-content: center;
  }

  .map-card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .map-card #map {
    min-height: 410px;
  }

  .device-list {
    grid-template-columns: 1fr;
  }

  .alert-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .alert-card form {
    grid-column: 2;
  }

  .app-page .form-grid {
    grid-template-columns: 1fr;
  }

  .app-page .full,
  .app-page .actions {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-status i {
    animation: none;
  }
}
