/* ==========================================================================
   57. Alay Personel Sistemi — tema
   Koyu zemin, bayrak kırmızısı vurgu, gümüş yazı, mavi parıltı (logodan)
   ========================================================================== */
:root {
  --bg: #06080c;
  --bg-soft: #0a0d13;
  --surface: #0e121a;
  --surface-2: #131923;
  --surface-3: #19212e;
  --line: rgba(201, 209, 220, 0.08);
  --line-2: rgba(201, 209, 220, 0.15);
  --text: #e8ebf1;
  --text-2: #b3bbc8;
  --muted: #7c8698;
  --accent: #d7141f;
  --accent-hi: color-mix(in srgb, var(--accent) 80%, #fff);
  --accent-lo: color-mix(in srgb, var(--accent) 65%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --steel: #c9d1dc;
  --gold: #d9ad45;
  --glow: #7cc8ff;
  --ok: #22c55e;
  --warn: #f59e0b;
  --info: #3b82f6;
  --purple: #a855f7;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Barlow Condensed', 'Inter', system-ui, sans-serif;
  --sidebar-w: 256px;
  --topbar-h: 64px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  /* star field + red/blue ambient glow */
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(124, 200, 255, 0.06), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='%23c9d1dc'%3E%3Ccircle cx='20' cy='30' r='.7' opacity='.35'/%3E%3Ccircle cx='140' cy='80' r='.6' opacity='.25'/%3E%3Ccircle cx='90' cy='170' r='.8' opacity='.3'/%3E%3Ccircle cx='200' cy='200' r='.5' opacity='.2'/%3E%3Ccircle cx='180' cy='20' r='.6' opacity='.3'/%3E%3Ccircle cx='60' cy='110' r='.5' opacity='.2'/%3E%3C/g%3E%3C/svg%3E"),
    var(--bg);
}
a {
  color: var(--accent-hi);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
img {
  max-width: 100%;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: #fff;
}
h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.45rem;
}
h3 {
  font-size: 1.2rem;
}
h4 {
  font-size: 1.05rem;
}
p {
  margin: 0 0 1em;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
code,
kbd,
.mono {
  font-family: ui-monospace, 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
  font-size: 0.92em;
}
code {
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--steel);
}
::selection {
  background: var(--accent);
  color: #fff;
}
.ic {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.2em;
  stroke-width: 2;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 2px;
}

/* ---------- utilities ---------- */
.muted {
  color: var(--muted);
}
.text-2 {
  color: var(--text-2);
}
.small {
  font-size: 0.86em;
}
.tiny {
  font-size: 0.76em;
}
.upper {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.display {
  font-family: var(--font-display);
}
.nowrap {
  white-space: nowrap;
}
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.center {
  text-align: center;
}
.right {
  text-align: right;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row.wrap {
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.row.top {
  align-items: flex-start;
}
.grow {
  flex: 1;
  min-width: 0;
}
.stack > * + * {
  margin-top: 16px;
}
.stack-lg > * + * {
  margin-top: 34px;
}
.stack-sm > * + * {
  margin-top: 8px;
}
.gap-sm {
  gap: 6px;
}
.gap-lg {
  gap: 20px;
}
.mt-0 {
  margin-top: 0 !important;
}
.mt {
  margin-top: 16px !important;
}
.mt-sm {
  margin-top: 8px;
}
.mt-lg {
  margin-top: 30px !important;
}
.mb-0 {
  margin-bottom: 0 !important;
}
.mb {
  margin-bottom: 16px;
}
.grid {
  display: grid;
  gap: 18px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid-side {
  grid-template-columns: minmax(0, 1fr) 340px;
}
.grid-side-l {
  grid-template-columns: 320px minmax(0, 1fr);
}
@media (max-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-side,
  .grid-side-l {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .grid-4 > .stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
  }
}
.hide-sm {
}
@media (max-width: 760px) {
  .hide-sm {
    display: none !important;
  }
}

/* ---------- buttons ---------- */
.btn {
  --b: var(--surface-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--b);
  color: var(--text);
  font: 600 13.5px/1 var(--font);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.05s,
    box-shadow 0.15s;
}
.btn:hover {
  background: color-mix(in srgb, var(--b) 85%, #fff);
  border-color: rgba(255, 255, 255, 0.22);
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled],
.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}
.btn-primary {
  --b: var(--accent);
  border-color: var(--accent-hi);
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.3) inset,
    0 6px 20px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover {
  background: var(--accent-hi);
}
.btn-ghost {
  --b: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  background: var(--surface-3);
  color: var(--text);
}
.btn-outline {
  --b: transparent;
}
.btn-success {
  --b: #15803d;
  border-color: #22c55e;
  color: #fff;
}
.btn-danger {
  --b: #7f1d1d;
  border-color: #b91c1c;
  color: #fecaca;
}
.btn-danger:hover {
  background: #991b1b;
  color: #fff;
}
.btn-steam {
  --b: #171a21;
  border-color: #2a475e;
  color: #fff;
  height: 46px;
  padding: 0 22px;
  font-size: 15px;
}
.btn-steam:hover {
  background: #1b2838;
  border-color: #66c0f4;
}
.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
  gap: 6px;
}
.btn-xs {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  gap: 5px;
  border-radius: 6px;
}
.btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: 15px;
}
.btn-icon {
  width: 38px;
  padding: 0;
}
.btn-icon.btn-sm {
  width: 30px;
}
.btn-block {
  width: 100%;
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-hi);
  cursor: pointer;
  font: inherit;
}
.link-btn:hover {
  text-decoration: underline;
}

/* ---------- forms ---------- */
.field {
  display: block;
  margin-bottom: 16px;
}
.field > label,
.label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field .req {
  color: var(--accent-hi);
  margin-left: 2px;
}
.help {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 5px;
}
input[type='text'],
input[type='number'],
input[type='date'],
input[type='time'],
input[type='datetime-local'],
input[type='password'],
input[type='search'],
input[type='url'],
input[type='color'],
select,
textarea,
.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: 14px/1.4 var(--font);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}
input[type='color'] {
  padding: 3px;
  width: 56px;
  cursor: pointer;
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b3bbc8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select[multiple] {
  height: auto;
  min-height: 120px;
  padding: 6px;
  background-image: none;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 70%, #fff);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder,
textarea::placeholder {
  color: #5d6677;
}
input[type='file'] {
  display: block;
  width: 100%;
  padding: 8px;
  background: var(--bg-soft);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
}
input[type='file']::file-selector-button {
  margin-right: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
  color: var(--text);
  font-weight: 500;
}
.check input {
  margin-top: 3px;
}
input[type='checkbox'],
input[type='radio'] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex: none;
  cursor: pointer;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px 16px;
}
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 500;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch .track {
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  position: relative;
  transition: background 0.2s;
  flex: none;
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition:
    transform 0.2s,
    background 0.2s;
}
.switch input:checked + .track {
  background: var(--accent);
  border-color: var(--accent-hi);
}
.switch input:checked + .track::after {
  transform: translateX(18px);
  background: #fff;
}
.switch input:focus-visible + .track {
  outline: 2px solid var(--glow);
  outline-offset: 2px;
}
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 8px;
}
.inline-form {
  display: inline;
}
.input-group {
  display: flex;
}
.input-group > input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group > .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  height: 40px;
}

/* ---------- cards ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  min-height: 54px;
}
.card-head h2,
.card-head h3 {
  margin: 0;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.card-head h2 .ic,
.card-head h3 .ic {
  color: var(--accent-hi);
}
.card-body {
  padding: 18px;
}
.card-body.tight {
  padding: 0;
}
.card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
.card.accent-top::before {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.card.glass {
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  backdrop-filter: blur(8px);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
  color: var(--text-2);
  margin: 0 0 14px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}

/* ---------- stats ---------- */
.stat {
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.stat .stat-ic {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent);
  color: var(--c, var(--accent-hi));
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 35%, transparent);
  flex: none;
}
.stat .stat-ic .ic {
  width: 22px;
  height: 22px;
}
.stat .v {
  font: 700 1.75rem/1 var(--font-display);
  color: #fff;
  letter-spacing: 0.02em;
}
.stat .l {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}
a.stat {
  color: inherit;
  text-decoration: none !important;
  transition: border-color 0.15s;
}
a.stat:hover {
  border-color: var(--line-2);
}

