:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --ink: #1f2937;
    --muted: #64748b;
    --line: #e2e8f0;
    --brand: #6b1d4a;
    --brand-dark: #4a0f33;
    --blue: #2563eb;
    --green: #19a463;
    --amber: #e0a800;
    --red: #dc3545;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
    --aeon: #a50064;
}

.battery-report-intro {
    display: grid;
    gap: 18px;
}

.battery-report-intro h2,
.battery-methodology h2,
.battery-report-heading h2 {
    margin: 0 0 6px;
}

.battery-report-intro p,
.battery-methodology p,
.battery-report-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.battery-summary-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.battery-report-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.battery-report-table {
    min-width: 1240px;
}

.battery-report-table td {
    vertical-align: top;
}

.battery-trend-cell {
    min-width: 170px;
}

.battery-sparkline {
    display: block;
    width: 170px;
    height: 48px;
    overflow: visible;
    border: 1px solid #dbe3ef;
    border-radius: 6px;
    background: linear-gradient(to bottom, #f8fafc, #fff);
}

.battery-sparkline polyline {
    fill: none;
    stroke: #2563eb;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.battery-sparkline.is-legacy polyline {
    stroke: #a16207;
    stroke-dasharray: 4 3;
}

.battery-basis {
    color: #047857 !important;
    font-weight: 700;
}

.battery-basis.is-legacy {
    color: #a16207 !important;
}

.battery-sparkline .battery-sparkline-threshold {
    stroke: #ef4444;
    stroke-width: 1;
    stroke-dasharray: 3 3;
    vector-effect: non-scaling-stroke;
}

.battery-row-attention {
    background: #fffaf0;
}

.battery-warning {
    color: #b45309 !important;
    font-weight: 700;
}

.battery-events {
    margin-top: 8px;
    max-width: 250px;
}

.battery-events summary {
    color: #2563eb;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
}

.battery-events small {
    padding-top: 5px;
}

.empty-value {
    color: var(--muted);
}

.battery-methodology {
    padding: 20px;
}

.battery-methodology p + p {
    margin-top: 10px;
}

@media (max-width: 1200px) {
    .battery-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .battery-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .battery-report-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
    display: flex;
    height: 100vh;
    min-height: 100vh;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background: #111827;
    color: #e5e7eb;
    padding: 22px 16px;
    position: sticky;
    top: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    line-height: 1.1;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
}

.nav {
    display: grid;
    min-height: 0;
    flex: 1 1 auto;
    align-content: start;
    gap: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-color: #475569 transparent;
    scrollbar-width: thin;
}

.nav::-webkit-scrollbar {
    width: 6px;
}

.nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #475569;
}

.nav-section-label {
    margin: 12px 10px 2px;
    color: #7890b2;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
}

.nav-section-label:first-child {
    margin-top: 2px;
}

.nav a,
.nav-group summary,
.logout-form button,
.reset-data-form button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    padding: 9px 10px;
    font-size: 0.9rem;
    line-height: 1.3;
    text-align: left;
}

.nav-icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    color: #94a3b8;
}

.nav a.active .nav-icon,
.nav a:hover .nav-icon,
.nav-group summary.active .nav-icon,
.nav-group summary:hover .nav-icon {
    color: currentColor;
}

.nav a.active,
.nav a:hover,
.nav-group summary.active,
.nav-group summary:hover,
.logout-form button:hover {
    background: #243044;
    color: #fff;
}

.reset-data-form button {
    color: #fca5a5;
}

.reset-data-form button:hover {
    background: #7f1d1d;
    color: #fff;
}

.nav-group summary {
    position: relative;
    list-style: none;
    user-select: none;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-group summary::after {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: '';
    transform: translateY(-65%) rotate(45deg);
    transition: transform 150ms ease;
}

.nav-group[open] summary::after {
    transform: translateY(-35%) rotate(225deg);
}

.nav-submenu {
    display: grid;
    gap: 4px;
    margin-top: 4px;
    padding-left: 16px;
}

.nav-submenu a {
    padding-block: 8px;
    font-size: 0.86rem;
}

.nav-submenu .nav-icon {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
}

.sidebar-session-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    margin-top: auto;
}

.sidebar-session-actions form {
    min-width: 0;
    flex: 1 1 0;
    margin: 0;
}

.sidebar-session-actions button {
    justify-content: center;
    padding-inline: 7px;
}

.main {
    display: flex;
    min-width: 0;
    min-height: 100vh;
    flex-direction: column;
    padding: 28px;
}

.topbar,
.panel-header,
.summary-card,
.header-actions,
.map-legend,
.row-actions,
.form-actions,
.inline-form {
    display: flex;
    align-items: center;
}

