:root {
    color-scheme: light;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: #172338;
    background: #f3f6fa;
    font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

.topbar {
    min-height: 74px;
    background: #10233d;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px clamp(18px, 4vw, 56px);
}

.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; font-weight: 700; }
.brand small { display: block; color: #afc0d8; font-size: 11px; font-weight: 500; margin-top: 3px; }
.brand-mark { width: 48px; height: 48px; border-radius: 15px; background: #e84747; color: #fff; display: grid; place-items: center; font-weight: 800; letter-spacing: .04em; }
.brand-mark.small { width: 39px; height: 39px; border-radius: 12px; font-size: 12px; }
.operator { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.operator form { margin: 0; }
.page-shell { width: min(1240px, calc(100% - 36px)); margin: 34px auto 60px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 26px; margin-bottom: 24px; }
.module-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 22px; }
.module-nav a { padding: 8px 12px; border: 1px solid #dfe5ed; border-radius: 20px; background: #fff; color: #526178; font-size: 11px; font-weight: 700; text-decoration: none; }
.module-nav a:hover, .module-nav a:focus-visible { border-color: #9aafc7; color: #18395f; }
.module-nav a.active { border-color: #18395f; background: #18395f; color: #fff; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 4vw, 36px); letter-spacing: -.03em; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.eyebrow { color: #e34b4b; text-transform: uppercase; letter-spacing: .11em; font-weight: 800; font-size: 10px; margin: 0 0 7px; }
.muted { color: #718096; font-size: 13px; line-height: 1.55; }
.community-picker { display: grid; grid-template-columns: minmax(190px, 1fr) auto; gap: 8px; align-items: center; min-width: min(440px, 100%); }
.community-picker label { grid-column: 1 / -1; color: #718096; font-size: 11px; font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.summary-card, .panel, .login-card { background: #fff; border: 1px solid #e6ebf2; border-radius: 16px; box-shadow: 0 6px 24px rgba(21, 42, 69, .045); }
.summary-card { padding: 18px 20px; display: grid; gap: 4px; }
.summary-card span { font-size: 12px; color: #69788e; }
.summary-card strong { font-size: 27px; letter-spacing: -.04em; }
.summary-card small { font-size: 11px; color: #9aa5b4; }
.panel { padding: 22px; margin-bottom: 18px; min-width: 0; }
.module-group-title { margin: 28px 0 14px; font-size: 17px; letter-spacing: -.02em; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.live-pill { border-radius: 30px; background: #e9f8f2; color: #277c5e; padding: 7px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.live-pill i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #29a574; margin-right: 6px; }
.live-pill.offline { background: #fff0ef; color: #a32d2d; }
.live-pill.offline i { background: #d94343; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; min-width: 720px; }
th { padding: 11px 12px; color: #8995a5; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid #edf0f4; }
td { padding: 13px 12px; font-size: 12px; border-bottom: 1px solid #f0f2f6; }
tbody tr:last-child td { border-bottom: 0; }
.type-badge { display: inline-block; padding: 5px 8px; border-radius: 7px; font-size: 10px; font-weight: 800; }
.type-badge.security { background: #fff0ef; color: #c53737; }
.type-badge.health { background: #fff4e5; color: #a76513; }
.cell-sub { display: block; color: #97a2b1; margin-top: 4px; font-size: 10px; }
.status-text { color: #56657a; font-size: 11px; }
.empty { padding: 26px; text-align: center; color: #8591a2; }
.empty.compact { padding: 10px 0 0; text-align: left; }
.panel-footnote { border-top: 1px solid #eef1f5; color: #8a96a5; font-size: 10px; padding-top: 13px; margin: 12px 0 0; }
.management-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.management-grid .panel { margin-bottom: 0; }
.inline-form { display: flex; align-items: end; gap: 10px; margin: 15px 0; }
.inline-form label { flex: 1; min-width: 0; }
.form-stack { display: grid; gap: 13px; }
label { display: grid; gap: 7px; color: #526178; font-size: 11px; font-weight: 700; }
input, select { width: 100%; min-width: 0; height: 40px; border: 1px solid #dfe5ed; border-radius: 8px; background: #fff; color: #1b2b42; padding: 0 11px; font: inherit; font-size: 12px; outline: none; }
input:focus, select:focus { border-color: #57799e; box-shadow: 0 0 0 3px rgba(87, 121, 158, .12); }
input[type="file"] { padding: 8px; }
.button { border: 0; border-radius: 8px; height: 40px; padding: 0 14px; font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.button:disabled { opacity: .48; cursor: not-allowed; }
.button.primary { background: #d94343; color: #fff; }
.button.secondary { background: #18395f; color: #fff; }
.button.quiet { color: #e3eaf3; background: #263d5a; height: 34px; }
.button.danger { color: #b93636; background: #fff0ef; }
.small-button { height: 30px; padding: 0 10px; }
.full { width: 100%; }
.assignment-form { margin-top: 20px; }
.plan-map { position: relative; overflow: hidden; width: 100%; border-radius: 11px; background: #edf1f5; cursor: crosshair; }
.plan-map img { display: block; width: 100%; height: auto; user-select: none; }
.map-marker { position: absolute; transform: translate(-50%, -50%); border: 2px solid #fff; background: #d94343; color: #fff; border-radius: 20px; box-shadow: 0 2px 8px rgba(19, 39, 64, .3); padding: 5px 8px; font-size: 9px; font-weight: 800; white-space: nowrap; z-index: 1; pointer-events: none; }
.viewer-plan-map { width: min(100%, 760px); margin: 0 auto; cursor: default; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; color: #718096; font-size: 12px; }
.pagination .button[aria-disabled="true"] { opacity: .48; cursor: default; pointer-events: none; }
.pending-marker { background: #235d8f; }
.marker-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 14px; }
.marker-form small { grid-column: 1 / -1; }
.marker-list { display: grid; gap: 7px; margin-top: 14px; }
.marker-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid #eef1f5; border-radius: 8px; color: #506078; font-size: 11px; }
.plan-empty { display: grid; place-items: center; min-height: 180px; border: 1px dashed #d7dfe9; border-radius: 11px; color: #8794a5; font-size: 12px; }
.plan-empty span { font-size: 30px; color: #a9b5c3; }
.plan-empty p { margin: 4px 0 0; }
.notice { border-radius: 9px; padding: 12px 15px; margin-bottom: 16px; font-size: 12px; }
.notice.success { color: #226e52; background: #e9f8f2; }
.notice.error { color: #a32d2d; background: #fff0ef; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 5%, #e6edf5, #f3f6fa 48%); }
.login-card { width: min(410px, 100%); padding: 32px; }
.login-card .brand-mark { margin-bottom: 20px; }
.login-card h1 { font-size: 28px; }
.login-card .form-stack { margin-top: 22px; }
.login-card .notice { margin-top: 14px; }

@media (max-width: 800px) {
    .page-heading { align-items: start; flex-direction: column; }
    .community-picker { width: 100%; }
    .management-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .topbar { padding: 11px 15px; }
    .operator { gap: 8px; font-size: 11px; }
    .page-shell { width: calc(100% - 24px); margin-top: 22px; }
    .summary-grid { grid-template-columns: 1fr; gap: 9px; }
    .summary-card { grid-template-columns: 1fr auto; align-items: center; padding: 12px 15px; }
    .summary-card strong { grid-column: 2; grid-row: 1 / span 2; }
    .summary-card small { grid-column: 1; }
    .panel { padding: 16px; }
    .viewer-plan-map { width: 100%; }
    .section-heading { align-items: start; flex-direction: column; }
    .pagination { flex-wrap: wrap; gap: 8px; }
    .inline-form { align-items: stretch; flex-direction: column; }
    .marker-form { grid-template-columns: 1fr; }
    .marker-form small { grid-column: 1; }
    .login-card { padding: 25px; }
}
