:root {
  --bg: #031927;
  --bg-soft: #043f63;
  --card: #0a2f47;
  --line: #1d5f86;
  --text: #e8f0fb;
  --muted: #abd5e8;
  --accent: #01add8;
  --accent-soft: #86d0e6;
  --ok: #49bf84;
}

* { box-sizing: border-box; }

.is-hidden {
  display: none !important;
}

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(1600px 600px at 10% -10%, #0a81bc 0%, transparent 55%), radial-gradient(1200px 800px at 100% 0%, #0465a0 0%, transparent 60%), var(--bg);
  font-family: "Exo", "IBM Plex Sans", Arial, sans-serif;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(transparent 95%, rgba(255, 255, 255, 0.03) 95%), linear-gradient(90deg, transparent 95%, rgba(255, 255, 255, 0.03) 95%);
  background-size: 24px 24px;
  opacity: 0.25;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(3, 25, 39, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 68px;
  height: auto;
}

.login-logo {
  width: 110px;
  height: auto;
  margin-bottom: 0.5rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent-soft);
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1, h2, h3 { font-family: "Exo", sans-serif; margin: 0 0 0.8rem; }
h1 { margin: 0.1rem 0 0; font-size: 1.4rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; color: var(--accent-soft); }

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  padding: 1rem;
}

.nav {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7, 39, 59, 0.95), rgba(5, 30, 45, 0.95));
  border-radius: 14px;
  padding: 0.7rem;
  position: sticky;
  top: 76px;
  height: fit-content;
}

.tab {
  width: 100%;
  border: 1px solid transparent;
  color: var(--text);
  background: transparent;
  text-align: left;
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.tab:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.04); }
.tab.active { background: rgba(1, 173, 216, 0.18); border-color: #0a81bc; color: #c8f4ff; }

.session-box {
  margin-top: 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.content { min-width: 0; }

.panel {
  display: none;
  border: 1px solid #d8e5ef;
  border-radius: 14px;
  background: #ffffff;
  color: #1c2b39;
  padding: 1rem;
}

.panel.active { display: block; }

.grid { display: grid; gap: 0.8rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #3d556a;
  font-size: 0.88rem;
}

input, textarea, select {
  width: 100%;
  border-radius: 9px;
  border: 1px solid #c8d9e6;
  background: #ffffff;
  color: #0f2233;
  padding: 0.6rem 0.65rem;
  font-family: inherit;
}

textarea { resize: vertical; }

.btn {
  border: 1px solid #0465a0;
  color: #ffffff;
  background: linear-gradient(180deg, #01add8, #0a81bc);
  border-radius: 10px;
  padding: 0.58rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn.ghost {
  border-color: #b4c7d6;
  color: #1f3a53;
  background: #f6f9fc;
}

.card {
  border: 1px solid #d8e5ef;
  border-radius: 11px;
  padding: 0.85rem;
  background: #ffffff;
}

.result-grid {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-box {
  border: 1px solid #d8e5ef;
  background: #ffffff;
  color: #112538;
  border-radius: 10px;
  padding: 0.75rem;
  min-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.helper {
  margin: 0 0 0.8rem;
  color: #365067;
  font-size: 0.9rem;
}

.guide-list {
  margin: 0;
  padding-left: 1.1rem;
  color: #223a4f;
}

.guide-list li {
  margin-bottom: 0.35rem;
}

[data-admin-only].is-hidden {
  display: none !important;
}

[data-role-scope="admin"].is-hidden {
  display: none !important;
}

.table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table th,
.data-table td {
  border: 1px solid #d8e5ef;
  padding: 0.45rem;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f6fbff;
  color: #284055;
}

.inline-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.inline-btn {
  border: 1px solid #c8d9e6;
  background: #ffffff;
  color: #24425a;
  border-radius: 7px;
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.toolbar {
  margin: 0.7rem 0;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.top-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.session-pill {
  border: 1px solid #1d5f86;
  background: rgba(1, 173, 216, 0.16);
  color: #dff7ff;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.top-actions input { min-width: 280px; }

.status {
  position: fixed;
  top: 84px;
  right: 16px;
  z-index: 50;
  max-width: min(520px, calc(100vw - 32px));
  border: 1px solid #386e54;
  color: #c8ffe5;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  background: #0f3a2b;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.status-close {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: inherit;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; }
  .nav { position: static; }
  .grid.two, .result-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; }
  .top-actions { flex-wrap: wrap; }
  .top-actions input { min-width: 0; }
}