.topbar {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.topbar-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.mobile-menu-button {
    display: none;
    width: 40px;
    min-width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.mobile-menu-button__bars {
    display: grid;
    width: 18px;
    gap: 4px;
}

.mobile-menu-button__bars span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.sidebar-backdrop {
    display: none;
}

.eyebrow,
.section-label {
    margin: 0 0 4px;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(1.7rem, 2.5vw, 2.25rem);
    line-height: 1.15;
}

h2 {
    margin: 0;
    font-size: 1.08rem;
}

.user-chip,
.record-count {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    padding: 7px 11px;
    font-size: 0.82rem;
    font-weight: 700;
}

.user-chip {
    display: grid;
    gap: 1px;
    border-radius: 10px;
    text-align: right;
}

.user-chip small {
    color: var(--brand);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.notice {
    margin-bottom: 14px;
    border: 1px solid #b7e2ce;
    border-radius: 8px;
    background: #eaf8f1;
    color: #0f6d45;
    padding: 10px 12px;
}

.notice.error,
.form-error {
    border-color: #f3bac3;
    background: #fff0f3;
    color: #9f1d35;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.summary-card {
    min-height: 108px;
    gap: 15px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 22px;
    position: relative;
}

.summary-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.summary-card strong {
    display: block;
    font-size: 1.9rem;
    line-height: 1.15;
}

.summary-icon,
.dot {
    display: inline-block;
    border-radius: 50%;
}

.summary-icon {
    display: grid;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 14px;
}

.summary-icon.total {
    background: var(--aeon);
}

.summary-icon.online,
.summary-icon.reporting,
.dot.online {
    background: var(--green);
}

.summary-icon.moving {
    background: var(--blue);
}

.summary-icon.idle,
.dot.idle {
    background: var(--amber);
}

.dot.unknown {
    background: var(--muted);
}

.summary-icon.offline,
.dot.offline {
    background: var(--red);
}

.panel {
    margin-bottom: 22px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel-header {
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding: 20px 24px;
}

.header-actions,
.map-legend {
    flex-wrap: wrap;
    gap: 10px;
}

.muted {
    color: var(--muted);
    font-size: 0.82rem;
}

.assignment-current-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.assignment-current-card div {
    display: grid;
    gap: .25rem;
}

.inline-notice {
    margin: 1rem 0;
    padding: .75rem 1rem;
    border-left: 4px solid #0f766e;
    border-radius: 6px;
    background: #f0fdfa;
    color: #115e59;
}

.assignment-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.assignment-summary-grid .summary-card small {
    display: block;
    margin-top: .35rem;
    color: var(--muted);
}

.dashboard-summary-grid .summary-card small {
    display: block;
    margin-top: .35rem;
    color: var(--muted);
    font-size: .78rem;
}

.assignment-summary-grid .summary-icon .nav-icon {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
    color: #fff;
    stroke-width: 2;
}

.assignment-summary-grid .tracker-unassigned-icon {
    position: relative;
}

.assignment-summary-grid .tracker-unassigned-icon::after {
    position: absolute;
    width: 31px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
    content: "";
    transform: rotate(-45deg);
}

.assignment-attention-card {
    border-color: #fecaca;
}

.assignment-pool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 1px;
    background: var(--line);
}

.assignment-pool-grid div {
    display: grid;
    gap: .25rem;
    background: var(--surface);
    padding: 1rem 1.5rem;
}

.assignment-pool-grid strong {
    font-size: 1.5rem;
}

.tracker-pool-count {
    justify-self: start;
    color: var(--ink);
    text-decoration: none;
}

.tracker-pool-count:hover,
.tracker-pool-count:focus-visible {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.assignment-pool-grid span {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 700;
}

.assignment-pool-grid .tracker-condition-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tracker-pool-panel {
    overflow: visible;
}

.assignment-pool-grid > div:last-child .report-help-tooltip {
    right: 0;
    left: auto;
}

.tracker-assignment-filter-panel {
    padding: 20px 24px;
}

.floor-map-shell,
.editor-canvas-wrap {
    margin: 20px;
    overflow: hidden;
    border: 1px solid #d8dee8;
    border-radius: 13px;
    background-color: #eef2f7;
    background-image:
        linear-gradient(#dfe6ef 1px, transparent 1px),
        linear-gradient(90deg, #dfe6ef 1px, transparent 1px);
    background-size: 24px 24px;
}

.floor-map-shell {
    background-color: #ffffff;
    background-image: none;
}

.editor-canvas-wrap {
    background-color: #ffffff;
    background-image: none;
}

.floor-map-svg,
.floor-editor-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 360px;
}

.floor-editor-canvas {
    cursor: crosshair;
    touch-action: none;
    user-select: none;
}

.floor-editor-canvas .floor-object,
.floor-editor-canvas .floor-object-label {
    cursor: grab;
}

.floor-editor-canvas .floor-object.is-selected {
    stroke: var(--brand);
    stroke-width: 0.42;
}

.floor-editor-canvas .floor-object-label.is-selected {
    fill: var(--brand-dark);
}

.floor-editor-canvas .editor-beacon-marker__background {
    fill: #ffffff;
    stroke: #9aa9bc;
    stroke-width: 0.18;
    filter: drop-shadow(0 1px 4px rgba(15, 23, 42, 0.22));
}

.floor-editor-canvas .editor-beacon-marker__dot {
    fill: var(--brand);
}

.floor-editor-canvas .editor-beacon-marker__label {
    fill: #153052;
    font-weight: 850;
}

.floor-editor-canvas .resize-frame {
    pointer-events: none;
    stroke: var(--brand);
    stroke-dasharray: 1 1;
    stroke-width: 0.2;
}

.floor-editor-canvas .resize-handle {
    cursor: pointer;
    fill: #ffffff;
    stroke: var(--brand);
    stroke-width: 0.24;
}

.floor-editor-canvas .resize-handle--n,
.floor-editor-canvas .resize-handle--s {
    cursor: ns-resize;
}

.floor-editor-canvas .resize-handle--e,
.floor-editor-canvas .resize-handle--w {
    cursor: ew-resize;
}

.floor-editor-canvas .resize-handle--nw,
.floor-editor-canvas .resize-handle--se {
    cursor: nwse-resize;
}

.floor-editor-canvas .resize-handle--ne,
.floor-editor-canvas .resize-handle--sw {
    cursor: nesw-resize;
}

.area-count-marker {
    cursor: pointer;
    outline: none;
}

.area-count-marker__background {
    fill: #ffffff;
    stroke: #94a3b8;
    stroke-width: 0.2;
    filter: drop-shadow(0 2px 7px rgba(15, 23, 42, 0.32));
}

.area-count-marker:hover .area-count-marker__background,
.area-count-marker:focus .area-count-marker__background {
    fill: #f8fafc;
    stroke: var(--brand);
    stroke-width: 0.32;
}

.area-count-marker.is-selected .area-count-marker__background {
    stroke: var(--brand);
    stroke-width: 0.32;
}

.area-count-marker__leader {
    pointer-events: none;
    stroke: #64748b;
    stroke-width: 0.22;
    stroke-dasharray: 0.65 0.45;
}

.area-count-marker__person-disc {
    fill: #153052;
}

.area-count-marker__person-head,
.area-count-marker__person-body {
    fill: #ffffff;
}

.area-count-marker__status-dot {
    stroke: #ffffff;
    stroke-width: 0.13;
}

.area-count-marker__status-dot.online {
    fill: var(--green);
}

.area-count-marker__status-dot.idle {
    fill: var(--amber);
}

.area-count-marker__status-dot.unknown {
    fill: var(--muted);
}

.area-count-marker__status-dot.offline {
    fill: var(--red);
}

.area-count-marker__count {
    fill: #153052;
    font-weight: 900;
}

.modal-backdrop {
    display: grid;
    place-items: center;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.42);
    padding: 20px;
}

.modal-backdrop[hidden] {
    display: none;
}

.area-detail-modal {
    width: min(620px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.area-detail-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding: 16px 18px;
}

.area-detail-modal h3 {
    margin: 0;
    font-size: 1.1rem;
}

.area-detail-modal__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    width: 34px;
    min-height: 34px;
    padding: 0;
}

.area-detail-list {
    display: grid;
    gap: 10px;
    max-height: min(590px, calc(100vh - 165px));
    overflow: auto;
    padding: 16px;
}

.area-detail-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    border: 1px solid #edf0f4;
    border-radius: 10px;
    background: #fafbfc;
    padding: 10px 12px;
}

.area-detail-meta {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    gap: 10px;
    color: var(--muted);
    font-size: 0.74rem;
}

.map-legend {
    padding: 0 18px 18px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.employee-count-swatch {
    display: inline-block;
    position: relative;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    border-radius: 50%;
    background: #153052;
    vertical-align: middle;
}

.employee-count-swatch::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
}

.employee-count-swatch::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 5px;
    width: 10px;
    height: 7px;
    border-radius: 7px 7px 4px 4px;
    background: #ffffff;
}

.dot {
    width: 9px;
    height: 9px;
    margin-right: 6px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf1f7;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

td strong,
td small {
    display: block;
}

td small {
    color: var(--muted);
    font-size: 0.75rem;
}

.battery-meter {
    display: inline-flex;
    min-width: 68px;
    align-items: center;
    gap: 7px;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
}

.battery-meter__icon {
    display: inline-flex;
    width: 25px;
    height: 13px;
    flex: 0 0 auto;
    align-items: stretch;
    position: relative;
    overflow: visible;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    padding: 2px;
}

.battery-meter__icon::after {
    width: 3px;
    height: 6px;
    position: absolute;
    top: 2px;
    right: -5px;
    border-radius: 0 2px 2px 0;
    background: currentColor;
    content: "";
}

.battery-meter__fill {
    display: block;
    height: 100%;
    border-radius: 1px;
    background: currentColor;
}

.battery-meter__value {
    min-width: 30px;
    font-variant-numeric: tabular-nums;
}

.battery-meter--good {
    color: #0f8a52;
}

.battery-meter--medium {
    color: #b27a00;
}

.battery-meter--low {
    color: #c62f3e;
}

.battery-meter--unknown {
    color: #94a3b8;
}

code {
    font-family: Consolas, "Courier New", monospace;
}

.row-actions {
    justify-content: flex-end;
    gap: 8px;
}

.row-actions form {
    margin: 0;
}

.sos-resolution-form {
    margin: 6px 0 0;
}

.compact-button {
    min-height: 30px;
    padding: 4px 9px;
    font-size: 0.72rem;
}

.pending-beacon-confirm {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.pending-beacon-confirm input {
    width: 180px;
    min-width: 150px;
}

.button,
.primary-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-weight: 750;
    padding: 7px 12px;
}

.primary-button {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.button:hover,
.button.active {
    border-color: #b7c3d4;
    background: #f1f5f9;
}

.primary-button:hover {
    background: var(--brand-dark);
}

.danger-button {
    border-color: #dc3545;
    background: #dc3545;
    color: #fff;
}

.danger-button:hover {
    border-color: #b4232f;
    background: #b4232f;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.7rem;
    font-weight: 800;
}

.status-badge::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    content: "";
}

.status-badge.online {
    background: #e8f7ef;
    color: #087443;
}

.status-badge.online::before {
    background: var(--green);
}

.status-badge.idle,
.status-badge.unknown,
.status-badge.awaiting {
    background: #fff7d6;
    color: #8a6500;
}

.status-badge.idle::before,
.status-badge.unknown::before,
.status-badge.awaiting::before {
    background: var(--amber);
}

.status-badge.offline {
    background: #fdecef;
    color: #a31f2d;
}

.status-badge.offline::before {
    background: var(--red);
}

.page-actions {
    margin-bottom: 14px;
}

.user-page-actions {
    display: flex;
    justify-content: flex-end;
}

.permission-guide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 16px;
    overflow: hidden;
    background: var(--line);
}

.permission-guide div {
    display: grid;
    gap: 4px;
    background: var(--surface);
    padding: 16px 18px;
}

.permission-guide span,
.field-help {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.45;
}

.user-management-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 16px 18px;
}

.user-management-note div {
    display: grid;
    gap: 3px;
}

.user-management-note span {
    color: var(--muted);
    font-size: 0.76rem;
}

.role-permissions {
    display: grid;
    gap: 14px;
    margin-top: 6px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.role-permissions-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.permission-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.permission-group {
    display: grid;
    align-content: start;
    gap: 8px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
}

.permission-group legend {
    padding: 0 5px;
    color: var(--brand);
    font-size: 0.76rem;
    font-weight: 850;
}

.permission-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border-radius: 7px;
    padding: 7px;
}

.permission-option:hover {
    background: var(--surface-soft);
}

.permission-option input {
    width: auto;
    margin-top: 3px;
}

.permission-option span,
.permission-option strong,
.permission-option small {
    display: block;
}

.permission-option small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 500;
}

