:root {
  --navy-950: #0b1630;
  --navy-900: #102042;
  --navy-800: #17315f;
  --blue-700: #2457d6;
  --blue-600: #3268e8;
  --blue-100: #eaf0ff;
  --indigo-600: #5a58d6;
  --green-600: #16845b;
  --green-100: #e8f7f0;
  --amber-600: #b46b08;
  --amber-100: #fff4dd;
  --red-600: #c73f4d;
  --red-100: #fdecef;
  --slate-900: #1b263d;
  --slate-700: #42506a;
  --slate-600: #5f6d84;
  --slate-500: #77849a;
  --slate-400: #9aa5b7;
  --slate-300: #c8cfdb;
  --slate-200: #e1e6ee;
  --slate-150: #e9edf3;
  --slate-100: #f2f5f9;
  --slate-50: #f7f9fc;
  --white: #ffffff;
  --sidebar-width: 258px;
  --shadow-sm: 0 1px 2px rgba(15, 30, 60, 0.05), 0 4px 12px rgba(15, 30, 60, 0.04);
  --shadow-md: 0 10px 28px rgba(12, 28, 61, 0.09);
  --radius-lg: 16px;
  --radius-md: 11px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--slate-900);
  background: var(--slate-50);
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

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

a {
  color: inherit;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  color: #dbe4f5;
  background:
    radial-gradient(circle at 0 0, rgba(70, 116, 218, 0.18), transparent 34%),
    linear-gradient(180deg, var(--navy-950), #0d1b38 68%, #0a152c);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.24s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 92px;
  padding: 22px 22px 19px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: var(--white);
  background: linear-gradient(145deg, #477cf0, #2451bd);
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(25, 73, 179, 0.35);
  font-size: 20px;
  font-weight: 800;
}

.brand strong {
  display: block;
  color: var(--white);
  font-size: 17px;
  letter-spacing: 0.02em;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: #91a2c1;
  font-size: 11px;
  white-space: nowrap;
}

.nav-list {
  display: grid;
  gap: 6px;
  padding: 20px 14px;
}

.nav-item {
  display: flex;
  min-height: 47px;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 0 14px;
  color: #aebbd2;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: 0.18s ease;
}

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

.nav-item.active {
  color: var(--white);
  background: linear-gradient(90deg, rgba(54, 104, 222, 0.96), rgba(44, 83, 179, 0.88));
  box-shadow: 0 8px 18px rgba(18, 58, 151, 0.24);
}

.nav-icon {
  display: grid;
  width: 24px;
  flex: 0 0 24px;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 16px 18px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-health {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.health-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  background: #d69a38;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(214, 154, 56, 0.12);
}

.health-dot.online {
  background: #36c58d;
  box-shadow: 0 0 0 4px rgba(54, 197, 141, 0.13);
}

.health-dot.offline {
  background: #ee6675;
  box-shadow: 0 0 0 4px rgba(238, 102, 117, 0.13);
}

.sidebar-health strong,
.sidebar-health span {
  display: block;
}

.sidebar-health strong {
  color: #e8eef9;
  font-size: 12px;
}

.sidebar-health span {
  color: #8697b7;
  font-size: 10px;
}

.docs-shortcut {
  display: block;
  margin-top: 11px;
  padding: 9px 10px;
  color: #9fb4db;
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
  text-decoration: none;
}

.docs-shortcut:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.workspace {
  display: flex;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--slate-200);
  backdrop-filter: blur(12px);
}

.topbar-title-group,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar-title-group {
  gap: 12px;
}

.topbar-actions {
  gap: 9px;
}

.eyebrow {
  margin: 0;
  color: var(--blue-600);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: -1px 0 0;
  color: var(--slate-900);
  font-size: 21px;
  line-height: 1.2;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  color: var(--slate-700);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  cursor: pointer;
}

.api-key-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 8px 0 12px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 9px;
}

.api-key-control span {
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.api-key-control input {
  width: 128px;
  padding: 5px 4px;
  color: var(--slate-800);
  background: transparent;
  border: 0;
  outline: 0;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: 0.18s ease;
}

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

.button-small {
  min-height: 38px;
  padding: 0 13px;
  font-size: 12px;
}

.button-primary {
  color: var(--white);
  background: var(--blue-600);
  border-color: var(--blue-600);
  box-shadow: 0 6px 14px rgba(50, 104, 232, 0.18);
}

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

.button-secondary {
  color: var(--slate-700);
  background: var(--white);
  border-color: var(--slate-200);
}

.button-secondary:hover {
  color: var(--blue-700);
  border-color: #b8c9ee;
}

.button-block {
  width: 100%;
}

.error-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 28px 0;
  padding: 12px 42px 12px 15px;
  color: #9b2835;
  background: var(--red-100);
  border: 1px solid #f5c8cf;
  border-radius: 10px;
  font-size: 13px;
}

.error-banner[hidden] {
  display: none;
}

.error-banner button {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 28px;
  height: 28px;
  color: #a73a47;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  transform: translateY(-50%);
}

.content {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: pageIn 0.22s ease;
}

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

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

.page-heading h2 {
  margin: 1px 0 3px;
  color: var(--slate-900);
  font-size: 25px;
  line-height: 1.3;
}

.page-heading p {
  margin: 0;
  color: var(--slate-600);
}

.section-kicker {
  color: var(--blue-600) !important;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reference-chip,
.result-count {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  color: var(--slate-600);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

.kpi-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  background: var(--white);
  border: 1px solid var(--slate-150);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.kpi-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 900;
}

.kpi-blue { color: #275bcf; background: #e9f0ff; }
.kpi-indigo { color: #5b55c9; background: #efedff; }
.kpi-green { color: #12734f; background: #e4f6ed; }
.kpi-amber { color: #9a5c08; background: #fff1d7; }
.kpi-red { color: #bd3645; background: #fde8eb; }
.kpi-slate { color: #4e5c73; background: #edf0f5; }

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

.kpi-content span,
.kpi-content strong,
.kpi-content small {
  display: block;
}

.kpi-content span {
  overflow: hidden;
  color: var(--slate-600);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-content strong {
  overflow: hidden;
  margin-top: 4px;
  color: var(--slate-900);
  font-size: clamp(16px, 1.3vw, 21px);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-content small {
  overflow: hidden;
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.dashboard-grid-chart {
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.85fr);
}

.panel {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--slate-150);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--slate-150);
}

.panel-header h3 {
  margin: 0;
  color: var(--slate-900);
  font-size: 15px;
}

.panel-header p {
  margin: 2px 0 0;
  color: var(--slate-500);
  font-size: 11px;
}

.panel-tag {
  padding: 5px 8px;
  color: var(--blue-700);
  background: var(--blue-100);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.text-button {
  color: var(--blue-600);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.text-button:hover {
  text-decoration: underline;
}

.chart-wrap {
  position: relative;
  height: 308px;
  padding: 15px 16px 9px;
}

.chart-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.department-bars {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.department-bar-row {
  display: grid;
  gap: 6px;
}

.department-bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--slate-700);
  font-size: 11px;
}

.department-bar-label strong {
  color: var(--slate-900);
  font-size: 11px;
}

.department-bar-track {
  overflow: hidden;
  height: 7px;
  background: var(--slate-100);
  border-radius: 999px;
}

.department-bar-fill {
  height: 100%;
  min-width: 3px;
  background: linear-gradient(90deg, #3268e8, #7396ef);
  border-radius: inherit;
}

.status-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 16px 4px;
}

.status-summary-item {
  padding: 9px 8px;
  background: var(--slate-50);
  border: 1px solid var(--slate-150);
  border-radius: 8px;
  text-align: center;
}

.status-summary-item span,
.status-summary-item strong {
  display: block;
}

.status-summary-item span {
  color: var(--slate-500);
  font-size: 9px;
}

.status-summary-item strong {
  margin-top: 1px;
  color: var(--slate-800);
  font-size: 15px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--slate-150);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--slate-500);
  background: #fafbfd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

td {
  color: var(--slate-700);
  font-size: 12px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfcff;
}

.compact-table th,
.compact-table td {
  padding: 11px 14px;
}

.compact-table td {
  font-size: 11px;
}

.empty-cell {
  height: 88px;
  color: var(--slate-500);
  text-align: center;
}

.cell-strong {
  color: var(--slate-900);
  font-weight: 700;
}

.cell-subtext {
  display: block;
  max-width: 260px;
  overflow: hidden;
  color: var(--slate-500);
  font-size: 10px;
  text-overflow: ellipsis;
}

.status-badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.status-green { color: #116f4c; background: var(--green-100); }
.status-blue { color: #2458c5; background: #e7efff; }
.status-amber { color: #965907; background: var(--amber-100); }
.status-red { color: #ad2f3e; background: var(--red-100); }
.status-gray { color: #647187; background: #edf0f5; }
.status-purple { color: #5b50b8; background: #eeebff; }

.progress-cell {
  min-width: 118px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--slate-600);
  font-size: 9px;
}

.progress-track {
  overflow: hidden;
  height: 6px;
  background: var(--slate-100);
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3268e8, #658cf0);
  border-radius: inherit;
}

.low-stock-row td {
  background: #fffafb;
}

.stock-shortage {
  color: var(--red-600);
  font-weight: 800;
}

.filter-panel {
  margin-bottom: 16px;
  padding: 17px;
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  gap: 11px;
  align-items: end;
}

.filter-form-compact {
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto;
}

.filter-form label,
.stack-form label {
  display: grid;
  gap: 6px;
}

.filter-form label > span,
.stack-form label > span {
  color: var(--slate-600);
  font-size: 10px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 39px;
  padding: 0 11px;
  color: var(--slate-800);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  outline: none;
  transition: 0.15s ease;
}

input::placeholder {
  color: #b0b9c8;
}

input:focus,
select:focus {
  border-color: #8eabea;
  box-shadow: 0 0 0 3px rgba(50, 104, 232, 0.09);
}

.filter-actions {
  display: flex;
  gap: 7px;
}

.checkbox-label {
  display: flex !important;
  min-height: 39px;
  align-items: center;
  gap: 8px !important;
  padding: 0 11px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
}

.checkbox-label input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--blue-600);
}

.checkbox-label span {
  color: var(--slate-700) !important;
  white-space: nowrap;
}

.purchase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.purchase-list-area {
  min-width: 0;
}

.purchase-form-panel {
  position: sticky;
  top: 98px;
}

.stack-form {
  display: grid;
  gap: 13px;
  padding: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
}

.calculated-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 13px;
  color: var(--slate-600);
  background: var(--slate-50);
  border: 1px dashed var(--slate-300);
  border-radius: 9px;
  font-size: 11px;
}

.calculated-total strong {
  color: var(--blue-700);
  font-size: 15px;
}

.form-help {
  margin: -3px 0 0;
  color: var(--slate-500);
  font-size: 10px;
  text-align: center;
}

.api-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 18px;
  padding: 28px;
  color: var(--white);
  background:
    radial-gradient(circle at 84% 0, rgba(88, 138, 255, 0.25), transparent 34%),
    linear-gradient(130deg, #102148, #173369);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

.api-hero-label {
  display: inline-block;
  margin-bottom: 8px;
  color: #9ab7f8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.api-hero h3 {
  margin: 0 0 9px;
  font-size: 20px;
  line-height: 1.45;
}

.api-hero p {
  margin: 0;
  color: #b7c6e2;
  font-size: 12px;
}

.api-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 20px 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
}

.api-flow span {
  padding: 8px 10px;
  color: #ecf2ff;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.api-flow b {
  color: #84a5ef;
  font-size: 10px;
  white-space: nowrap;
}

.api-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.info-card {
  padding: 18px;
}

.info-card span,
.info-card strong,
.info-card small {
  display: block;
}

.info-card span {
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.info-card strong {
  overflow-wrap: anywhere;
  margin-top: 6px;
  color: var(--slate-900);
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
}

.info-card strong a {
  color: var(--blue-600);
  text-decoration: none;
}

.info-card small {
  margin-top: 5px;
  color: var(--slate-500);
  font-size: 10px;
}

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

.code-card-full,
.status-code-panel {
  margin-bottom: 18px;
}

.copy-button {
  min-height: 29px;
  padding: 0 10px;
  color: var(--blue-700);
  background: var(--blue-100);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.copy-button:hover {
  background: #dce7ff;
}

pre {
  overflow: auto;
  min-height: 92px;
  max-height: 410px;
  margin: 0;
  padding: 18px;
  color: #d8e2f5;
  background: #101b31;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  white-space: pre-wrap;
  word-break: break-word;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.65;
}

.status-code-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.status-code-grid div {
  padding: 14px 9px;
  background: var(--slate-50);
  border: 1px solid var(--slate-150);
  border-radius: 9px;
  text-align: center;
}

.status-code-grid b,
.status-code-grid span {
  display: block;
}

.status-code-grid b {
  font-family: Consolas, monospace;
  font-size: 17px;
}

.status-code-grid span {
  margin-top: 4px;
  color: var(--slate-600);
  font-size: 9px;
}

.http-success { color: var(--green-600); }
.http-warning { color: var(--amber-600); }
.http-danger { color: var(--red-600); }

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
  padding: 18px 28px 24px;
  color: var(--slate-500);
  border-top: 1px solid var(--slate-150);
  font-size: 10px;
  text-align: center;
}

.footer strong {
  color: var(--slate-700);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 48px));
  padding: 12px 15px;
  color: var(--white);
  background: var(--slate-900);
  border-radius: 9px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 0.22s ease;
  font-size: 12px;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 1450px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-form {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

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

@media (max-width: 1160px) {
  :root {
    --sidebar-width: 226px;
  }

  .brand {
    padding-inline: 17px;
  }

  .brand span {
    font-size: 10px;
  }

  .content,
  .topbar {
    padding-left: 20px;
    padding-right: 20px;
  }

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

  .purchase-layout {
    grid-template-columns: 1fr;
  }

  .purchase-form-panel {
    position: static;
  }

  .api-hero {
    grid-template-columns: 1fr;
  }

  .status-code-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 258px;
    transform: translateX(-100%);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    background: rgba(5, 13, 29, 0.46);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace {
    margin-left: 0;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
  }

  .topbar-actions .api-key-control {
    display: none;
  }

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

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

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

@media (max-width: 680px) {
  .topbar {
    min-height: 70px;
    padding: 10px 14px;
  }

  .topbar h1 {
    font-size: 17px;
  }

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

  .topbar-actions .button-primary {
    min-height: 36px;
    padding: 0 10px;
    font-size: 11px;
  }

  .content {
    padding: 20px 14px;
  }

  .error-banner {
    margin: 12px 14px 0;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 16px;
  }

  .page-heading h2 {
    font-size: 21px;
  }

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

  .kpi-card {
    padding: 15px;
  }

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

  .filter-actions {
    justify-content: stretch;
  }

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

  .api-info-grid {
    grid-template-columns: 1fr;
  }

  .api-hero {
    padding: 20px;
  }

  .api-flow {
    align-items: stretch;
    flex-direction: column;
  }

  .api-flow b {
    transform: rotate(90deg);
    text-align: center;
  }

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

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

  .footer {
    align-items: center;
    flex-direction: column;
    padding-inline: 14px;
  }
}
