:root {
  --bg: #0f1115;
  --card: #151923;
  --text: #e7eaf0;
  --muted: #aab3c5;
  --border: #23283a;
  --accent: #5ea2ff;
  --danger: #ff5e6a;
  --ok: #35d07f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.container { max-width: 1100px; margin: 0 auto; padding: 22px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 260px; }

h1,h2,h3 { margin: 0 0 12px; }
.small { color: var(--muted); font-size: 0.92rem; }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b0d12;
  color: var(--text);
  outline: none;
}
textarea { min-height: 120px; resize: vertical; }

label { display:block; margin: 10px 0 6px; color: var(--muted); }

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #1b2233;
  color: var(--text);
  cursor: pointer;
}
.btn:hover { border-color: #2f3752; }
.btn.primary { background: var(--accent); border-color: transparent; color: #06101f; font-weight: 650; }
.btn.danger { background: var(--danger); border-color: transparent; color: #24060a; font-weight: 650; }
.btn.ok { background: var(--ok); border-color: transparent; color: #06180f; font-weight: 650; }

.topbar {
  display:flex; justify-content: space-between; align-items:center;
  gap: 14px; margin-bottom: 16px;
}
.nav a { margin-right: 12px; color: var(--muted); }
.nav a:hover { color: var(--text); }

.alert { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); margin: 12px 0; }
.alert.bad { border-color: rgba(255,94,106,.35); background: rgba(255,94,106,.10); }
.alert.good { border-color: rgba(53,208,127,.35); background: rgba(53,208,127,.10); }

.table { width:100%; border-collapse: collapse; }
.table th, .table td { text-align:left; padding: 10px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; }

/* --- Dashboard grid/tiles --- */
.grid {
  display:grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  gap: 12px;
}

.tile {
  position: relative;
  background: #0b0d12;
  border: 1px solid var(--border);
  border-radius: 14px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding: 10px;
}

.tile .title { padding: 10px; }

.tile img {
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.tile .overlay {
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,.45);
  opacity: 0;
  transition: opacity .12s ease-in-out;
}

.tile:hover .overlay { opacity: 1; }

.tile .overlay span {
  background: rgba(15,17,21,.85);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Disabled tile behavior + lock icon */
.tile.disabled {
  opacity: .62;
  cursor: not-allowed;
}
.tile.disabled a { pointer-events: none; }
.tile.disabled:hover .overlay { opacity: 1; } /* keep overlay but it's not clickable */

.tile.disabled .overlay span::before {
  content: "🔒";
  font-size: 1.05em;
  line-height: 1;
  opacity: 0.95;
}

/* Responsive grid */
@media (max-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
