:root {
  --bg: #0b0e14;
  --bg-2: #10151f;
  --panel: rgba(16, 22, 32, 0.82);
  --stroke: rgba(0, 240, 160, 0.16);
  --text: #f2f7f4;
  --muted: #8fa39a;
  --accent: #00f0a0;
  --accent-2: #5ef0c0;
  --accent-deep: #008060;
  --ok: #22c55e;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #5eead4;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Sora", "DM Sans", sans-serif;
  --radius: 14px;
  --grad: linear-gradient(135deg, #80ffdb 0%, #00f0a0 45%, #008060 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }

.bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 480px at 8% -8%, rgba(0, 240, 160, 0.16), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(0, 128, 96, 0.14), transparent 50%),
    linear-gradient(180deg, #0d121a 0%, var(--bg) 40%, #080b10 100%);
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0, 240, 160, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 160, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 40% 10%, #000 15%, transparent 70%);
}
.bg-glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.32; }
.bg-glow-a { width: 300px; height: 300px; top: -50px; left: 18%; background: #00f0a0; }
.bg-glow-b { width: 240px; height: 240px; top: 42%; right: -50px; background: #008060; }

.top, .page, .foot { position: relative; z-index: 1; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.25rem;
  backdrop-filter: blur(16px);
  background: rgba(11, 14, 20, 0.8);
  border-bottom: 1px solid var(--stroke);
}
.brand { display: flex; align-items: center; gap: 0.7rem; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 44px; height: 44px; object-fit: contain;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 0 12px rgba(0, 240, 160, 0.25));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong {
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}
.brand-text strong span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-text em { font-style: normal; color: var(--muted); font-size: 0.78rem; }

.nav { display: flex; gap: 0.35rem; flex: 1; flex-wrap: wrap; }
.nav-link {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color .2s, background .2s, border-color .2s;
}
.nav-link:hover { color: var(--text); background: rgba(0, 240, 160, 0.08); text-decoration: none; }
.nav-link.is-active {
  color: var(--text);
  border-color: var(--stroke);
  background: rgba(0, 240, 160, 0.12);
}
.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}
.top-user { display: flex; align-items: center; gap: 0.55rem; margin-left: auto; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad);
  color: #04110c;
  font-weight: 700; font-size: 0.8rem;
}
.btn-icon {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  color: var(--muted); border: 1px solid transparent;
  background: transparent; cursor: pointer;
}
.btn-icon:hover { color: var(--text); border-color: var(--stroke); text-decoration: none; }

.page { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 1.5rem 0 3rem; }
.page-head { margin-bottom: 1.25rem; animation: rise .45s ease both; }
.page-head h1 {
  margin: 0.15rem 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  letter-spacing: -0.03em;
}
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
}
.sub, .muted { color: var(--muted); }
.tiny { font-size: 0.8rem; }
.back { margin: -0.5rem 0 1rem; color: var(--muted); }

.panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
}
.panel h2 { margin: 0 0 0.85rem; font-size: 1.05rem; font-family: var(--display); }
.panel h3 { margin: 0 0 0.5rem; font-size: 0.92rem; color: var(--accent-2); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.panel-head h2 { margin: 0; }
.panel-sub {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--stroke);
}
.panel-sub p { margin: 0.35rem 0 0.75rem; color: var(--muted); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  display: flex; flex-direction: column; gap: 0.2rem;
  animation: rise 0.45s ease both;
}
.kpi:nth-child(2) { animation-delay: 0.04s; }
.kpi:nth-child(3) { animation-delay: 0.08s; }
.kpi:nth-child(4) { animation-delay: 0.12s; }
.kpi:nth-child(5) { animation-delay: 0.16s; }
.kpi:nth-child(6) { animation-delay: 0.2s; }
.kpi--ok { border-color: rgba(34, 197, 94, 0.35); }
.kpi--warn { border-color: rgba(251, 191, 36, 0.35); }
.kpi--danger { border-color: rgba(248, 113, 113, 0.35); }
.kpi-label { color: var(--muted); font-size: 0.78rem; }
.kpi-val {
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}
.kpi-hint { color: var(--muted); font-size: 0.75rem; }

.split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid rgba(0, 240, 160, 0.08);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted); font-weight: 600; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.keep { white-space: nowrap; }

