:root {
  /* SIMA brand (from sima-site) */
  --sima-blue: #003c65;
  --sima-green: #14b978;
  --sima-green-700: #05814f;
  --sima-green-100: #cdfae1;
  --bg: #ebebe6;
  --card: #ffffff;
  --text: #242424;
  --muted: #5b6b7b;
  --border: #e1e3e0;
  --danger: #be3c37;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0, 60, 101, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.5;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: var(--sima-blue);
  color: #fff;
  box-shadow: var(--shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}
.brand-logo { height: 38px; width: 38px; display: block; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.5px; }
.brand-sub {
  font-weight: 400;
  opacity: 0.85;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}
.userbox { display: flex; align-items: center; gap: 14px; }
.userbox .user { font-size: 0.92rem; opacity: 0.92; }

/* Icons (sprite from sima-site icons.commons.svg) */
.icon {
  width: 1.05em;
  height: 1.05em;
  fill: currentColor;
  flex-shrink: 0;
  vertical-align: -0.15em;
}

/* Layout */
.container {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.card-narrow { max-width: 420px; margin: 0 auto; }
.center { text-align: center; }

h1 { font-size: 1.5rem; margin: 0 0 12px; color: var(--sima-blue); }
.muted { color: var(--muted); margin: 0 0 24px; }
code {
  background: #eef2f6;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.9em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sima-green); color: #fff; }
.btn-primary:hover { background: var(--sima-green-700); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.card .btn-ghost { color: var(--sima-blue); border-color: var(--border); }
.card .btn-ghost:hover { background: #eef2f6; }
.btn-block { width: 100%; }

/* Upload form */
.uploader {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.filefield { flex: 1; min-width: 220px; }
.filefield input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fafbfc;
  cursor: pointer;
}
.filefield input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: var(--sima-green-700);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* Misc */
.link { color: var(--sima-green); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
.code {
  background: #0f2233;
  color: #e6edf3;
  padding: 18px;
  border-radius: 8px;
  overflow: auto;
  font-size: 0.85rem;
  line-height: 1.45;
}
.errbox {
  background: #fdecea;
  border: 1px solid #f5c6c0;
  border-radius: 8px;
  padding: 16px 18px;
  margin: 0 0 24px;
}
.errbox dt { font-weight: 700; color: var(--danger); margin-bottom: 4px; }
.errbox dd { margin: 0; color: #7a342c; font-size: 0.92rem; word-break: break-word; }

.footer {
  text-align: center;
  padding: 18px;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .container { padding: 24px 14px; }
  .card { padding: 22px; }
  .brand span { display: none; }
}