/* ---------- chips ---------- */
.chip {
  --c: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--c) 75%, #fff);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
  white-space: nowrap;
  vertical-align: middle;
}
.chip .ic {
  width: 12px;
  height: 12px;
}
.chip.dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c);
}
.chip-lg {
  height: 28px;
  padding: 0 12px;
  font-size: 12.5px;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.count.soft {
  background: var(--surface-3);
  color: var(--text-2);
}

/* ---------- avatar / rank ---------- */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  flex: none;
}
.avatar.sm {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.avatar.lg {
  width: 72px;
  height: 72px;
  border-radius: 12px;
}
.avatar.xl {
  width: 120px;
  height: 120px;
  border-radius: 16px;
}
.rank-ic {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: none;
}
.rank-ic.lg {
  width: 44px;
  height: 44px;
}
.rank-ic.xl {
  width: 64px;
  height: 64px;
}
.badge-ic {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: none;
}
.badge-ic.sm {
  width: 22px;
  height: 22px;
}
.badge-ic.lg {
  width: 52px;
  height: 52px;
}
.person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
}
.person:hover {
  text-decoration: none;
}
.person:hover .person-name {
  color: var(--accent-hi);
}
.person-name {
  font-weight: 600;
  color: var(--text);
}
.person-sub {
  font-size: 12px;
  color: var(--muted);
}
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ---------- tables ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface-3) 45%, transparent);
  white-space: nowrap;
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table tbody tr {
  transition: background 0.12s;
}
.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.022);
}
.table .actions {
  text-align: right;
  white-space: nowrap;
}
.table.compact td,
.table.compact th {
  padding: 8px 10px;
}
.table tr.dim td {
  opacity: 0.55;
}