.status-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.status-tab {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.status-tab:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: rgba(0, 240, 160, 0.35);
}
.status-tab strong {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.status-tab span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.status-tab.is-active {
  border-color: rgba(0, 240, 160, 0.45);
  background: rgba(0, 240, 160, 0.1);
  box-shadow: 0 0 0 1px rgba(0, 240, 160, 0.12);
}
.status-tab--ok.is-active { border-color: rgba(34, 197, 94, 0.5); background: rgba(34, 197, 94, 0.12); }
.status-tab--warn.is-active { border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.12); }
.status-tab--danger.is-active { border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.12); }
.status-tab--muted.is-active { border-color: rgba(143, 163, 154, 0.45); background: rgba(143, 163, 154, 0.12); }
.status-tab--ok strong { color: var(--ok); }
.status-tab--warn strong { color: var(--warn); }
.status-tab--danger strong { color: var(--danger); }

.toolbar {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.toolbar input[type="search"],
.toolbar select,
.login-form input,
.stack-form input,
.stack-form textarea,
.stack-form select {
  background: #0a1210;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  outline: none;
  min-width: 0;
}
.toolbar input[type="search"] { flex: 1; min-width: 200px; }
.toolbar select { min-width: 150px; }
.toolbar input:focus,
.login-form input:focus,
.stack-form input:focus,
.stack-form textarea:focus,
.stack-form select:focus {
  border-color: rgba(0, 240, 160, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 240, 160, 0.12);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  padding: 0.6rem 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: filter .15s, background .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--grad);
  color: #04110c;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost {
  background: transparent;
  border-color: var(--stroke);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(0, 240, 160, 0.08); }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
.btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }

.flash {
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid var(--stroke);
}
.flash--ok { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35); }
.flash--err { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.35); }
.empty {
  padding: 1rem;
  color: var(--muted);
  border: 1px dashed var(--stroke);
  border-radius: 10px;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--ok { background: rgba(34, 197, 94, 0.14); color: var(--ok); border-color: rgba(34, 197, 94, 0.3); }
.badge--warn { background: rgba(251, 191, 36, 0.14); color: var(--warn); border-color: rgba(251, 191, 36, 0.3); }
.badge--danger { background: rgba(248, 113, 113, 0.14); color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.badge--info { background: rgba(94, 234, 212, 0.14); color: var(--info); border-color: rgba(94, 234, 212, 0.3); }
.badge--muted { background: rgba(143, 163, 154, 0.12); color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--chip, var(--accent)) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip, var(--accent)) 40%, transparent);
  color: var(--text);
}

.corps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.corps-card {
  display: grid; gap: 0.35rem;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--chip) 35%, transparent);
  background: color-mix(in srgb, var(--chip) 8%, rgba(10, 18, 16, 0.7));
  color: inherit;
  text-decoration: none;
  transition: transform .2s, border-color .2s;
}
.corps-card:hover { transform: translateY(-2px); text-decoration: none; border-color: var(--chip); }
.corps-card strong { font-family: var(--display); }
.corps-meta, .corps-alert, .corps-ok { font-size: 0.8rem; color: var(--muted); }
.corps-ok { color: var(--ok); }
.corps-alert { color: var(--warn); }
.bar {
  height: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.bar i {
  display: block; height: 100%;
  background: var(--grad);
  border-radius: inherit;
}

.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.alert a {
  display: grid; gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(10, 18, 16, 0.55);
  color: inherit;
  text-decoration: none;
}
.alert a:hover { border-color: rgba(0, 240, 160, 0.35); }
.alert a span { color: var(--muted); font-size: 0.82rem; }
.alert--danger a { border-color: rgba(248, 113, 113, 0.35); }
.alert--warn a { border-color: rgba(251, 191, 36, 0.3); }

.cert-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
.cert-card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1rem;
  display: grid;
  gap: 0.7rem;
  animation: rise .4s ease both;
  box-shadow: var(--shadow);
}
.cert-card--ok { border-top: 3px solid var(--ok); }
.cert-card--warn { border-top: 3px solid var(--warn); }
.cert-card--danger { border-top: 3px solid var(--danger); }
.cert-card--muted { border-top: 3px solid var(--muted); }
.cert-card-top { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.cert-card-identity { display: flex; gap: 0.75rem; align-items: flex-start; min-width: 0; }
.cert-logo {
  width: 72px; height: 48px; object-fit: contain;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  padding: 0.25rem 0.35rem;
  flex-shrink: 0;
}
.cert-detail-logo {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  display: inline-flex;
}
.cert-detail-logo img { max-height: 64px; max-width: 220px; object-fit: contain; }
.cert-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}
.cert-title:hover { color: var(--accent-2); }
.cert-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0;
}
.cert-meta dt { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.cert-meta dd { margin: 0.1rem 0 0; font-weight: 600; }
.cert-notes { margin: 0; color: var(--muted); font-size: 0.88rem; }

.kv { display: grid; gap: 0.55rem; margin: 0; }
.kv > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(0, 240, 160, 0.08);
}
.kv dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; }
.notes-block {
  margin: 1rem 0 0;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(0, 240, 160, 0.06);
  border: 1px solid var(--stroke);
}

