:root {
  color-scheme: dark;
  --brand-black: #0D1117;
  --surface: #3A4858;
  --accent: #6496B4;
  --muted: #8C9DB5;
  --brand-white: #E8EDF2;
  --border: rgba(100, 150, 180, .42);
  --border-subtle: rgba(140, 157, 181, .22);
  --success: #5E9E79;
  --error: #CA6C6C;
  --shell-width: 1180px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--brand-black); }

body {
  min-width: 320px;
  margin: 0;
  background-color: var(--brand-black);
  background-image: radial-gradient(circle at 1px 1px, rgba(140, 157, 181, .18) 1px, transparent 0);
  background-size: 32px 32px;
  color: var(--brand-white);
  font-family: "Liberation Sans", Helvetica, Arial, sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }
h1, h2, p { margin-top: 0; }
h1, h2 { letter-spacing: -.025em; }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 20; transform: translateY(-160%);
  border: 1px solid var(--accent); background: var(--brand-black); color: var(--brand-white); padding: 10px 14px;
}
.skip-link:focus { transform: translateY(0); }

.shell { width: min(var(--shell-width), calc(100% - 48px)); margin: 0 auto; }

.auth-view { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.public-header {
  min-height: 104px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--brand-white); text-decoration: none; }
.brand img { display: block; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: "Liberation Mono", "Courier New", monospace; font-size: 1.16rem; letter-spacing: .04em; }
.brand small, .environment-label, .eyebrow {
  color: var(--accent); font-family: "Liberation Mono", "Courier New", monospace;
  font-size: .71rem; font-weight: 700; letter-spacing: .12em;
}
.brand small { margin-top: 4px; }
.environment-label { border: 1px solid var(--border); padding: 8px 10px; }
.eyebrow { margin: 0 0 14px; }

.auth-layout {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); align-items: center;
  gap: clamp(48px, 10vw, 148px); padding: 70px 0;
}
.intro-panel { max-width: 680px; }
.intro-panel h1 { max-width: 650px; margin-bottom: 24px; font-size: clamp(2.65rem, 6vw, 5rem); line-height: .98; }
.lead { max-width: 580px; color: var(--muted); font-size: 1.16rem; line-height: 1.65; }
.capability-list { display: grid; gap: 17px; margin: 38px 0 0; padding: 0; list-style: none; }
.capability-list li {
  display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px;
  padding-bottom: 17px; border-bottom: 1px solid var(--border-subtle);
}
.capability-list span { color: var(--accent); font-family: "Liberation Mono", "Courier New", monospace; font-weight: 700; }

.login-panel, .information-card, .metric-card, .table-wrap {
  border: 1px solid var(--border); background: rgba(13, 17, 23, .92);
}
.login-panel { padding: clamp(28px, 4vw, 46px); }
.panel-heading { margin-bottom: 30px; }
.panel-heading h2 { margin-bottom: 10px; font-size: 1.8rem; }
.panel-heading p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.5; }
form { display: grid; gap: 10px; }
label { margin-top: 8px; color: var(--muted); font-size: .86rem; font-weight: 700; }
input {
  width: 100%; min-height: 46px; border: 1px solid var(--border-subtle); border-radius: 0; outline: none;
  background: rgba(58, 72, 88, .32); color: var(--brand-white); padding: 10px 12px;
}
input:focus { border-color: var(--accent); }
.primary-button, .secondary-button, .text-button { min-height: 46px; border-radius: 0; font-weight: 700; }
.primary-button {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--brand-black); padding: 10px 15px;
}
.primary-button:hover, .primary-button:focus-visible { background: var(--brand-white); border-color: var(--brand-white); }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .65; }
.secondary-button { border: 1px solid var(--border); background: transparent; color: var(--brand-white); padding: 10px 15px; }
.secondary-button:hover, .secondary-button:focus-visible { border-color: var(--accent); color: var(--accent); }
.form-feedback { min-height: 1.3em; margin: 4px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.form-feedback.error { color: var(--error); }
.form-feedback.success { color: var(--success); }
.public-footer {
  display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border-subtle);
  color: var(--muted); font-family: "Liberation Mono", "Courier New", monospace; font-size: .7rem; letter-spacing: .08em; padding: 25px 0;
}

