:root {
  --ink: #102a33;
  --muted: #65777d;
  --navy: #071e27;
  --navy-2: #0b303b;
  --teal: #1a7f9f;
  --aqua: #59d4cc;
  --lime: #d9e83f;
  --paper: #f5f7f4;
  --white: #ffffff;
  --line: #dce5e3;
  --danger: #dc3f4d;
  --brand-blue: #2458b8;
  --brand-gray: #a4adbf;
  --shadow: 0 24px 70px rgba(3, 25, 34, .18);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-logo-frame { display: block; width: 124px; height: 40px; overflow: hidden; }
.brand-logo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 43%; }
.brand-product { padding-left: 10px; border-left: 1px solid #d8ddea; color: var(--brand-gray); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.brand--large .brand-logo-frame { width: 188px; height: 62px; border-radius: 10px; }

.login-page { overflow-x: hidden; }
.login-shell { display: grid; grid-template-columns: minmax(420px, 1.16fr) minmax(420px, .84fr); min-height: 100vh; }
.login-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 54px clamp(44px, 7vw, 104px); color: white; overflow: hidden; background: linear-gradient(90deg, transparent 65%, rgba(2,11,28,.72) 88%, #020b1c 100%), radial-gradient(circle at 78% 54%, rgba(0,128,255,.22), transparent 38%), radial-gradient(circle at 18% 82%, rgba(0,194,255,.08), transparent 35%), linear-gradient(110deg, #071d35 0%, #04162d 52%, #020b1c 100%); }
.login-story::before { content: ""; position: absolute; inset: auto -18% -38% 5%; height: 65%; border: 1px solid rgba(56,192,255,.18); border-radius: 50%; transform: rotate(-8deg); }
.story-copy { position: relative; z-index: 2; max-width: 690px; margin: auto 0; }
.eyebrow { display: block; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.login-story .eyebrow { color: #63ddff; }
.story-copy h1 { max-width: 610px; margin: 14px 0 18px; font-size: clamp(36px, 4.4vw, 62px); line-height: 1.02; letter-spacing: -.05em; }
.story-copy p { max-width: 530px; margin: 0; color: #b9cdd1; font-size: 16px; line-height: 1.55; }
.story-footer { position: relative; z-index: 2; max-width: 690px; margin-bottom: clamp(50px, 11vh, 120px); }
.story-foot { margin: 0 0 11px; color: #8da9b0; font-size: 11px; letter-spacing: .08em; }
.privacy-notice { margin: 0; color: rgba(231,241,243,.86); font-size: 12px; line-height: 1.5; }
.privacy-notice b { color: #d5e3e5; }
.privacy-notice a { color: #63ddff; text-decoration: none; }
.privacy-notice a:hover { text-decoration: underline; }
.ocean-orbit { position: absolute; width: 390px; height: 390px; right: -110px; bottom: 8%; }
.orbit { position: absolute; inset: 0; border: 1px solid rgba(89,212,204,.18); border-radius: 50%; }
.orbit--two { inset: 55px; border-color: rgba(65,199,255,.22); }
.signal-dot { position: absolute; left: 62px; top: 92px; width: 12px; height: 12px; border-radius: 50%; background: #4dd9ff; box-shadow: 0 0 0 12px rgba(77,217,255,.08), 0 0 40px #159cff; }

.login-panel { position: relative; isolation: isolate; display: grid; place-items: center; padding: 48px; overflow: hidden; background: #020b1c url("/static/images/login-satellite-network.png") center top / cover no-repeat; }
.login-panel::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #020b1c 0%, rgba(2,11,28,.82) 5%, rgba(2,11,28,.38) 14%, transparent 28%), linear-gradient(180deg, rgba(0,8,27,.12), rgba(0,12,36,.46) 48%, rgba(0,7,24,.72)); }
.login-panel::after { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.login-card { width: min(100%, 450px); padding: clamp(28px, 4vw, 44px); border: 0; border-radius: 0; color: #f5fbff; background: transparent; box-shadow: none; }
.mobile-brand { display: none; width: 154px; height: 51px; margin-bottom: 42px; overflow: hidden; border-radius: 9px; background: #fff; box-shadow: 0 1px 7px rgba(0,0,0,.1); }
.mobile-brand .brand-logo { object-position: center 43%; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; color: #33705d; background: #e0f2e8; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-chip i, .live-status i { width: 7px; height: 7px; border-radius: 50%; background: #24a36e; box-shadow: 0 0 0 4px rgba(36,163,110,.12); }
.login-heading h2 { margin: 24px 0 8px; font-size: 42px; letter-spacing: -.04em; }
.login-heading p { margin: 0 0 38px; color: var(--muted); line-height: 1.6; }
.auth-form { display: grid; gap: 10px; }
.auth-form label { margin-top: 10px; font-size: 13px; font-weight: 750; }
.field-wrap { position: relative; }
.field-wrap input { width: 100%; height: 56px; padding: 0 70px 0 48px; border: 1px solid #cdd9d6; border-radius: 13px; outline: none; background: white; transition: border-color .2s, box-shadow .2s; }
.field-wrap input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(26,127,159,.1); }
.field-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 21px; height: 21px; color: var(--teal); border: 1px solid #9db6ba; border-radius: 50%; font-size: 9px; font-weight: 800; }
.password-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); padding: 8px; border: 0; color: var(--teal); background: transparent; font-size: 12px; font-weight: 800; }
.form-error { min-height: 21px; color: var(--danger); font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 22px; min-height: 42px; padding: 0 18px; border: 0; border-radius: 11px; font-weight: 800; transition: transform .15s, opacity .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button--primary { min-height: 56px; color: #10222a; background: var(--lime); box-shadow: 0 13px 30px rgba(185,202,38,.24); }
.button--primary b { font-size: 20px; }
.button--secondary { color: white; background: var(--teal); }
.button--quiet { color: var(--muted); background: #edf1ef; }
.button--danger { width: 100%; color: white; background: var(--danger); }
.security-note { margin-top: 24px; color: #819095; text-align: center; font-size: 12px; }
.security-note span { color: #55a18b; }

.login-panel .status-chip { color: #bfeeff; border: 1px solid rgba(70,196,255,.28); background: rgba(16,105,169,.28); box-shadow: inset 0 0 18px rgba(20,135,220,.1); }
.login-panel .status-chip i { background: #4cddff; box-shadow: 0 0 0 4px rgba(76,221,255,.12), 0 0 18px rgba(76,221,255,.75); }
.login-panel .login-heading h2 { color: #fff; font-size: clamp(34px, 3vw, 44px); line-height: 1.02; text-shadow: 0 2px 20px rgba(0,122,255,.28); }
.login-panel .login-heading p { color: #b9d2e8; }
.login-panel .auth-form label { color: #dcecff; letter-spacing: .02em; }
.login-panel .field-wrap input { color: #f5fbff; border-color: rgba(118,189,235,.34); background: rgba(2,15,40,.68); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.login-panel .field-wrap input:focus { border-color: #41c8ff; box-shadow: 0 0 0 4px rgba(43,180,255,.16), 0 0 24px rgba(0,132,255,.12); }
.login-panel .field-wrap input:-webkit-autofill { -webkit-text-fill-color: #f5fbff; -webkit-box-shadow: 0 0 0 1000px #071938 inset; caret-color: #f5fbff; }
.login-panel .field-icon { color: #77ddff; border-color: rgba(105,207,255,.62); }
.login-panel .password-toggle { color: #6bdcff; }
.login-panel .form-error { color: #ff9eaa; }
.login-panel .button--primary { color: #fff; background: linear-gradient(135deg, #0879e7, #00bdf2); box-shadow: 0 15px 35px rgba(0,127,244,.34), inset 0 1px 0 rgba(255,255,255,.3); }
.login-panel .button--primary:hover { background: linear-gradient(135deg, #0b88fa, #13c9f7); }
.login-panel .security-note { color: #a9c7dd; }
.login-panel .security-note span { color: #5be2ff; }
.login-recovery-link, .account-link { display: inline-block; color: #6bdcff; font-size: 13px; font-weight: 750; text-decoration: none; }
.login-recovery-link { margin-top: 16px; }
.login-recovery-link:hover, .account-link:hover { text-decoration: underline; }
.form-success { color: #2d9e79 !important; }

.account-page { min-height: 100vh; background: radial-gradient(circle at 10% 10%, rgba(31,146,219,.22), transparent 30%), linear-gradient(135deg, #04162d, #071e27 60%, #0c3f50); }
.account-shell { width: min(100% - 32px, 560px); min-height: 100vh; margin: auto; padding: 56px 0; }
.account-shell > .brand { margin: 0 0 25px 8px; }
.account-card { padding: clamp(25px, 5vw, 42px); border: 1px solid rgba(147,213,244,.24); border-radius: 20px; color: #eef8ff; background: rgba(3,20,42,.82); box-shadow: 0 22px 65px rgba(0,0,0,.3); backdrop-filter: blur(12px); }
.account-card h1, .account-card h2 { margin: 12px 0 8px; color: #fff; letter-spacing: -.035em; }
.account-card h1 { font-size: 32px; }
.account-card h2 { font-size: 27px; }
.account-card > p { margin: 0 0 22px; color: #b9d2e8; line-height: 1.55; }
.account-card .auth-form label { color: #dcecff; }
.account-card .field-wrap input { color: #f5fbff; border-color: rgba(118,189,235,.34); background: rgba(2,15,40,.68); }
.account-card .field-icon { color: #77ddff; border-color: rgba(105,207,255,.62); }
.account-card .button--primary { color: #fff; background: linear-gradient(135deg, #0879e7, #00bdf2); }
.account-card .button--secondary { color: #fff; background: #126c89; }
.account-card .account-link { margin-top: 22px; }
.account-shell--profile { width: min(100% - 32px, 1050px); }
.account-topbar { display: flex; align-items: center; justify-content: space-between; margin: 0 0 25px; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.profile-grid--password-only { grid-template-columns: minmax(0, 520px); justify-content: center; }
.profile-summary { white-space: pre-line; }

.app-page { height: 100vh; overflow: hidden; background: #e9efed; }
.topbar { position: relative; z-index: 1000; display: flex; align-items: center; justify-content: space-between; height: 70px; padding: 0 22px 0 26px; color: var(--brand-blue); background: #fff; border-bottom: 1px solid #e0e4ec; box-shadow: 0 3px 16px rgba(26,47,84,.10); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.live-status { display: inline-flex; align-items: center; gap: 9px; margin-right: 8px; color: var(--brand-gray); font-size: 12px; font-weight: 700; }
.icon-button { width: 38px; height: 38px; border: 1px solid #d9dfeb; border-radius: 10px; color: var(--brand-blue); background: #f8f9fc; font-size: 20px; }
.icon-button:hover { background: #edf1f9; }
.user-menu { display: flex; align-items: center; gap: 9px; padding: 0 10px; }
.user-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: white; background: var(--brand-blue); font-weight: 900; }
.user-copy { display: grid; min-width: 90px; }
.user-copy b { color: var(--brand-blue); font-size: 13px; }
.user-copy small { color: var(--brand-gray); font-size: 10px; }
.topbar .button--quiet { color: var(--brand-blue); background: #edf1f8; }
.topbar .button--quiet:hover { background: #e2e8f4; }

.workspace { display: grid; grid-template-columns: 330px 1fr; height: calc(100vh - 70px); transition: grid-template-columns .28s ease; }
.fleet-sidebar { position: relative; z-index: 600; display: flex; flex-direction: column; width: 330px; min-width: 0; padding: 17px 14px 10px; overflow: visible; background: #f9fbf9; border-right: 1px solid var(--line); box-shadow: 8px 0 24px rgba(10,41,49,.06); transition: transform .28s ease, box-shadow .28s ease; }
.sidebar-collapsed .workspace { grid-template-columns: 0 1fr; }
.sidebar-collapsed .fleet-sidebar { transform: translateX(-330px); box-shadow: none; }
.sidebar-heading { display: flex; align-items: end; justify-content: space-between; padding: 0 6px; }
.sidebar-heading h1 { margin: 3px 0 0; font-size: 26px; letter-spacing: -.04em; }
.count-badge { display: grid; place-items: center; min-width: 32px; height: 27px; padding: 0 8px; border-radius: 999px; color: var(--teal); background: #e3f0f1; font-weight: 850; }
.fleet-picker { display: grid; margin: 12px 0 6px; }
.fleet-current { display: flex; align-items: center; height: 39px; padding: 0 11px; overflow: hidden; border: 1px solid #cbdad7; border-radius: 11px; color: var(--ink); background: #f4f7f5; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.device-icon-picker { display: grid; grid-template-columns: 1fr 116px; align-items: center; gap: 9px; margin: 5px 1px 2px; color: #657b80; font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.device-icon-picker select { height: 31px; padding: 0 8px; border: 1px solid #cbdad7; border-radius: 8px; color: #245560; background: #f4f7f5; font-size: 10px; font-weight: 800; text-transform: none; }
.search-box { display: flex; align-items: center; gap: 9px; height: 40px; margin: 13px 0 10px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.search-box span { color: #82999e; font-size: 21px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; }
.fleet-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 9px; padding: 8px; border-radius: 12px; background: #eef3f1; }
.fleet-summary div { display: grid; gap: 1px; text-align: center; }
.fleet-summary b { font-size: 16px; }
.fleet-summary span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.alert-chip, .device-alert-badge { display: inline-flex; align-items: center; min-height: 20px; padding: 3px 6px; border-radius: 999px; color: #765211; background: #fff0cf; font-size: 9px; font-weight: 850; line-height: 1; }
.alert-chip--sos, .device-alert-badge--sos { color: #a32936; background: #fee3e5; }
.alert-chip--low-battery, .device-alert-badge--low-battery { color: #a75411; background: #fff0d5; }
.alert-chip--fishing-zone, .device-alert-badge--fishing-zone { color: #8c3075; background: #fae5f5; }
.alert-chip--no-transmission, .device-alert-badge--no-transmission { color: #75631a; background: #faf2bc; }
.device-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #95bec4 transparent; }
.device-list::-webkit-scrollbar { width: 8px; }
.device-list::-webkit-scrollbar-thumb { border: 2px solid #f9fbf9; border-radius: 8px; background: #95bec4; }
.device-list-navigation { display: grid; flex: 0 0 auto; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 2px 8px; padding: 6px; border: 1px solid rgba(196,219,215,.92); border-radius: 12px; background: #f6fbfa; box-shadow: 0 3px 10px rgba(10,41,49,.08); }
.device-list-navigation[hidden] { display: none; }
.device-list-nav-button { min-height: 31px; border: 1px solid #cfe0dd; border-radius: 9px; color: #24616a; background: #f2f8f6; font-size: 10px; font-weight: 850; }
.device-list-nav-button:hover { border-color: #8ebeb8; background: #e4f2ef; }
.device-list-nav-button:disabled { cursor: not-allowed; opacity: .45; }
.sidebar-toggle { position: absolute; z-index: 750; top: 50%; right: -24px; display: grid; place-items: center; width: 24px; height: 58px; padding: 0; border: 0; border-radius: 0 10px 10px 0; color: #fff; background: #0b303b; box-shadow: 6px 3px 13px rgba(5,34,42,.22); font-size: 27px; line-height: 1; transform: translateY(-50%); }
.sidebar-toggle:hover { background: var(--teal); }
.sidebar-collapsed .sidebar-toggle { transform: translateY(-50%) rotate(180deg); }
.device-card { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; width: 100%; margin-bottom: 5px; padding: 9px 9px; border: 1px solid transparent; border-radius: 12px; color: inherit; text-align: left; background: transparent; }
.device-card:hover { background: #eef5f3; }
.device-card.is-selected { border-color: #b9d9d8; background: #e5f1f0; box-shadow: inset 3px 0 var(--teal); }
.device-card.has-alert { border-color: rgba(220,63,77,.3); background: #fff2f3; }
.device-card.alert-low-battery { border-color: rgba(224,139,30,.35); background: #fff9ef; }
.device-card.alert-fishing-zone { border-color: rgba(174,64,151,.30); background: #fff5fd; }
.device-card.alert-no-transmission { border-color: rgba(186,153,21,.35); background: #fffdf0; }
.device-card.alert-other { border-color: rgba(224,139,30,.38); background: #fff8ed; }
.device-symbol { display: grid; place-items: center; width: 32px; height: 32px; color: white; border-radius: 11px 11px 14px 14px; background: var(--teal); transform: rotate(0); }
.device-symbol--spot { border: 2px solid #fff; border-radius: 50% 50% 50% 0; box-shadow: 0 2px 6px rgba(4,35,43,.22); transform: rotate(-45deg); }
.device-symbol--spot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #e7f6f5; transform: rotate(45deg); }
.has-alert .device-symbol { background: #d87920; animation: pulse-alert 1s infinite; }
.alert-sos .device-symbol { background: var(--danger); }
.alert-low-battery .device-symbol, .alert-fishing-zone .device-symbol, .alert-no-transmission .device-symbol, .alert-other .device-symbol { background: #d87920; }
.device-alert-badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.ship-icon { position: relative; display: inline-block; width: 20px; height: 16px; }
.ship-icon::before { content: ""; position: absolute; left: 5px; top: 2px; width: 10px; height: 7px; border-radius: 2px 2px 0 0; background: currentColor; box-shadow: -3px 5px 0 -1px currentColor, 3px 5px 0 -1px currentColor; }
.ship-icon::after { content: ""; position: absolute; left: 1px; bottom: 0; width: 18px; height: 7px; background: currentColor; clip-path: polygon(0 0, 100% 0, 78% 100%, 22% 100%); }
.ship-icon i { position: absolute; z-index: 1; left: 8px; top: 0; width: 4px; height: 4px; border-radius: 1px 1px 0 0; background: currentColor; }
.ship-icon--small { width: 18px; height: 14px; transform: scale(.82); }
.vehicle-icon { display: block; width: 22px; height: 18px; fill: currentColor; }
.vehicle-icon--motorcycle { width: 24px; height: 20px; }
.vehicle-icon--dinghy { width: 28px; height: 21px; }
.vehicle-icon--small { transform: scale(.8); }
.device-copy, .device-meta { display: grid; gap: 3px; min-width: 0; }
.device-copy b { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.device-copy small, .device-meta small { color: #7f9195; font-size: 10px; }
.device-meta { text-align: right; }
.device-meta b { color: #35535a; font-size: 11px; }
.empty-state { margin: auto 10px; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--ink); font-size: 16px; }
.empty-state p { font-size: 12px; line-height: 1.5; }
.empty-radar { display: inline-block; width: 70px; height: 70px; border: 1px solid #b8cecf; border-radius: 50%; background: radial-gradient(circle, var(--teal) 0 3px, transparent 4px), repeating-radial-gradient(circle, transparent 0 13px, rgba(26,127,159,.14) 14px 15px); }

.map-stage { position: relative; min-width: 0; overflow: hidden; }
.map { width: 100%; height: 100%; background: #dce6e3; }
.leaflet-container { width: 100%; height: 100%; background: #dce6e3; }
.leaflet-container .leaflet-tile { max-width: none !important; max-height: none !important; }
.map-toolbar { position: absolute; z-index: 500; top: 15px; left: 16px; display: flex; flex-wrap: wrap; gap: 8px; max-width: calc(100% - 32px); }
.map-action { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 14px; border: 1px solid rgba(14,54,64,.12); border-radius: 9px; color: var(--ink); background: rgba(255,255,255,.94); box-shadow: 0 7px 22px rgba(5,37,46,.12); font-size: 12px; font-weight: 800; text-decoration: none; }
.map-action--dark { color: white; background: rgba(7,30,39,.9); }
.map-action--alerts { display: inline-flex; align-items: center; gap: 7px; }
.map-alert-count { display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; color: #fff; background: #718a8f; font-size: 10px; }
.map-action--unread { border-color: #d85560; color: #8f2934; background: #fff0f1; animation: alert-flash 1s ease-in-out infinite; }
.map-action--unread .map-alert-count { background: #c83c49; }
.fishing-label-shell { background: transparent; border: 0; }
.fishing-label { display: inline-block; max-width: 170px; padding: 4px 7px; overflow: hidden; border: 1px solid rgba(183,142,0,.62); border-radius: 7px; color: #765e00; background: rgba(255,252,218,.91); box-shadow: 0 2px 8px rgba(112,83,0,.20); font-size: 10px; font-weight: 850; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.geofence-label-shell { background: transparent; border: 0; }
.geofence-label { display: inline-block; max-width: 170px; padding: 4px 7px; overflow: hidden; border: 0; border-radius: 0; color: #ffeb32; background: transparent; box-shadow: none; font-size: 6.875px; font-weight: 900; line-height: 10px; text-align: center; text-overflow: ellipsis; text-shadow: -1px -1px 2px rgba(0,0,0,.95), 1px -1px 2px rgba(0,0,0,.95), -1px 1px 2px rgba(0,0,0,.95), 1px 1px 2px rgba(0,0,0,.95), 0 2px 4px rgba(0,0,0,.9); white-space: nowrap; }
.reference-point-label-shell { background: transparent; border: 0; }
.reference-point-label { display: inline-block; max-width: 170px; padding: 4px 7px; overflow: hidden; border: 0; border-radius: 0; color: #071a21; background: transparent; box-shadow: none; font-size: 9px; font-weight: 900; line-height: 12px; text-align: center; text-overflow: ellipsis; text-shadow: -1px -1px 2px rgba(255,255,255,.98), 1px -1px 2px rgba(255,255,255,.98), -1px 1px 2px rgba(255,255,255,.98), 1px 1px 2px rgba(255,255,255,.98), 0 2px 4px rgba(255,255,255,.92); white-space: nowrap; }
.toast { position: absolute; z-index: 900; top: 65px; left: 50%; transform: translateX(-50%); max-width: 520px; padding: 13px 18px; border-radius: 11px; color: white; background: #a63440; box-shadow: var(--shadow); font-size: 13px; }
.coordinate-warning { position: absolute; z-index: 500; top: 64px; left: 16px; max-width: 330px; padding: 10px 13px; border: 1px solid #e9d58e; border-radius: 9px; color: #725711; background: rgba(255,248,215,.96); box-shadow: 0 7px 20px rgba(59,46,7,.12); cursor: pointer; font-size: 11px; font-weight: 700; text-align: left; }
.coordinate-warning:hover { border-color: #c4a434; background: #fff4c5; }
.data-drawer { position: absolute; z-index: 500; right: 14px; bottom: 14px; left: 14px; height: 245px; padding: 15px 18px 12px; border: 1px solid rgba(255,255,255,.65); border-radius: 16px; background: rgba(250,252,250,.95); box-shadow: 0 18px 55px rgba(4,31,39,.22); backdrop-filter: blur(16px); transition: transform .28s; }
.data-drawer.is-collapsed { transform: translateY(calc(100% + 18px)); }
.drawer-grip { display: none; width: 38px; height: 4px; margin: -5px auto 8px; border-radius: 5px; background: #bcc9c7; }
.drawer-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.drawer-heading h2 { margin: 3px 0 0; font-size: 18px; letter-spacing: -.025em; }
.drawer-actions { display: flex; align-items: center; gap: 9px; }
.drawer-search { display: flex; align-items: center; gap: 7px; width: min(290px, 29vw); height: 35px; padding: 0 10px; border: 1px solid #cdddda; border-radius: 9px; color: #6f8589; background: #fff; }
.drawer-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.table-scroll { overflow: auto; height: 158px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { position: sticky; top: 0; z-index: 1; padding: 8px 10px; color: #73858a; text-align: left; background: #f6f8f6; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 9px 10px; border-top: 1px solid #e5ebe9; white-space: nowrap; }
td b, td small { display: block; }
td small { margin-top: 2px; color: var(--muted); font-size: 9px; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr.is-selected { background: #eaf3f1; }
.type-pill { display: inline-block; padding: 4px 7px; border-radius: 999px; color: #25666d; background: #dcefee; font-size: 9px; font-weight: 850; }
.type-pill--alert { color: #a32936; background: #fee3e5; }

.history-marker-shell, .history-direction-shell { background: transparent; border: 0; }
.history-spot { position: relative; display: grid; place-items: center; width: 29px; height: 29px; border: 2px solid #fff; border-radius: 50% 50% 50% 0; background: #f3d40b; box-shadow: 0 2px 7px rgba(4,35,43,.48); transform: rotate(-45deg); }
.history-spot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff9c7; }
.history-spot-number { position: relative; z-index: 1; color: #063743; font-size: 10px; font-weight: 900; line-height: 1; transform: rotate(45deg); }
.history-spot-number--compact { font-size: 8px; letter-spacing: -.5px; }
.history-spot-tooltip { color: #16333a; font-size: 11px; line-height: 1.45; }
.history-direction { display: block; width: 24px; height: 16px; overflow: visible; filter: drop-shadow(0 1px 1px rgba(255,255,255,.9)); }
.history-direction path { fill: #063743; }

.marker-shell { background: transparent; border: 0; }
.marker-shell > b { position: absolute; left: 36px; top: 5px; max-width: 112px; padding: 5px 8px; overflow: hidden; border: 1px solid rgba(13,58,69,.14); border-radius: 7px; color: var(--ink); background: rgba(255,255,255,.94); box-shadow: 0 5px 14px rgba(4,35,43,.16); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.fleet-cluster-shell { background: transparent; border: 0; }
.fleet-cluster { display: grid; width: 42px; height: 42px; place-items: center; border: 3px solid white; border-radius: 50%; color: white; background: var(--teal); box-shadow: 0 5px 18px rgba(4,33,42,.34); font-size: 13px; font-weight: 800; line-height: 1; }
.fleet-cluster--large { font-size: 11px; }
.fleet-cluster--alert { background: var(--danger); animation: pulse-alert 1s infinite; }
.vessel-marker { position: relative; display: grid; place-items: center; width: 34px; height: 38px; border: 3px solid white; border-radius: 15px 15px 18px 18px; color: white; background: var(--teal); box-shadow: 0 5px 18px rgba(4,33,42,.34); }
.vessel-marker::after { content: ""; position: absolute; right: 7px; bottom: -7px; width: 11px; height: 11px; border-right: 3px solid white; border-bottom: 3px solid white; background: inherit; transform: rotate(45deg); }
.vessel-marker .ship-icon { z-index: 1; }
.vessel-marker--alert { background: #d87920; animation: pulse-alert 1s infinite; }
.vessel-marker--sos { background: var(--danger); animation: pulse-alert 1s infinite; }
.vessel-marker--low-battery { background: #d87920; }
.vessel-marker--fishing-zone { background: #d87920; }
.vessel-marker--no-transmission { background: #d87920; }
.vessel-marker--other { background: #d87920; animation: pulse-alert 1s infinite; }
.spot-marker { position: relative; display: grid; place-items: center; width: 31px; height: 31px; border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: var(--teal); box-shadow: 0 5px 18px rgba(4,33,42,.34); transform: rotate(-45deg); }
.spot-marker::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #e7f6f5; }
.spot-marker--alert { background: #d87920; animation: pulse-alert 1s infinite; }
.spot-marker--sos { background: var(--danger); animation: pulse-alert 1s infinite; }
.spot-marker--low-battery, .spot-marker--fishing-zone, .spot-marker--no-transmission, .spot-marker--other { background: #d87920; animation: pulse-alert 1s infinite; }

dialog { border: 0; border-radius: 20px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(4,24,31,.66); backdrop-filter: blur(4px); }
.alert-dialog { width: min(92vw, 430px); padding: 32px; text-align: center; }
.alert-signal { display: grid; place-items: center; width: 70px; height: 70px; margin: -66px auto 24px; border: 7px solid #fff; border-radius: 50%; color: white; background: var(--danger); box-shadow: 0 10px 30px rgba(220,63,77,.38); font-size: 36px; font-weight: 900; animation: pulse-alert 1s infinite; }
.eyebrow--danger { color: var(--danger); }
.alert-dialog h2 { margin: 8px 0; font-size: 26px; }
.alert-dialog p { color: var(--muted); line-height: 1.5; }
.alert-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 22px 0; }
.alert-details div { padding: 11px; border-radius: 10px; background: #f1f4f2; }
.alert-details dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.alert-details dd { margin: 4px 0 0; font-size: 12px; font-weight: 800; }
.alerts-dialog { width: min(94vw, 650px); max-height: min(82vh, 720px); padding: 28px; overflow: hidden; }
.alerts-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 6px; }
.geofence-events-dialog { width: min(96vw, 1060px); max-height: min(84vh, 760px); padding: 28px; overflow: hidden; }
.geofence-events-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 18px 0 8px; }
.geofence-events-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.geofence-events-filters input { height: 34px; padding: 0 9px; border: 1px solid #cdddda; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; }
.geofence-events-table-scroll { max-height: 420px; overflow: auto; margin-top: 12px; border: 1px solid #dce7e5; border-radius: 12px; }
.geofence-events-table-scroll table { min-width: 940px; }
.geofence-events-empty { padding: 28px; color: var(--muted); text-align: center; }
.geofence-event { display: inline-block; min-width: 64px; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 850; text-align: center; }
.geofence-event--entrada { color: #17633e; background: #dff5e7; }
.geofence-event--salida { color: #9a4d15; background: #fff0dd; }
.geofence-admin-page { height: auto; min-height: 100vh; overflow-x: hidden; overflow-y: auto; background: linear-gradient(140deg, #062434, #0a4d63); }
.geofence-admin-page .topbar { height: 60px; padding: 0 18px; }
.geofence-admin-page .brand-logo-frame { width: 108px; height: 35px; }
.geofence-admin-page .topbar .button { min-height: 36px; padding: 0 13px; font-size: 13px; }
.geofence-admin { width: min(1240px, calc(100% - 28px)); margin: 0 auto; padding: 18px 0 28px; }
.geofence-admin__intro { max-width: 900px; margin-bottom: 13px; color: #e7f4f3; }
.geofence-admin__intro h1 { margin: 3px 0; color: #fff; font-size: clamp(24px, 3vw, 32px); }
.geofence-admin__intro p { margin: 4px 0; color: #c8e0df; font-size: 14px; line-height: 1.4; }
.geofence-admin__status { display: none; margin: 5px 0 0; color: #ffb8bd !important; font-size: 13px; font-weight: 800; }
.geofence-admin__status.is-error { display: block; }
.geofence-admin__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.geofence-admin__column { display: grid; align-content: start; gap: 9px; }
.geofence-admin__panel { align-self: start; padding: 11px; border: 1px solid rgba(139,210,211,.36); border-radius: 13px; color: #eaf7f7; background: rgba(1,22,34,.78); box-shadow: 0 11px 25px rgba(0,0,0,.15); }
.geofence-admin__panel h2 { margin: 0 0 5px; color: #fff; font-size: 18px; }
.geofence-admin__panel--wide { grid-column: 1 / -1; }
.geofence-admin__hint { margin: 0 0 8px; color: #b8d3d4; font-size: 11px; line-height: 1.3; }
.geofence-form { display: grid; gap: 6px; }
.geofence-form label, .geofence-admin__assignment label { display: grid; gap: 3px; color: #d9eeee; font-size: 11px; font-weight: 800; }
.geofence-form input, .geofence-form select, .geofence-form textarea, .geofence-admin__assignment input { width: 100%; min-height: 34px; box-sizing: border-box; border: 1px solid #2c6070; border-radius: 8px; padding: 7px 9px; color: #eaf7f7; background: #041c2a; font: inherit; font-size: 13px; }
.geofence-form textarea { min-height: 72px; resize: vertical; }
.geofence-form__coordinates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.geofence-draw { display: grid; gap: 6px; padding: 8px; border: 1px solid rgba(91,174,184,.46); border-radius: 10px; background: rgba(0,39,56,.54); }
.geofence-draw__heading, .geofence-draw__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.geofence-draw__heading b { display: block; color: #fff; font-size: 13px; }
.geofence-draw__heading small { display: block; margin-top: 2px; color: #b8d3d4; font-size: 10px; line-height: 1.3; }
.geofence-draw__map { height: 235px; overflow: hidden; border: 1px solid #2b6677; border-radius: 8px; background: #b8dbe2; }
.geofence-draw__map.is-drawing { cursor: crosshair; }
.geofence-draw__map.is-drawing .leaflet-interactive { cursor: crosshair; }
.geofence-draw__actions { justify-content: flex-start; }
.geofence-admin__actions, .geofence-admin__assignment { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; }
.geofence-admin__assignment label { flex: 1 1 360px; }
.geofence-admin .button { min-height: 34px; padding: 0 12px; border-radius: 8px; font-size: 12px; }
.geofence-admin .button--primary { min-height: 38px; }
.geofence-admin__list { display: grid; gap: 7px; max-height: min(52vh, 420px); overflow: auto; }
.geofence-admin__record { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid rgba(105,170,178,.35); border-radius: 9px; background: rgba(3,39,55,.7); }
.geofence-admin__record b { font-size: 13px; }
.geofence-admin__record b, .geofence-admin__record small { display: block; }
.geofence-admin__record small, .geofence-admin__empty { margin-top: 2px; color: #acc9ca; font-size: 10px; }
.geofence-admin__record > div:last-child { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: 6px; justify-content: flex-end; }
.geofence-admin__record > div:last-child .button { min-width: 72px; }
.geofence-admin__record .button--danger { width: auto; }
@media (max-width: 760px) { .geofence-admin__grid { grid-template-columns: 1fr; } .geofence-admin__column { gap: 9px; } .geofence-admin__panel--wide { grid-column: auto; } .geofence-form__coordinates { grid-template-columns: 1fr; } .geofence-draw__map { height: 220px; } .geofence-admin__record { align-items: start; flex-direction: column; } .geofence-admin__record > div:last-child { justify-content: start; } }
.invalid-coordinates-dialog { width: min(92vw, 600px); padding: 28px; }
.invalid-coordinates-list { display: grid; gap: 9px; max-height: 440px; overflow: auto; margin-top: 18px; }
.invalid-coordinate-record { display: grid; gap: 3px; padding: 13px 15px; border: 1px solid #e6d69b; border-radius: 11px; color: #5b4b16; background: #fffaf0; }
.invalid-coordinate-record span { color: #87742d; font-size: 12px; font-weight: 800; }
.invalid-coordinate-record small { color: #786f51; font-size: 11px; }
.alerts-list { max-height: min(52vh, 470px); overflow: auto; border: 1px solid #e0e9e7; border-radius: 12px; }
.alert-record { padding: 13px 14px; border-bottom: 1px solid #e5ecea; }
.alert-record:last-child { border-bottom: 0; }
.alert-record--selectable { cursor: pointer; transition: background .16s ease; }
.alert-record--selectable:hover, .alert-record--selectable:focus { background: #eff8f8; outline: 0; }
.alert-record h3 { margin: 0; color: var(--ink); font-size: 14px; }
.alert-record p { margin: 5px 0 0; color: #364f55; font-size: 12px; line-height: 1.4; white-space: pre-line; }
.alert-record small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.alerts-empty { padding: 24px 14px; color: var(--muted); font-size: 12px; text-align: center; }
.history-dialog { width: min(92vw, 600px); padding: 28px; }
.modal-heading { display: flex; justify-content: space-between; align-items: start; }
.modal-heading h2 { margin: 5px 0 0; font-size: 25px; }
.dialog-close { border: 0; background: transparent; color: var(--muted); font-size: 28px; }
.modal-subtitle { color: var(--muted); }
.history-fields { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 10px; margin: 22px 0 14px; }
.history-fields label { display: grid; gap: 6px; font-size: 11px; font-weight: 800; }
.history-fields input, .history-fields select { height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.type-filter { display: flex; gap: 22px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; }
.type-filter legend { padding: 0 6px; color: var(--muted); font-size: 10px; }
.type-filter label { font-size: 12px; }
.history-status { min-height: 24px; margin-top: 12px; color: var(--teal); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.modal-actions .button--primary { min-height: 43px; }

@keyframes pulse-alert { 50% { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(220,63,77,.12); } }
@keyframes alert-flash { 50% { opacity: .52; box-shadow: 0 7px 22px rgba(200,60,73,.42); } }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 30px 22px; }
  .mobile-brand { display: block; }
  .workspace { grid-template-columns: 280px 1fr; }
  .user-copy, .live-status span, .brand-product { display: none; }
  .data-drawer { height: 220px; }
}

@media (max-width: 680px) {
  .account-shell { width: min(100% - 24px, 560px); padding: 28px 0; }
  .account-shell--profile { width: min(100% - 24px, 560px); }
  .account-topbar { align-items: start; gap: 14px; }
  .profile-grid { grid-template-columns: 1fr; }
  .topbar { height: 62px; padding: 0 12px; }
  .topbar-actions { gap: 5px; }
  .topbar .button { min-width: auto; padding: 0 10px; }
  .workspace { display: block; height: calc(100vh - 62px); }
  .fleet-sidebar { position: absolute; z-index: 700; top: 62px; bottom: 0; left: 0; width: min(86vw, 320px); transform: translateX(calc(-100% + 12px)); transition: transform .25s; }
  .fleet-sidebar:focus-within, .fleet-sidebar:hover { transform: translateX(0); }
  .map-stage { width: 100%; height: 100%; }
  .data-drawer { right: 7px; bottom: 7px; left: 18px; height: 205px; padding: 12px; border-radius: 13px; }
  .drawer-grip { display: block; }
  .drawer-heading h2 { font-size: 15px; }
  .drawer-actions { gap: 6px; }
  .drawer-search { width: min(220px, 34vw); }
  .drawer-heading .button { padding: 0 10px; font-size: 10px; }
  .map-toolbar { left: 24px; }
  .history-fields { grid-template-columns: 1fr; }
}