.stack-form { display: grid; gap: 0.55rem; }
.stack-form label { display: grid; gap: 0.3rem; }
.stack-form label > span { color: var(--muted); font-size: 0.85rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.check-grid {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}
.check-grid legend { padding: 0 0.35rem; color: var(--muted); font-size: 0.85rem; }
.check-grid .check {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem;
}

.doc-list { list-style: none; margin: 0.85rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.doc-list li {
  display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(10, 18, 16, 0.55);
  border: 1px solid rgba(0, 240, 160, 0.1);
}
.doc-list--rich li { align-items: center; }
.linkish {
  background: none; border: 0; color: var(--accent-2); cursor: pointer; padding: 0;
  font: inherit;
}
.linkish:hover { text-decoration: underline; }

.corps-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.corps-panel { border-left: 3px solid var(--chip, var(--accent)); }
.mini-cert { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.mini-cert li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: rgba(10, 18, 16, 0.5);
  border: 1px solid rgba(0, 240, 160, 0.08);
}
.mini-cert time { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }

.action-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.action-list li {
  display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(10, 18, 16, 0.55);
  border: 1px solid rgba(0, 240, 160, 0.1);
}
.action-list li.is-overdue { border-color: rgba(248, 113, 113, 0.4); }
.action-list li.is-done { opacity: 0.55; }
.action-side { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; justify-content: flex-end; }
.action-side time { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }

.foot {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--muted); font-size: 0.82rem;
}

/* —— Connexion type fenêtre (KommandIA) —— */
.gate-body {
  min-height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 240, 160, 0.16), transparent 55%),
    #0b0e14;
  color: #f2f7f4;
  font-family: var(--font);
}
.gate-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  padding: 32px 16px;
}
.km-modal-box {
  position: relative;
  z-index: 1;
  background: #141b24;
  width: min(440px, calc(100vw - 48px));
  max-height: min(86vh, 860px);
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 240, 160, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gate-box { width: min(440px, calc(100vw - 48px)); z-index: 1; }
.gate-box[hidden] { display: none; }
.gate-box.is-pinned { position: fixed; margin: 0; max-height: none; }
.gate-box .km-modal-header { cursor: grab; }
.gate-box.is-max .km-modal-header,
.gate-box.is-min .km-modal-header { cursor: default; }
.km-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: #10161e;
  border-bottom: 1px solid rgba(0, 240, 160, 0.14);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}
.km-modal-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  flex: 1;
  min-width: 0;
  color: #f2f7f4;
  font-family: var(--font);
}
.km-modal-win {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  flex-shrink: 0;
}
.km-win {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 -1px 1px rgba(0, 0, 0, 0.18) inset;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.km-win:hover { transform: scale(1.1); filter: brightness(1.05); }
.km-win:active { transform: scale(0.96); filter: brightness(0.96); }
.km-win-min {
  background: radial-gradient(120% 90% at 30% 18%, #ffe27a 0%, #ffc53d 38%, #f5a623 72%, #d8890c 100%);
}
.km-win-max {
  background: radial-gradient(120% 90% at 30% 18%, #7dff8f 0%, #3fd65a 38%, #22c53e 72%, #14a32e 100%);
}
.km-win-close {
  background: radial-gradient(120% 90% at 30% 18%, #ff9a93 0%, #ff6b63 38%, #ff3b30 72%, #d92018 100%);
}
.km-win::before {
  content: "";
  position: absolute;
  left: 14%; right: 14%; top: 8%;
  height: 38%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.km-win::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: center / 11px 11px no-repeat;
  pointer-events: none;
}
.km-win-min::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 6h7.6' stroke='%231a1a1a' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.km-win-max::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Crect x='2.6' y='2.6' width='6.8' height='6.8' rx='0.6' fill='none' stroke='%23fff' stroke-width='1.7'/%3E%3C/svg%3E");
}
.km-win-max.is-restore::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.2 2.8h5v5' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3Crect x='2.4' y='4' width='5.2' height='5.2' rx='0.4' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E");
}
.km-win-close::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 3l6 6M9 3L3 9' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.km-modal-resize {
  position: absolute;
  right: 0; bottom: 0;
  width: 22px; height: 22px;
  cursor: nwse-resize;
  z-index: 3;
  touch-action: none;
}
.km-modal-resize::after {
  content: "";
  position: absolute;
  right: 4px; bottom: 4px;
  width: 8px; height: 8px;
  border-right: 2px solid rgba(143, 163, 154, 0.7);
  border-bottom: 2px solid rgba(143, 163, 154, 0.7);
}
.gate-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 8px;
}
.gate-brand img {
  display: block;
  width: 210px;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}