/* ---------- alerts / flash ---------- */
.alert {
  --c: var(--info);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--c) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  border-left: 3px solid var(--c);
  color: var(--text);
  margin-bottom: 16px;
}
.alert .ic {
  color: var(--c);
  margin-top: 2px;
}
.alert-success {
  --c: var(--ok);
}
.alert-error {
  --c: var(--danger);
}
.alert-warn {
  --c: var(--warn);
}
.alert-info {
  --c: var(--info);
}
.flash-stack {
  position: fixed;
  top: 76px;
  right: 18px;
  z-index: 200;
  width: min(420px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.flash-stack .alert {
  pointer-events: auto;
  box-shadow: var(--shadow);
  animation: slideIn 0.35s ease;
  margin: 0;
}
.flash-stack .alert.out {
  animation: fadeOut 0.35s ease forwards;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs a,
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13.5px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  text-decoration: none !important;
}
.tabs a:hover,
.tabs button:hover {
  color: var(--text);
}
.tabs a.active,
.tabs button.active {
  color: #fff;
  border-bottom-color: var(--accent);
}
.pills {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-wrap: wrap;
}
.pills a {
  padding: 6px 12px;
  border-radius: 7px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none !important;
}
.pills a.active {
  background: var(--surface-3);
  color: #fff;
}

/* ---------- empty ---------- */
.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
}
.empty .ic {
  width: 38px;
  height: 38px;
  color: var(--line-2);
  margin-bottom: 10px;
  stroke-width: 1.5;
}
.empty h3 {
  color: var(--text-2);
  font-size: 1.1rem;
}

/* ---------- dialog ---------- */
dialog.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
dialog.modal.wide {
  width: min(820px, calc(100vw - 32px));
}
dialog.modal::backdrop {
  background: rgba(3, 5, 8, 0.72);
  backdrop-filter: blur(3px);
}
dialog.modal[open] {
  animation: pop 0.18s ease;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 0 0 14px 14px;
}

/* ---------- dropdown ---------- */
.dropdown {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 120;
  display: none;
}
.dropdown.open .dropdown-menu {
  display: block;
  animation: pop 0.14s ease;
}
.dropdown-menu a,
.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--text-2);
  background: none;
  border: 0;
  font: 500 13.5px var(--font);
  cursor: pointer;
  text-align: left;
  text-decoration: none !important;
}
.dropdown-menu a:hover,
.dropdown-menu button:hover {
  background: var(--surface-3);
  color: #fff;
}
.dropdown-menu hr {
  margin: 6px 0;
}

