:root {
  --ink: #16324a;
  --mist: #e7f2f5;
  --foam: #f4fafb;
  --signal: #d7263d;
  --brass: #7c5a18;
  --gold: #e4c27a;
  --tide: #1f6f8a;
  --text: #1a2c38;
  --line: #c9d8de;
  --ui: "Tajawal", "Segoe UI", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--text);
  font-family: var(--ui);
  line-height: 1.55;
}
a { color: var(--tide); }
:focus-visible { outline: 2px solid var(--tide); outline-offset: 2px; }
button, input, select { font: inherit; }
button {
  background: var(--ink);
  color: var(--foam);
  border: 0;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
}
button:hover { background: #21465f; }
input, select {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  padding: 8px 10px;
}

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.rail {
  background: var(--ink);
  color: var(--foam);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.rail .brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
}
.lamp {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #8ea4b3;
}
.lamp.live { background: var(--signal); box-shadow: 0 0 0 4px rgba(215, 38, 61, 0.25); }
.rail nav { display: flex; flex-direction: column; gap: 4px; }
.rail nav a {
  color: #d5e4ec;
  text-decoration: none;
  padding: 8px 10px;
}
.rail nav a[aria-current="page"] {
  background: #21465f;
  color: var(--gold);
}
.rail form { margin-top: auto; }
.rail button { background: transparent; color: var(--gold); padding: 8px 0; }
.desk { padding: 28px; }
.desk-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
h1 { margin: 0; font-size: 1.8rem; }
h2 { font-size: 1.1rem; }
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  background: var(--foam);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.facts p { margin: 0; }
.facts strong { font-size: 1.4rem; display: block; }
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.plain span, small, .muted { color: #5d7482; display: block; }
.job { color: var(--tide); font-weight: 700; }
.ok { color: #1d6b45; font-weight: 700; }
.warn { color: #9d1c32; font-weight: 700; }
.table-wrap { overflow-x: auto; background: var(--foam); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; color: var(--ink); }
.inline, .row-actions, .filters, .stack { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline input { min-width: 220px; flex: 1; }
.check { display: flex; gap: 6px; align-items: center; }
.stack { flex-direction: column; align-items: stretch; max-width: 360px; }
.stack button { align-self: flex-start; }

.bare { min-height: 100vh; background: var(--mist); }
.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.gate-mark {
  background: var(--ink);
  color: var(--foam);
  padding: 64px 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
}
.gate-mark h1 { font-size: 2.6rem; }
.gate-mark p { max-width: 28rem; color: #d5e4ec; }
.gate form {
  padding: 64px 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.gate h2 { margin: 0 0 8px; }
.gate button { margin-top: 10px; align-self: flex-start; }

@media (max-width: 860px) {
  .shell, .gate, .split { grid-template-columns: 1fr; }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .rail nav { flex-direction: row; flex-wrap: wrap; }
  .rail form { margin-top: 0; }
  .desk, .gate form, .gate-mark { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .lamp.live { box-shadow: none; }
}
