:root {
  --navy: #0B1120;
  --panel: #0E1526;
  --royal: #2E4FE0;
  --silver: #E9ECF3;
  --muted: #9AA3B2;
  --hairline: rgba(233, 236, 243, 0.14);
  --danger: #c0392b;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Tahoma, sans-serif; background: var(--navy); color: var(--silver); }
a { color: #8FA2FF; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { background: rgba(192,57,43,0.18); border: 1px solid var(--danger); padding: 0.6rem 0.8rem; border-radius: 8px; }
.ok { background: rgba(46,79,224,0.2); border: 1px solid var(--royal); padding: 0.6rem 0.8rem; border-radius: 8px; }

.admin-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--hairline); }
.admin-brand { font-weight: 700; letter-spacing: 0.04em; }
.nav-drop { position: relative; }
.nav-drop-panel { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: var(--panel); border: 1px solid var(--hairline); border-radius: 12px; padding: 0.45rem; min-width: 210px; z-index: 60; flex-direction: column; box-shadow: 0 12px 32px rgba(0,0,0,0.45); }
.nav-drop-panel.open { display: flex; }
.nav-drop-panel a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 0.65rem 0.8rem; border-radius: 8px; }
.nav-drop-panel a:hover { color: var(--silver); background: var(--navy); }
.admin-main { max-width: 900px; margin: 0 auto; padding: 1.25rem; }
h1 { font-size: 1.6rem; margin: 0.4rem 0 0.8rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.35rem; }

.btn { display: inline-block; background: var(--panel); color: var(--silver); border: 1px solid var(--hairline); border-radius: 8px; padding: 0.55rem 1rem; text-decoration: none; cursor: pointer; font-size: 0.95rem; min-height: 44px; }
.btn:hover { border-color: var(--royal); }
.btn.primary { background: var(--royal); border-color: var(--royal); color: #fff; }
.btn.danger { border-color: var(--danger); color: #ff9d94; }
.btn[disabled] { opacity: 0.35; cursor: default; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-box { background: var(--panel); border: 1px solid var(--hairline); border-radius: 14px; padding: 1.75rem; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 0.9rem; }
.login-box h1 { margin: 0; }
.login-box label, .edit-form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.95rem; }
input[type="text"], input[type="password"], textarea { background: var(--navy); color: var(--silver); border: 1px solid var(--hairline); border-radius: 8px; padding: 0.65rem; font-size: 1rem; width: 100%; }
textarea { resize: vertical; }

.proj-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.proj-row { background: var(--panel); border: 1px solid var(--hairline); border-radius: 14px; padding: 1.1rem 1.25rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.proj-main { flex: 1 1 320px; min-width: 0; }
.proj-url { margin: 0 0 0.4rem; word-break: break-all; }
.proj-url a { font-size: 0.92rem; }
.proj-actions { display: flex; align-items: flex-start; }
.actions-select { background: var(--navy); color: var(--silver); border: 1px solid var(--hairline); border-radius: 8px; padding: 0.65rem 0.8rem; font-size: 0.95rem; min-height: 44px; min-width: 170px; cursor: pointer; }
.actions-select:hover { border-color: var(--royal); }
.badge { display: inline-block; font-size: 0.8rem; padding: 0.2rem 0.6rem; border: 1px solid var(--hairline); border-radius: 999px; color: var(--muted); }
.badge.on { border-color: var(--royal); color: #b9c6ff; }

.edit-form { display: flex; flex-direction: column; gap: 1rem; max-width: 560px; }
.edit-form label.check { flex-direction: row; align-items: center; gap: 0.6rem; }
.edit-form input[type="checkbox"] { width: 20px; height: 20px; }

@media (max-width: 640px) {
  .proj-row { flex-direction: column; }
  .proj-actions form.inline { width: 100%; }
  .proj-actions .btn { flex: 1; text-align: center; }
}