/* ==========================================================================
   APP SHELL (panel)
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #0b0e15 0%, #080a0f 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  color: #fff;
  text-decoration: none !important;
  border-bottom: 1px solid var(--line);
}
.brand img {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--accent) 40%, transparent));
}
.brand .t1 {
  font: 800 1.35rem/1 var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.brand .t2 {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-top: 4px;
}
.nav {
  padding: 10px 10px 20px;
  flex: 1;
}
.nav-group {
  margin-top: 14px;
}
.nav-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #5b6477;
  padding: 0 12px 6px;
  font-weight: 700;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  margin: 1px 0;
  border-radius: 8px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 13.8px;
  text-decoration: none !important;
  position: relative;
  transition:
    background 0.12s,
    color 0.12s;
}
.nav a .ic {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.nav a.active {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  color: #fff;
}
.nav a.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.nav a.active .ic {
  color: var(--accent-hi);
  opacity: 1;
}
.nav a .count {
  margin-left: auto;
}
.sidebar-foot {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #525b6c;
}
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .page-title {
  font: 700 1.25rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-btn {
  display: none;
}
.user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: 600 13px var(--font);
}
.user-btn:hover {
  border-color: var(--line-2);
}
.user-btn .rank-ic {
  width: 20px;
  height: 20px;
}
.bell {
  position: relative;
}
.bell .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.content {
  padding: 26px 28px 60px;
  width: 100%;
  max-width: 1480px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head h1 {
  margin: 0;
  font-size: 1.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.page-head .sub {
  color: var(--muted);
  margin-top: 6px;
}
.crumbs {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.crumbs a {
  color: var(--text-2);
}
.scrim {
  display: none;
}
@media (max-width: 980px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  body.nav-open .sidebar {
    transform: none;
    box-shadow: var(--shadow);
  }
  body.nav-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(0, 0, 0, 0.6);
  }
  .menu-btn {
    display: inline-flex;
  }
  .topbar {
    padding: 0 16px;
  }
  .content {
    padding: 20px 16px 50px;
  }
  .user-btn .un {
    display: none;
  }
}

/* ==========================================================================
   PUBLIC SITE
   ========================================================================== */
.pub-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.pub-nav .inner {
  max-width: 1240px;
  margin: 0 auto;
  height: 70px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
}
.pub-nav .brand {
  border: 0;
  padding: 0;
}
.pub-nav .brand img {
  width: 44px;
  height: 44px;
}
.pub-links {
  display: flex;
  gap: 4px;
  flex: 1;
}
.pub-links a {
  padding: 8px 12px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13.5px;
  border-radius: 8px;
  text-decoration: none !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pub-links a:hover,
.pub-links a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}
.pub-menu-btn {
  display: none;
}
@media (max-width: 860px) {
  .pub-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 10px 16px 16px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
  }
  body.nav-open .pub-links {
    display: flex;
  }
  .pub-menu-btn {
    display: inline-flex;
    margin-left: auto;
  }
  .pub-nav .inner {
    gap: 12px;
  }
  .pub-nav .login-cta .t {
    display: none;
  }
}
.pub-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 20px 70px;
}
.pub-footer {
  border-top: 1px solid var(--line);
  padding: 28px 20px;
  color: var(--muted);
  font-size: 13px;
}
.pub-footer .inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* hero */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 420px at 72% 45%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    radial-gradient(500px 300px at 78% 70%, rgba(124, 200, 255, 0.1), transparent 70%),
    linear-gradient(180deg, transparent 60%, var(--bg));
}
.hero::after {
  /* ring of stars echoing the logo */
  content: '';
  position: absolute;
  right: -180px;
  top: 50%;
  width: 900px;
  height: 900px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(201, 209, 220, 0.06) 0deg 1.2deg, transparent 1.2deg 12deg);
  mask: radial-gradient(circle, transparent 57%, #000 58%, #000 66%, transparent 67%);
  -webkit-mask: radial-gradient(circle, transparent 57%, #000 58%, #000 66%, transparent 67%);
  animation: spin 160s linear infinite;
  pointer-events: none;
}
@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 80px 20px 90px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.hero .eyebrow .live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
.hero h1 {
  font-size: clamp(3rem, 8vw, 6.2rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 22px 0 18px;
  background: linear-gradient(180deg, #fff 20%, #aab3c0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.5));
}
.hero h1 span {
  display: block;
  font-size: max(0.2em, 0.95rem);
  letter-spacing: 0.24em;
  line-height: 1.35;
  margin-top: 14px;
  background: linear-gradient(90deg, var(--accent-hi), #fff);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero .lead {
  font-size: 1.08rem;
  color: var(--text-2);
  max-width: 560px;
  margin-bottom: 30px;
}
.hero-emblem {
  position: relative;
  justify-self: center;
  width: min(420px, 80vw);
  aspect-ratio: 1;
}
.hero-emblem img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 60px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 40px color-mix(in srgb, var(--accent) 35%, transparent));
  animation: float 7s ease-in-out infinite;
}
.hero-emblem::before {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%);
  filter: blur(30px);
  animation: breathe 5s ease-in-out infinite;
}
.hero-emblem .glint {
  position: absolute;
  left: 58%;
  top: 70%;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(200, 235, 255, 0.95) 0 2px, rgba(124, 200, 255, 0.4) 6px, transparent 40px);
  mix-blend-mode: screen;
  animation: glint 4.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes float {
  50% {
    transform: translateY(-12px);
  }
}
@keyframes breathe {
  50% {
    opacity: 0.55;
    transform: scale(1.06);
  }
}
@keyframes glint {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.6);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}
.hero-stats {
  display: flex;
  gap: 34px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.hero-stats .v {
  font: 800 2.2rem/1 var(--font-display);
  color: #fff;
}
.hero-stats .l {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 6px;
}
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    padding: 40px 20px 60px;
    text-align: center;
  }
  .hero-emblem {
    order: -1;
    width: min(260px, 70vw);
  }
  .hero .lead {
    margin-left: auto;
    margin-right: auto;
  }
  .hero .row {
    justify-content: center;
  }
  .hero-stats {
    justify-content: center;
  }
  .hero::after {
    right: 50%;
    top: 190px;
    transform: translate(50%, -50%);
    width: 620px;
    height: 620px;
    animation: none;
  }
}

