:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #68737e;
  --faint: #929ca5;
  --line: #dce1e5;
  --surface: #ffffff;
  --canvas: #eef1f3;
  --charcoal: #17212b;
  --charcoal-2: #23313d;
  --green: #087f6d;
  --green-dark: #056455;
  --green-soft: #dff3ee;
  --amber: #bd7411;
  --amber-soft: #fff0d5;
  --red: #bc4149;
  --red-soft: #fde8e9;
  --blue: #376a9f;
  --blue-soft: #e5eef7;
  --shadow: 0 16px 40px rgba(23, 33, 43, 0.08);
  --sidebar-width: 248px;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(8, 127, 109, 0.2);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  gap: 18px;
  background: var(--charcoal);
  color: #dbe4e8;
  text-align: center;
  transition: opacity 280ms ease, visibility 280ms ease;
}

.boot-screen.is-done {
  opacity: 0;
  visibility: hidden;
}

.boot-mark {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 0 auto;
}

.boot-mark img {
  width: 48px;
  height: 48px;
  margin: 10px;
  border-radius: 6px;
  object-fit: cover;
}

.boot-mark span {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #47c5ad;
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.boot-screen p {
  margin: 0;
  color: #aebbc3;
  font-size: 13px;
}

.auth-view {
  display: grid;
  grid-template-columns: minmax(360px, 44%) minmax(440px, 56%);
  min-height: 100vh;
  background: #f4f6f7;
}

.auth-brand {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 42px 48px 36px;
  background: var(--charcoal);
  color: #ffffff;
}

.auth-brand::after {
  position: absolute;
  right: -70px;
  bottom: 120px;
  width: 360px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 -76px rgba(255, 255, 255, 0.07), 0 76px rgba(255, 255, 255, 0.07);
  content: "";
  transform: rotate(-35deg);
}

.brand-lockup,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup img,
.sidebar-brand img {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
}

.brand-lockup div,
.sidebar-brand div {
  display: grid;
  gap: 2px;
}

.brand-lockup strong,
.sidebar-brand strong {
  font-size: 17px;
}

.brand-lockup span,
.sidebar-brand span {
  color: #8fa1ad;
  font-size: 10px;
  font-weight: 700;
}

.auth-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 80px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-brand-copy .eyebrow {
  color: #47c5ad;
}

.auth-brand-copy h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.28;
  font-weight: 750;
}

.signal-board {
  display: grid;
  gap: 14px;
  max-width: 430px;
  margin-top: 54px;
}

.signal-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  color: #b8c5cc;
  font-size: 12px;
}

.signal-row i {
  height: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.13);
}

.signal-row i::after {
  display: block;
  width: 32%;
  height: 100%;
  background: #47c5ad;
  content: "";
  animation: signal 2.4s ease-in-out infinite;
}

.signal-row:nth-child(2) i::after {
  animation-delay: 300ms;
}

.signal-row:nth-child(3) i::after {
  animation-delay: 600ms;
}

.signal-row b {
  color: #ffffff;
  font-size: 10px;
}

.auth-version {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #71838e;
  font-size: 10px;
  font-weight: 700;
}

.auth-workspace {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 40px;
}

.auth-panel {
  width: min(100%, 420px);
  animation: auth-in 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.auth-heading p {
  margin: 0 0 5px;
  color: var(--green);
  font-weight: 700;
}

.auth-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 34px 0 26px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #e9edef;
}

.auth-tab {
  height: 40px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.auth-tab.is-active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(23, 33, 43, 0.08);
}

.field-label {
  display: block;
  margin: 18px 0 8px;
  color: #3d4852;
  font-size: 12px;
  font-weight: 700;
}

.field-control {
  position: relative;
  display: flex;
  height: 50px;
  align-items: center;
  border: 1px solid #cfd6db;
  border-radius: 6px;
  background: #ffffff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field-control:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(8, 127, 109, 0.09);
  transform: translateY(-1px);
}