.role-badge {
    display: inline-flex;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    padding: 4px 8px;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 800;
}

.role-badge.role-administrator {
    border-color: #d8b4fe;
    background: #faf5ff;
    color: #7e22ce;
}

.role-badge.role-manager {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.app-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 16px 0 4px;
}

.pagination-summary {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.pagination-link {
    display: inline-flex;
    min-width: 34px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    padding: 6px 10px;
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.pagination-link:hover,
.pagination-link:focus-visible {
    border-color: var(--brand);
    color: var(--brand);
    outline: none;
}

.pagination-link.is-current {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.pagination-link.is-disabled {
    cursor: default;
    opacity: 0.48;
}

@media (max-width: 720px) {
    .app-pagination {
        align-items: flex-start;
        flex-direction: column;
    }
}

.empty-state {
    padding: 30px;
    color: var(--muted);
    text-align: center;
}

.form-panel {
    padding: 18px;
}

.form-stack {
    display: grid;
    gap: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.span-2 {
    grid-column: span 2;
}

label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 0.83rem;
    font-weight: 750;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 9px 10px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-row input {
    width: auto;
}

.form-actions {
    gap: 10px;
    margin-top: 16px;
}

.inline-form {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
}

.history-filter-header h2,
.history-results-header h2 {
    margin: 0;
    font-size: 1rem;
}

.history-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) repeat(2, minmax(150px, 0.7fr)) auto;
    align-items: end;
    gap: 14px;
    padding: 18px 24px 22px;
}

.history-filters label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 750;
}

.history-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}

