:root {
  --bg: #0b0d12;
  --surface: #161922;
  --surface-2: #1d2128;
  --border: #2a2e38;
  --text: #e8e9ed;
  --muted: #8b8f9a;
  --accent: #5b8cff;
  --accent-strong: #3b6fea;
  --success: #2ecc71;
  --warning: #f5a623;
  --danger: #ef5a6f;
  --danger-bg: #2a1a1e;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scroll-area {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 40px;
}

footer.site-footer { flex-shrink: 0; }

.site-header {
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 2px solid var(--accent-strong);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.header-inner .brand {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -.01em;
}

.header-inner .brand:hover { opacity: .85; }

.header-inner .brand::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.logout-link {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(239, 90, 111, .3);
  padding: 5px 12px;
  border-radius: 8px;
  transition: background .2s;
}
.logout-link:hover { background: rgba(239, 90, 111, .1); }

.tab-nav {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 0 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }

@media (max-width: 600px) {
  .header-inner { padding: 9px 16px; gap: 8px; }
  .header-inner .brand { font-size: 14px; }
  .logout-link { padding: 5px 10px; font-size: 11px; }

  .tab-nav { padding: 0 6px; gap: 1px; }
  .tab-btn { padding: 11px 10px; font-size: 12.5px; }
}

h1 { font-size: 19px; margin: 0 0 22px; color: var(--text); font-weight: 600; }

.breadcrumb {
  font-size: 13px;
  margin-bottom: 20px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--muted); text-decoration: none; padding: 4px 2px; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb a:last-child { color: var(--text); font-weight: 600; }
.breadcrumb .sep { margin: 0 6px; color: #444; }

.btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}

.btn:hover { background: #262b35; border-color: #3a3f4c; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.primary:hover { background: #2f5fd9; }
.btn.danger { background: var(--danger-bg); border-color: #4a2a30; color: var(--danger); }
.btn.danger:hover { background: #3a2126; }

input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
input[type=text],
input[type=password] {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 16px;
}
input[type=text]:focus,
input[type=password]:focus { outline: none; border-color: var(--accent); }
input[type=text]:-webkit-autofill,
input[type=password]:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0px 1000px var(--bg) inset;
  transition: background-color 5000s ease-in-out 0s;
}

.error {
  background: var(--danger-bg);
  border: 1px solid #4a2a30;
  color: var(--danger);
  padding: 14px 18px;
  border-radius: var(--radius);
}

.empty {
  color: var(--muted);
  padding: 48px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

footer.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
footer.site-footer div { display: inline; }
footer.site-footer div:first-child::after { content: ' · '; }
footer.site-footer a { color: inherit; text-decoration: underline; }

@media (max-width: 600px) {
  footer.site-footer div { display: block; }
  footer.site-footer div:first-child::after { content: ''; }
}