.app-view { min-height: 100vh; display: grid; grid-template-columns: 262px minmax(0, 1fr); background: var(--brand-black); }
.sidebar {
  min-height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--border-subtle);
  background: rgba(13, 17, 23, .96); padding: 28px 20px;
}
.brand-sidebar { padding: 0 8px 28px; border-bottom: 1px solid var(--border-subtle); }
.navigation { display: grid; gap: 6px; margin-top: 26px; }
.nav-item {
  display: flex; gap: 12px; width: 100%; border: 1px solid transparent; background: transparent;
  color: var(--muted); padding: 12px; text-align: left;
}
.nav-item:hover, .nav-item:focus-visible, .nav-item.active { border-color: var(--border); background: rgba(100, 150, 180, .12); color: var(--brand-white); }
.nav-item b { color: var(--accent); font-family: "Liberation Mono", "Courier New", monospace; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 12px 8px 0; color: var(--muted); font-size: .84rem; }
.status-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.app-main { min-width: 0; padding: 38px clamp(24px, 4vw, 66px) 64px; }
.app-header, .section-header, .user-tools, .filter-bar, .flow-steps { display: flex; align-items: center; }
.app-header, .section-header { justify-content: space-between; gap: 24px; }
.app-header { border-bottom: 1px solid var(--border-subtle); padding-bottom: 27px; }
.app-header h1 { margin-bottom: 0; font-size: clamp(1.8rem, 3vw, 2.65rem); }
.user-tools { gap: 18px; }
.user-name { color: var(--muted); font-family: "Liberation Mono", "Courier New", monospace; font-size: .85rem; }
.text-button { min-height: auto; border: 0; background: transparent; color: var(--accent); padding: 5px 0; }
.text-button:hover, .text-button:focus-visible { color: var(--brand-white); text-decoration: underline; }
.content-panel { padding-top: 38px; }
.section-header h2 { margin-bottom: 6px; font-size: 1.5rem; }
.section-header p { margin-bottom: 0; color: var(--muted); line-height: 1.5; }
code { color: var(--accent); font-family: "Liberation Mono", "Courier New", monospace; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 20px; }
.metric-card { min-height: 142px; padding: 22px; }
.metric-card span { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.metric-card strong { display: block; margin-top: 18px; color: var(--brand-white); font-family: "Liberation Mono", "Courier New", monospace; font-size: 2rem; }
.information-card { margin-top: 28px; padding: clamp(22px, 3vw, 34px); }
.information-card h2 { margin-bottom: 10px; font-size: 1.35rem; }
.information-card > p:not(.eyebrow) { max-width: 790px; margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.flow-steps { flex-wrap: wrap; gap: 11px; margin-top: 24px; color: var(--brand-white); font-family: "Liberation Mono", "Courier New", monospace; font-size: .82rem; }
.flow-steps span { border: 1px solid var(--border); padding: 8px 10px; }
.flow-steps b { color: var(--accent); }
.filter-bar { flex-wrap: wrap; gap: 10px; margin-top: 22px; padding: 16px; border: 1px solid var(--border-subtle); background: rgba(58, 72, 88, .2); }
.filter-bar label { margin: 0 0 0 2px; }
.filter-bar input { width: 166px; min-height: 40px; }
.compact-button { min-height: 40px; margin: 0; }
.table-wrap { width: 100%; overflow-x: auto; margin-top: 16px; }
table { width: 100%; min-width: 780px; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--border-subtle); padding: 14px 16px; text-align: left; vertical-align: top; }
th { color: var(--accent); font-family: "Liberation Mono", "Courier New", monospace; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
td { color: var(--muted); font-size: .9rem; }
td.description { max-width: 360px; color: var(--brand-white); }
.amount-column, td.amount { text-align: right; font-family: "Liberation Mono", "Courier New", monospace; white-space: nowrap; }
.empty-table-cell { color: var(--muted); text-align: center; }

@media (max-width: 820px) {
  .auth-layout { grid-template-columns: 1fr; gap: 44px; padding: 52px 0; }
  .login-panel { max-width: 580px; }
  .app-view { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; border-right: 0; border-bottom: 1px solid var(--border-subtle); padding: 16px; }
  .brand-sidebar { padding: 0 4px 15px; }
  .navigation { display: flex; overflow-x: auto; margin-top: 14px; }
  .nav-item { flex: 0 0 auto; width: auto; }
  .sidebar-footer { display: none; }
}

@media (max-width: 580px) {
  .shell { width: min(100% - 32px, var(--shell-width)); }
  .public-header { min-height: 86px; }
  .environment-label { display: none; }
  .intro-panel h1 { font-size: 2.55rem; }
  .public-footer, .app-header, .section-header { align-items: flex-start; flex-direction: column; }
  .public-footer { font-size: .62rem; }
  .app-main { padding: 28px 16px 42px; }
  .user-tools { width: 100%; justify-content: space-between; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar input { width: 100%; }
}
