* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  background: #eef0f3;
  color: #0f172a;
}

.app-shell {
  width: min(1280px, 96vw);
  margin: 0 auto;
  padding: 8px 0 10px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.brand {
  margin: 0;
  font-size: 14px !important;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0;
}

.sub-brand {
  margin: 4px 0 0;
  font-size: 11px !important;
  color: #334155;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  line-height: 1.3;
}

.nav-tabs {
  display: flex;
  gap: 8px;
}

.nav-tabs a {
  text-decoration: none;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  background: #e5e7eb;
  padding: 8px 12px;
  font-size: 11px !important;
  font-weight: 700;
}

.nav-tabs a.active {
  background: #0f1c3d;
  color: #fff;
  border-color: #0f1c3d;
}

.nav-tabs a.danger {
  background: #e11d48;
  color: #fff;
  border-color: #e11d48;
}

.panel {
  border: 1px solid #c7cfdb;
  background: #f8fafc;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
}

.panel h2, .panel h3 {
  margin: 0 0 10px;
  font-size: 14px !important;
}

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

.metric h4 {
  margin: 0;
  font-size: 11px !important;
  color: #334155;
}

.metric p {
  margin: 8px 0 0;
  font-size: 16px !important;
  font-weight: 900;
}

.split-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 12px;
}

.bar-row {
  margin-bottom: 16px;
}

.bar-row .row-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 6px;
}

.bar {
  width: 100%;
  height: 14px;
  background: #dbe1ea;
  border-radius: 999px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: #6366f1;
}

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

label {
  display: block;
  font-size: 11px;
  margin-bottom: 6px;
}

input, select {
  width: 100%;
  border: 1px solid #bfccde;
  border-radius: 12px;
  background: #fff;
  font-size: 12px !important;
  padding: 8px 9px;
}

.button,
button {
  border: 1px solid #0f172a;
  background: #fff;
  color: #0f172a;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 11px !important;
  font-weight: 700;
  cursor: pointer;
}

.button.primary,
button.primary {
  background: #0f1c3d;
  color: #fff;
  border-color: #0f1c3d;
}

.button.danger,
button.danger {
  background: #c81e1e;
  color: #fff;
  border-color: #c81e1e;
}

.button:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.pos-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 12px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.tile {
  border: 1px solid #bcc8de;
  background: #eef2ff;
  border-radius: 10px;
  padding: 12px;
  text-align: left;
}

.tile strong {
  display: block;
  font-size: 12px;
}

.tile span {
  font-size: 11px;
}

.tile-actions {
  margin-top: 8px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #d3dbe7;
  font-size: 11px;
}

th {
  font-size: 11px;
  color: #1e3a5f;
}

.cart-summary {
  font-size: 12px;
  margin: 12px 0;
}

.status {
  margin: 8px 0;
  font-size: 11px;
  color: #334155;
}

.muted {
  color: #64748b;
}

.alert {
  color: #b91c1c;
  font-weight: 700;
}

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

.row > * {
  flex: 1;
}

.app-footer {
  text-align: center;
  font-size: 11px;
  color: #334155;
  margin-top: 10px;
  padding-bottom: 8px;
}

.login-shell {
  width: min(700px, 90vw);
  margin: 60px auto;
}

.login-shell h2 {
  margin: 0 0 12px;
  font-size: 16px !important;
}

.small {
  font-size: 11px;
}

.success {
  color: #166534;
}

@media (max-width: 1200px) {
  .brand {
    font-size: 13px !important;
  }

  .sub-brand,
  .nav-tabs a,
  label,
  input,
  select,
  button,
  .button,
  th,
  td,
  .status,
  .app-footer,
  .tile strong,
  .tile span,
  .bar-row .row-head,
  .metric h4 {
    font-size: 11px !important;
  }

  .metric p {
    font-size: 15px !important;
  }

  .split-grid,
  .metrics-grid,
  .pos-grid,
  .form-grid,
  .tiles {
    grid-template-columns: 1fr;
  }
}
