:root {
  color-scheme: light;
  --canvas: #f2f4ef;
  --surface: #ffffff;
  --surface-muted: #f7f8f5;
  --ink: #17211f;
  --ink-soft: #34413e;
  --muted: #697572;
  --line: #dce2dc;
  --line-strong: #cbd3cc;
  --primary: #0d6b5d;
  --primary-hover: #09584c;
  --primary-soft: #e5f3ef;
  --accent: #c66a09;
  --accent-soft: #fff1dc;
  --danger: #a53a32;
  --danger-soft: #fae9e7;
  --warning: #8c5a00;
  --warning-soft: #fff4d8;
  --info: #315f82;
  --info-soft: #e9f2f8;
  --sidebar: #17211f;
  --sidebar-soft: #22302c;
  --shadow: 0 12px 28px rgba(23, 33, 31, 0.08);
  --radius: 6px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

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

button {
  color: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(13, 107, 93, 0.22);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-lockup > span:last-child {
  display: grid;
  min-width: 0;
}

.brand-lockup strong {
  font-size: 1rem;
  line-height: 1.25;
}

.brand-lockup small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.brand-lockup-light {
  color: #f7faf8;
}

.brand-lockup-light small {
  color: #aebdb7;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: #eef8f4;
  color: var(--sidebar);
  font-size: 1rem;
  font-weight: 800;
}

.login-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.25fr) minmax(380px, 0.75fr);
  background: var(--surface);
}

.login-brand {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 5vw, 72px);
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--sidebar);
  background-size: 32px 32px;
  color: #f5f8f6;
}

.login-brand-copy {
  max-width: 690px;
  margin: auto 0;
  padding: 56px 0;
}

.login-brand-copy .eyebrow {
  color: #8dc7ba;
}

.login-brand-copy h1 {
  max-width: 640px;
  margin: 0 0 22px;
  font-size: clamp(2.2rem, 4.7vw, 4.7rem);
  line-height: 1.06;
  font-weight: 760;
  letter-spacing: 0;
}

.login-brand-copy > p:last-child {
  max-width: 620px;
  margin: 0;
  color: #c4d0cb;
  font-size: 1.03rem;
  line-height: 1.85;
}

