/* File: public/style.css */
:root {
  --bg: #0b1020;
  --bg-soft: #111833;
  --panel: rgba(18, 25, 51, 0.82);
  --panel-solid: #121933;
  --panel-2: #182243;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f7ff;
  --muted: #aab6d4;
  --primary: #6ea8fe;
  --primary-strong: #4f8ef7;
  --accent: #6ef3d6;
  --danger: #ff7f96;
  --warning: #ffd37a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max: 1220px;
  --font:
    Inter, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top left, rgba(110, 168, 254, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(110, 243, 214, 0.12), transparent 22%),
    linear-gradient(180deg, #08101e 0%, #0d1326 100%);
  color: var(--text);
  font-family: var(--font);
  min-height: 100%;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 14px;
  outline: none;
  transition: 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(110, 168, 254, 0.55);
  box-shadow: 0 0 0 4px rgba(110, 168, 254, 0.14);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.app-shell.narrow {
  width: min(980px, calc(100% - 32px));
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1,
.sidebar-brand h1 {
  font-size: 20px;
  font-weight: 700;
}

.brand p,
.sidebar-brand p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  color: #06101d;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 30px rgba(110, 168, 254, 0.35);
}

.page {
  display: grid;
  gap: 22px;
}

.page-login {
  min-height: calc(100vh - 120px);
  align-items: center;
}

.hero-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  padding: 30px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(18px);
}

.hero-copy {
  padding: 14px;
  align-self: center;
}

.eyebrow {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(110, 243, 214, 0.22);
  background: rgba(110, 243, 214, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-copy h2 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  margin-bottom: 18px;
}

.hero-copy p {
  color: var(--muted);
  line-height: 1.8;
  max-width: 56ch;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.login-card {
  padding: 24px;
}

.card-head {
  margin-bottom: 18px;
}

.card-head h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.card-head p {
  color: var(--muted);
  line-height: 1.7;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.two-col .full {
  grid-column: 1 / -1;
}

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 16px;
  cursor: pointer;
  transition: 0.18s ease;
  font-weight: 600;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #071120;
  border-color: transparent;
}

.btn-primary:hover {
  filter: brightness(1.04);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
}

.btn-block {
  width: 100%;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.status-text {
  min-height: 24px;
  color: var(--warning);
  margin-top: 14px;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.sidebar {
  position: sticky;
  top: 18px;
  height: fit-content;
  background: rgba(14, 21, 42, 0.88);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.nav-list {
  display: grid;
  gap: 10px;
  margin: 28px 0;
}

.nav-item {
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
  transition: 0.18s ease;
  border: 1px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: rgba(110, 168, 254, 0.08);
  border-color: rgba(110, 168, 254, 0.18);
}

.content {
  display: grid;
  gap: 22px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.content-header h2 {
  font-size: 34px;
  margin-top: 8px;
  margin-bottom: 10px;
}

.content-header p {
  color: var(--muted);
  line-height: 1.8;
  max-width: 70ch;
}

.meta-badge {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  white-space: nowrap;
}

.section-grid {
  display: grid;
  gap: 16px;
}

.section-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.035));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.metric-card span {
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

.metric-card strong {
  font-size: 28px;
  line-height: 1.2;
}

.section-card {
  padding: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.section-head h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.section-head p {
  color: var(--muted);
  line-height: 1.75;
}

.toggle-list {
  display: grid;
  gap: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.toggle-meta strong {
  display: block;
  margin-bottom: 6px;
}

.toggle-meta span {
  color: var(--muted);
  font-size: 13px;
}

.switch {
  position: relative;
  width: 58px;
  height: 34px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  cursor: pointer;
  transition: 0.18s ease;
}

.switch input {
  display: none;
}

.switch-slider {
  position: absolute;
  inset: 4px auto 4px 4px;
  width: 26px;
  border-radius: 50%;
  background: white;
  transition: 0.18s ease;
}

.switch input:checked + .switch-slider {
  transform: translateX(24px);
}

.switch:has(input:checked) {
  background: rgba(110, 168, 254, 0.6);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.data-table td {
  vertical-align: top;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(110, 243, 214, 0.1);
  color: var(--accent);
  border: 1px solid rgba(110, 243, 214, 0.18);
}

.badge-pill.off {
  background: rgba(255, 127, 150, 0.08);
  color: var(--danger);
  border-color: rgba(255, 127, 150, 0.16);
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.summary-list {
  display: grid;
  gap: 12px;
}

.summary-item {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  gap: 10px;
}

.summary-item-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.summary-item p {
  color: var(--muted);
  line-height: 1.7;
}

.message-box {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  line-height: 1.9;
  color: var(--text);
  white-space: pre-wrap;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
}

.danger-link {
  color: var(--danger);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

@media (max-width: 1100px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .section-grid.four,
  .section-grid.three,
  .two-col,
  .hero-card {
    grid-template-columns: 1fr;
  }

  .content-header {
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  .app-shell,
  .dashboard-shell {
    width: min(100% - 20px, 100%);
    padding-top: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-copy h2 {
    font-size: 34px;
  }

  .section-card,
  .login-card,
  .hero-card {
    padding: 18px;
  }

  .preset-grid {
    grid-template-columns: 1fr;
  }
}