.field-control > svg {
  width: 18px;
  margin-left: 15px;
  color: #7a8790;
}

.field-control input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.field-control input:-webkit-autofill {
  transition: background-color 9999s ease-out;
}

.field-action {
  margin-right: 6px;
}

.form-error {
  min-height: 19px;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 12px;
}

.primary-button,
.secondary-button,
.danger-button,
.danger-text-button,
.logout-button {
  display: inline-flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button svg,
.secondary-button svg,
.danger-button svg,
.danger-text-button svg,
.logout-button svg {
  width: 17px;
  height: 17px;
}

.primary-button {
  padding: 0 18px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(8, 127, 109, 0.18);
}

.primary-button:hover:not(:disabled) {
  background: var(--green-dark);
  transform: translateY(-2px);
}

.secondary-button {
  padding: 0 16px;
  border: 1px solid #ccd3d8;
  background: #ffffff;
  color: #34414c;
}

.secondary-button:hover:not(:disabled) {
  border-color: #9facb5;
  background: #f7f9fa;
  transform: translateY(-2px);
}

.danger-button {
  padding: 0 18px;
  border: 1px solid var(--red);
  background: var(--red);
  color: #ffffff;
}

.danger-text-button {
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--red);
}

.danger-text-button:hover:not(:disabled) {
  background: var(--red-soft);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none !important;
}

.auth-submit,
.full-button {
  width: 100%;
}

.auth-submit {
  height: 50px;
  margin-top: 12px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, color 160ms ease;
}

.icon-button:hover:not(:disabled) {
  background: #e8edef;
  transform: translateY(-1px);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 28px 18px 20px;
  background: var(--charcoal);
  color: #dce5ea;
}

.sidebar-brand {
  padding: 0 10px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 24px;
}

.nav-item {
  display: flex;
  width: 100%;
  height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #91a1ab;
  cursor: pointer;
  font-weight: 650;
  text-align: left;
  transition: background 170ms ease, color 170ms ease, transform 170ms ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--charcoal-2);
  color: #ffffff;
  transform: translateX(2px);
}

.nav-item.is-active::after {
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: #47c5ad;
  content: "";
  box-shadow: 0 0 0 4px rgba(71, 197, 173, 0.12);
}

.sidebar-foot {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.server-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.server-state div {
  display: grid;
  gap: 2px;
}

.server-state strong {
  color: #e9f0f3;
  font-size: 11px;
}

.server-state small {
  color: #7f919c;
  font-size: 9px;
}

.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #47c5ad;
}

.live-dot::after {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(71, 197, 173, 0.55);
  border-radius: 50%;
  content: "";
  animation: pulse-ring 1.8s ease-out infinite;
}

.logout-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #91a1ab;
}

.logout-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.task-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  z-index: 80;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.task-progress span {
  display: block;
  width: 35%;
  height: 100%;
  background: var(--green);
  transform: translateX(-110%);
}

.task-progress.is-active {
  opacity: 1;
}

.task-progress.is-active span {
  animation: task-progress 1.15s ease-in-out infinite;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(238, 241, 243, 0.96);
  backdrop-filter: blur(12px);
}

.topbar-date {
  display: grid;
  gap: 3px;
}

.topbar-date strong {
  font-size: 13px;
}

.topbar-date span {
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.refresh-button.is-spinning svg {
  animation: spin 700ms linear infinite;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.user-chip > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--charcoal);
  color: #ffffff;
  font-weight: 800;
}

.user-chip div {
  display: grid;
  gap: 1px;
}

.user-chip strong {
  max-width: 160px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  color: var(--muted);
  font-size: 10px;
}

.mobile-menu-button {
  display: none;
}

.dashboard {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 34px;
}

.overview-band {
  display: flex;
  min-height: 146px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px;
  border-left: 4px solid var(--green);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.overview-band h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.3;
}