.login-facts {
  display: grid;
  max-width: 850px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.login-facts > div {
  min-width: 0;
  padding: 20px 22px 0 0;
}

.login-facts span {
  color: #79b7aa;
  font-size: 0.72rem;
  font-weight: 700;
}

.login-facts p {
  margin: 7px 0 0;
  color: #d7e1dd;
  font-size: 0.83rem;
  line-height: 1.55;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(28px, 5vw, 72px);
  background: #f8faf7;
}

.login-form {
  width: min(100%, 390px);
}

.login-heading {
  margin-bottom: 30px;
}

.login-heading .eyebrow {
  color: var(--primary);
}

.login-heading h2 {
  margin: 0 0 8px;
  font-size: 2rem;
  line-height: 1.2;
}

.login-heading > p:last-child {
  margin: 0;
  color: var(--muted);
}

.login-method-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.login-method {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.login-method:hover:not(:disabled) {
  color: var(--ink);
}

.login-method.is-active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(23, 33, 31, 0.1);
}

.login-method:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.login-method-note {
  margin: -4px 0 17px;
  color: var(--warning);
  font-size: 0.78rem;
  line-height: 1.55;
}

.login-notice {
  min-height: 21px;
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 0.78rem;
  line-height: 1.5;
}

.verification-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.verification-control input {
  min-width: 0;
}

.verification-control .button {
  min-width: 108px;
  white-space: nowrap;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin-bottom: 17px;
}

.field > span,
.field-label {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.field small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.field input,
.field select,
.field textarea,
.compact-select,
.search-box input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.field input,
.field select {
  min-height: 43px;
  padding: 0 12px;
}

.field textarea {
  min-height: 94px;
  resize: vertical;
  padding: 10px 12px;
}

.field input::placeholder,
.field textarea::placeholder,
.search-box input::placeholder {
  color: #98a39f;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: #eef1ed;
  color: var(--muted);
  cursor: not-allowed;
}

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

.field-grid .field-span-2 {
  grid-column: 1 / -1;
}

.field-hint {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.55;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 4px 0 17px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.check-field input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
  accent-color: var(--primary);
}

.form-error {
  min-height: 21px;
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 0.8rem;
  line-height: 1.5;
}

.login-security {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
  text-align: center;
}

.button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

.button-primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.button-secondary:hover {
  border-color: #adb9b2;
  background: var(--surface-muted);
}

.button-danger {
  border-color: #ddbbb6;
  background: var(--danger-soft);
  color: var(--danger);
}

.button-danger:hover {
  border-color: var(--danger);
  background: #f5d8d4;
}

.button-small {
  min-height: 33px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.button-wide {
  width: 100%;
  min-height: 44px;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
  color: var(--ink);
}

.icon-button-dark {
  border-color: rgba(255, 255, 255, 0.13);
  background: transparent;
  color: #b9c7c1;
}

.icon-button-dark:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 24px 16px 16px;
  background: var(--sidebar);
  color: #ffffff;
}

.sidebar .brand-lockup {
  padding: 0 8px 23px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #b4c2bd;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.nav-item.is-active {
  border-color: rgba(121, 183, 170, 0.2);
  background: var(--sidebar-soft);
  color: #ffffff;
}

.nav-item.is-active .icon {
  color: #75c0af;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 15px 2px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.operator {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.operator > span:last-child {
  display: grid;
  min-width: 0;
}

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

.operator strong {
  color: #eef4f1;
  font-size: 0.8rem;
}

.operator small {
  color: #91a29c;
  font-size: 0.68rem;
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  background: #e8f4ef;
  color: var(--sidebar);
  font-size: 0.8rem;
  font-weight: 800;
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.72rem);
  line-height: 1.25;
  font-weight: 760;
}

.topbar .eyebrow {
  color: var(--primary);
}

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

.mobile-account-actions {
  display: none;
}

.current-date {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.mobile-nav {
  display: none;
}

.main-content {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px) clamp(18px, 3vw, 40px) 60px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: view-in 180ms ease-out;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.boundary-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  padding: 11px 14px;
  border: 1px solid #c9dfd8;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: #274c45;
  font-size: 0.8rem;
  line-height: 1.55;
}

.boundary-note p {
  margin: 1px 0 0;
}

.boundary-note-amber {
  border-color: #ead4aa;
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: #65420e;
}

.boundary-note-danger {
  border-color: #e5c4bf;
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: #6c2923;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.metric {
  display: grid;
  min-height: 132px;
  align-content: space-between;
  padding: 18px;
  background: var(--surface);
}

.metric-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.metric-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--primary);
}

.metric-icon .icon {
  width: 16px;
  height: 16px;
}

.metric-value {
  margin: 14px 0 2px;
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  line-height: 1.1;
  font-weight: 780;
  letter-spacing: 0;
  word-break: break-word;
}

.metric-detail {
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.45;
}