.history-result-count {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    padding: 5px 9px;
    font-size: 0.76rem;
    font-weight: 750;
}

.report-heading,
.report-actions,
.report-filter-actions,
.report-legend {
    display: flex;
    align-items: center;
}

.report-heading {
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.report-period {
    margin-bottom: 2px;
    font-size: 1rem;
    font-weight: 800;
}

.report-actions,
.report-filter-actions,
.report-legend {
    flex-wrap: wrap;
    gap: 8px;
}

.demo-data-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    border: 1px solid #e4bd76;
    border-radius: 10px;
    background: #fff8e8;
    color: #7a4b00;
    padding: 11px 14px;
    font-size: 0.82rem;
}

.demo-data-banner strong {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #e0a800;
    color: #fff;
    padding: 3px 8px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.report-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(145px, 0.7fr)) minmax(220px, 1.2fr) repeat(2, minmax(180px, 0.9fr)) auto;
    align-items: end;
    gap: 14px;
    padding: 18px 24px 22px;
}

.report-async-state {
    display: flex;
    min-height: 240px;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 36px;
    text-align: left;
}

.report-async-state h2,
.report-async-state p {
    margin: 0;
}

.report-async-state p {
    margin-top: 5px;
    color: var(--muted);
}

.report-async-state--error {
    border-color: #f3b9bf;
    background: #fff8f8;
}

