@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700;800&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --black: #0a0a0a;
  --near-black: #101210;
  --panel: #1b1b1b;
  --line: #333333;
  --gray: #8a8a8a;
  --white: #f7f7f5;
  --dim-white: #c9c9c6;
  --green: #4dff7a;
  --green-dim: #2fb85c;
  --green-glow: rgba(77,255,122,0.45);
  --display: 'Space Grotesk', sans-serif;
  --body: 'Inter', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --radius: 2px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--body);
  background: var(--black);
  color: var(--white);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--green); color: var(--black); }

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 190px;
  flex-shrink: 0;
  background: var(--near-black);
  border-right: 1px solid var(--line);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar .brand {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--white);
  padding: 0 0.4rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar .brand img { width: 20px; height: 20px; }
.sidebar a {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--gray);
  padding: 9px 10px;
  border-radius: var(--radius);
  text-transform: uppercase;
  transition: color .2s, background .2s;
}
.sidebar a.active {
  background: var(--panel);
  color: var(--green);
}
.sidebar a.disabled {
  color: #4a4a4a;
  cursor: default;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar a.disabled .soon {
  font-size: 9px;
  color: #4a4a4a;
  border: 1px solid #2a2a2a;
  padding: 1px 5px;
  border-radius: var(--radius);
  letter-spacing: 0.03em;
}
.sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.sidebar-footer a:hover { color: var(--white); }

.content { flex: 1; min-width: 0; padding: 2rem 2.5rem; max-width: 920px; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }

.status-pill { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.dot.off { background: #ff5c5c; }
.tag {
  font-family: var(--mono); font-size: 11px; color: var(--dim-white);
  border: 1px solid var(--line); padding: 3px 9px; border-radius: var(--radius);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.banner {
  font-family: var(--mono); font-size: 12.5px; color: var(--green);
  border: 1px solid var(--green-dim); background: rgba(77,255,122,0.06);
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 1.5rem;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 2rem; }
.stat-card { background: var(--black); padding: 1.1rem 1.2rem; }
.stat-label { font-family: var(--mono); font-size: 10.5px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 8px; }
.stat-value { font-family: var(--mono); font-size: 26px; font-weight: 600; margin: 0; color: var(--white); }
.stat-sub { font-size: 14px; color: var(--gray); font-weight: 400; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.restrict-card { background: var(--black); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 8px; }
.restrict-title { font-family: var(--display); font-weight: 700; font-size: 15px; margin: 0; }
.restrict-row { display: flex; gap: 8px; }
.restrict-row input, .restrict-row select {
  background: var(--near-black); border: 1px solid var(--line); color: var(--white);
  padding: 9px 10px; border-radius: var(--radius); font-family: var(--mono); font-size: 12.5px; flex: 1; min-width: 0;
}
.restrict-row input:focus, .restrict-row select:focus { outline: none; border-color: var(--green); }
.restrict-card .ctrl-btn { align-self: flex-start; margin-top: 4px; }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .restrict-row { flex-direction: column; }
}

.mode-row { display: flex; gap: 6px; margin-bottom: 1.5rem; }
.mode-btn {
  font-family: var(--mono); font-size: 11.5px; padding: 6px 14px; border-radius: var(--radius);
  color: var(--gray); border: 1px solid var(--line); background: transparent; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.03em; transition: border-color .2s, color .2s;
}
.mode-btn:hover { border-color: var(--dim-white); color: var(--dim-white); }
.mode-btn.active { border-color: var(--green); color: var(--green); }

.service-controls { display: flex; align-items: center; gap: 8px; }
.pause-form { display: flex; align-items: center; gap: 6px; }
.pause-form input {
  width: 64px; background: var(--black); border: 1px solid var(--line); color: var(--white);
  padding: 8px 10px; border-radius: var(--radius); font-family: var(--mono); font-size: 12px;
}
.pause-form input:focus { outline: none; border-color: var(--green); }
.ctrl-btn {
  font-family: var(--mono); font-size: 12.5px; background: var(--white); color: var(--black);
  border: none; padding: 8px 14px; border-radius: var(--radius); cursor: pointer;
  transition: transform .15s, box-shadow .2s; white-space: nowrap;
}
.ctrl-btn:hover { transform: translateY(-1px); box-shadow: 0 0 16px var(--green-glow); }
.ctrl-btn.danger { background: transparent; color: var(--dim-white); border: 1px solid var(--line); }
.ctrl-btn.danger:hover { border-color: #ff5c5c; color: #ff5c5c; box-shadow: none; transform: none; }

.mobile-menu-btn {
  display: none;
  position: fixed; top: 14px; left: 14px; z-index: 60;
  width: 38px; height: 38px; background: var(--near-black); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--white); font-size: 16px; cursor: pointer;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 45;
}

@media (max-width: 760px) {
  .mobile-menu-btn { display: block; }
  .shell { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    width: 220px; transform: translateX(-100%); transition: transform .25s ease;
    padding-top: 4rem;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .content { padding: 4.5rem 1.25rem 2rem; max-width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .section-title { flex-wrap: wrap; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .service-controls { width: 100%; flex-wrap: wrap; }
  .pause-form { flex: 1; min-width: 140px; }
  .pause-form input { flex: 1; width: auto; }
  .thumb-row input[type="checkbox"] { width: 20px; height: 20px; }
  .thumb { width: 52px; height: 74px; }
  .submit-row { flex-direction: column; align-items: stretch; }
  .submit-btn { width: 100%; }
  .pager { justify-content: center; }
  .login-card { width: 88%; max-width: 300px; }
}

.stat-value.level-0 { color: var(--white); }
.stat-value.level-1 { color: #ffe66d; }
.stat-value.level-2 { color: #ffa94d; }
.stat-value.level-3 { color: #ff5c5c; }

.section-title {
  font-family: var(--display); font-weight: 700; font-size: 18px;
  margin: 2rem 0 1rem; padding-bottom: 12px; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 10px;
}
.section-title .sec-num { font-family: var(--mono); font-size: 11px; color: var(--gray); letter-spacing: 0.08em; }
.muted { color: var(--gray); }
.small { font-size: 12px; }

.list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--black); padding: 12px 14px; transition: background .2s;
}
.list-row:hover { background: var(--near-black); }
.list-row.overdue { border-left: 2px solid #ff5c5c; }
.list-row a { color: var(--green); font-family: var(--mono); font-size: 12px; }
.row-title { margin: 0; font-size: 13px; font-family: var(--mono); }

.filter-row { display: flex; gap: 6px; }
.filter-row a {
  font-family: var(--mono); font-size: 11px; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--gray); text-transform: uppercase; letter-spacing: 0.04em;
}
.filter-row a.active { border-color: var(--green); color: var(--green); }

.phase-note {
  margin-top: 2.5rem; font-family: var(--mono); font-size: 11px; color: var(--gray);
  border-top: 1px solid var(--line); padding-top: 1rem; text-transform: uppercase; letter-spacing: 0.04em;
}

.flash {
  font-family: var(--mono); font-size: 12.5px; color: #ff8080;
  border: 1px solid #5c2020; background: rgba(255,92,92,0.08);
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 1rem;
}

.thumb-row { cursor: pointer; }
.thumb-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--green); flex-shrink: 0; cursor: pointer;
}
.thumb {
  width: 42px; height: 60px; object-fit: cover; border-radius: var(--radius);
  border: 1px solid var(--line); flex-shrink: 0; background: var(--near-black);
}
.thumb-empty { display: flex; }

.submit-btn {
  margin-top: 1rem; font-family: var(--mono); font-size: 13px;
  background: var(--white); color: var(--black); border: none;
  padding: 12px 22px; border-radius: var(--radius); cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.submit-btn:hover { transform: translateY(-1px); box-shadow: 0 0 20px var(--green-glow); }

.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }

.pager { display: flex; align-items: center; gap: 10px; }
.pager-label { font-family: var(--mono); font-size: 11px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.04em; }
.pager-btn {
  font-family: var(--mono); font-size: 13px; color: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s;
}
.pager-btn:hover { border-color: var(--green); color: var(--green); }
.pager-btn.disabled { color: #3a3a3a; border-color: #222222; pointer-events: none; }

.lightbox {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.88); align-items: center; justify-content: center;
  cursor: zoom-out; padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(90vw, 480px); max-height: 85vh; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 0 40px rgba(77,255,122,0.15);
}

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--black); position: relative; overflow: hidden; }
.login-wrap::before {
  content: ''; position: absolute; width: 560px; height: 560px; border-radius: 50%;
  top: -220px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, var(--green-glow) 0%, rgba(77,255,122,0) 70%);
  filter: blur(10px); opacity: 0.28; pointer-events: none;
}
.login-card {
  position: relative; background: var(--near-black); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2.5rem 2.25rem; width: 300px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-title {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gray); margin: 0 0 0.5rem; text-align: center;
}
.login-card input {
  background: var(--black); border: 1px solid var(--line); color: var(--white);
  padding: 12px 14px; border-radius: var(--radius); font-size: 14px; font-family: var(--body);
}
.login-card input:focus { outline: none; border-color: var(--green); }
.login-card button {
  font-family: var(--mono); font-size: 13px; padding: 12px; border: none;
  border-radius: var(--radius); background: var(--white); color: var(--black); cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.login-card button:hover { transform: translateY(-1px); box-shadow: 0 0 20px var(--green-glow); }