/* feature / event tiles on home */
.op-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--c, var(--accent)) 16%, transparent), transparent 55%),
    var(--surface);
}
.op-card .day {
  font: 800 3.4rem/0.9 var(--font-display);
  color: color-mix(in srgb, var(--c) 80%, #fff);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.op-card .kind {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-2);
  margin-top: 6px;
}
.op-card .big-ic {
  position: absolute;
  right: -16px;
  bottom: -18px;
  width: 140px;
  height: 140px;
  color: color-mix(in srgb, var(--c) 30%, transparent);
  stroke-width: 1.2;
}
.countdown {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.countdown div {
  min-width: 56px;
  padding: 8px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  text-align: center;
}
.countdown b {
  display: block;
  font: 700 1.5rem/1 var(--font-display);
  color: #fff;
}
.countdown span {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- login / apply ---------- */
.auth-wrap {
  min-height: calc(100vh - 70px);
  display: grid;
  place-items: center;
  padding: 40px 16px;
}
.auth-card {
  width: min(460px, 100%);
  text-align: center;
  padding: 34px 30px;
}
.auth-card img.logo {
  width: 120px;
  height: 120px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 30px color-mix(in srgb, var(--accent) 40%, transparent));
}
.apply-wrap {
  max-width: 820px;
  margin: 0 auto;
}
.q-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  margin-bottom: 14px;
}
.q-card .q-num {
  font: 700 12px var(--font-display);
  color: var(--accent-hi);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.yesno {
  display: inline-flex;
  gap: 8px;
}
.yesno label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  cursor: pointer;
  font-weight: 600;
}
.yesno label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #fff;
}

/* status screen */
.status-hero {
  text-align: center;
  padding: 40px 24px;
}
.status-hero .ring {
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--c) 25%, transparent);
}
.status-hero .ring .ic {
  width: 42px;
  height: 42px;
}

/* ---------- dossier (profile) ---------- */
.dossier {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 240px at 100% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  padding: 26px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}
.dossier::after {
  content: '';
  position: absolute;
  right: 24px;
  top: 50%;
  width: 180px;
  height: 180px;
  transform: translateY(-50%);
  background: var(--logo) center/contain no-repeat;
  opacity: 0.06;
  pointer-events: none;
}
.dossier .avatar-wrap {
  position: relative;
}
.dossier .avatar-wrap .rank-ic {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 46px;
  height: 46px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line-2);
}
.dossier .callsign {
  font: 800 2.3rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  margin: 0;
}
.dossier .rank-line {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text-2);
  margin-top: 8px;
  font-weight: 600;
}
.dossier .meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.dossier .meta div {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dossier .meta b {
  display: block;
  font: 700 1.05rem var(--font-display);
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: none;
  margin-top: 2px;
}
.sicil {
  font: 700 12px var(--font-display);
  letter-spacing: 0.24em;
  color: var(--muted);
  text-transform: uppercase;
}
@media (max-width: 760px) {
  .dossier {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
    padding: 22px 16px;
  }
  .dossier .avatar-wrap,
  .dossier .ring-stat {
    justify-self: center;
  }
  .dossier .rank-line,
  .dossier .meta,
  .dossier .row {
    justify-content: center;
  }
}

/* big ring for attendance rate */
.ring-stat {
  --p: 0;
  --c: var(--ok);
  width: 118px;
  height: 118px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0);
  position: relative;
  flex: none;
}
.ring-stat::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--surface);
}
.ring-stat .in {
  position: relative;
  text-align: center;
}
.ring-stat b {
  display: block;
  font: 800 1.9rem/1 var(--font-display);
  color: #fff;
}
.ring-stat span {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* timeline */
.timeline {
  position: relative;
  padding-left: 26px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--line));
}
.tl-item {
  position: relative;
  padding-bottom: 18px;
}
.tl-item:last-child {
  padding-bottom: 0;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--c, var(--accent));
}
.tl-item .when {
  font-size: 12px;
  color: var(--muted);
}
.tl-item .what {
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* attendance strip */
.att-strip {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.att-dot {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: var(--c, var(--surface-3));
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none !important;
}
.att-dot.none {
  --c: var(--surface-3);
  color: var(--muted);
}
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-2);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--c);
  display: inline-block;
}

