*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #0E0C09;
  --sidebar: #0B0A07;
  --surface: #161310;
  --border:  rgba(240,237,232,0.08);
  --accent:  #F0B429;
  --text:    #F0EDE8;
  --muted:   rgba(240,237,232,0.38);
  --error:   #ef4444;
}

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
}

body {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 16px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
}

.sidebar-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  object-fit: cover;
  flex-shrink: 0;
}

.logo-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  transition: color .15s, background .15s;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(240,237,232,0.04);
}

.nav-item.active {
  color: var(--text);
  background: rgba(240,237,232,0.06);
}

.nav-item.disabled {
  opacity: .35;
  pointer-events: none;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  width: 100%;
  transition: color .15s, background .15s;
}

.logout-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.logout-btn:hover {
  color: var(--error);
  background: rgba(239,68,68,0.06);
}

/* ── Content ── */

.content {
  margin-left: 220px;
  flex: 1;
  padding: 48px 56px 80px;
  max-width: 780px;
}

/* ── Loading ── */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
}

.loading-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(240,237,232,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Page ── */

.page {
  animation: fadeUp .45s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header {
  margin-bottom: 36px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.page-sub {
  font-size: 13px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
}

/* ── Status cards ── */

.cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
}

.card-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.card-value {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.card-value.active  { color: #4ade80; }
.card-value.warning { color: var(--accent); }
.card-value.error   { color: var(--error); }

.card-meta {
  font-size: 12px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
}

/* ── Actions ── */

.section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}

.actions {
  display: flex;
  flex-direction: column;
}

.action-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--surface);
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  cursor: pointer;
  transition: background .15s;
}

.action-row:hover { background: rgba(240,237,232,0.03); }

a.action-row { color: inherit; text-decoration: none; }

.action-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}

.action-left svg {
  width: 16px;
  height: 16px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.chevron {
  width: 16px;
  height: 16px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s cubic-bezier(0.16,1,0.3,1);
  flex-shrink: 0;
}

.chevron.open { transform: rotate(180deg); }
.chevron.rotate-left { transform: rotate(-90deg); }

/* Expandable password section */

.action-expand {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s cubic-bezier(0.16,1,0.3,1);
}

.action-expand.open {
  grid-template-rows: 1fr;
}

.expand-inner {
  overflow: hidden;
  padding: 0 18px;
  transition: padding .3s cubic-bezier(0.16,1,0.3,1);
}

.action-expand.open .expand-inner {
  padding: 0 18px 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.field-row input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s;
}

.field-row input:focus { border-color: rgba(240,237,232,0.2); }
.field-row input::placeholder { color: var(--muted); }

.expand-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.expand-error {
  font-size: 12.5px;
  color: var(--error);
  min-height: 16px;
}

.btn-gold {
  padding: 8px 18px;
  background: var(--accent);
  border: none;
  border-radius: 7px;
  color: #0E0C09;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  flex-shrink: 0;
}

.btn-gold:hover { opacity: .88; }
.btn-gold:disabled { opacity: .4; cursor: not-allowed; }

.reset-info {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-danger {
  padding: 8px 18px;
  background: transparent;
  border: 1px solid rgba(239,68,68,.4);
  border-radius: 7px;
  color: #ef4444;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}

.btn-danger:hover {
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.7);
}

.btn-danger:disabled { opacity: .4; cursor: not-allowed; }

/* ── Docs ── */

.doc-list-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.doc-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.doc-list-item:hover {
  background: rgba(240,237,232,0.035);
  border-color: rgba(240,237,232,0.12);
}

.doc-list-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: rgba(240,237,232,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-list-icon svg {
  width: 17px;
  height: 17px;
  stroke: rgba(240,237,232,0.5);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doc-list-text { flex: 1; min-width: 0; }

.doc-list-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.doc-list-desc {
  font-size: 12.5px;
  color: var(--muted);
}

.doc-list-chevron {
  width: 15px;
  height: 15px;
  stroke: rgba(240,237,232,0.18);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Detail view */

.doc-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
  transition: color .15s;
}

.doc-back:hover { color: var(--text); }

.doc-back svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doc-detail-section { display: none; }

.doc-coming-soon {
  padding: 52px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* Content cards */

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 28px;
  animation: fadeUp .3s cubic-bezier(0.16,1,0.3,1) both;
}

.doc-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.doc-step {
  display: flex;
  gap: 14px;
}

.doc-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(240,180,41,0.1);
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.doc-step-body { flex: 1; min-width: 0; }

.doc-step-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}

.doc-step-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.doc-step-desc strong { color: rgba(240,237,232,0.6); font-weight: 500; }

.doc-inline {
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  background: rgba(240,237,232,0.06);
  border: 1px solid rgba(240,237,232,0.08);
  border-radius: 4px;
  padding: 1px 5px;
  color: rgba(240,237,232,0.65);
}

.doc-code {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: rgba(240,237,232,0.45);
  line-height: 1.75;
}

.doc-note {
  margin-top: 10px;
  padding: 10px 13px;
  background: rgba(240,180,41,0.05);
  border: 1px solid rgba(240,180,41,0.14);
  border-radius: 7px;
  font-size: 12.5px;
  color: rgba(240,180,41,0.7);
  line-height: 1.55;
}

.doc-inline--note {
  background: rgba(240,180,41,0.1);
  border-color: rgba(240,180,41,0.18);
  color: rgba(240,180,41,0.85);
}

/* ── Toast ── */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