.report-async-state--error .primary-button {
    margin-top: 14px;
}

.report-loading-spinner {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 4px solid #ead7e2;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: report-loading-spin 0.75s linear infinite;
}

@keyframes report-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.report-scope-panel {
    margin-bottom: 22px;
    border: 1px solid #cfd9e7;
    border-radius: 15px;
    background: #f8fafc;
    padding: 18px 20px 20px;
}

.report-scope-heading {
    margin-bottom: 13px;
}

.report-scope-heading h2,
.report-results-heading h2 {
    margin: 0;
    font-size: 1rem;
}

.report-scope-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.report-scope-item {
    min-width: 0;
    border: 1px solid #dce3ed;
    border-radius: 11px;
    background: #fff;
    padding: 14px;
}

.report-scope-item--historical {
    border-left: 4px solid #7c3aed;
}

.report-scope-item--current {
    border-left: 4px solid #0f8a78;
}

.report-scope-item > strong {
    display: block;
    margin-top: 8px;
    color: var(--text);
    font-size: 0.86rem;
}

.report-scope-item p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

.report-scope-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid #d6dce6;
    border-radius: 999px;
    background: #f5f7fa;
    color: #526078;
    padding: 2px 7px;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.025em;
    line-height: 1.35;
    text-transform: uppercase;
    white-space: nowrap;
}

.report-scope-badge.is-historical {
    border-color: #d8c8ff;
    background: #f5f0ff;
    color: #6332b5;
}

.report-scope-badge.is-current {
    border-color: #a7dfd4;
    background: #ebfaf7;
    color: #087565;
}

.report-scope-badge.is-filter {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #475569;
}

.report-results-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.report-panel-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.report-panel-description {
    max-width: 760px;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.report-section-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
}

.report-section-help .report-help-tooltip {
    right: 0;
    left: auto;
    width: min(320px, 75vw);
    text-align: left;
    text-transform: none;
}

.report-section-help:hover .report-help-tooltip,
.report-section-help:focus-within .report-help-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.report-column-scope {
    display: block;
    margin-top: 4px;
    color: #6332b5;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    white-space: nowrap;
}

.report-column-scope.is-current {
    color: #087565;
}

.report-filter-hint {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 500;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.report-stat-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 17px;
}

.report-stat-card p,
.report-stat-card small {
    color: var(--muted);
}

.report-stat-card p {
    margin-bottom: 7px;
    font-size: 0.78rem;
    font-weight: 750;
}

.report-stat-card .report-stat-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-help {
    display: inline-grid;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--brand);
    cursor: help;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.report-help:hover,
.report-help:focus-visible {
    border-color: var(--brand);
    outline: none;
}

.report-help-tooltip {
    position: absolute;
    z-index: 20;
    top: calc(100% + 7px);
    left: 0;
    width: min(270px, 75vw);
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #172033;
    box-shadow: var(--shadow);
    padding: 9px 11px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-3px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.report-help:hover + .report-help-tooltip,
.report-help:focus + .report-help-tooltip,
.report-help:focus-visible + .report-help-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.report-stat-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1.55rem;
    line-height: 1.15;
}

.report-stat-card small {
    display: block;
    font-size: 0.7rem;
}

.report-disclaimer {
    border-color: #d7c4d0;
    background: #fffafd;
    padding: 16px 20px;
}

.report-disclaimer p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.report-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.report-bars {
    display: grid;
    gap: 14px;
    padding: 20px 24px 24px;
}

.report-bar-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(140px, 1.5fr) 52px;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
}

.report-bar-label {
    min-width: 0;
}

.report-bar-label strong,
.report-bar-label small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-bar-label small {
    color: var(--muted);
}

.report-bar-track {
    height: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1f6;
}

.report-bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--aeon));
}

.daily-chart {
    display: flex;
    height: 230px;
    align-items: stretch;
    gap: 8px;
    overflow-x: auto;
    padding: 24px 24px 10px;
}

.daily-chart-column {
    display: grid;
    min-width: 42px;
    flex: 1 0 42px;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 7px;
    text-align: center;
}

.daily-chart-bars {
    display: flex;
    height: 100%;
    align-items: end;
    justify-content: center;
    gap: 3px;
    border-bottom: 1px solid var(--line);
}

.daily-bar {
    display: block;
    width: 9px;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
}