.metric-alert .metric-icon {
  background: var(--warning-soft);
  color: var(--warning);
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  min-width: 0;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-flat {
  padding: 0;
  overflow: visible;
}

.panel-flat > .panel-heading {
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-flat > :not(.panel-heading) {
  margin-right: 20px;
  margin-left: 20px;
}

.panel-flat > :last-child:not(.panel-heading) {
  margin-bottom: 20px;
}

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

.panel-heading-wrap {
  flex-wrap: wrap;
}

.panel-heading h2,
.panel-heading h3 {
  margin: 0;
  line-height: 1.35;
}

.panel-heading h2 {
  font-size: 1.15rem;
}

.panel-heading h3 {
  font-size: 1rem;
}

.meta-label {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.stack-list {
  display: grid;
}

.stack-item {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.stack-item:last-child {
  border-bottom: 0;
}

.stack-main {
  min-width: 0;
}

.stack-main strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-main small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.stack-side {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: right;
}

.timeline {
  display: grid;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-dot {
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.timeline-main {
  min-width: 0;
}

.timeline-main strong {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.timeline-main small {
  color: var(--muted);
  font-size: 0.7rem;
}

.timeline time {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.view-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.view-toolbar .button:last-child {
  margin-left: auto;
}

.search-box {
  position: relative;
  min-width: min(100%, 290px);
  flex: 1 1 280px;
}

.search-box .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  min-height: 40px;
  padding: 0 12px 0 36px;
}

.compact-select {
  width: auto;
  min-width: 145px;
  min-height: 40px;
  padding: 0 32px 0 11px;
}

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

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.81rem;
}

.data-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background: #fafbf9;
}

.cell-title {
  display: block;
  max-width: 330px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-subtitle {
  display: block;
  max-width: 330px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.71rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.status::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-active {
  border-color: #b9dcd3;
  background: var(--primary-soft);
  color: #0a6859;
}

.status-trial {
  border-color: #bad1e2;
  background: var(--info-soft);
  color: var(--info);
}

.status-expired {
  border-color: #e4cfaa;
  background: var(--warning-soft);
  color: var(--warning);
}

.status-suspended,
.status-archived {
  border-color: #ddc0bc;
  background: var(--danger-soft);
  color: var(--danger);
}

.status-neutral {
  border-color: var(--line);
  background: #f0f2ef;
  color: var(--muted);
}

.status-ok {
  border-color: #b9dcd3;
  background: var(--primary-soft);
  color: #0a6859;
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.empty-state-compact {
  min-height: 70px;
  justify-items: start;
  text-align: left;
}

.permission-state {
  display: grid;
  max-width: 720px;
  min-height: 320px;
  place-items: center;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  margin: 40px auto;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.permission-state-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: var(--warning-soft);
  color: var(--warning);
}

.permission-state-icon .icon {
  width: 27px;
  height: 27px;
}

.permission-state h2 {
  margin: 0;
  font-size: 1.45rem;
}

.permission-state p:not(.eyebrow) {
  max-width: 520px;
  margin: 9px 0 20px;
  color: var(--muted);
  line-height: 1.7;
}

.loading-line {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.sms-ledger {
  margin-top: 18px;
}

.quota-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.quota-item {
  min-width: 0;
  padding: 14px;
  background: var(--surface-muted);
}

.quota-item span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}

.quota-item strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.06rem;
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.company-row,
.backup-company-row {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.company-row-head,
.backup-company-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.company-row-main,
.backup-company-main {
  min-width: 0;
}

.company-row-main strong,
.backup-company-main strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-row-main small,
.backup-company-main small {
  color: var(--muted);
  font-size: 0.7rem;
}

.company-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 0.72rem;
}

.company-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: #c8cfcb;
  transition: background 150ms ease;
}

.toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  content: "";
  transition: transform 150ms ease;
}

.toggle input:checked + .toggle-track {
  background: var(--primary);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(15px);
}

.toggle input:disabled + .toggle-track {
  opacity: 0.5;
}

.backup-company-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.backup-company-row {
  background: var(--surface);
}

.backup-company-row.is-selected {
  border-color: #8fbeb2;
  background: #f2faf7;
}

.backup-company-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.detail-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section:first-child {
  padding-top: 0;
}

.detail-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.detail-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.detail-section-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.detail-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

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

.subscription-block {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.subscription-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.subscription-block-head strong {
  font-size: 0.9rem;
}

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

.subscription-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
}

.subscription-stat strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.subscription-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.notice-band {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 13px 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.notice-band strong {
  color: var(--ink-soft);
}

.dialog {
  width: min(calc(100vw - 28px), 620px);
  max-height: min(90vh, 900px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(12, 22, 19, 0.22);
}

.dialog-wide {
  width: min(calc(100vw - 28px), 1040px);
}

.dialog::backdrop {
  background: rgba(13, 23, 20, 0.55);
  backdrop-filter: blur(2px);
}

.dialog > form {
  display: flex;
  max-height: min(90vh, 900px);
  flex-direction: column;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.3;
}

.dialog-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.dialog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.tab-list {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab {
  min-height: 33px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--primary);
}

.dialog-body {
  min-height: 230px;
  overflow: auto;
  padding: 20px;
}

.dialog > form .dialog-body {
  flex: 1;
}

.dialog > form > .form-error {
  margin: 0;
  padding: 0 20px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
}

.password-dialog .dialog-body {
  min-height: 0;
}

.password-dialog .boundary-note {
  margin-bottom: 18px;
}

.form-body .field-grid {
  margin-bottom: 0;
}

.danger-callout {
  margin: 0 0 17px;
  padding: 12px;
  border: 1px solid #e5c4bf;
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: #6c2923;
  font-size: 0.78rem;
  line-height: 1.6;
}

.code-inline {
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #f0f2ef;
  color: var(--ink);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.75rem;
}

.license-key-preview {
  max-height: 130px;
  margin-top: 12px;
  overflow: auto;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.license-key-preview code {
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.68rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.license-output-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  font-size: 0.76rem;
}

.license-output-meta span {
  color: var(--muted);
}

.license-output-meta code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: Consolas, "SFMono-Regular", monospace;
}

.license-output-field strong {
  display: block;
  margin-bottom: 7px;
  font-size: 0.78rem;
}

.license-secret-output {
  max-height: 330px;
  margin: 0;
  overflow: auto;
  padding: 15px;
  border: 1px solid #20332d;
  border-radius: var(--radius);
  background: #13201c;
  color: #e9f3ef;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.72rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.license-output-actions {
  margin-top: 14px;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--ink);
  color: #f4f8f6;
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  line-height: 1.55;
  animation: toast-in 160ms ease-out;
  pointer-events: auto;
}

.toast.is-error {
  border-color: #bf6b63;
  background: #5b231f;
}

.toast .icon {
  margin-top: 1px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

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

  .login-brand {
    min-height: auto;
    padding: 28px 24px;
  }

  .login-brand-copy {
    padding: 44px 0 34px;
  }

  .login-brand-copy h1 {
    max-width: 720px;
    font-size: clamp(2rem, 7vw, 3.3rem);
  }

  .login-facts {
    display: none;
  }

  .login-panel {
    min-height: auto;
    padding: 40px 22px 54px;
  }

  .app-shell {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 10px 12px;
  }

  .sidebar .brand-lockup {
    justify-content: center;
    padding: 0 0 19px;
  }

  .sidebar .brand-lockup > span:last-child,
  .nav-item span {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .sidebar-foot {
    justify-content: center;
  }

  .operator {
    display: none;
  }

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

@media (max-width: 760px) {
  :root {
    font-size: 14px;
  }

  .login-brand-copy {
    padding: 34px 0 18px;
  }

  .login-brand-copy h1 {
    margin-bottom: 14px;
  }

  .login-brand-copy > p:last-child {
    font-size: 0.9rem;
  }

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

  .sidebar {
    display: none;
  }

  .topbar {
    min-height: 72px;
    padding: 13px 16px;
  }

  .topbar h1 {
    font-size: 1.24rem;
  }

  .current-date {
    display: none;
  }

  .topbar-actions .button span {
    display: none;
  }

  .topbar-actions .button {
    width: 38px;
    padding: 0;
  }

  .mobile-account-actions {
    display: flex;
    gap: 6px;
  }

  .mobile-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(248, 250, 247, 0.96);
    scrollbar-width: none;
  }

  .mobile-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav-item {
    min-width: 68px;
    min-height: 35px;
    flex: 1 0 auto;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
  }

  .mobile-nav-item.is-active {
    border-color: #bbd7d0;
    background: var(--primary-soft);
    color: var(--primary);
  }

  .main-content {
    padding: 16px 12px 44px;
  }

  .boundary-note {
    padding: 10px 11px;
    font-size: 0.76rem;
  }

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

  .metric {
    min-height: 118px;
    padding: 14px;
  }

  .metric-value {
    font-size: 1.42rem;
  }

  .panel,
  .dashboard-grid {
    margin-bottom: 14px;
  }

  .panel {
    padding: 15px;
  }

  .panel-flat {
    padding: 0;
  }

  .panel-flat > .panel-heading {
    padding: 15px;
  }

  .panel-flat > :not(.panel-heading) {
    margin-right: 15px;
    margin-left: 15px;
  }

  .view-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .view-toolbar .search-box {
    min-width: 0;
    grid-column: 1 / -1;
  }

  .view-toolbar .compact-select {
    width: 100%;
    min-width: 0;
  }

  .view-toolbar .button {
    min-width: 0;
  }

  .view-toolbar .button:last-child {
    margin-left: 0;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: grid;
    gap: 9px;
    padding: 10px 0;
  }

  .data-table tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .data-table tbody tr:hover {
    background: var(--surface);
  }

  .data-table td {
    display: grid;
    grid-template-columns: minmax(86px, 34%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    border-bottom: 1px solid var(--line);
    text-align: right;
  }

  .data-table td:last-child {
    border-bottom: 0;
  }

  .data-table td::before {
    color: var(--muted);
    font-size: 0.69rem;
    font-weight: 700;
    text-align: left;
    content: attr(data-label);
  }

  .cell-title,
  .cell-subtitle {
    max-width: none;
    white-space: normal;
  }

  .cell-title {
    text-align: right;
  }

  .cell-subtitle {
    text-align: right;
  }

  .table-actions {
    justify-content: flex-end;
  }

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

  .permission-state {
    min-height: 280px;
    grid-template-columns: 1fr;
    justify-items: start;
    margin: 18px auto;
  }

  .panel-heading-wrap {
    align-items: stretch;
  }

  .panel-heading-wrap > .inline-actions {
    width: 100%;
  }

  .panel-heading-wrap .compact-select {
    min-width: 0;
    flex: 1;
  }

  .inline-actions {
    width: 100%;
  }

  .inline-actions .compact-select {
    flex: 1;
  }

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

  .company-grid,
  .subscription-grid {
    grid-template-columns: 1fr;
  }

  .company-row-head,
  .backup-company-row {
    align-items: flex-start;
  }

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

  .backup-company-actions .button {
    width: 100%;
  }

  .dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .dialog-head {
    padding: 15px;
  }

  .dialog-toolbar {
    align-items: stretch;
    padding: 9px 15px;
    flex-direction: column;
  }

  .dialog-toolbar .button {
    align-self: flex-start;
  }

  .dialog-body {
    padding: 15px;
  }

  .dialog-actions {
    padding: 11px 15px;
  }

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

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

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

  .toast-region {
    right: 12px;
    bottom: 12px;
  }
}

@media (max-width: 430px) {
  .login-brand {
    padding: 20px 18px;
  }

  .login-brand-copy {
    padding-top: 28px;
  }

  .login-panel {
    padding: 30px 18px 40px;
  }

  .verification-control {
    grid-template-columns: 1fr;
  }

  .verification-control .button {
    width: 100%;
  }

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

  .metric {
    min-height: 100px;
  }

  .metric-value {
    margin-top: 9px;
  }

  .panel-heading {
    flex-direction: column;
  }

  .panel-heading > .button {
    width: 100%;
  }

  .view-toolbar {
    grid-template-columns: 1fr;
  }

  .view-toolbar .search-box,
  .view-toolbar .compact-select,
  .view-toolbar .button {
    grid-column: auto;
    width: 100%;
  }

  .timeline-item {
    grid-template-columns: 9px minmax(0, 1fr);
  }

  .timeline time {
    grid-column: 2;
  }

  .subscription-stats,
  .quota-band {
    grid-template-columns: 1fr;
  }

  .dialog-actions .button {
    flex: 1;
  }
}

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