html[data-theme="dark"] .gate-brand .logo--light,
html[data-theme="dark"] .gate-hero .logo--light,
html:not([data-theme]) .gate-brand .logo--light,
html:not([data-theme]) .gate-hero .logo--light,
html[data-theme="light"] .gate-brand .logo--dark,
html[data-theme="light"] .gate-hero .logo--dark {
  display: none;
}
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 28px 26px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.gate-form p { margin: 0; color: #8fa39a; line-height: 1.45; }
.gate-form .fld {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #c5d5ce;
  font-weight: 600;
}
.gate-form .fld input {
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 160, 0.22);
  background: #0c1218;
  color: #f2f7f4;
  font-weight: 500;
  outline: none;
}
.gate-form .fld input:focus {
  border-color: rgba(0, 128, 96, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 240, 160, 0.18);
}
.pass-wrap { position: relative; display: block; }
.pass-wrap input { width: 100%; padding-right: 40px !important; }
.pass-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #8fa39a;
  padding: 4px;
  display: flex;
  border-radius: 6px;
  cursor: pointer;
}
.pass-eye:hover { color: #f2f7f4; background: rgba(255, 255, 255, 0.06); }
.pass-eye .eye-off { display: none; }
.pass-eye.is-on .eye-on { display: none; }
.pass-eye.is-on .eye-off { display: block; }
.gate-form .btn {
  align-self: flex-start;
  margin-top: 6px;
  padding: 10px 18px;
  border-radius: 8px;
}
.gate-form .btn-primary {
  background: var(--grad);
  border: 1px solid #008060;
  color: #04110c;
}
.gate-error { color: #9d342c !important; font-weight: 600; }
.gate-box.is-max {
  position: fixed;
  left: 16px;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
}
.gate-box.is-max .km-modal-resize { display: none; }
.gate-box.is-min {
  position: fixed;
  left: 18px;
  bottom: 18px;
  width: auto;
  height: auto;
  max-height: none;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
.gate-box.is-min .gate-form,
.gate-box.is-min .km-modal-resize { display: none; }
.gate-box.is-min .km-modal-header {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: #141b24;
}
.gate-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.gate-hero[hidden] { display: none; }
.gate-hero img {
  display: block;
  width: min(260px, 80vw);
  height: auto;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}
.gate-hero-title {
  font-family: var(--display);
  font-size: 2rem;
  letter-spacing: -0.03em;
  color: #f2f7f4;
}
.gate-hero-title span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gate-hero .btn { padding: 12px 26px; font-size: 16px; }

.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(560px, calc(100vw - 2rem));
  width: 100%;
}
.modal::backdrop { background: rgba(4, 8, 10, 0.72); backdrop-filter: blur(4px); }
.modal-card {
  background: var(--bg-2);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-card > header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--stroke);
}
.modal-card > header h2 { margin: 0; font-size: 1.05rem; font-family: var(--display); }
.modal-body { padding: 1rem; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 0.55rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--stroke);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse-soft {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 14px rgba(0, 240, 160, 0.3)); }
  50% { transform: scale(1.03); filter: drop-shadow(0 0 22px rgba(0, 240, 160, 0.45)); }
}

@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split, .cert-list, .corps-board, .corps-grid { grid-template-columns: 1fr; }
  .status-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .status-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: rgba(11, 14, 20, 0.97);
    border-bottom: 1px solid var(--stroke);
    padding: 0.75rem;
  }
  .nav.is-open { display: flex; }
  .top-user { margin-left: 0; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fold-kid { flex-direction: column; align-items: flex-start; }
  .fold-kid-side { justify-content: flex-start; }
  .row2, .cert-meta, .check-grid, .mini-cert li { grid-template-columns: 1fr; }
  .kv > div { grid-template-columns: 1fr; }
  .action-list li { flex-direction: column; }
}


.folds { display: grid; gap: 0.7rem; }
.fold {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.fold > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.95rem 1.1rem;
  user-select: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: rgba(0, 240, 160, 0.05); }