.daily-bar.employees,
.legend-swatch.employees {
    background: var(--brand);
}

.daily-bar.entries,
.legend-swatch.entries {
    background: var(--blue);
}

.daily-chart-column small {
    color: var(--muted);
    font-size: 0.68rem;
    white-space: nowrap;
}

.report-legend {
    justify-content: center;
    padding: 6px 20px 18px;
    color: var(--muted);
    font-size: 0.75rem;
}

.legend-swatch {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 5px;
    border-radius: 2px;
}

.exception-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}

.exception-grid button {
    appearance: none;
    border: 0;
    display: grid;
    gap: 3px;
    background: var(--surface);
    padding: 18px 20px;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.exception-grid button:hover,
.exception-grid button:focus-visible {
    background: var(--surface-soft);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 40%, transparent);
    outline: none;
}

.exception-grid button.is-active {
    background: color-mix(in srgb, var(--brand) 8%, var(--surface));
    box-shadow: inset 0 -3px 0 var(--brand);
}

.exception-grid strong {
    color: var(--brand);
    font-size: 1.45rem;
}

.exception-grid span {
    color: var(--muted);
    font-size: 0.78rem;
}

.exception-grid small {
    margin-top: 5px;
    color: var(--brand);
    font-size: 0.68rem;
    font-weight: 700;
}

.exception-show-all {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    padding: 7px 12px;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
}

.exception-show-all:hover,
.exception-show-all:focus-visible,
.exception-show-all.is-active {
    border-color: var(--brand);
    color: var(--brand);
    outline: none;
}

.exception-detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 10px;
}

.exception-detail-heading div {
    display: grid;
    gap: 3px;
}

.exception-detail-heading small,
.exception-detail-heading span {
    color: var(--muted);
    font-size: 0.73rem;
}

.exception-detail-table {
    min-width: 1080px;
}

.exception-issue-list,
.exception-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.exception-issue-badge {
    display: inline-flex;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fff1f2;
    padding: 3px 7px;
    color: #be123c;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.exception-issue-badge.issue-low_battery,
.exception-issue-badge.issue-unknown_area {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.exception-issue-badge.issue-sos {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
}

.exception-actions a {
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
}

.exception-actions a:hover {
    text-decoration: underline;
}

.report-table-panel table {
    min-width: 940px;
}

.employee-area-toggle,
.employee-offline-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--brand);
    cursor: pointer;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 750;
}

.employee-area-toggle::after,
.employee-offline-toggle::after {
    content: "\203A";
    font-size: 1rem;
    line-height: 0.8;
    transform: rotate(90deg);
    transition: transform 140ms ease;
}

.employee-area-toggle.is-open::after,
.employee-offline-toggle.is-open::after {
    transform: rotate(-90deg);
}

.employee-area-toggle:hover,
.employee-area-toggle:focus-visible,
.employee-offline-toggle:hover,
.employee-offline-toggle:focus-visible {
    text-decoration: underline;
    outline: none;
}

.employee-offline-toggle:disabled {
    cursor: wait;
    opacity: 0.65;
}

.employee-offline-details-row td {
    border-top: 0;
    background: #f8fafc;
    padding: 0;
    white-space: normal;
}

.employee-offline-details {
    padding: 16px 22px 19px;
}

.employee-offline-details-heading,
.employee-offline-day-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.employee-offline-details-heading > div,
.employee-offline-day-heading > div {
    display: grid;
    gap: 2px;
}

.employee-offline-details-heading > div:last-child,
.employee-offline-day-heading > div:last-child {
    text-align: right;
}

.employee-offline-details-heading small,
.employee-offline-day-heading small,
.employee-offline-ranges,
.employee-offline-axis,
.employee-offline-loading,
.employee-offline-empty,
.employee-offline-error p {
    color: var(--muted);
    font-size: 0.7rem;
}

.employee-offline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    margin: 11px 0;
    color: var(--muted);
    font-size: 0.68rem;
}

.employee-offline-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.employee-offline-legend i {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: #e2e8f0;
}

.employee-offline-legend i.is-reporting {
    background: #22a66a;
}

.employee-offline-segment.is-reporting {
    background: var(--location-segment-color, #22a66a);
}

.employee-offline-legend i.is-offline,
.employee-offline-segment.is-offline {
    background: #e23449;
}

.employee-offline-day-list {
    display: grid;
    gap: 9px;
}

.employee-offline-day {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    padding: 11px 13px;
}

.employee-offline-timeline {
    position: relative;
    height: 18px;
    overflow: hidden;
    margin-top: 9px;
    border-radius: 6px;
    background: #e2e8f0;
    box-shadow: inset 0 0 0 1px rgb(148 163 184 / 25%);
}

.employee-offline-segment {
    position: absolute;
    top: 0;
    bottom: 0;
    min-width: 2px;
}

.employee-offline-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 3px;
}

.employee-timeline-periods {
    display: grid;
    gap: 5px;
    margin-top: 8px;
}

