/* DebDist stylesheet — internal, single-org edition.
   Structure borrowed from the inventory-tool UI (sticky solid navbar,
   cards with solid title bars, bordered tables, stat boxes, sharp edges)
   but keeps the DebDist palette: red #9c060e on paper/white.
*/
:root {
  --red: #9c060e;
  --red-deep: #6b040b;
  --red-hot: #c22a33;
  --ink: #1a1615;
  --text-light: #6d615c;
  --bg: #f5f1ee;
  --bg2: #e2dcd7;
  --white: #fff;
  --border: #9c060e;
  --green: #1a7f37;
  --orange: #b4450c;
  --grey: #6d615c;
  --maxw: 1180px;
  --font: "Inter", "Helvetica Neue", Helvetica, Roboto, Arial, system-ui,
    sans-serif;
}

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

body {
  font-family: var(--font);
  font-size: 16px; line-height: 1.5;
  background: var(--bg); color: var(--ink);
}

a { color: var(--red); text-decoration: underline; font-weight: 600; }
a:hover { text-decoration: none; }

/* ---------- navbar ---------- */
.navbar {
  background: var(--red); color: var(--white);
  padding: 12px 24px; display: flex; align-items: center;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.navbar a { color: var(--white); text-decoration: none; }
.navbar .brand { font-size: 1.4rem; font-weight: 800; margin-right: 32px; letter-spacing: -0.02em; }
.navbar .nav { display: flex; gap: 4px; flex-wrap: wrap; }
.navbar .nav a {
  padding: 6px 14px; border-radius: 0; font-size: 0.95rem;
  font-weight: 600; transition: none;
}
.navbar .nav a:hover { background: rgba(255,255,255,0.15); }
.navbar .nav a.active { background: rgba(255,255,255,0.2); }
.navbar .nav-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.navbar .nav-right a { padding: 6px 14px; font-size: 0.9rem; font-weight: 600; }
.navbar .nav-user { font-size: 0.9rem; color: rgba(255,255,255,0.85); }
.navbar .btn-outline { color: var(--white); border-color: rgba(255,255,255,0.7); }
.navbar .btn-outline:hover { background: var(--white); color: var(--red); border-color: var(--white); }

/* ---------- layout ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 20px 24px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

h1 { font-size: 1.8rem; margin-bottom: 16px; }
h2 { font-size: 1.4rem; margin-bottom: 12px; }
h3 { font-size: 1.2rem; margin-bottom: 8px; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

.kicker {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px;
  font-weight: 700; color: var(--red); margin-bottom: 4px;
}

/* ---------- cards ---------- */
.card {
  background: var(--white); border: 2px solid var(--border);
  margin-bottom: 20px;
}
.card-title {
  background: var(--red); color: var(--white);
  padding: 10px 16px; font-size: 1.05rem; font-weight: 700;
  display: flex; align-items: center; gap: 12px;
}
.card-title a { color: var(--white); }
.card-body { padding: 16px; }

/* ---------- tabs (repo sub-pages) ---------- */
.tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 2px solid var(--red);
}
.tabs a {
  padding: 8px 18px; font-weight: 700; font-size: 0.95rem;
  color: var(--red); text-decoration: none;
  border: 2px solid var(--bg2); border-bottom: none; margin-bottom: -2px;
}
.tabs a.active { background: var(--red); border-color: var(--red); color: var(--white); }
.tabs a:hover:not(.active) { background: var(--bg2); text-decoration: none; }

/* legacy alias so older templates keep working */
.panel { border: 2px solid var(--border); background: var(--white); padding: 16px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--red); color: var(--white);
  padding: 10px 12px; text-align: left; font-size: 0.9rem;
  white-space: nowrap;
}
td { padding: 8px 12px; border-bottom: 1px solid var(--bg2); font-size: 0.95rem; }
tr:nth-child(even) td { background: var(--bg); }
tr:hover td { background: #eadfd9; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 20px; font-size: 0.95rem; font-weight: 700;
  font-family: var(--font); text-decoration: none; cursor: pointer;
  border: 2px solid var(--border); background: var(--red);
  color: var(--white); line-height: 1.4;
}
.btn:hover { background: var(--red-deep); border-color: var(--red-deep); color: var(--white); text-decoration: none; }
.btn-outline { background: transparent; color: var(--red); }
.btn-outline:hover { background: var(--red); color: var(--white); }
.btn-sm { padding: 4px 12px; font-size: 0.85rem; }
.btn-lg { padding: 12px 24px; font-size: 1.05rem; }
.btn-success { background: var(--green); border-color: var(--green); }
.btn-success:hover { background: #145c29; border-color: #145c29; }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-deep); border-color: var(--red-deep); }

/* ---------- forms ---------- */
input, select, textarea {
  padding: 8px 12px; font-size: 0.95rem;
  border: 2px solid var(--border); background: var(--white);
  font-family: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; box-shadow: 0 0 0 3px rgba(156,6,14,0.25);
}
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 4px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 150px; }
.form-row .btn { flex: 0 0 auto; }

/* ---------- badges / tags ---------- */
.badge {
  display: inline-block; padding: 2px 10px;
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
}
.badge-red { background: var(--red); color: var(--white); }
.badge-up { background: var(--green); color: var(--white); }
.badge-down { background: var(--orange); color: var(--white); }
.badge-danger { background: var(--red); color: var(--white); }
.badge-muted { background: var(--grey); color: var(--white); }
.tag {
  display: inline-block; border: 1px solid var(--red); color: var(--red);
  padding: 2px 10px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.tag.tag-red { background: var(--red); color: var(--white); }
.tag.tag-ink { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* ---------- stat boxes ---------- */
.stats { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.stat {
  background: var(--white); border: 2px solid var(--border);
  padding: 16px; text-align: center; flex: 1;
}
.stat-num { font-size: 2.2rem; font-weight: 800; color: var(--red); line-height: 1.1; }
.stat-label { font-size: 0.85rem; font-weight: 600; color: var(--text-light); }

/* ---------- code / terminal ---------- */
.precode {
  background: #140e0d; color: #f2ece7; padding: 14px 16px; overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.6; white-space: pre;
}
.copybar { display: flex; justify-content: space-between; align-items: center;
  background: #2a221f; color: var(--white); }
.copybar .lbl { padding: 6px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: #cbbfb8; }
.copybar button.btn { background: transparent; border-color: #5a4c46; color: var(--white); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9rem; }
code { background: var(--bg2); padding: 1px 6px; font-size: 13px; }

/* ---------- usage bar ---------- */
.meter { height: 10px; background: var(--bg2); }
.meter > div { height: 100%; background: var(--red); }

/* ---------- utilities ---------- */
.small { font-size: 13px; color: var(--text-light); }
.text-muted { color: var(--text-light); }
.text-center, .center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; }
.mb-3 { margin-bottom: 20px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(2, 1fr); }
/* keep tracks on a single track: without this, min-width:auto lets
   unbreakable content (e.g. .precode lines) blow the page out sideways */
.grid > * { min-width: 0; }
.grid .span-6 { grid-column: span 1; }
.grid .span-12 { grid-column: span 2; }
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .grid .span-6, .grid .span-12 { grid-column: span 1; }
}

/* ---------- footer ---------- */
.site-foot {
  max-width: var(--maxw); margin: 0 auto; padding: 8px 24px 32px;
  font-size: 13px; color: var(--text-light);
}
