:root {
    color-scheme: dark;
    --black: #070707;
    --surface: #0d0d0d;
    --surface-2: #131313;
    --surface-3: #191919;
    --line: rgba(255, 255, 255, .09);
    --line-gold: rgba(213, 174, 93, .28);
    --gold: #d5ae5d;
    --gold-light: #f0d692;
    --gold-deep: #8d6a2b;
    --text: #f5f1e8;
    --muted: #96938b;
    --green: #58d68d;
    --red: #df6d67;
    --shadow: 0 24px 70px rgba(0, 0, 0, .46);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
    background: var(--black);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
    overflow: hidden;
}
button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.eyebrow, .kicker, .nav-label {
    color: var(--gold);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .15em;
    margin: 0;
    text-transform: uppercase;
}
.muted { color: var(--muted); }

.login-shell {
    align-items: center;
    background:
        radial-gradient(circle at 18% 24%, rgba(213, 174, 93, .1), transparent 29%),
        linear-gradient(120deg, #050505 0%, #0a0907 47%, #050505 100%);
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(380px, 520px);
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(32px, 7vw, 110px);
    position: relative;
}
.login-shell::before {
    background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
    background-size: 52px 52px;
    content: "";
    inset: 0;
    mask-image: linear-gradient(90deg, #000, transparent 75%);
    pointer-events: none;
    position: absolute;
}
.login-aura {
    border: 1px solid rgba(213, 174, 93, .12);
    border-radius: 50%;
    height: 660px;
    left: -210px;
    position: absolute;
    top: calc(50% - 330px);
    width: 660px;
}
.login-aura::before, .login-aura::after {
    border: 1px solid rgba(213, 174, 93, .08);
    border-radius: inherit;
    content: "";
    inset: 70px;
    position: absolute;
}
.login-aura::after { inset: 145px; }
.login-brand { max-width: 620px; position: relative; z-index: 1; }
.brand-mark {
    align-items: center;
    background: linear-gradient(145deg, #211b0f, #0c0b08);
    border: 1px solid var(--line-gold);
    border-radius: 12px;
    box-shadow: inset 0 0 24px rgba(213,174,93,.06);
    display: flex;
    height: 46px;
    justify-content: center;
    transform: rotate(45deg);
    width: 46px;
}
.brand-mark span {
    color: var(--gold-light);
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -.08em;
    transform: rotate(-45deg);
}
.brand-mark.large { height: 76px; margin: 0 0 46px 12px; width: 76px; }
.brand-mark.large span { font-size: 1.45rem; }
.login-brand h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3.6rem, 7vw, 7rem);
    font-weight: 500;
    letter-spacing: -.055em;
    line-height: .88;
    margin: 20px 0 24px;
    max-width: 690px;
}
.login-brand h1 span { color: var(--gold); display: block; font-style: italic; }
.login-copy { color: #b5b1a7; font-size: 1.06rem; max-width: 470px; }
.signal-line { align-items: end; display: flex; gap: 6px; height: 30px; margin-top: 38px; }
.signal-line i { background: linear-gradient(var(--gold-light), var(--gold-deep)); border-radius: 4px; display: block; width: 4px; }
.signal-line i:nth-child(1) { height: 8px; }.signal-line i:nth-child(2) { height: 14px; }.signal-line i:nth-child(3) { height: 21px; }.signal-line i:nth-child(4) { height: 28px; }
.login-card {
    background: rgba(16, 16, 15, .92);
    border: 1px solid var(--line-gold);
    border-radius: 22px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 24px;
    padding: clamp(28px, 4vw, 50px);
    position: relative;
    z-index: 2;
}
.login-card::before { background: linear-gradient(90deg, transparent, var(--gold), transparent); content: ""; height: 1px; left: 12%; position: absolute; right: 12%; top: -1px; }
.login-card h2 { font-family: Georgia, serif; font-size: 2.25rem; font-weight: 500; margin: 8px 0 5px; }
.login-card p { margin-bottom: 0; }
.login-card label { display: grid; gap: 9px; }
.login-card label span { color: #c9c4b9; font-size: .88rem; font-weight: 600; }
.login-card input {
    background: #090909;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 10px;
    color: var(--text);
    outline: none;
    padding: 14px 15px;
    transition: border-color .2s, box-shadow .2s;
}
.login-card input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(213,174,93,.12); }
.gold-button {
    align-items: center;
    background: linear-gradient(110deg, #b58b3d, #f0d692 52%, #b4883c);
    border: 0;
    border-radius: 10px;
    color: #171107;
    cursor: pointer;
    display: flex;
    font-weight: 800;
    justify-content: space-between;
    padding: 15px 18px;
    transition: filter .2s, transform .2s;
}
.gold-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.gold-button:disabled { cursor: wait; filter: grayscale(.4); opacity: .65; }
.form-error { color: #f08a83; font-size: .875rem; min-height: 1.2em; }
.secure-note { color: #7e7b74; font-size: .78rem; text-align: center; }
.secure-note span { color: var(--gold); margin-right: 6px; }

.app-shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); height: 100vh; }
.sidebar {
    background: linear-gradient(180deg, #0c0c0c, #080808);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 27px 18px 20px;
}
.sidebar-brand { align-items: center; display: flex; gap: 16px; padding: 4px 10px 42px; }
.sidebar-brand strong { display: block; font-family: Georgia, serif; font-size: 1.15rem; letter-spacing: .04em; }
.sidebar-brand small { color: var(--gold); display: block; font-size: .62rem; font-weight: 800; letter-spacing: .18em; margin-top: 2px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-item {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #9e9b94;
    cursor: pointer;
    display: flex;
    font-size: .9rem;
    font-weight: 600;
    gap: 12px;
    padding: 11px 12px;
    text-align: left;
}
.nav-item svg, .icon-button svg, .search-box svg { fill: none; height: 19px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 19px; }
.nav-item.active { background: linear-gradient(90deg, rgba(213,174,93,.13), rgba(213,174,93,.025)); border-color: var(--line-gold); color: var(--gold-light); }
.nav-divider { border-top: 1px solid var(--line); margin: 22px 8px; }
.nav-label { margin: 0 11px 10px; }
.network-state { align-items: center; border: 1px solid var(--line); border-radius: 10px; display: flex; gap: 11px; margin: 0 4px; padding: 12px; }
.network-state strong, .network-state small { display: block; }
.network-state strong { font-size: .79rem; }
.network-state small { color: var(--muted); font-size: .66rem; margin-top: 2px; }
.pulse { background: var(--green); border-radius: 50%; box-shadow: 0 0 0 5px rgba(88,214,141,.1); height: 8px; width: 8px; }
.sidebar-user { align-items: center; border-top: 1px solid var(--line); display: grid; gap: 10px; grid-template-columns: 38px 1fr 30px; margin-top: auto; padding: 20px 6px 0; }
.avatar { align-items: center; background: linear-gradient(145deg, var(--gold), #79581f); border-radius: 10px; color: #140f06; display: flex; font-size: .76rem; font-weight: 900; height: 38px; justify-content: center; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: .78rem; }.sidebar-user small { color: var(--muted); font-size: .67rem; margin-top: 2px; text-transform: capitalize; }
.sidebar-user button { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 1.15rem; }

.workspace { background: #090909; display: flex; flex-direction: column; min-width: 0; overflow: auto; padding: 25px 28px 28px; }
.topbar { align-items: center; display: flex; justify-content: space-between; margin-bottom: 20px; }
.topbar h1 { font-family: Georgia, serif; font-size: 2rem; font-weight: 500; margin: 4px 0 0; }
.top-actions, .sync-state { align-items: center; display: flex; }
.top-actions { gap: 13px; }
.sync-state { gap: 10px; }
.sync-state > span { background: var(--green); border-radius: 50%; box-shadow: 0 0 0 5px rgba(88,214,141,.08); height: 7px; width: 7px; }
.sync-state small, .sync-state strong { display: block; text-align: right; }
.sync-state small { color: var(--muted); font-size: .68rem; }.sync-state strong { font-size: .76rem; font-weight: 600; margin-top: 2px; }
.icon-button { align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; display: flex; height: 42px; justify-content: center; width: 42px; }
.icon-button:hover { border-color: var(--line-gold); color: var(--gold); }
.icon-button.loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.metrics { display: grid; gap: 13px; grid-template-columns: repeat(4, minmax(150px, 1fr)); margin-bottom: 15px; }
.metrics article { background: linear-gradient(145deg, #111, #0c0c0c); border: 1px solid var(--line); border-radius: 12px; min-height: 112px; padding: 17px 19px; position: relative; }
.metrics article::after { background: linear-gradient(90deg, var(--gold), transparent); bottom: -1px; content: ""; height: 1px; left: 18px; opacity: .55; position: absolute; width: 42px; }
.metrics span, .metrics small { display: block; }.metrics span { color: #a9a69e; font-size: .76rem; font-weight: 650; }
.metrics strong { display: block; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; line-height: 1; margin: 12px 0 8px; }
.metrics small { color: #6f6d67; font-size: .66rem; }.metrics small.positive { color: #78cda0; }.metrics small i { background: var(--green); border-radius: 50%; display: inline-block; height: 5px; margin-right: 5px; width: 5px; }

.command-grid { display: grid; flex: 1; gap: 15px; grid-template-columns: minmax(275px, 320px) minmax(450px, 1fr); min-height: 570px; }
.fleet-panel, .map-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-height: 0; overflow: hidden; }
.fleet-panel { display: flex; flex-direction: column; padding: 18px 14px 12px; }
.panel-heading { align-items: center; display: flex; justify-content: space-between; padding: 0 5px 15px; }
.panel-heading h2, .asset-card h2 { font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; margin: 4px 0 0; }
.count-chip { align-items: center; background: rgba(213,174,93,.1); border: 1px solid var(--line-gold); border-radius: 999px; color: var(--gold-light); display: flex; font-size: .72rem; font-weight: 800; height: 29px; justify-content: center; min-width: 29px; padding: 0 8px; }
.search-box { align-items: center; background: #090909; border: 1px solid var(--line); border-radius: 9px; color: #706e68; display: flex; gap: 8px; margin-bottom: 10px; padding: 0 11px; }
.search-box input { background: transparent; border: 0; color: var(--text); font-size: .8rem; min-width: 0; outline: 0; padding: 11px 0; width: 100%; }
.filter-tabs { background: #080808; border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 3px; grid-template-columns: repeat(3, 1fr); margin-bottom: 12px; padding: 3px; }
.filter-tabs button { background: transparent; border: 0; border-radius: 6px; color: #77746e; cursor: pointer; font-size: .69rem; font-weight: 700; padding: 7px 4px; }
.filter-tabs button.active { background: #1b1811; color: var(--gold-light); }
.device-list { display: grid; gap: 7px; overflow: auto; padding-right: 2px; }
.device-item { background: #0b0b0b; border: 1px solid transparent; border-radius: 10px; cursor: pointer; display: grid; gap: 10px; grid-template-columns: 38px minmax(0,1fr) auto; padding: 12px; text-align: left; transition: background .2s, border-color .2s; width: 100%; }
.device-item:hover { background: #10100f; }.device-item.selected { background: linear-gradient(100deg, rgba(213,174,93,.1), rgba(213,174,93,.02)); border-color: var(--line-gold); }
.device-icon { align-items: center; background: #17150f; border: 1px solid rgba(213,174,93,.15); border-radius: 9px; color: var(--gold); display: flex; font-size: 1.05rem; height: 38px; justify-content: center; }
.device-copy { min-width: 0; }.device-copy strong, .device-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.device-copy strong { font-size: .79rem; }.device-copy small { color: var(--muted); font-size: .67rem; margin-top: 4px; }
.device-reading { text-align: right; }.device-reading strong { display: block; font-size: .75rem; }.device-reading small { color: var(--muted); display: block; font-size: .62rem; margin-top: 4px; }
.status-dot { background: #777; border-radius: 50%; display: inline-block; height: 7px; margin-right: 6px; width: 7px; }.status-dot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(88,214,141,.08); }.status-dot.offline { background: var(--red); }
.list-empty { color: var(--muted); font-size: .8rem; padding: 32px 12px; text-align: center; }

.map-panel { min-height: 570px; position: relative; }
#map { background: #0b0c0c; height: 100%; min-height: 570px; width: 100%; }
.leaflet-container { background: #0b0c0c; font-family: inherit; }
.leaflet-tile-pane { filter: grayscale(.82) brightness(.53) contrast(1.25) sepia(.16); }
.leaflet-control-zoom a { background: #111 !important; border-color: var(--line) !important; color: var(--gold-light) !important; }
.leaflet-control-attribution { background: rgba(5,5,5,.78) !important; color: #777 !important; font-size: 10px !important; }.leaflet-control-attribution a { color: #aaa !important; }
.boss-marker { align-items: center; background: linear-gradient(145deg, var(--gold-light), var(--gold-deep)); border: 3px solid #0a0a0a; border-radius: 50% 50% 50% 10%; box-shadow: 0 5px 24px rgba(0,0,0,.62), 0 0 0 4px rgba(213,174,93,.16); color: #111; display: flex; font-size: 15px; font-weight: 900; height: 34px; justify-content: center; transform: rotate(-45deg); width: 34px; }.boss-marker span { transform: rotate(45deg); }
.boss-marker.offline { filter: grayscale(1); opacity: .7; }
.map-toolbar { align-items: center; backdrop-filter: blur(12px); background: rgba(10,10,10,.88); border: 1px solid var(--line); border-radius: 9px; display: flex; font-size: .7rem; justify-content: space-between; left: 54px; padding: 8px 10px; position: absolute; right: 14px; top: 13px; z-index: 500; }
.map-toolbar button { background: transparent; border: 0; color: var(--gold-light); cursor: pointer; font-size: .7rem; font-weight: 700; }
.asset-card { backdrop-filter: blur(16px); background: rgba(11,11,11,.93); border: 1px solid var(--line-gold); border-radius: 13px; bottom: 18px; box-shadow: var(--shadow); left: 18px; max-width: 620px; padding: 17px 18px; position: absolute; right: 18px; z-index: 500; }
.asset-card-head { align-items: start; display: flex; justify-content: space-between; }
.status-badge { border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: var(--muted); font-size: .66rem; font-weight: 800; padding: 5px 9px; text-transform: uppercase; }.status-badge.online { background: rgba(88,214,141,.08); border-color: rgba(88,214,141,.26); color: #83dcaa; }.status-badge.offline { background: rgba(223,109,103,.08); border-color: rgba(223,109,103,.25); color: #ef918b; }
.asset-stats { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); margin: 14px 0 11px; padding: 12px 0; }.asset-stats span, .asset-stats strong { display: block; }.asset-stats span { color: var(--muted); font-size: .62rem; }.asset-stats strong { font-size: .78rem; margin-top: 4px; }.asset-stats b { font-family: Georgia, serif; font-size: 1.18rem; font-weight: 500; }
.asset-meta { color: #7e7c76; display: flex; font-size: .65rem; justify-content: space-between; }
.map-empty { align-items: center; background: rgba(8,8,8,.82); display: flex; flex-direction: column; inset: 0; justify-content: center; position: absolute; text-align: center; z-index: 400; }.map-empty div { color: var(--gold); font-size: 3rem; }.map-empty strong { font-family: Georgia, serif; font-size: 1.35rem; }.map-empty span { color: var(--muted); font-size: .75rem; margin-top: 5px; }
.toast { background: #181610; border: 1px solid var(--line-gold); border-radius: 9px; bottom: 24px; box-shadow: var(--shadow); color: var(--gold-light); font-size: .78rem; padding: 11px 15px; position: fixed; right: 24px; z-index: 1000; }

::-webkit-scrollbar { height: 8px; width: 8px; }::-webkit-scrollbar-track { background: transparent; }::-webkit-scrollbar-thumb { background: #292723; border-radius: 99px; }

@media (max-width: 1050px) {
    .app-shell { grid-template-columns: 78px minmax(0,1fr); }
    .sidebar { padding-inline: 11px; }.sidebar-brand { justify-content: center; padding-inline: 0; }.sidebar-brand > div:last-child, .nav-item:not(.active), .nav-item.active { font-size: 0; }.nav-item { justify-content: center; }.nav-item svg { height: 22px; width: 22px; }.nav-label, .network-state, .sidebar-user > div:not(.avatar), .sidebar-user button { display: none; }.sidebar-user { display: flex; justify-content: center; }.avatar { width: 38px; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
    body { overflow: auto; }
    .login-shell { display: flex; padding: 24px; }.login-brand { display: none; }.login-card { margin: auto; width: min(100%, 460px); }
    .app-shell { display: block; height: auto; min-height: 100vh; }.sidebar { display: none; }.workspace { min-height: 100vh; padding: 18px 14px; }.topbar { align-items: flex-start; }.sync-state { display: none; }.metrics { gap: 8px; }.metrics article { min-height: 98px; padding: 14px; }.command-grid { display: flex; flex-direction: column; min-height: 0; }.fleet-panel { max-height: 380px; }.map-panel, #map { min-height: 520px; }.asset-stats { grid-template-columns: repeat(2, 1fr); }.asset-meta { flex-direction: column; gap: 4px; }
}


/* THE BOSS DEVICE ICON FIX START */
.device-icon { width: 38px; }
.device-icon svg { fill: none; height: 21px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 21px; }
.device-icon svg .icon-core { fill: currentColor; stroke: none; }
.boss-marker svg { fill: none; height: 18px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; transform: rotate(45deg); width: 18px; }
.boss-marker svg .marker-core { fill: currentColor; stroke: none; }
/* THE BOSS DEVICE ICON FIX END */
