:root {
  color-scheme: light;
  --bg: #eef4f5;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #d3dde0;
  --accent: #176f70;
  --accent-dark: #105657;
  --accent-soft: #e5f4f3;
  --nav: #0b2427;
  --nav-2: #12383b;
  --ok: #18794e;
  --warn: #a15c07;
  --bad: #b42318;
  --shadow: 0 12px 28px rgb(16 40 43 / 8%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
  background:
    radial-gradient(circle at 88% 8%, rgba(55, 177, 179, 0.13), transparent 28%),
    linear-gradient(180deg, #f7fbfb 0%, var(--bg) 44%, #f5f7f9 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.app-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.app-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(23, 111, 112, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 111, 112, 0.035) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(115deg, transparent 0%, #000 18%, #000 72%, transparent 100%);
}

.app-fiber {
  position: absolute;
  display: block;
  height: 2px;
  width: 720px;
  background: linear-gradient(90deg, transparent, rgba(23, 111, 112, 0.08), rgba(41, 174, 176, 0.4), transparent);
  box-shadow: 0 0 18px rgba(41, 174, 176, 0.22);
  transform-origin: center;
}

.app-fiber-a {
  top: 96px;
  right: -180px;
  transform: rotate(-18deg);
}

.app-fiber-b {
  top: 360px;
  right: -240px;
  transform: rotate(14deg);
  opacity: 0.72;
}

.app-fiber-c {
  bottom: 90px;
  left: 180px;
  transform: rotate(-8deg);
  opacity: 0.46;
}

body.auth-page {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(18, 130, 132, 0.28), transparent 42%),
    linear-gradient(245deg, rgba(46, 106, 170, 0.22), transparent 48%),
    #071c1f;
  color: #eef8f8;
}

body.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(115deg, transparent 0%, #000 18%, #000 72%, transparent 100%);
}

aside {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(37, 100, 103, 0.42), transparent 34%),
    linear-gradient(155deg, var(--nav-2), var(--nav) 52%, #071719);
  color: #fff;
  padding: 24px 16px;
  box-shadow: 8px 0 28px rgb(8 31 34 / 12%);
}

.brand {
  display: grid;
  gap: 3px;
  margin-bottom: 28px;
  padding: 4px 4px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand span {
  color: #88dbdc;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand strong {
  color: #f5ffff;
  font-size: 22px;
  line-height: 1;
}

nav {
  display: grid;
  gap: 6px;
}

nav a {
  color: #c8d7d8;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 700;
}

nav a:hover,
nav a.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(139, 232, 233, 0.18);
  color: #fff;
}

nav a.active {
  box-shadow: inset 3px 0 0 #77e4e6;
}

.logout-form {
  margin-top: 18px;
}

.logout-form button {
  width: 100%;
  background: #194142;
  color: #c8d7d8;
}

.logout-form button:hover {
  background: #255253;
  color: #fff;
}

main {
  padding: 28px;
  overflow-x: visible;
  min-width: 0;
}

.auth-main {
  width: 100%;
  max-width: 460px;
  padding: 0;
  overflow: visible;
  position: relative;
  z-index: 1;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(211, 221, 224, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

.env {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

section {
  margin-bottom: 24px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.metric,
.panel,
table {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(41, 174, 176, 0.26));
}

.metric strong {
  display: block;
  font-size: 30px;
  margin-bottom: 4px;
}

.metric span {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(600px, 1fr);
  gap: 20px;
  align-items: start;
}

.login-shell {
  display: grid;
  gap: 18px;
  position: relative;
}

.login-form {
  display: grid;
  gap: 6px;
  position: relative;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
}

.login-brand {
  display: grid;
  gap: 6px;
  text-align: center;
  color: #f5ffff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.26);
}

.login-brand span {
  color: #9ed9da;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-brand strong {
  font-size: 31px;
}

.login-form-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.login-form-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.login-status-strip span {
  border: 1px solid #d7e6e7;
  border-radius: 6px;
  padding: 8px 6px;
  color: #176f70;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.fiber-scene {
  position: absolute;
  inset: -120px -120px -80px -120px;
  pointer-events: none;
  z-index: -1;
}

.fiber-line,
.fiber-node {
  position: absolute;
  display: block;
}

.fiber-line {
  height: 2px;
  width: 680px;
  background: linear-gradient(90deg, transparent, rgba(135, 238, 239, 0.1), rgba(135, 238, 239, 0.95), rgba(246, 255, 255, 0.86), transparent);
  box-shadow: 0 0 18px rgba(88, 228, 230, 0.55);
  transform-origin: center;
}

.line-a {
  top: 135px;
  left: -170px;
  transform: rotate(-24deg);
}

.line-b {
  top: 315px;
  left: -105px;
  transform: rotate(18deg);
}

.line-c {
  top: 250px;
  left: -215px;
  transform: rotate(-7deg);
  opacity: 0.72;
}

.fiber-node {
  width: 9px;
  height: 9px;
  border: 2px solid #d8ffff;
  border-radius: 50%;
  background: #6ce4e6;
  box-shadow: 0 0 18px rgba(123, 240, 241, 0.9);
}

.node-a {
  top: 145px;
  left: 45px;
}

.node-b {
  top: 292px;
  right: 30px;
}

.node-c {
  bottom: 92px;
  left: 140px;
}

.panel {
  position: relative;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  min-width: 0;
}

.panel-heading form {
  flex: 0 0 auto;
}

form {
  margin: 0;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #344054;
  font-weight: 600;
}

input,
select {
  width: 100%;
  height: 38px;
  border: 1px solid #c7cdd5;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

input:focus,
select:focus {
  outline: 2px solid rgba(41, 174, 176, 0.2);
  border-color: var(--accent);
}

.check {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.check input {
  width: 16px;
  height: 16px;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  height: 38px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgb(16 86 87 / 12%);
}

button:hover {
  background: var(--accent-dark);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 6px 14px rgb(16 86 87 / 12%);
}

.button-link:hover {
  background: var(--accent-dark);
}

.button-link.secondary {
  background: #53606b;
}

.button-link.secondary:hover {
  background: #3f4a54;
}

.button-link.danger {
  background: var(--bad);
}

.button-link.danger:hover {
  background: #8f1d14;
}

.button-link.small {
  height: 30px;
  padding: 0 10px;
}

button.small {
  height: 30px;
  padding: 0 10px;
}

button.secondary {
  background: #53606b;
}

button.secondary:hover {
  background: #3f4a54;
}

button.danger {
  background: var(--bad);
}

button.danger:hover {
  background: #8f1d14;
}

.actions {
  width: 1%;
  min-width: 112px;
  white-space: nowrap;
}

.actions form {
  margin: 0;
}

.action-menu {
  display: inline-block;
}

.action-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  background: #667085;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu summary:hover {
  background: #4b5563;
}

.action-menu summary::after {
  content: "v";
  margin-left: 8px;
  font-size: 11px;
}

.action-menu[open] summary::after {
  content: "^";
}

.action-menu-panel {
  display: grid;
  gap: 4px;
  width: 190px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgb(31 41 51 / 16%);
}

.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #344054;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover {
  background: #eef2f5;
  color: #1f2933;
}

.menu-item.danger {
  color: var(--bad);
}

.menu-item.danger:hover {
  background: #fdecec;
  color: var(--bad);
}

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

.filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(150px, 1fr) minmax(130px, 0.8fr) minmax(150px, 0.9fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.filter-form h2 {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.filter-form label {
  margin-bottom: 0;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.import-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  min-width: 780px;
}

.import-form label {
  margin-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading span {
  color: var(--muted);
  font-weight: 700;
}

.notice {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.notice span {
  color: var(--muted);
}

.notice.error {
  border-color: #f0b8b4;
  background: #fff7f6;
}

.notice.error strong {
  color: var(--bad);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
}

.compliance-panel {
  grid-column: 1 / -1;
}

.operator-panel {
  grid-column: 1 / -1;
}

.operator-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.operator-strip div {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #f5faf9);
}

.operator-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compliance-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.compliance-head strong {
  font-size: 16px;
}

.compliance-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.compliance-part {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f6fbfb;
}

.compliance-part span {
  font-weight: 700;
  color: #344054;
}

.details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.details div {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 12px;
  align-items: start;
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

dd small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #e8f1f1;
  color: #174647;
}

.inline-action {
  margin-left: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.inline-action:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.edit-form {
  max-width: 720px;
}

.delete-panel {
  max-width: 760px;
}

.delete-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.delete-check {
  flex-basis: 100%;
  margin-bottom: 4px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.table-scroll table {
  border: 0;
  border-radius: 0;
}

.compact-table th,
.compact-table td {
  padding: 9px 10px;
  white-space: nowrap;
}

.live-check-table {
  table-layout: fixed;
  min-width: 760px;
}

.live-check-table th,
.live-check-table td {
  padding: 8px 10px;
}

.live-check-table th:nth-child(1),
.live-check-table td:nth-child(1) {
  width: 92px;
}

.live-check-table th:nth-child(2),
.live-check-table td:nth-child(2) {
  width: 150px;
}

.live-check-table th:nth-child(3),
.live-check-table td:nth-child(3),
.live-check-table th:nth-child(4),
.live-check-table td:nth-child(4) {
  width: 160px;
}

.live-check-table th:nth-child(5),
.live-check-table td:nth-child(5) {
  width: auto;
}

.live-check-table .badge {
  white-space: nowrap;
}

.path-cell {
  min-width: 0;
}

.path-cell code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.optical-table {
  min-width: 980px;
}

.optical-table code {
  display: inline-block;
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.optical-cards {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.optical-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  background: linear-gradient(180deg, #ffffff, #f7fbfb);
}

.optical-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.optical-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.optical-metrics div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  min-width: 0;
  background: #ffffff;
}

.optical-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.optical-metrics strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.compact-details {
  gap: 7px;
}

.compact-details div {
  grid-template-columns: minmax(95px, 130px) minmax(0, 1fr);
}

.compact-details code {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

th,
td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.template-table td {
  min-width: 140px;
}

.template-table td:nth-child(4),
.template-table td:nth-child(5),
.template-table td:nth-child(6) {
  min-width: 220px;
}

.job-message {
  max-width: 460px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

th {
  background: linear-gradient(180deg, #eef7f7, #e8eff1);
  color: #315154;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tbody tr:hover td {
  background: #f8fcfc;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #edf0f3;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.badge.provisioned,
.badge.completed,
.badge.compliant,
.badge.wifi_applied,
.badge.management_applied,
.badge.wan_applied,
.badge.online,
.badge.active {
  background: #e8f5ee;
  border-color: #c7ead8;
  color: var(--ok);
}

.badge.offline,
.badge.expired {
  background: #edf0f3;
  border-color: #d9dee4;
  color: #667085;
}

.badge.pending,
.badge.queued,
.badge.running,
.badge.inform_received,
.badge.partial,
.badge.reboot_requested,
.badge.maintenance {
  background: #fff4e5;
  border-color: #f7d7a5;
  color: var(--warn);
}

.badge.failed,
.badge.non_compliant,
.badge.inactive {
  background: #fdecec;
  border-color: #f1c4c0;
  color: var(--bad);
}

.badge.skipped,
.badge.unknown {
  background: #edf0f3;
  color: #667085;
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
  }

  aside {
    position: static;
    min-height: auto;
    padding: 18px 16px;
  }

  .brand {
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

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

  nav a {
    text-align: center;
  }

  main {
    padding: 18px;
  }

  header {
    display: grid;
    gap: 6px;
    padding: 15px;
  }

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

  .metrics,
  .split,
  .detail-grid,
  .operator-strip,
  .filter-form,
  .import-form {
    grid-template-columns: 1fr;
  }

  .details div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