.overview-message {
  margin: 7px 0 0;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric {
  display: flex;
  min-width: 0;
  min-height: 102px;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.metric:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(23, 33, 43, 0.07);
}

.metric-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 6px;
}

.metric-icon svg {
  width: 21px;
  height: 21px;
}

.metric-sites .metric-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.metric-bindings .metric-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.metric-checkin .metric-icon {
  background: var(--green-soft);
  color: var(--green);
}

.metric-failure .metric-icon {
  background: var(--red-soft);
  color: var(--red);
}

.metric > div:last-child {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
}

.metric strong {
  overflow: hidden;
  font-size: 21px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric strong.is-bumping {
  animation: number-bump 320ms ease;
}

.panel {
  min-height: 390px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.dashboard > .panel.dashboard-view {
  width: 100%;
}

.account-panel.dashboard-view {
  max-width: 1040px;
  min-height: 500px;
}

.site-list-panel.dashboard-view {
  max-width: 1180px;
  min-height: 430px;
}

.panel-heading,
.section-heading,
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2,
.section-heading h2,
.dialog-heading h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
}

.status-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
}

.status-badge.is-muted {
  background: #edf0f2;
  color: #77838c;
}

.site-switcher {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-bottom: 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.site-tab {
  display: flex;
  min-width: 190px;
  min-height: 58px;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f9fa;
  color: var(--charcoal);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.site-tab:hover {
  border-color: #9aaab4;
  transform: translateY(-1px);
}

.site-tab.is-active {
  border-color: var(--green);
  background: var(--green-soft);
}

.site-tab > svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  color: var(--green);
}

.site-tab > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.site-tab strong,
.site-tab small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-tab strong {
  font-size: 12px;
}

.site-tab small {
  color: var(--muted);
  font-size: 10px;
}

.empty-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 15px;
  place-items: center;
  border: 1px dashed #aab5bc;
  border-radius: 50%;
  color: var(--green);
}

.empty-icon svg {
  width: 24px;
}

.empty-state h3 {
  margin: 0;
  font-size: 16px;
}

.empty-state p {
  max-width: 360px;
  margin: 7px auto 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.account-connected {
  padding-top: 30px;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.account-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
}

.account-avatar svg {
  width: 25px;
}

.account-identity > div:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.account-identity span,
.account-facts dt {
  color: var(--muted);
  font-size: 10px;
}

.account-identity strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.site-link {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  color: var(--blue);
  font-size: 10px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-link:hover {
  text-decoration: underline;
}

.dialog-site-context {
  margin: -8px 0 18px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11px;
}

.account-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 24px 0;
}

.account-facts div {
  min-width: 0;
  padding: 0 16px;
  border-right: 1px solid var(--line);
}

.account-facts div:first-child {
  padding-left: 0;
}

.account-facts div:last-child {
  padding-right: 0;
  border-right: 0;
}

.account-facts dt {
  margin-bottom: 7px;
}

.account-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 700;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.site-management-list {
  display: grid;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.site-operation-row,
.schedule-site-row {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  animation: row-in 280ms ease both;
}

.site-operation-row {
  grid-template-columns: minmax(220px, 1.1fr) minmax(120px, 0.55fr) minmax(220px, 1fr) auto;
}

.schedule-site-row {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.9fr) minmax(310px, auto);
}

.schedule-site-row.is-dirty {
  box-shadow: inset 3px 0 var(--amber);
}

.site-row-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.site-row-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
}

.site-row-icon svg {
  width: 19px;
  height: 19px;
}