/* ---------- roll call ---------- */
.roll {
  display: flex;
  flex-direction: column;
}
.roll-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.roll-row:last-child {
  border-bottom: 0;
}
.roll-row.saving {
  opacity: 0.6;
}
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border-radius: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  flex-wrap: wrap;
}
.seg button {
  --c: var(--muted);
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  color: var(--text-2);
  font: 600 12.5px var(--font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.seg button .ic {
  width: 14px;
  height: 14px;
}
.seg button:hover {
  background: var(--surface-3);
  color: #fff;
}
.seg button.on {
  background: color-mix(in srgb, var(--c) 22%, transparent);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  color: #fff;
}
.seg[aria-disabled='true'] {
  pointer-events: none;
  opacity: 0.7;
}
.rcon-seen {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: #7dd3fc;
}
@media (max-width: 760px) {
  .roll-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .seg button .lbl {
    display: none;
  }
}

/* ---------- matrix ---------- */
.matrix {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
.matrix th,
.matrix td {
  padding: 5px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}
.matrix th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--surface-2);
  z-index: 1;
}
.matrix th.ev {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 96px;
  vertical-align: bottom;
  padding: 8px 4px;
}
.matrix td.name,
.matrix th.name {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
  min-width: 200px;
}
.matrix th.name {
  z-index: 3;
  background: var(--surface-2);
}
.matrix .att-dot {
  margin: 0 auto;
}

/* ---------- calendar ---------- */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cal-head h2 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1.6rem;
}
.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.cal .dow {
  padding: 10px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.cal .dow.we {
  color: var(--accent-hi);
}
.cal .day {
  min-height: 118px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.cal .day:nth-child(7n) {
  border-right: 0;
}
.cal .day.out {
  background: rgba(0, 0, 0, 0.25);
}
.cal .day.out .num {
  opacity: 0.35;
}
.cal .day.today {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.cal .num {
  font: 700 1rem var(--font-display);
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cal .day.today .num b {
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 0 7px;
}
.cal-ev {
  --c: var(--muted);
  display: block;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  border-left: 3px solid var(--c);
  text-decoration: none !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-ev:hover {
  background: color-mix(in srgb, var(--c) 35%, transparent);
}
.cal-ev.cancelled {
  opacity: 0.45;
  text-decoration: line-through !important;
}
.cal-ev .t {
  opacity: 0.75;
  font-weight: 500;
  margin-right: 4px;
}
.cal-ev .me {
  float: right;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 3px;
  background: var(--m);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
}
@media (max-width: 760px) {
  .cal .dow {
    font-size: 10px;
    padding: 6px 2px;
    letter-spacing: 0;
  }
  .cal .day {
    min-height: 64px;
    padding: 4px;
  }
  .cal-ev {
    font-size: 0;
    padding: 0;
    height: 6px;
    border-left-width: 0;
    background: var(--c);
  }
  .cal-ev .me {
    display: none;
  }
}
.ev-list-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none !important;
}
.ev-list-item:last-child {
  border-bottom: 0;
}
.ev-list-item:hover {
  background: rgba(255, 255, 255, 0.02);
}
@media (max-width: 760px) {
  .ev-list-item {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 4px 12px;
  }
  .ev-list-item > :nth-child(3) {
    grid-column: 2;
    justify-content: flex-start !important;
  }
}
.ev-date {
  --c: var(--accent);
  text-align: center;
  border-radius: 10px;
  padding: 7px 4px;
  background: color-mix(in srgb, var(--c) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.ev-date b {
  display: block;
  font: 800 1.5rem/1 var(--font-display);
  color: #fff;
}
.ev-date span {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-2);
}

/* ---------- ORBAT ---------- */
.orbat {
  overflow-x: auto;
  padding: 10px 4px 20px;
}
.orbat ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.orbat-tree,
.orbat-tree ul {
  display: flex;
  justify-content: center;
  padding-top: 26px;
  position: relative;
}
.orbat-tree {
  padding-top: 0;
  min-width: max-content;
}
.orbat-tree li {
  position: relative;
  padding: 26px 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.orbat-tree > li {
  padding-top: 0;
}
.orbat-tree li::before,
.orbat-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 26px;
  border-top: 2px solid var(--line-2);
}
.orbat-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid var(--line-2);
}
.orbat-tree li:only-child::before,
.orbat-tree li:only-child::after {
  display: none;
}
.orbat-tree li:only-child {
  padding-top: 0;
}
.orbat-tree li:first-child::before,
.orbat-tree li:last-child::after {
  border: 0 none;
}
.orbat-tree li:last-child::before {
  border-right: 2px solid var(--line-2);
  border-radius: 0 8px 0 0;
}
.orbat-tree li:first-child::after {
  border-radius: 8px 0 0 0;
}
.orbat-tree ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  height: 26px;
  border-left: 2px solid var(--line-2);
}
.orbat-tree > li::before,
.orbat-tree > li::after {
  display: none;
}
.unit-card {
  --c: var(--accent);
  width: 250px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--c);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  text-align: left;
}
.unit-card .uh {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
}
.unit-card .uh img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.unit-card .un {
  font: 700 1.05rem/1.1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
}
.unit-card .cs {
  font-size: 11px;
  color: color-mix(in srgb, var(--c) 70%, #fff);
  letter-spacing: 0.14em;
  font-weight: 700;
}
.unit-card .um {
  padding: 6px 8px 8px;
}
.unit-card .um a,
.unit-card .um .slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  color: var(--text);
  font-size: 12.5px;
  text-decoration: none !important;
}
.unit-card .um a:hover {
  background: var(--surface-3);
}
.unit-card .um .rank-ic {
  width: 20px;
  height: 20px;
}
.unit-card .um .pos {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}
.unit-card .um .lead {
  color: var(--gold);
}
.unit-card .um .empty-slot {
  color: var(--muted);
  font-size: 12px;
  padding: 6px;
}
/* ORBAT list view (mobile-friendly) */
.orbat-list .unit-row {
  border-left: 2px solid var(--line-2);
  margin-left: 10px;
  padding-left: 14px;
}

/* ---------- misc ---------- */
.kv {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 16px;
  font-size: 13.5px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  word-break: break-word;
}
.answer {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.answer:last-child {
  border-bottom: 0;
}
.answer .q {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.answer .a {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.comment {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.comment:last-child {
  border-bottom: 0;
}
.comment .body {
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 4px;
}
.icon-tile {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.icon-tile img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.icon-preview {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sortable-handle {
  cursor: grab;
  color: var(--muted);
}
.dragging {
  opacity: 0.4;
}
.drop-target {
  box-shadow: inset 0 2px 0 var(--accent);
}
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.perm-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  padding: 12px 14px;
}
.perm-group h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  justify-content: space-between;
}
.perm-group .check {
  font-size: 13px;
  padding: 5px 0;
}
.role-chip {
  --c: var(--muted);
}
.console {
  height: 360px;
  overflow-y: auto;
  padding: 12px 14px;
  background: #030507;
  border-radius: 10px;
  border: 1px solid var(--line);
  font: 12.5px/1.55 ui-monospace, 'JetBrains Mono', Consolas, monospace;
  color: #9fb3c8;
  white-space: pre-wrap;
  word-break: break-word;
}
.console .t {
  color: #4b5a6b;
}
.console .chat {
  color: #e8ebf1;
}
.console .sys {
  color: #7dd3fc;
}
.console .me {
  color: #fbbf24;
}
.console .err {
  color: #f87171;
}
.status-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, var(--muted));
  box-shadow: 0 0 10px var(--c, transparent);
  display: inline-block;
  flex: none;
}
.mod-list {
  columns: 2 280px;
  column-gap: 20px;
}
.mod-list li {
  break-inside: avoid;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.notif {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none !important;
}
.notif.unread {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.notif .ni {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text-2);
  flex: none;
}
.progress {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--c, var(--accent));
  border-radius: 99px;
}
.bar-list .bar-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  padding: 4px 0;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 13.5px;
  animation: slideUp 0.25s ease;
}
.toast.err {
  border-color: var(--danger);
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}
.error-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 16px;
}
.error-page .code {
  font: 800 6rem/1 var(--font-display);
  color: var(--accent);
  text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 50%, transparent);
}
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
}
.filters .field {
  margin: 0;
  min-width: 160px;
}
.filters .field.grow {
  flex: 1;
  min-width: 200px;
}
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 16px;
}
.divider-v {
  width: 1px;
  align-self: stretch;
  background: var(--line);
}
.warn-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: #fecaca;
  font-weight: 600;
}

