:root {
  --navy: #1a3a5c;
  --navy-dark: #0f2541;
  --teal: #00a9b5;
  --teal-light: #1ec1cc;
  --accent: #b8d12e;
  --bg: #f3f6fa;
  --bg-card: #ffffff;
  --text: #1a2942;
  --muted: #6b7a8d;
  --border: #dde3ee;
  --danger: #d63a3a;
  --shadow: 0 2px 12px rgba(15, 37, 65, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; width: 100%; }
main.container { flex: 1; padding-top: 1.5rem; padding-bottom: 2rem; }

/* Topbar */
.topbar { background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1.25rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; color: #fff; text-decoration: none; }
.brand-logo { height: 42px; width: auto; border-radius: 6px; background: #fff; padding: 2px; }
.brand-text strong { display: block; font-size: 1.05rem; }
.brand-text small { display: block; color: var(--teal-light); font-size: 0.78rem; letter-spacing: 0.5px; }
.topnav { display: flex; align-items: center; gap: 0.75rem; }
.navlink { color: #fff; text-decoration: none; padding: 0.4rem 0.7rem; border-radius: 6px; font-size: 0.95rem; }
.navlink:hover { background: rgba(255,255,255,0.1); }
.navuser { color: var(--teal-light); font-size: 0.9rem; }

/* Footer */
.footer { background: var(--navy-dark); color: #c5d1e2; padding: 0.75rem 0; margin-top: 2rem; }
.footer-inner { display: flex; justify-content: space-between; font-size: 0.85rem; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
  color: #fff; border-radius: 14px; padding: 2rem 2rem; margin-bottom: 1.5rem;
  border-bottom: 4px solid var(--accent);
}
.hero h1 { margin: 0 0 0.4rem; font-size: 1.85rem; }
.hero p { margin: 0 0 1.25rem; opacity: 0.9; }
.search { display: flex; gap: 0.5rem; max-width: 600px; }
.search input { flex: 1; padding: 0.7rem 1rem; border: 0; border-radius: 8px; font-size: 1rem; }

/* Cards & themes */
.card {
  background: var(--bg-card); border-radius: 12px; padding: 1.25rem 1.5rem;
  margin-bottom: 1rem; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.card h2 { margin-top: 0; color: var(--navy); }
.themes-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.theme-card {
  background: var(--bg-card); border-radius: 12px; padding: 1.25rem; text-decoration: none;
  color: var(--text); display: flex; flex-direction: column; gap: 0.5rem;
  border: 1px solid var(--border); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.theme-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--teal); transition: background 0.15s; }
.theme-card:hover { transform: translateY(-2px); border-color: var(--teal); box-shadow: 0 6px 22px rgba(0, 169, 181, 0.18); }
.theme-card:hover::before { background: var(--accent); }
.theme-icon { font-size: 2rem; }
.theme-icon-lg { font-size: 1.5rem; }
.theme-name { font-weight: 600; font-size: 1.1rem; color: var(--navy); }
.theme-desc { color: var(--muted); font-size: 0.88rem; }
.theme-count { color: var(--teal); font-size: 0.85rem; font-weight: 600; margin-top: auto; }

/* Page head */
.page-head { margin: 0.5rem 0 1.25rem; }
.page-head h1 { margin: 0 0 0.25rem; color: var(--navy); font-size: 1.7rem; }
.breadcrumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.breadcrumbs a { color: var(--teal); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* Prompts */
.prompts { display: flex; flex-direction: column; gap: 1rem; }
.prompt-card .prompt-head { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem; }
.prompt-card h3, .prompt-card h1 { margin: 0; color: var(--navy); }
.prompt-body {
  background: #f8fafd; border: 1px solid var(--border); border-radius: 8px;
  padding: 1rem; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.92rem;
  white-space: pre-wrap; word-break: break-word; max-height: 500px; overflow-y: auto;
  color: var(--text); margin: 0;
}
.prompt-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.prompt-list { list-style: none; padding: 0; margin: 0; }
.prompt-list li { border-bottom: 1px solid var(--border); }
.prompt-list li:last-child { border-bottom: 0; }
.prompt-row { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 0; text-decoration: none; color: var(--text); gap: 1rem; }
.prompt-row:hover { color: var(--teal); }
.prompt-title { font-weight: 500; }
.prompt-meta { color: var(--muted); font-size: 0.85rem; }

/* Auth */
.auth-wrap { display: flex; justify-content: center; padding-top: 2rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-title { margin: 0 0 0.25rem; color: var(--navy); }
.auth-sub { color: var(--muted); margin: 0 0 1.25rem; }
.auth-foot { color: var(--muted); font-size: 0.9rem; margin-top: 1rem; text-align: center; }
.auth-foot a { color: var(--teal); text-decoration: none; }
.check { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0; color: var(--muted); font-size: 0.92rem; }

/* Forms */
.field { margin-bottom: 0.85rem; }
.field label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--border); border-radius: 7px;
  font-size: 0.95rem; font-family: inherit; background: #fff; color: var(--text);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,169,181,0.15); }
.field textarea { resize: vertical; font-family: 'SF Mono', Menlo, Consolas, monospace; }
.field-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 150px; }
.row-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: stretch; }
.row-form input { padding: 0.55rem 0.75rem; border: 1px solid var(--border); border-radius: 7px; font-size: 0.95rem; }

/* Buttons */
.btn {
  display: inline-block; padding: 0.55rem 1.1rem; border: 0; border-radius: 7px;
  font-size: 0.95rem; font-weight: 500; cursor: pointer; text-decoration: none;
  font-family: inherit; transition: background 0.15s, transform 0.05s;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-light); }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); border-color: var(--teal); color: var(--teal); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b62929; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.6rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: #f0f4fa; color: var(--navy); font-weight: 600; font-size: 0.88rem; }

/* Badges */
.badge { display: inline-block; padding: 0.18rem 0.55rem; border-radius: 10px; background: #e6edf7; color: var(--navy); font-size: 0.78rem; font-weight: 500; }
.badge-accent { background: var(--accent); color: var(--navy); }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { background: var(--bg-card); border-radius: 12px; padding: 1rem 1.25rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.stat-value { font-size: 1.85rem; font-weight: 700; color: var(--navy); }
.stat-label { color: var(--muted); font-size: 0.88rem; }

/* Admin */
.admin-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.admin-head h1 { margin: 0; color: var(--navy); }
.admin-nav { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.prompt-edit { margin-bottom: 0.75rem; border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; background: #fafbfd; }
.prompt-edit summary { cursor: pointer; padding: 0.25rem 0; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-error { background: #fde6e6; color: var(--danger); border: 1px solid #f5b5b5; }

/* Misc */
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
code { background: #f0f4fa; padding: 0.1rem 0.35rem; border-radius: 4px; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.85rem; }

@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; gap: 0.5rem; }
  .hero { padding: 1.5rem 1.25rem; }
  .hero h1 { font-size: 1.4rem; }
  .brand-text small { display: none; }
}

/* ===== ЕЗ logo (CSS only) ===== */
.logo-ez {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 11px;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8fb 100%);
  position: relative; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(0,169,181,0.12);
}
.logo-ez::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal) 55%, var(--accent) 55%, var(--accent) 100%);
}
.logo-ez-inner {
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 900; font-size: 18px; letter-spacing: -1px;
  color: var(--navy); line-height: 1; padding-bottom: 3px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--teal) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* Logout button on dark header */
.btn-logout {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  padding: 0.45rem 1rem; border-radius: 7px;
  text-decoration: none; font-size: 0.92rem;
  transition: background 0.15s, border-color 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.12); border-color: var(--accent); color: var(--accent); }
