:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f6f8;
  color: #162032;
}

* {
  box-sizing: border-box;
}

body {
  background: #f3f6f8;
  line-height: 1.45;
  margin: 0;
  min-height: 100vh;
}

a {
  color: #0f766e;
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  min-height: 100vh;
}

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

.sidebar {
  background: #fbfcfd;
  border-right: 1px solid #d7dee7;
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-height: 100vh;
  padding: 24px;
  position: sticky;
  top: 0;
}

.sidebar-header {
  align-items: center;
  display: flex;
  gap: 12px;
}

.sidebar-header span,
.sidebar-footer span {
  color: #64748b;
  display: block;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.brand-mark {
  align-items: center;
  background: #134e4a;
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  border-radius: 6px;
  color: #334155;
  display: block;
  font-weight: 800;
  padding: 10px 12px;
}

.nav-link:hover {
  background: #f1f5f9;
  text-decoration: none;
}

.nav-link.is-active {
  background: #e7f5f2;
  box-shadow: inset 3px 0 0 #0f766e;
  color: #134e4a;
}

.nav-divider {
  border-top: 1px solid #e2e8f0;
  margin: 12px 0 6px;
}

.nav-label {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 0 12px 4px;
  text-transform: uppercase;
}

.sidebar-footer {
  border-top: 1px solid #e2e8f0;
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}

.page-content {
  margin: 0 auto;
  max-width: 1320px;
  padding: 34px 32px 52px;
  width: 100%;
}

.page-heading {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.page-heading h1 {
  color: #111827;
  font-size: 2rem;
  margin: 6px 0 6px;
}

.page-heading p {
  color: #64748b;
  margin: 0;
  max-width: 680px;
}

.eyebrow {
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.heading-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.secondary-link {
  align-items: center;
  background: #ffffff;
  border: 1px solid #bfccd8;
  border-radius: 6px;
  color: #263548;
  display: inline-flex;
  font-weight: 800;
  min-height: 38px;
  padding: 8px 12px;
}

.secondary-link.compact-link {
  min-height: 34px;
  padding: 6px 10px;
}

.secondary-link:hover {
  border-color: #8393a4;
  text-decoration: none;
}

.auth-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
}

.auth-panel {
  background: #ffffff;
  border: 1px solid #d7dee7;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(22, 32, 50, 0.12);
  max-width: 420px;
  padding: 32px;
  width: 100%;
}

.brand {
  color: #0f766e;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  font-size: 1.8rem;
  line-height: 1.2;
  margin: 8px 0 24px;
}

.form-stack {
  display: grid;
  gap: 10px;
}

label {
  color: #344256;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid #b9c4d0;
  border-radius: 6px;
  color: #162032;
  font: inherit;
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
  outline: none;
}

.primary-button,
.secondary-button,
.danger-button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 44px;
  padding: 10px 16px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.secondary-link:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: #0f766e;
  color: #ffffff;
  margin-top: 8px;
  width: 100%;
}

.primary-button:hover {
  background: #115e59;
}

.primary-button.compact {
  margin-top: 0;
  min-height: 38px;
  width: auto;
}

.secondary-button {
  background: #ffffff;
  border: 1px solid #bfccd8;
  color: #263548;
}

.secondary-button:hover {
  border-color: #8393a4;
}

.danger-button {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
  min-height: 38px;
}

.danger-button:hover {
  background: #ffe4e6;
}

.alert {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  color: #9f1239;
  font-size: 0.94rem;
  margin-bottom: 18px;
  padding: 12px;
}

.auth-link {
  color: #64748b;
  margin: 22px 0 0;
  text-align: center;
}

.dashboard {
  margin: 0 auto;
  max-width: 1040px;
  padding: 32px 18px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 26px;
}

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

.info-card {
  background: #ffffff;
  border: 1px solid #d8e1e8;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 20px;
}

.info-card span {
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.info-card strong {
  overflow-wrap: anywhere;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 22px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid #d7dee7;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(22, 32, 50, 0.05);
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 20px;
}

.metric-card span {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  color: #162032;
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.flash {
  border-radius: 6px;
  font-weight: 700;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.flash.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.flash.error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

.flash.info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.dashboard-section,
.panel {
  background: #ffffff;
  border: 1px solid #d7dee7;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(22, 32, 50, 0.05);
  margin-top: 18px;
  padding: 22px;
}

.dashboard-section.narrow,
.narrow-panel {
  max-width: 620px;
}

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

.section-heading h2,
.panel-header h2 {
  font-size: 1.2rem;
  margin: 0 0 4px;
}

.section-heading p,
.panel-header p,
.empty-state,
.request-card span,
.request-card p {
  color: #64748b;
  margin: 0;
}

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

.action-tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 18px;
}

.action-tile:hover {
  border-color: #94a3b8;
  text-decoration: none;
}

.action-tile span {
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.action-tile strong {
  color: #162032;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap.spaced {
  margin-top: 22px;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #475569;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.inline-form {
  align-items: center;
  display: flex;
  gap: 10px;
}

.inline-form select {
  min-width: 140px;
}

.inline-form .secondary-button {
  min-height: 38px;
}

.badge {
  background: #e0f2fe;
  border-radius: 999px;
  color: #075985;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 9px;
}

.badge.muted {
  background: #f1f5f9;
  color: #475569;
}

.badge.warning {
  background: #fef2f2;
  color: #b91c1c;
}

.table-subtext {
  color: #64748b;
  display: block;
  font-size: 0.84rem;
  margin-top: 3px;
  max-width: 360px;
  overflow-wrap: anywhere;
}

.account-panel-header {
  gap: 18px;
}

.account-search {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: min(420px, 100%);
}

.account-search input {
  min-height: 40px;
}

.account-search .secondary-button {
  min-height: 40px;
}

.account-table {
  min-width: 1060px;
}

.account-table td {
  vertical-align: top;
}

.badge.info {
  background: #eef2ff;
  color: #3730a3;
}

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

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

.wide-field {
  grid-column: span 3;
}

.two-column .wide-field {
  grid-column: span 2;
}

.checkbox-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.checkbox-row input {
  min-height: auto;
  width: auto;
}

.form-submit {
  align-self: end;
  justify-self: start;
  margin-top: 0;
  width: auto;
}

.inventory-empty {
  margin-top: 18px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.server-card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}

.server-card {
  background: #ffffff;
  border: 1px solid #d7dee7;
  border-left: 4px solid #0f766e;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(22, 32, 50, 0.05);
  display: grid;
  gap: 16px;
  min-height: 320px;
  padding: 18px;
}

.server-card.has-warning {
  border-left-color: #d97706;
}

.server-card.is-muted {
  border-left-color: #94a3b8;
}

.server-card-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.server-card-header span {
  color: #64748b;
  display: block;
  font-size: 0.86rem;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.server-title {
  color: #111827;
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 900;
}

.badge-stack {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 112px;
}

.server-facts {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.server-facts div {
  background: #ffffff;
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
}

.server-facts span,
.resource-row span,
.server-card-note span,
.resource-tile span {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.server-facts strong,
.server-card-note strong {
  color: #162032;
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.resource-stack {
  display: grid;
  gap: 10px;
}

.resource-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 72px minmax(90px, 1fr) 58px;
}

.resource-row strong {
  color: #162032;
  font-size: 0.86rem;
  text-align: right;
}

.meter {
  background: #e5eaf0;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.meter span {
  background: linear-gradient(90deg, #0f766e, #2563eb);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 0;
}

.meter.large {
  height: 10px;
}

.server-card-note {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
}

.server-card-actions {
  align-items: center;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
}

.server-card-actions .secondary-link,
.server-card-actions .secondary-button {
  min-height: 38px;
}

.resource-panel {
  margin-bottom: 18px;
}

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

.resource-tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 108px;
  padding: 16px;
}

.resource-tile strong {
  color: #111827;
  font-size: 1.35rem;
}

.detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.45fr);
}

.detail-list {
  display: grid;
  gap: 10px;
  grid-template-columns: 140px minmax(0, 1fr);
  margin: 0;
}

.detail-list dt {
  color: #64748b;
  font-weight: 900;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.panel-action {
  border-top: 1px solid #e2e8f0;
  margin-top: 18px;
  padding-top: 18px;
}

.request-list {
  display: grid;
  gap: 12px;
}

.request-card {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px;
}

.request-card div {
  display: grid;
  gap: 4px;
}

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

.mini-history {
  border-top: 1px solid #e2e8f0;
  margin-top: 22px;
  padding-top: 18px;
}

.mini-history h3 {
  font-size: 1rem;
  margin: 0 0 10px;
}

.history-row {
  align-items: center;
  border-top: 1px solid #eef2f7;
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
}

.history-list .history-row:first-child {
  border-top: 0;
  padding-top: 0;
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

  .page-content {
    padding: 24px 16px 36px;
  }

  .auth-panel {
    padding: 24px;
  }

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

  .dashboard-grid,
  .metric-grid,
  .action-grid,
  .detail-grid,
  .resource-overview {
    grid-template-columns: 1fr;
  }

  .dashboard-section,
  .panel {
    padding: 18px;
  }

  .request-card,
  .inline-form,
  .checkbox-row,
  .account-search {
    align-items: stretch;
    flex-direction: column;
  }

  .request-actions {
    justify-content: flex-start;
  }

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

  .wide-field,
  .two-column .wide-field {
    grid-column: auto;
  }

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

  .heading-actions {
    justify-content: flex-start;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .server-card-grid {
    grid-template-columns: 1fr;
  }

  .server-card-header,
  .server-card-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .badge-stack {
    align-items: flex-start;
  }

  .server-facts {
    grid-template-columns: 1fr;
  }

  .resource-row {
    grid-template-columns: 68px minmax(80px, 1fr) 54px;
  }
}