.site-row-copy,
.site-balance-cell,
.site-row-status {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.site-row-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-row-copy small,
.site-row-copy a,
.site-balance-cell span,
.site-row-status small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-row-copy a {
  width: fit-content;
  max-width: 100%;
  color: var(--blue);
  text-decoration: none;
}

.site-row-copy a:hover {
  text-decoration: underline;
}

.site-balance-cell strong {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-row-status b {
  font-size: 11px;
}

.site-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.compact-button {
  height: 38px;
  padding-right: 13px;
  padding-left: 13px;
  white-space: nowrap;
}

.schedule-site-controls {
  display: grid;
  grid-template-columns: 46px 128px minmax(104px, auto);
  align-items: center;
  justify-content: end;
  gap: 10px;
}

.schedule-time-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid #cfd6db;
  border-radius: 6px;
  background: #f8fafb;
  color: var(--ink);
  font-weight: 700;
}

.site-list-empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--faint);
  font-size: 11px;
}

.site-list-empty svg {
  width: 25px;
  height: 25px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 26px;
  flex: 0 0 46px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  width: 100%;
  border-radius: 999px;
  background: #cbd2d7;
  transition: background 200ms ease;
}

.switch span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(23, 33, 43, 0.2);
  content: "";
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.switch input:focus-visible + span {
  outline: 3px solid rgba(8, 127, 109, 0.2);
  outline-offset: 2px;
}

.activity-section {
  margin-top: 0;
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.dashboard-view.view-enter {
  animation: view-switch 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.count-label {
  color: var(--muted);
  font-size: 11px;
}

.activity-table-wrap {
  position: relative;
  min-height: 180px;
  margin-top: 20px;
  overflow-x: auto;
}

.activity-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.activity-table th {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
}

.activity-table th:nth-child(1) { width: 16%; }
.activity-table th:nth-child(2) { width: 12%; }
.activity-table th:nth-child(3) { width: 36%; }
.activity-table th:nth-child(4) { width: 16%; }
.activity-table th:nth-child(5) { width: 20%; }

.activity-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf0f2;
  color: #45515b;
  font-size: 11px;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.activity-table tr {
  animation: row-in 320ms ease both;
}

.activity-table tr:hover td {
  background: #f8fafb;
}

.event-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.event-cell svg {
  width: 15px;
  height: 15px;
  color: var(--green);
}

.result-pill {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 800;
}

.result-pill.is-error {
  background: var(--red-soft);
  color: var(--red);
}

.result-pill svg {
  width: 11px;
}

.table-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--faint);
  font-size: 11px;
}

.table-empty svg {
  width: 24px;
}

.reveal-item {
  opacity: 0;
  transform: translateY(12px);
}

.app-shell.is-ready .reveal-item {
  animation: reveal 420ms ease forwards;
}

.app-shell.is-ready .reveal-item:nth-child(2) { animation-delay: 60ms; }
.app-shell.is-ready .reveal-item:nth-child(3) { animation-delay: 120ms; }

.app-shell.is-ready .dashboard-view.view-enter {
  animation: view-switch 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: 0ms;
}

.dialog {
  width: min(92vw, 460px);
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(23, 33, 43, 0.28);
}

.dialog::backdrop {
  background: rgba(15, 23, 30, 0.66);
  backdrop-filter: blur(3px);
}

.dialog[open] {
  animation: dialog-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dialog form {
  padding: 27px;
}

.dialog .full-button {
  margin-top: 16px;
}

.confirm-dialog {
  width: min(92vw, 400px);
  text-align: center;
}

.confirm-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 19px;
}