.employee-timeline-period {
    display: grid;
    grid-template-columns: 9px 92px minmax(180px, 1fr) 70px;
    align-items: center;
    gap: 9px;
    border-radius: 7px;
    background: #f8fafc;
    padding: 7px 9px;
    font-size: 0.7rem;
}

.employee-timeline-period > div {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.employee-timeline-period > div strong,
.employee-timeline-period > div small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-timeline-period > div small,
.employee-timeline-period > span:last-child {
    color: var(--muted);
    font-size: 0.67rem;
}

.employee-timeline-period > span:last-child {
    text-align: right;
}

.employee-timeline-period-marker {
    width: 9px;
    height: 22px;
    border-radius: 999px;
    background: var(--location-segment-color, #22a66a);
}

.employee-timeline-period.is-offline {
    background: #fff7f7;
}

.employee-timeline-period.is-offline .employee-timeline-period-marker {
    background: #e23449;
}

.employee-timeline-period.is-offline > div > strong {
    color: #be123c;
}

.employee-offline-ranges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.employee-offline-ranges span {
    border-radius: 999px;
    background: #fff1f2;
    padding: 2px 7px;
    color: #be123c;
    font-weight: 700;
}

.employee-offline-ranges small + span:only-child {
    background: #ecfdf5;
    color: #047857;
}

.employee-offline-loading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
}

.employee-offline-loading .report-loading-spinner {
    width: 18px;
    height: 18px;
}

.employee-offline-empty,
.employee-offline-error p {
    margin: 8px 0 0;
}

.employee-area-breakdown-row td {
    border-top: 0;
    background: #f8fafc;
    padding: 0;
    white-space: normal;
}

.employee-area-breakdown {
    padding: 16px 22px 19px;
}

.employee-area-breakdown-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 11px;
}

.employee-area-breakdown-heading div,
.employee-area-time-name,
.employee-area-time-value,
.employee-area-time-entries {
    display: grid;
    gap: 2px;
}

.employee-area-breakdown-heading small,
.employee-area-breakdown-heading span,
.employee-area-time-name small,
.employee-area-time-value small,
.employee-area-time-entries small,
.employee-area-time-note {
    color: var(--muted);
    font-size: 0.68rem;
}

.employee-area-time-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.employee-area-time-item {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 1.6fr) minmax(125px, 0.7fr) 72px;
    align-items: center;
    gap: 16px;
    padding: 11px 13px;
}

.employee-area-time-item + .employee-area-time-item {
    border-top: 1px solid var(--line);
}

.employee-area-time-name {
    min-width: 0;
}

.employee-area-time-name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-area-time-name .charging-area-badge {
    width: max-content;
    margin: 2px 0 0;
}

.employee-area-time-bar {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8edf4;
}

.employee-area-time-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--aeon));
}

.employee-area-time-value,
.employee-area-time-entries {
    text-align: right;
}

.employee-area-time-note {
    margin: 9px 0 0;
}

@media (max-width: 1400px) {
    .report-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .report-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.auth-body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    padding: 20px;
}

.auth-content {
    display: grid;
    width: 100%;
    flex: 1;
    place-items: center;
}

