:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #dae3ef;
  --brand: #0f8b8d;
  --brand-dark: #0b6567;
  --accent: #f2a541;
  --danger: #c2413b;
  --shadow: 0 14px 34px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px 18px;
  background: #101828;
  color: white;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-logo {
  display: block;
  width: auto;
  height: 74px;
  object-fit: contain;
}

.sidebar .brand {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: white;
}

.sidebar .brand-logo {
  width: 100%;
  height: auto;
  max-height: 116px;
}

.brand small,
.eyebrow,
.muted,
.list small,
.table small,
.graphs small,
.product-card small {
  color: var(--muted);
}

.sidebar .brand small {
  color: var(--muted);
}

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

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  color: #d0d5dd;
  background: transparent;
}

.nav-item.active,
.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

main {
  padding: 28px;
  overflow: auto;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

.primary,
.ghost,
.danger {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
}

.primary {
  color: white;
  background: var(--brand);
}

.primary:hover {
  background: var(--brand-dark);
}

.ghost {
  color: var(--ink);
  background: #e8eef6;
}

.danger {
  color: white;
  background: var(--danger);
}

.view {
  display: none;
}

.hidden {
  display: none !important;
}

.view.active {
  display: block;
}

.stats,
.split,
.server-layout,
.toolbar,
.product-grid,
.graphs,
.client-grid {
  display: grid;
  gap: 16px;
}

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

.stats article,
.panel,
.product-card,
.login-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stats article {
  padding: 18px;
}

.stats span {
  display: block;
  font-size: 32px;
  font-weight: 800;
}

.split,
.server-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.panel,
.login-panel {
  padding: 18px;
}

.list,
.table,
.server-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

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

.invoice-actions {
  min-width: 190px;
}

.icon-danger {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--danger);
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.icon-danger:hover {
  filter: brightness(0.94);
}

.toolbar {
  grid-template-columns: 280px minmax(220px, 1fr);
  margin-bottom: 16px;
}

.profile-form .toolbar {
  grid-template-columns: minmax(220px, 1fr) auto;
  margin-bottom: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
}

textarea {
  min-height: 82px;
  resize: vertical;
}

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

.product-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.price {
  font-size: 26px;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: #0f5132;
  background: #d1f2df;
  font-size: 12px;
  font-weight: 700;
}

.badge.pending {
  color: #7a4a00;
  background: #ffedc2;
}

.badge.cancelled {
  color: #842029;
  background: #f8d7da;
}

.form-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.profile-form h3 {
  margin: 8px 0 0;
  font-size: 16px;
}

.section-title {
  display: grid;
  gap: 4px;
}

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

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

.check-row input {
  width: auto;
}

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

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

.choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: start;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  text-align: left;
  color: var(--ink);
  background: white;
}

.choice-card span {
  grid-row: span 2;
  width: 28px;
  height: 28px;
  border: 3px solid #7b8797;
  border-radius: 50%;
}

.choice-card.active {
  border-color: #7cc7ff;
  box-shadow: 0 0 0 3px rgba(14, 142, 229, 0.14);
}

.choice-card.active span {
  border: 8px solid #0e8ee5;
}

.choice-card small {
  color: var(--muted);
}

.mode-row,
.modal-actions {
  display: flex;
  gap: 10px;
}

.mode {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--muted);
  background: white;
}

.mode.active {
  color: white;
  border-color: var(--brand);
  background: var(--brand);
}

.email-account-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 24, 40, 0.62);
}

.email-account-panel {
  position: relative;
  width: min(100%, 760px);
  max-height: min(92vh, 900px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 28px 70px rgba(16, 24, 40, 0.22);
}

.confirm-panel {
  width: min(100%, 520px);
}

.confirm-summary {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.confirm-summary small {
  color: var(--muted);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #eef2f7;
  color: var(--ink);
}

.period-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.mailbox-pill {
  width: fit-content;
  border: 1px solid #7cc7ff;
  border-radius: 999px;
  padding: 8px 14px;
  color: #0e8ee5;
  background: #eef8ff;
  font-weight: 800;
}

.email-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(140px, auto);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.email-user-row input {
  border: 0;
  border-radius: 0;
}

.email-user-row span,
.email-user-row strong {
  padding: 0 12px;
}

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

.instruction-grid,
.ssl-output {
  display: grid;
  gap: 10px;
}

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

.instruction-grid div,
.ssl-output label {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.instruction-grid ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.ssl-output span {
  font-weight: 700;
}

.ssl-output textarea {
  min-height: 132px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.triple {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.server-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.server-card.active {
  border-color: var(--brand);
  box-shadow: inset 4px 0 0 var(--brand);
}

.kvm {
  margin-top: 16px;
}

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

.terminal {
  min-height: 160px;
  border-radius: 8px;
  padding: 14px;
  background: #111827;
  color: #a7f3d0;
  font-family: "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
}

.graphs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.graphs div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

canvas {
  width: 100%;
  height: 80px;
}

.client-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
}

.client-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.client-header .brand {
  margin-bottom: 0;
}

.client-header .brand small {
  display: none;
}

.client-grid {
  grid-template-columns: 340px 1fr;
}

.client-panel {
  min-width: 0;
}

.client-summary {
  margin-bottom: 16px;
}

.client-workspace {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.client-menu {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.client-tab {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  color: var(--ink);
  background: transparent;
}

.client-tab.active,
.client-tab:hover {
  color: white;
  background: var(--brand);
}

.client-content {
  min-width: 0;
}

.client-view {
  display: none;
}

.client-view.active {
  display: grid;
}

.client-view.profile-form,
#profileSection .profile-form {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#profileSection {
  gap: 14px;
}

.login-panel {
  display: grid;
  gap: 12px;
  height: fit-content;
}

@media (max-width: 960px) {
  .shell,
  .stats,
  .split,
  .server-layout,
  .product-grid,
  .toolbar,
    .graphs,
    .client-grid,
    .client-workspace,
    .form-columns,
    .settings-grid,
    .choice-grid,
    .instruction-grid,
    .period-row,
    .email-user-row,
    .row {
    grid-template-columns: 1fr;
  }

  .client-menu {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-logo {
    height: 56px;
  }

  .sidebar .brand-logo {
    height: auto;
  }

  .client-tab {
    text-align: center;
  }

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

  .sidebar {
    min-height: auto;
  }
}
