:root {
  --admin-accent: #0f766e;
  --admin-accent-soft: #e6f4f1;
  --admin-warn-soft: #fff7e6;
  --admin-border: #dbe3ea;
}

body {
  background: #f6f8fb;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(246, 248, 251, 0.3)),
    #f6f8fb;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--admin-border);
  box-shadow: 0 18px 50px rgba(21, 33, 48, 0.12);
}

.login-mark,
.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #fff;
  background: var(--admin-accent);
}

.login-mark {
  margin-bottom: 18px;
  font-size: 23px;
}

.admin-sidebar {
  border-right: 1px solid var(--admin-border);
}

.admin-sidebar .container-fluid,
.admin-sidebar .navbar-collapse {
  min-height: 100%;
}

.admin-sidebar .navbar-collapse {
  display: flex;
  flex-direction: column;
}

.navbar-brand {
  gap: 10px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px 18px;
  border-top: 1px solid rgba(219, 227, 234, 0.78);
}

.sidebar-logout {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.sidebar-logout:hover {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff7f7;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.08);
}

.sidebar-logout:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.sidebar-logout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  color: #64748b;
  background: #f1f5f9;
  font-size: 16px;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.sidebar-logout:hover .sidebar-logout-icon {
  color: #b91c1c;
  background: #fee2e2;
}

.sidebar-logout-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-wrapper .page-body {
  margin-top: 0;
  padding-top: 18px;
}

.nav-link {
  border-radius: 6px;
}

.nav-link.active {
  color: var(--admin-accent);
  background: var(--admin-accent-soft);
}

.metric-card {
  min-height: 124px;
  border: 1px solid var(--admin-border);
}

.metric-card .h1 {
  letter-spacing: 0;
}

.status-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #475569;
  background: #fff;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-dot.ok {
  background: #16a34a;
}

.status-dot.warn {
  background: #f59e0b;
}

.status-dot.off {
  background: #ef4444;
}

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

@media (min-width: 992px) {
  .panel-grid.two {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.62fr);
  }
}

.table-responsive {
  border-radius: 8px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--admin-border);
  border-radius: 8px;
  color: #64748b;
  background: #fff;
}