.confirm-dialog p {
  margin: 8px 0 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: grid;
  width: min(360px, calc(100vw - 44px));
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid #cbd5d9;
  border-left: 4px solid var(--green);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(23, 33, 43, 0.18);
  pointer-events: auto;
  animation: toast-in 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast.is-error {
  border-left-color: var(--red);
}

.toast-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.toast.is-error .toast-icon {
  background: var(--red-soft);
  color: var(--red);
}

.toast-icon svg {
  width: 16px;
}

.toast div:nth-child(2) {
  display: grid;
  gap: 2px;
}

.toast strong {
  font-size: 11px;
}

.toast span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.toast button {
  width: 26px;
  height: 26px;
}

.toast.is-leaving {
  animation: toast-out 200ms ease forwards;
}

.sidebar-scrim {
  display: none;
}

.button-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.secondary-button .button-spinner {
  border-color: rgba(23, 33, 43, 0.2);
  border-top-color: currentColor;
}

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

@keyframes signal {
  0% { transform: translateX(-110%); }
  55%, 100% { transform: translateX(330%); }
}

@keyframes auth-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-ring {
  0% { opacity: 1; transform: scale(0.7); }
  75%, 100% { opacity: 0; transform: scale(1.4); }
}

@keyframes task-progress {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes view-switch {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes number-bump {
  50% { color: var(--green); transform: translateY(-2px); }
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(18px); }
}

@media (max-width: 1280px) {
  .site-operation-row {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 0.7fr);
  }

  .site-operation-row .site-row-status {
    grid-column: 1;
  }

  .site-operation-row .site-row-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .schedule-site-row {
    grid-template-columns: minmax(0, 1fr) minmax(310px, auto);
  }

  .schedule-row-status {
    grid-column: 1;
  }

  .schedule-site-controls {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 1080px) {
  :root {
    --sidebar-width: 220px;
  }

  .dashboard {
    padding: 26px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel {
    min-height: auto;
  }
}

@media (max-width: 820px) {
  .auth-view {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 260px;
    padding: 28px;
  }

  .auth-brand-copy {
    margin: 34px 0 16px;
  }

  .auth-brand-copy h1 {
    font-size: 30px;
  }

  .signal-board,
  .auth-version {
    display: none;
  }

  .auth-workspace {
    min-height: auto;
    padding: 38px 24px 54px;
  }

  .sidebar {
    width: 248px;
    transform: translateX(-102%);
    transition: transform 220ms ease;
  }

  .app-shell.is-menu-open .sidebar {
    transform: translateX(0);
  }

  .workspace {
    margin-left: 0;
  }

  .task-progress {
    left: 0;
  }

  .topbar {
    height: 68px;
    padding: 0 20px;
  }

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

  .topbar-date {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0 0 0 248px;
    z-index: 25;
    display: block;
    border: 0;
    background: rgba(15, 23, 30, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  .app-shell.is-menu-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 620px) {
  .dashboard {
    padding: 18px 14px 28px;
  }

  .user-chip div {
    display: none;
  }

  .user-chip {
    padding-left: 10px;
  }

  .overview-band {
    min-height: auto;
    align-items: stretch;
    flex-direction: column;
    padding: 22px;
  }

  .overview-band h1 {
    font-size: 23px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric {
    min-height: 90px;
    gap: 10px;
    padding: 14px;
  }

  .metric-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .metric strong {
    font-size: 17px;
  }

  .panel,
  .activity-section {
    padding: 20px;
  }

  .site-tab {
    min-width: 156px;
  }

  .account-facts {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .account-facts div,
  .account-facts div:first-child,
  .account-facts div:last-child {
    padding: 0 0 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .account-facts div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .panel-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-actions button {
    width: 100%;
  }

  .site-operation-row,
  .schedule-site-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0;
  }

  .site-operation-row .site-row-status,
  .site-operation-row .site-row-actions,
  .schedule-row-status,
  .schedule-site-controls {
    grid-column: 1;
    grid-row: auto;
  }

  .site-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-row-actions button {
    width: 100%;
  }

  .site-row-actions button:only-child {
    grid-column: 1 / -1;
  }

  .schedule-site-controls {
    grid-template-columns: 46px minmax(108px, 1fr) minmax(94px, auto);
    justify-content: stretch;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

@media (max-width: 400px) {
  .auth-brand {
    min-height: 230px;
    padding: 22px;
  }

  .auth-brand-copy h1 {
    font-size: 26px;
  }

  .auth-workspace {
    padding-inline: 18px;
  }

  .schedule-site-controls {
    grid-template-columns: 46px minmax(100px, 1fr) minmax(88px, auto);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
