:root {
  --bg: #f3efe8;
  --paper: #fffdf8;
  --ink: #1d1a16;
  --muted: #6b6256;
  --line: #ddd2c2;
  --accent: #184e77;
  --accent-2: #d97706;
  --success: #0f766e;
  --error: #b91c1c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217,119,6,0.10), transparent 30%),
    radial-gradient(circle at bottom right, rgba(24,78,119,0.10), transparent 35%),
    var(--bg);
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  background: #1d2d44;
  color: #f9f4ed;
  padding: 28px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 22px;
}
.sidebar a {
  display: block;
  color: #f7efe4;
  text-decoration: none;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}
.sidebar a:hover { background: rgba(255,255,255,0.12); }

.main-content { flex: 1; padding: 28px; }
.main-content.full {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: end;
  margin-bottom: 18px;
}

.login-topbar {
  width: min(460px, 92vw);
  justify-content: center;
  margin-bottom: 12px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lang-switch a {
  text-decoration: none;
  min-width: 64px;
}

.lang-switch .button.secondary {
  background: linear-gradient(135deg, var(--accent-2), #b45309);
}

.sidebar-footer {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.sidebar-credit {
  padding: 2px 4px 0;
  font-size: 14px;
}

.hero, .card, .login-card {
  background: rgba(255,253,248,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(29,26,22,0.08);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  margin-bottom: 24px;
}

.card {
  padding: 22px;
  margin-bottom: 22px;
  overflow: hidden;
}

.login-card {
  width: min(460px, 92vw);
  padding: 30px;
}

.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > * { min-width: 0; }

.stack { display: grid; gap: 14px; }
.inline-form {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}

.action-buttons {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.action-buttons form {
  margin: 0;
  width: 100%;
}

.action-buttons button {
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0;
}
.account-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.secret-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.secret-toggle {
  white-space: nowrap;
  padding: 10px 14px;
}

label { display: grid; gap: 8px; font-weight: 600; }
input, textarea, select, button {
  font: inherit;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}
textarea {
  resize: vertical;
  min-height: 140px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent), #0f3d5e);
  color: #fff;
  font-weight: 700;
}
.button.secondary, button.secondary {
  background: linear-gradient(135deg, var(--accent-2), #b45309);
}

.muted, .meta { color: var(--muted); }
.hero-actions, .align-end {
  display: flex;
  align-items: end;
  justify-content: end;
}

.path-block {
  display: block;
  gap: 6px;
  margin: 0 0 14px;
  min-width: 0;
  max-width: 100%;
}

.path-block strong {
  display: block;
  margin-bottom: 6px;
}

.path-text {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
  word-wrap: break-word;
  white-space: normal;
  max-width: 100%;
  min-width: 0;
}

.block-text {
  display: block;
}

.compact-code {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f1e8;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  word-wrap: break-word;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
}
.checkbox input { width: auto; }

.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { background: #f7f1e8; }

.log-box {
  background: #171717;
  color: #f3f3f3;
  padding: 14px;
  border-radius: 14px;
  min-height: 320px;
  white-space: pre-wrap;
  overflow: auto;
}

.flash-stack { margin-bottom: 18px; display: grid; gap: 10px; }
.flash {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.flash.success { border-color: rgba(15,118,110,0.3); color: var(--success); }
.flash.error { border-color: rgba(185,28,28,0.3); color: var(--error); }

.narrow { max-width: 760px; }

@media (max-width: 1100px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .sidebar { width: 220px; }
}

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .hero { flex-direction: column; }
  .account-row { grid-template-columns: 1fr; }
}