.code-box {
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.secret-output {
  word-break: break-all;
  border: 1px solid #bfd7ff;
  background: #f5f9ff;
  border-radius: 8px;
  padding: 12px;
}

.timeline-entry {
  padding: 12px 0;
  border-bottom: 1px solid var(--admin-border);
}

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

.audit-card {
  border: 1px solid var(--admin-border);
}

.audit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

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

.audit-page-size {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 650;
}

.audit-page-size .form-select {
  width: 76px;
  min-height: 30px;
}

.audit-table-wrap {
  border-top: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
}

.audit-table {
  min-width: 820px;
  margin-bottom: 0;
}

.audit-table th {
  padding: 8px 12px;
  border-bottom-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.audit-table td {
  padding: 7px 12px;
  color: #334155;
  font-size: 12px;
  vertical-align: middle;
}

.audit-row:hover td {
  background: #fbfdff;
}

.audit-group-row td {
  background: #fffbeb;
}

.audit-group-row:hover td {
  background: #fff7db;
}

.audit-time {
  width: 190px;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  white-space: nowrap;
}

.audit-time-range {
  display: block;
  margin-top: 2px;
  color: #94a3b8;
  font-family: inherit;
  font-size: 11px;
}

.audit-action {
  display: inline-flex;
  max-width: 160px;
  align-items: center;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 2px 8px;
  overflow: hidden;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-action-system {
  border-color: #fde68a;
  color: #92400e;
  background: #fef3c7;
}

.audit-group-count {
  display: inline-flex;
  margin-left: 6px;
  color: #92400e;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.audit-actor,
.audit-ip {
  max-width: 130px;
  overflow: hidden;
  color: #475569;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-path {
  max-width: 340px;
  overflow: hidden;
  color: #0f766e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-detail-btn {
  min-height: 28px;
  gap: 4px;
  padding: 3px 8px;
  font-size: 12px;
}

.audit-detail-row td {
  padding: 0 12px 10px;
  background: #fbfdff;
}

.audit-detail-box {
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.audit-detail-title {
  margin-bottom: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.audit-detail-box pre {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.45;
}

.audit-group-list {
  display: grid;
  gap: 4px;
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
}

.audit-group-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  border: 1px solid #e5eaf0;
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
}

.audit-group-main {
  display: grid;
  grid-template-columns: 170px minmax(150px, 220px) minmax(220px, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #475569;
  font-size: 12px;
}

.audit-group-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 12px;
}

.audit-group-time,
.audit-group-path {
  min-width: 0;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-group-summary {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-mini-detail {
  position: relative;
  color: #64748b;
  font-size: 12px;
}

.audit-mini-detail summary {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #dbe3ea;
  border-radius: 999px;
  padding: 2px 8px;
  color: #475569;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 750;
  list-style: none;
  cursor: pointer;
}

.audit-mini-detail summary::-webkit-details-marker {
  display: none;
}

.audit-mini-detail:not([open]) pre {
  display: none;
}

.audit-mini-detail[open] {
  grid-column: 1 / -1;
}

.audit-mini-detail[open] summary {
  margin-bottom: 6px;
}

.audit-group-item pre {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  max-height: 140px;
  margin-top: 6px;
  border: 1px solid #dbe3ea;
  border-radius: 6px;
  padding: 8px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 11px;
  line-height: 1.45;
}

.audit-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 46px;
  padding: 9px 16px;
  background: #fff;
}

.audit-page-label {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.audit-empty {
  min-height: 120px;
  border: 0;
  background: transparent;
}

.route-box {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.route-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: #0f766e;
}

.notice-warn {
  border-color: #ffd999;
  background: var(--admin-warn-soft);
}

.small-muted {
  color: #64748b;
  font-size: 12px;
}

.runtime-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.json-box {
  min-height: 320px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 14px;
  background: #0f172a;
  color: #e2e8f0;
}

.usage-page {
  display: grid;
  gap: 16px;
}

.usage-hero {
  border: 1px solid var(--admin-border);
}

.usage-hero-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.usage-title {
  margin: 2px 0 4px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0;
}

.usage-sync-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 16px;
  color: #64748b;
  font-size: 13px;
}

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

.usage-metric {
  display: flex;
  min-height: 96px;
  align-items: center;
  gap: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.usage-metric-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 20px;
}

.usage-metric-label {
  color: #64748b;
  font-size: 12px;
}

.usage-metric-value {
  margin-top: 2px;
  color: #0f172a;
  font-size: 21px;
  font-weight: 760;
  line-height: 1.15;
}

.usage-metric-hint {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 12px;
}

.usage-todo-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 13px 14px;
  color: #7c2d12;
  background: #fff7ed;
  font-size: 13px;
  line-height: 1.55;
}

.usage-todo-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #c2410c;
  background: #ffedd5;
  font-size: 18px;
}

.usage-table-header {
  align-items: center;
  justify-content: space-between;
}

.usage-table th,
.usage-table td {
  white-space: nowrap;
}

.usage-model-name {
  max-width: 280px;
  overflow: hidden;
  color: #0f766e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  text-overflow: ellipsis;
}

.usage-vendor {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 4px 9px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 700;
}

.service-tier-badge {
  display: inline-flex;
  min-width: 118px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 9px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.service-tier-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.service-tier-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.service-tier-secondary {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

.service-tier-info {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
}

.usage-empty {
  min-height: 220px;
  border: 0;
  background: transparent;
  text-align: center;
}

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

.account-list-header {
  align-items: flex-start;
  gap: 16px;
}

.account-provider-panel {
  display: grid;
  flex: 1 1 auto;
  gap: 12px;
  min-width: 0;
}

.account-provider-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.account-provider-current {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.account-provider-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 20px;
}

.account-provider-icon img,
.account-provider-tab img,
.provider-empty-icon img {
  width: 1em;
  height: 1em;
  display: block;
}

.account-provider-title {
  margin: 0;
  color: #172033;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

.account-provider-subtitle {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.2;
}

.account-provider-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #f8fafc;
}

.account-provider-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #475569;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.account-provider-tab:hover {
  color: #0f172a;
  background: #fff;
}

.account-provider-tab.active {
  color: #0f766e;
  border-color: #99f6e4;
  background: #ccfbf1;
  box-shadow: 0 1px 4px rgba(15, 118, 110, 0.16);
}

.account-header-actions {
  display: grid;
  align-items: flex-start;
  justify-content: flex-end;
  justify-items: end;
  gap: 8px;
  margin-left: auto;
}

.account-action-panel {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.account-routing-control {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.account-routing-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.account-routing-button {
  min-width: 138px;
  justify-content: space-between;
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
  font-weight: 800;
}

.account-routing-button:hover,
.account-routing-button:focus {
  border-color: #93c5fd;
  color: #1e40af;
  background: #dbeafe;
}

.account-routing-menu {
  min-width: 172px;
  padding: 8px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.account-routing-option {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  color: #172033;
  font-size: 13px;
  font-weight: 800;
}

.account-routing-option:hover {
  color: #1d4ed8;
  background: #eff6ff;
}

.account-routing-option.active {
  color: #1d4ed8;
  background: #e0e7ff;
}

.account-auto-refresh {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.account-auto-label,
.account-auto-unit {
  white-space: nowrap;
}

.account-auto-input {
  width: 76px;
  text-align: center;
}

.account-stats-dropdown {
  position: relative;
}

.account-stats-button {
  min-width: 112px;
  justify-content: space-between;
}

.account-stats-menu {
  min-width: 150px;
  padding: 6px;
}

.account-stats-option {
  display: flex;
  min-height: 30px;
  align-items: center;
  border-radius: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.account-stats-option:hover {
  color: #0f766e;
  background: #eefaf7;
}

.account-stats-option.active {
  color: #0f766e;
  background: #ccfbf1;
}

.provider-empty {
  min-height: 220px;
  align-items: center;
  padding: 28px;
}

.account-list-body {
  padding: 14px;
}

.account-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.account-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: 210px;
  padding: 26px;
  border: 1px solid #dfe6ee;
  border-radius: 8px;
  background: #fbfcfe;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.account-card-top {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 30px;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.account-select-mark {
  width: 22px;
  height: 22px;
  border: 1.5px solid #8a94a3;
  border-radius: 3px;
  background: #fff;
}

.account-name {
  min-width: 0;
  margin: 0;
  color: #1f2937;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-plan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  min-width: 64px;
  padding: 4px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  color: #0f5132;
  border: 1px solid #6ee7b7;
  background: linear-gradient(180deg, #a7f3d0, #6ee7b7);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.28);
}

.account-plan.free,
.account-plan.unknown {
  color: #475569;
  border-color: #d8dee8;
  background: #eef2f7;
  box-shadow: none;
}

.account-plan.pro,
.account-plan.team,
.account-plan.enterprise {
  color: #064e3b;
  border-color: #34d399;
  background: linear-gradient(180deg, #d1fae5, #86efac);
}

.account-plan.api-key {
  min-width: 78px;
  color: #075985;
  border-color: #bae6fd;
  background: #e0f2fe;
  box-shadow: none;
}

.account-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 6px;
}

.account-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #475569;
  background: transparent;
  cursor: pointer;
  opacity: 0.34;
}

.account-icon-btn:hover {
  color: #0f172a;
  border-color: var(--admin-border);
  background: #fff;
  opacity: 1;
}

.account-icon-btn.danger:hover {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.account-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #536176;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 10px;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid #d8dee8;
  border-radius: 999px;
  color: #475569;
  background: #eef2f7;
  font-size: 12px;
  font-weight: 700;
}

.account-login-row {
  min-width: 0;
  color: #536176;
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-quota-section {
  display: grid;
  gap: 12px;
  padding: 2px 0 4px;
}

.account-quota-item {
  display: grid;
  gap: 6px;
}

.account-quota-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.account-quota-head span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.account-quota-head strong {
  color: #047857;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.account-quota-head strong.medium {
  color: #b45309;
}

.account-quota-head strong.low,
.account-quota-head strong.critical {
  color: #b91c1c;
}

.account-quota-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.account-quota-bar {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #10b981);
}

.account-quota-bar.medium {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

.account-quota-bar.low,
.account-quota-bar.critical {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.account-quota-reset {
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.2;
}

.account-quota-empty {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}

.account-quota-empty.warning {
  border-color: #fed7aa;
  color: #b45309;
  background: #fff7ed;
}

.account-subscription-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.25;
}

.account-subscription-footer span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #047857;
  font-weight: 800;
}

.account-subscription-footer time {
  min-width: 0;
  color: #536176;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-subscription-footer.active {
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
}

.account-subscription-footer.expired {
  border: 1px solid #fecaca;
  background: #fef2f2;
}

.account-subscription-footer.expired span {
  color: #b91c1c;
}

.account-subscription-footer.missing {
  border: 1px solid #d8dee8;
  background: #f8fafc;
}

.account-subscription-footer.missing span {
  color: #64748b;
}

.account-empty {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  text-align: left;
}

.account-empty .ti {
  color: #94a3b8;
  font-size: 24px;
}

.provider-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 24px;
}

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

.account-import-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  background: #fff;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.26);
}

.account-import-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--admin-border);
}

.account-import-modal .modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.account-import-modal .modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  color: #64748b;
  background: #fff;
}

.account-import-modal .modal-tabs {
  display: flex;
  gap: 6px;
  margin: 16px 22px 0;
  padding: 4px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #f1f5f9;
}

.account-import-modal .modal-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  color: #475569;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.account-import-modal .modal-tab.active {
  color: #fff;
  background: var(--admin-accent);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.22);
}

.account-import-modal .modal-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-import-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 170px);
  overflow: auto;
  padding: 18px 22px 22px;
}

.account-import-modal .add-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-import-modal .section-desc {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.oauth-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.oauth-url-box {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.oauth-url-box input {
  min-width: 0;
}

.oauth-manual-input {
  flex-wrap: wrap;
}

.oauth-manual-input input {
  flex: 1 1 280px;
}

.token-input {
  min-height: 180px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.token-format-collapse {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #f8fafc;
}

.token-format-collapse-summary {
  padding: 10px 12px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.token-format {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.token-format-label {
  margin-bottom: 5px;
  color: #64748b;
  font-size: 12px;
}

.token-format-code {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
}

.file-drop {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 150px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  color: #475569;
  background: #f8fafc;
  cursor: pointer;
}

.file-drop .ti {
  font-size: 28px;
  color: var(--admin-accent);
}

.file-drop input {
  max-width: min(360px, calc(100% - 24px));
}

.add-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.add-status.success {
  color: #047857;
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
}

.add-status.loading {
  color: #075985;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
}

.add-status.warning {
  color: #b45309;
  border: 1px solid #fde68a;
  background: #fffbeb;
}

.add-status.error {
  color: #b91c1c;
  border: 1px solid #fecaca;
  background: #fef2f2;
}

.loading-spinner {
  animation: spin 0.9s linear infinite;
}

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

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

@media (max-width: 575px) {
  .usage-hero-header {
    flex-direction: column;
  }

  .usage-hero-header .btn {
    width: 100%;
  }

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

  .account-list-header {
    align-items: stretch;
    flex-direction: column;
  }

  .account-provider-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-provider-tabs {
    width: 100%;
  }

  .account-provider-tab {
    flex: 1 0 auto;
  }

  .account-header-actions,
  .account-stats-dropdown,
  .account-stats-button,
  .account-routing-control,
  .account-routing-dropdown,
  .account-routing-button,
  .account-action-panel,
  .account-auto-refresh {
    width: 100%;
  }

  .account-header-actions,
  .account-routing-control,
  .account-action-panel {
    justify-items: stretch;
  }

  .account-auto-refresh {
    justify-content: flex-start;
  }

  .account-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-card {
    padding: 18px;
  }

  .account-card-top {
    grid-template-columns: 22px minmax(0, 1fr) auto;
  }

  .account-actions {
    display: none;
  }

  .account-subscription-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-import-modal .modal-tabs {
    flex-wrap: wrap;
  }

  .account-import-modal .modal-tab {
    flex: 1 1 calc(50% - 6px);
  }

  .audit-header,
  .audit-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-toolbar,
  .audit-toolbar .btn,
  .audit-page-size,
  .audit-page-size .form-select {
    width: 100%;
  }

  .audit-pagination {
    justify-content: space-between;
  }

  .audit-group-item,
  .audit-group-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .audit-mini-detail {
    justify-self: start;
  }
}