.login-card {
    width: min(420px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 26px;
}

.login-brand {
    margin-bottom: 22px;
}

.site-footer {
    margin-top: auto;
    padding-top: 28px;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

.auth-body .site-footer {
    width: 100%;
    padding-top: 20px;
}

.editor-shell {
    display: grid;
    gap: 12px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.editor-tool-group,
.editor-selection-actions,
.editor-draft-actions,
.editor-save-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-tool-group {
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.editor-tool-group .button {
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
}

.editor-tool-group .button:last-child {
    border-right: 0;
}

.editor-selection-actions,
.editor-draft-actions {
    margin-left: 4px;
    border-left: 1px solid var(--line);
    padding-left: 12px;
}

.editor-selection-actions[hidden],
.editor-draft-actions[hidden] {
    display: none;
}

.editor-draft-actions .button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.editor-save-group {
    margin-left: auto;
}

.editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
}

.editor-canvas-wrap {
    margin: 0;
}

.editor-panel {
    min-height: 520px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 14px;
}

.editor-panel h2 {
    margin: 0 0 10px;
}

.editor-list {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.editor-item {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    padding: 10px;
}

.editor-item--selected-area {
    border-color: #b9cbed;
    background: #f7faff;
}

.editor-selection-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--muted);
    padding: 18px 12px;
    font-size: 0.8rem;
    text-align: center;
}

.editor-item-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.editor-area-option {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 750;
}

.editor-area-option input {
    width: auto;
    margin: 0;
}

.summary-card--charging {
    border-color: #99f6e4;
    background: linear-gradient(145deg, #ffffff, #f0fdfa);
}

.summary-icon.charging {
    width: 50px;
    height: 50px;
    border: 2px solid #5eead4;
    border-radius: 14px;
    background: #ccfbf1;
}

.summary-icon.charging::after {
    content: "\26A1";
    color: #0f766e;
    font-size: 1.55rem;
    font-weight: 900;
}

.charging-area-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #0f766e;
    border-radius: 3px;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    line-height: 12px;
    text-align: center;
}

.charging-area-map-badge {
    pointer-events: none;
}

.charging-area-note {
    color: #0f766e !important;
    font-weight: 750;
}

.charging-report-panel {
    border-color: #99f6e4;
}

.charging-stat-card {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.charging-area-badge {
    display: inline-flex;
    margin-left: 6px;
    border: 1px solid #5eead4;
    border-radius: 999px;
    background: #ccfbf1;
    padding: 2px 7px;
    color: #0f766e;
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}

.color-chip {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 3px;
    vertical-align: middle;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 50;
        width: min(290px, calc(100vw - 48px));
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        transform: translateX(-100%);
        transition: transform 180ms ease;
        box-shadow: 18px 0 44px rgba(15, 23, 42, 0.24);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 45;
        border: 0;
        background: rgba(15, 23, 42, 0.46);
        cursor: pointer;
    }

    .sidebar-backdrop[hidden] {
        display: none;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

    .nav {
        grid-template-columns: 1fr;
    }

    .editor-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .main {
        padding: 18px;
    }

    .tracker-assignment-filter-panel {
        padding: 16px;
    }

    .summary-grid,
    .form-grid,
    .assignment-pool-grid,
    .permission-guide,
    .permission-groups {
        grid-template-columns: 1fr;
    }

    .user-management-note,
    .role-permissions-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .history-filters {
        grid-template-columns: 1fr;
        padding-inline: 18px;
    }

    .history-filter-actions .primary-button,
    .history-filter-actions .button {
        flex: 1;
    }

    .span-2 {
        grid-column: auto;
    }

    .topbar,
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-title {
        width: 100%;
    }

    .nav {
        grid-template-columns: 1fr;
    }

    .report-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .report-actions {
        width: 100%;
    }

    .report-actions .button,
    .report-actions .primary-button {
        flex: 1;
        text-align: center;
    }

    .report-filters,
    .report-summary-grid,
    .report-scope-grid,
    .report-two-column,
    .exception-grid {
        grid-template-columns: 1fr;
    }

    .report-results-heading,
    .report-panel-header-actions {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
    }

    .report-section-help .report-help-tooltip {
        right: auto;
        left: 0;
    }

    .employee-area-breakdown-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .employee-area-time-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .employee-area-time-value,
    .employee-area-time-entries {
        text-align: left;
    }

    .report-filters {
        padding-inline: 18px;
    }

    .report-filter-actions .button,
    .report-filter-actions .primary-button {
        flex: 1;
    }

    .report-bar-row {
        grid-template-columns: minmax(100px, 1fr) minmax(100px, 1.4fr) 48px;
    }
}

@media print {
    @page {
        size: landscape;
        margin: 10mm;
    }

    body {
        background: #fff;
        color: #111827;
        font-size: 10px;
    }

    .sidebar,
    .sidebar-backdrop,
    .topbar,
    .site-footer,
    .report-actions,
    .report-filter-panel,
    .pagination,
    .app-pagination {
        display: none !important;
    }

    .app-shell {
        display: block;
    }

    .main {
        display: block;
        padding: 0;
    }

    .report-heading {
        margin-bottom: 10px;
    }

    .panel,
    .report-stat-card {
        break-inside: avoid;
        border-color: #cbd5e1;
        box-shadow: none;
    }

    .report-summary-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 10px;
    }

    .report-stat-card {
        padding: 9px;
    }

    .report-stat-card strong {
        font-size: 1.15rem;
    }

    .report-two-column {
        gap: 10px;
    }

    .panel,
    .report-table-panel {
        margin-bottom: 10px;
    }

    .panel-header {
        padding: 10px 12px;
    }

    .report-bars {
        padding: 10px 12px;
    }

    .daily-chart {
        height: 130px;
        padding: 12px 12px 6px;
    }

    .exception-grid button {
        padding: 9px 10px;
    }

    .exception-grid button small,
    .exception-show-all {
        display: none;
    }

    .exception-detail-heading {
        padding: 8px 10px 5px;
    }

    .exception-detail-table {
        min-width: 0;
        font-size: 7px;
    }

    .exception-detail-row[hidden] {
        display: table-row !important;
    }

    .employee-area-toggle,
    .employee-offline-toggle,
    .employee-offline-details-row {
        display: none !important;
    }

    .employee-area-breakdown-row[hidden] {
        display: table-row !important;
    }

    .employee-area-breakdown {
        padding: 8px 10px;
    }

    .employee-area-time-item {
        grid-template-columns: minmax(120px, 1fr) minmax(100px, 1.2fr) 95px 55px;
        gap: 8px;
        padding: 6px 8px;
    }

    .table-wrap {
        overflow: visible;
    }

    .report-table-panel table {
        min-width: 0;
        font-size: 8px;
    }

    th,
    td {
        padding: 6px;
    }

    tr {
        break-inside: avoid;
    }
}