/* ---------- icon library (picker) ---------- */
.icon-lib {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--bg-soft);
}
.icon-lib[open] {
  max-height: 340px;
  overflow-y: auto;
}
.icon-lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 6px;
}
.icon-lib-grid label {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s;
}
.icon-lib-grid label:hover {
  border-color: var(--line-2);
  background: var(--surface-3);
}
.icon-lib-grid label:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.icon-lib-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.icon-lib-grid img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

/* ---------- class matrix ---------- */
.cls-matrix th.cls {
  min-width: 74px;
  vertical-align: bottom;
  padding: 8px 4px;
  white-space: normal;
  line-height: 1.2;
}
.cls-matrix th.cls img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  margin: 0 auto 6px;
}
.cls-matrix th.cls span {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  text-transform: none;
  letter-spacing: 0;
}
.cls-cell {
  width: 34px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: var(--bg-soft);
  display: inline-grid;
  place-items: center;
  color: transparent;
  cursor: default;
  padding: 0;
  transition:
    background 0.12s,
    border-color 0.12s;
}
.cls-cell .ic {
  width: 18px;
  height: 18px;
  stroke-width: 3;
}
.cls-cell.on {
  background: #16a34a;
  border-color: #22c55e;
  color: #fff;
  box-shadow: 0 0 12px -4px #22c55e;
}
button.cls-cell {
  cursor: pointer;
}
button.cls-cell:hover {
  border-color: #22c55e;
}
button.cls-cell.saving {
  opacity: 0.5;
}
.cls-matrix tfoot td {
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-2);
  position: sticky;
  bottom: 0;
}
.cls-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cls-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 99px;
  background: color-mix(in srgb, #22c55e 12%, transparent);
  border: 1px solid color-mix(in srgb, #22c55e 35%, transparent);
  font-size: 12.5px;
  font-weight: 600;
}
.cls-chip img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.mini-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-width: 124px;
}
.mini-icons img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
@media (max-width: 640px) {
  .cls-matrix td.name,
  .cls-matrix th.name {
    min-width: 116px;
    max-width: 132px;
  }
  .cls-matrix td.name .tiny {
    display: none;
  }
  .cls-matrix td.name .person-name {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cls-matrix th.cls {
    min-width: 58px;
  }
}

/* ---------- kurallar ---------- */
.rules-layout {
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
}
.rules-toc .card {
  position: sticky;
  top: 84px;
}
.rules-toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
}
.rules-toc-link:hover {
  background: var(--surface-2);
  color: var(--text);
}
.rules-toc-link .count {
  margin-left: auto;
}
.rules-no {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-hi);
  font-family: var(--font-display, inherit);
  font-weight: 800;
  font-size: 13px;
}
.rules-section {
  scroll-margin-top: 80px;
}
.rules-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.rule-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  scroll-margin-top: 90px;
  line-height: 1.55;
}
.rule-item + .rule-item {
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.rule-item:target {
  background: var(--accent-soft);
  border-radius: 10px;
}
.rule-no {
  font-family: var(--font-display, inherit);
  font-weight: 800;
  color: var(--accent-hi);
  font-size: 15px;
  padding-top: 1px;
}
.rule-no:hover {
  text-decoration: underline;
}
.rule-penalty {
  margin-top: 6px;
  height: auto;
  white-space: normal;
}
@media (max-width: 1100px) {
  .rules-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .rules-toc .card {
    position: static;
  }
}
@media (max-width: 640px) {
  .rule-item {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    padding: 10px 2px;
  }
}
