:root {
  color-scheme: dark;
  --bg: #080b11;
  --bg2: #0d111a;
  --panel: rgba(21, 27, 38, .94);
  --panel2: rgba(29, 38, 54, .94);
  --panel3: rgba(12, 17, 26, .96);
  --line: rgba(255,255,255,.10);
  --line2: rgba(255,255,255,.16);
  --text: #eff5ff;
  --muted: #9dadc2;
  --blue: #4ea1ff;
  --blue2: #74b8ff;
  --green: #28d17c;
  --yellow: #ffc857;
  --red: #ff5e66;
  --purple: #b584ff;
  --gray: #8f9bab;
  --shadow: 0 22px 80px rgba(0,0,0,.38);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% -10%, rgba(78,161,255,.20), transparent 34%),
    radial-gradient(circle at 88% 5%, rgba(181,132,255,.14), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Arial, sans-serif;
}
a { color: inherit; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: rgba(12,16,24,.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-size: 20px; font-weight: 900; letter-spacing: -.02em; }
nav { display: flex; gap: 10px; flex-wrap: wrap; }
nav a, .button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  color: var(--text);
  border-radius: 11px;
  padding: 9px 12px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
nav a:hover, .button:hover, button:hover { transform: translateY(-1px); border-color: var(--line2); }
button.primary, .primary { background: linear-gradient(180deg, var(--blue2), var(--blue)); color: #07111f; border-color: transparent; }
.success-btn { background: linear-gradient(180deg, #51e59a, var(--green)); color: #06170e; border-color: transparent; }
.publish-btn { border-color: rgba(40,209,124,.4); }
.save-btn { border-color: rgba(78,161,255,.45); }
.ghost-btn { opacity: .82; }
.container { padding: 22px; max-width: 1900px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.35; }
.flash-wrap { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: 0 12px 35px rgba(0,0,0,.18); }
.flash.success { border-color: rgba(40,209,124,.45); }
.flash.error { border-color: rgba(255,94,102,.55); color: #ffd7da; }
.hero-panel, .actions-panel {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)), var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.hero-panel h1 { margin: 0 0 6px; font-size: clamp(22px, 2vw, 34px); letter-spacing: -.03em; }
.hero-panel p { margin: 0; color: var(--muted); max-width: 920px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.hero-actions form, .actions-panel form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-check { display: inline-flex; gap: 8px; color: var(--muted); font-size: 13px; align-items: center; }
.inline-check input { width: auto; }
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 12px; margin: 18px 0; }
.stat {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  box-shadow: 0 14px 45px rgba(0,0,0,.16);
}
.stat span { display: block; font-size: 30px; font-weight: 950; color: var(--text); letter-spacing: -.04em; }
.stat.ok span { color: var(--green); }
.stat.old span { color: var(--yellow); }
.stat.stalled span, .stat.missing span, .stat.unconfigured span { color: #ffb7bc; }
.stat.disabled span { color: var(--gray); }
.hint { padding: 14px 16px; background: rgba(78,161,255,.08); border: 1px solid rgba(78,161,255,.22); border-radius: 16px; color: #cfe5ff; line-height: 1.55; }
code { background: rgba(255,255,255,.075); padding: 2px 6px; border-radius: 7px; }
.location-section { margin-top: 28px; }
.location-title { margin: 0 0 10px; display: flex; gap: 10px; align-items: baseline; letter-spacing: -.02em; }
.location-title span { color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.image-table { width: 100%; border-collapse: collapse; min-width: 1500px; }
.image-table th, .image-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.image-table th {
  color: #cfe2ff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  background: rgba(255,255,255,.04);
  position: sticky;
  top: 76px;
  z-index: 4;
}
.image-table tr:last-child td { border-bottom: 0; }
.image-row { transition: background .16s ease, outline .16s ease; }
.image-row:hover { background: rgba(255,255,255,.035); }
.image-row:target { outline: 2px solid var(--blue); outline-offset: -2px; background: rgba(78,161,255,.10); }
.image-row.dirty { box-shadow: inset 4px 0 0 var(--yellow); }
.image-row.status-stalled, .image-row.status-missing { opacity: .78; }
.attention-row { background: rgba(255,200,87,.035); }
.thumb { width: 128px; height: 72px; object-fit: cover; background: #05070b; border-radius: 10px; border: 1px solid var(--line); display: block; }
.pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--gray);
  color: #081019;
  white-space: nowrap;
  margin-bottom: 6px;
}
.pill.ok { background: var(--green); }
.pill.old { background: var(--yellow); }
.pill.stalled, .pill.missing, .pill.expired { background: var(--red); color: #1d0507; }
.pill.disabled { background: #556172; color: #f2f4f7; }
.pill.unconfigured, .pill.new { background: var(--purple); color: #160a2b; }
.yes { color: var(--green); font-weight: 900; }
.no { color: var(--red); font-weight: 900; }
.status-cell { min-width: 170px; }
.filename-cell { min-width: 190px; }
.age-cell { min-width: 112px; white-space: nowrap; }
.api-cell { min-width: 130px; }
.actions { display: flex; gap: 8px; align-items: center; }
.action-stack { display: grid; gap: 7px; min-width: 150px; }
.actions form { margin: 0; }
.error-text { color: #ffb7bc; white-space: pre-wrap; max-width: 360px; }
.compact { font-size: 13px; min-width: 1000px; }
.inline-input, input, textarea {
  width: 100%;
  background: rgba(4,8,14,.74);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  outline: none;
}
.inline-input:focus, input:focus, textarea:focus { border-color: rgba(78,161,255,.8); box-shadow: 0 0 0 3px rgba(78,161,255,.12); }
.title-input { min-width: 210px; font-weight: 800; }
.desc-input { min-width: 240px; resize: vertical; }
.sub-input { margin-top: 6px; }
.sort-input { width: 74px; }
.mini-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #d7e3f5; margin: 4px 0; white-space: nowrap; font-weight: 700; }
.mini-check input { width: auto; }
.attention-panel { margin: 18px 0; padding: 16px; background: rgba(255,94,102,.08); border: 1px solid rgba(255,94,102,.25); border-radius: 18px; box-shadow: 0 16px 45px rgba(0,0,0,.20); }
.attention-panel h2 { margin: 0 0 12px; display: flex; gap: 10px; align-items: baseline; }
.attention-panel h2 span { color: var(--muted); font-size: 14px; }
.attention-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.attention-card { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; padding: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 15px; text-decoration: none; }
.attention-card:hover { border-color: var(--line2); background: rgba(255,255,255,.065); }
.attention-card img { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; background: #05070b; border: 1px solid var(--line); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); }
.login-card h1 { margin-top: 0; }
label { display: grid; gap: 6px; color: #d7e3f5; font-weight: 800; font-size: 13px; }
.login-card label { margin: 14px 0; }
.back { display: inline-flex; margin-bottom: 16px; color: #cfe2ff; text-decoration: none; }
.edit-grid { display: grid; grid-template-columns: minmax(320px, 520px) minmax(400px, 1fr); gap: 18px; align-items: start; }
.preview-card, .edit-form { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.preview-card img { width: 100%; border-radius: 14px; background: #05070b; border: 1px solid var(--line); }
.preview-meta { margin-top: 12px; color: var(--muted); line-height: 1.6; }
.edit-form { display: grid; gap: 14px; }
.edit-form h1, .edit-form h2 { margin: 4px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; padding: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 12px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; }
.checks input { width: auto; }
.form-actions { display: flex; gap: 10px; }
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .topbar, .hero-panel { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 900px) {
  .container { padding: 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .edit-grid, .two, .three, .four { grid-template-columns: 1fr; }
  .attention-grid { grid-template-columns: 1fr; }
}
