/* xtike — cyberpunk dark theme (black / white / neon red) */
:root {
  --bg: #07060a;
  --bg-elev: #0f0d14;
  --bg-elev-2: #16131c;
  --border: #261c2a;
  --border-strong: #3a2a40;
  --text: #f0e9ee;
  --muted: #8a7a90;
  --red: #ff2d55;
  --red-hover: #ff4d6d;
  --red-dim: #2a0814;
  --neon: #ff2d55;
  --neon-2: #ff0033;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background:
    radial-gradient(ellipse at top, rgba(255, 45, 85, 0.06), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(80, 0, 120, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--red-hover); }

header {
  background: #000;
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header .brand { font-weight: 700; font-size: 1.15rem; color: #fff; letter-spacing: 2px; text-transform: uppercase; text-shadow: 0 0 8px rgba(255, 45, 85, 0.5); }
header .brand span { color: var(--red); }
header nav a { margin-left: 16px; color: var(--muted); }
header nav a.active { color: #fff; font-weight: 600; }
header nav a:hover { color: var(--red); text-decoration: none; }

main {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 32px;
}

.intro { margin-bottom: 16px; }
.intro h1 { font-size: 1.4rem; margin: 0 0 4px; color: #fff; }
.intro p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.status {
  margin: 12px 0;
  padding: 8px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}
.status.ok { color: var(--red); border-color: var(--red-dim); background: #150505; }

table.services {
  width: 100%;
  background: var(--bg-elev);
  border-collapse: collapse;
  border: 1px solid var(--border);
}
table.services th, table.services td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
table.services th {
  background: var(--bg-elev-2);
  font-weight: 600;
  color: var(--muted);
}
table.services tr:last-child td { border-bottom: 0; }
table.services tr.disabled td { color: #555; }
table.services .qty { font-weight: 600; color: #fff; }
table.services .updated { color: var(--muted); font-size: 0.8rem; }
table.services td.actions { text-align: right; }

/* Service cards (zefoy-style grid) */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
  margin-top: 8px;
}
.service-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  min-height: 240px;
  transition: border-color 0.15s, transform 0.15s;
}
.service-card:hover {
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--red), 0 0 22px rgba(255, 45, 85, 0.18);
}
.service-card .icon {
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(255, 45, 85, 0.45));
}
.service-card .name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #fff;
}
.service-card .qty {
  font-size: 0.95rem;
  color: var(--muted);
}
.service-card .status-line {
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 12px;
  background: var(--bg-elev-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.service-card .status-line.working {
  background: transparent;
  color: #fff;
  border-color: #fff;
}
.service-card .status-line.cooldown {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-strong);
}
.service-card .status-line.down {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red);
}
.service-card button {
  margin-top: 8px;
  width: 100%;
  padding: 10px 16px;
  font-size: 0.95rem;
}
.service-card .updated {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: auto;
}

button {
  font: inherit;
  padding: 6px 14px;
  border: 1px solid var(--red);
  background: var(--red);
  color: #fff;
  border-radius: 2px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.85rem;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  box-shadow: 0 0 0 0 rgba(255, 45, 85, 0);
}
button:hover:not(:disabled) { background: var(--red-hover); border-color: var(--red-hover); box-shadow: 0 0 14px rgba(255, 45, 85, 0.45); }
button:disabled { background: #2a2a2a; border-color: #2a2a2a; color: #666; cursor: not-allowed; }
button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
button.secondary:hover { background: var(--bg-elev-2); border-color: #fff; }

input[type=text], input[type=password], input[type=number], textarea {
  font: inherit;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: #000;
  color: var(--text);
}
input:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 0 12px rgba(255, 45, 85, 0.25); }
textarea { font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; min-height: 70px; }

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  backdrop-filter: blur(2px);
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--bg-elev);
  padding: 20px;
  border-radius: 2px;
  width: 92%; max-width: 420px;
  border: 1px solid var(--red);
  box-shadow: 0 0 40px rgba(255, 45, 85, 0.25), inset 0 0 0 1px rgba(255, 45, 85, 0.08);
}
.modal-card h2 { margin: 0 0 8px; font-size: 1.1rem; color: #fff; }
.modal-card p { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }
.modal-card input { margin-bottom: 10px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

.error { color: var(--red); font-size: 0.85rem; margin-top: 6px; }
.result { margin-top: 8px; font-size: 0.85rem; }
.result.ok { color: #fff; }
.result.err { color: var(--red); }

/* Admin */
.login-card {
  max-width: 360px;
  margin: 40px auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
}
.login-card h1 { margin: 0 0 12px; font-size: 1.1rem; color: #fff; }
.login-card input { margin-bottom: 10px; }
.login-card button { width: 100%; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 { margin: 0 0 12px; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.card label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.card label input, .card label textarea { margin-top: 3px; }

.service-editor {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--bg-elev-2);
}
.service-editor .row-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.service-editor .row-head h3 { margin: 0; font-size: 0.95rem; color: #fff; }
.service-editor .del {
  background: transparent; color: var(--red); border: 0;
  cursor: pointer; padding: 2px 6px; font-size: 0.85rem;
}
.service-editor .del:hover { color: var(--red-hover); text-decoration: underline; }
.service-editor .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.service-editor .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; }

.actions-row { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
#save-status.ok { color: #fff; font-size: 0.9rem; }
#save-status.err { color: var(--red); font-size: 0.9rem; }

::selection { background: var(--red); color: #fff; }

.hidden { display: none !important; }
