* { box-sizing: border-box; margin: 0; }
body {
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background: #f1f3f6; color: #1d2733;
}
code { background: #e8ecf1; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
a { color: #1d5fbf; }

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #16222f; color: #cdd8e4; padding: 20px 0;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.brand { font-size: 18px; font-weight: 700; color: #fff; padding: 0 20px 20px; }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a {
  color: #cdd8e4; text-decoration: none; padding: 11px 20px; border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #1f2f40; }
.sidebar nav a.active { background: #1f2f40; border-left-color: #4da3ff; color: #fff; }
.logout { margin-top: auto; padding: 20px; }
.logout button {
  width: 100%; background: none; border: 1px solid #3a4c5f; color: #cdd8e4;
  padding: 8px; border-radius: 6px; cursor: pointer;
}
.logout button:hover { background: #1f2f40; }

.content { flex: 1; padding: 28px 36px; max-width: 1100px; }
.content h1 { font-size: 24px; margin-bottom: 18px; }
.panel {
  background: #fff; border-radius: 10px; padding: 20px 24px; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(20, 35, 50, .08);
}
.panel h2 { font-size: 17px; margin-bottom: 12px; }

.cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.card {
  background: #fff; border-radius: 10px; padding: 16px 20px; min-width: 150px; flex: 1;
  box-shadow: 0 1px 3px rgba(20, 35, 50, .08);
}
.card-label { font-size: 13px; color: #5c6c7d; }
.card-value { font-size: 24px; font-weight: 700; }
.card-value.small { font-size: 15px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #e6eaef; vertical-align: top; }
th { font-size: 13px; color: #5c6c7d; }
table.kv th { width: 180px; }

.ok { color: #1d7a3d; font-weight: 600; }
.bad { color: #b3261e; font-weight: 600; }
.hint { color: #5c6c7d; font-size: 13px; margin-top: 6px; }

.flash { padding: 11px 15px; border-radius: 8px; margin-bottom: 14px; }
.flash-ok { background: #e2f4e8; color: #14532d; border: 1px solid #b5e0c4; }
.flash-err { background: #fdeceb; color: #7f1d1d; border: 1px solid #f5c6c3; }

.btn {
  display: inline-block; background: #eef2f6; border: 1px solid #cfd8e1; color: #1d2733;
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
  text-decoration: none;
}
.btn:hover { background: #e2e8ee; }
.btn.primary { background: #1d5fbf; border-color: #1d5fbf; color: #fff; }
.btn.primary:hover { background: #174c99; }
.btn.danger { background: #b3261e; border-color: #b3261e; color: #fff; }
.btn.danger:hover { background: #8f1e18; }
.btn.wide { width: 100%; padding: 10px; font-size: 15px; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; align-items: flex-start; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.actions form { display: inline; }

.danger-link { color: #b3261e; list-style: none; }
details > summary { cursor: pointer; }
.danger-form {
  margin-top: 10px; padding: 12px; background: #fdf6f5; border: 1px solid #f5c6c3;
  border-radius: 8px; display: flex; flex-direction: column; gap: 8px; max-width: 420px;
}
.danger-form p { font-size: 13px; }

input[type=text], input[type=password], select, textarea {
  padding: 8px 10px; border: 1px solid #cfd8e1; border-radius: 6px; font-size: 14px;
  font-family: inherit;
}
textarea { width: 100%; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.check { font-size: 13px; color: #3c4a59; display: flex; gap: 6px; align-items: center; }

progress {
  width: 140px; height: 10px; vertical-align: middle; margin-left: 8px;
  accent-color: #4da3ff;
}

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
  background: #fff; padding: 32px; border-radius: 12px; width: 340px;
  box-shadow: 0 4px 20px rgba(20, 35, 50, .12);
}
.login-box .brand { color: #16222f; text-align: center; font-size: 20px; padding-bottom: 18px; }
.login-box label { display: block; margin-bottom: 12px; font-size: 13px; color: #3c4a59; }
.login-box input { width: 100%; margin-top: 4px; }