.fold-text { display: grid; gap: 0.15rem; min-width: 0; }
.fold-text strong { font-family: var(--display); font-size: 1.05rem; }
.fold-text span { color: var(--muted); font-size: 0.82rem; }
.fold-count {
  font-family: var(--display);
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1;
  min-width: 1.6ch;
  text-align: right;
}
.fold-chevron {
  width: 9px; height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .15s ease;
}
.fold[open] > summary .fold-chevron { transform: rotate(-135deg) translateY(-2px); }
.fold--ok { border-color: rgba(34, 197, 94, 0.4); }
.fold--ok .fold-count { color: var(--ok); }
.fold--warn { border-color: rgba(251, 191, 36, 0.45); }
.fold--warn .fold-count { color: var(--warn); }
.fold--danger { border-color: rgba(248, 113, 113, 0.45); }
.fold--danger .fold-count { color: var(--danger); }
.fold-body { padding: 0 0.4rem 0.85rem; }
.fold-kids {
  list-style: none;
  margin: 0 0.4rem 0 1.15rem;
  padding: 0.15rem 0 0.15rem 0.95rem;
  border-left: 2px solid rgba(0, 240, 160, 0.55);
}
.fold-kid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.15rem;
  border-bottom: 1px solid rgba(0, 240, 160, 0.1);
  color: inherit;
  text-decoration: none;
}
.fold-kids li:last-child .fold-kid { border-bottom: 0; }
.fold-kid:hover { text-decoration: none; color: var(--accent-2); }
.fold-kid-main { display: grid; gap: 0.12rem; min-width: 0; }
.fold-kid-main strong { font-size: 0.98rem; }
.fold-kid-main span, .fold-kid time { color: var(--muted); font-size: 0.8rem; }
.fold-kid-side { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; justify-content: flex-end; }
.fold-empty { margin: 0.2rem 1.15rem 0.35rem; color: var(--muted); }
.fold-nest { display: grid; gap: 0.55rem; margin: 0.15rem 0.35rem 0.2rem 1.15rem; padding-left: 0.85rem; border-left: 2px solid rgba(0, 240, 160, 0.35); }
.fold-nest .fold { box-shadow: none; }

html[data-theme="light"] {
  --bg: #f3faf6;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.9);
  --stroke: rgba(0, 128, 96, 0.18);
  --text: #10241c;
  --muted: #5c7268;
  --shadow: 0 18px 48px rgba(16, 36, 28, 0.12);
}
html[data-theme="light"] .bg {
  background:
    radial-gradient(900px 480px at 8% -8%, rgba(0, 240, 160, 0.12), transparent 55%),
    linear-gradient(180deg, #eef8f3 0%, var(--bg) 45%, #e8f2ec 100%);
}
html[data-theme="light"] .top {
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: rgba(0, 128, 96, 0.12);
}
html[data-theme="light"] .toolbar input,
html[data-theme="light"] .toolbar select,
html[data-theme="light"] .stack-form input,
html[data-theme="light"] .stack-form textarea,
html[data-theme="light"] .stack-form select,
html[data-theme="light"] .modal-card input,
html[data-theme="light"] .modal-card textarea,
html[data-theme="light"] .modal-card select {
  background: #fff;
  color: var(--text);
  border-color: rgba(0, 128, 96, 0.22);
}
html[data-theme="light"] .doc-list li,
html[data-theme="light"] .mini-cert li,
html[data-theme="light"] .action-list li,
html[data-theme="light"] .alert a,
html[data-theme="light"] .corps-card {
  background: #fff;
  color: var(--text);
}
html[data-theme="light"] .nav.is-open { background: rgba(255, 255, 255, 0.98); }
html[data-theme="light"] .gate-body {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 255, 255, 0.55), transparent 60%),
    #e7e2d4;
  color: #1c2416;
}
html[data-theme="light"] .km-modal-box {
  background: #fff;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(28, 36, 22, 0.06);
}
html[data-theme="light"] .km-modal-header {
  background: #f6f3ea;
  border-bottom-color: #e6e0d2;
}
html[data-theme="light"] .km-modal-header h2,
html[data-theme="light"] .gate-hero-title { color: #1c2416; }
html[data-theme="light"] .gate-form p { color: #5e6756; }
html[data-theme="light"] .gate-form .fld { color: #3d4636; }
html[data-theme="light"] .gate-form .fld input {
  border-color: #d5d0c2;
  background: #f0f4f8;
  color: #1c2416;
}
html[data-theme="light"] .pass-eye { color: #6b6558; }
html[data-theme="light"] .pass-eye:hover { color: #1c2416; background: #f4f1e6; }
html[data-theme="light"] .gate-box.is-min .km-modal-header { background: #fff; }
html[data-theme="light"] .km-modal-resize::after {
  border-right-color: #b7b09e;
  border-bottom-color: #b7b09e;
}
