/* ── Variables ── */
:root {
  --accent:        #00d7f3;
  --accent-dim:    rgba(0, 215, 243, 0.12);
  --accent-hover:  #00c2db;

  --danger:        #e53935;
  --danger-dim:    rgba(229, 57, 53, 0.14);
  --danger-text:   #ef9a9a;

  --success:       #43a047;
  --success-dim:   rgba(67, 160, 71, 0.14);
  --success-text:  #a5d6a7;

  --warn-dim:      rgba(253, 216, 53, 0.12);
  --warn-text:     #fff176;

  --bg:            #0a0a0a;
  --surface:       #141414;
  --surface-2:     #1c1c1c;
  --surface-3:     #242424;
  --border:        #272727;
  --border-2:      #333333;

  --text:          #e2e2e2;
  --text-muted:    #808080;
  --text-faint:    #484848;

  --radius-sm:     4px;
  --radius:        6px;
  --radius-lg:     10px;
  --radius-xl:     14px;

  --header-h:      64px;
  --sidebar-w:     220px;
  --shadow:        0 4px 24px rgba(0,0,0,0.55);
  --shadow-sm:     0 2px 10px rgba(0,0,0,0.38);

  --font:          'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.65;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
input, textarea, select, button { font-family: var(--font); }

/* ══════════════════════════════════════════════
   ADMIN — top-nav header
   ══════════════════════════════════════════════ */

header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  text-decoration: none;
}
.header-logo:hover { color: var(--text); }
.header-logo img { height: 30px; width: auto; }
.header-logo .logo-sep { color: var(--border-2); font-weight: 300; margin: 0 0.15rem; }

header nav { display: flex; align-items: center; gap: 4px; }

header nav a {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  transition: background 0.13s, color 0.13s;
  white-space: nowrap;
  text-decoration: none;
}
header nav a:hover  { background: var(--surface-3); color: var(--text); }
header nav a.active { background: var(--accent-dim); color: var(--accent); }

.nav-sep { width: 1px; height: 18px; background: var(--border); margin: 0 0.4rem; flex-shrink: 0; }

header nav a.nav-logout { color: var(--text-faint); border: 1px solid transparent; }
header nav a.nav-logout:hover { color: var(--danger-text); background: var(--danger-dim); }

/* ── Mobile hamburger ── */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.13s, color 0.13s;
}
.nav-hamburger:hover { background: var(--surface-3); color: var(--text); }

/* ── Admin main ── */
main {
  flex: 1;
  padding: 2rem 2rem;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════
   DASHBOARD — sidebar layout
   ══════════════════════════════════════════════ */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.4rem 0.85rem;
  gap: 0.2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  transition: width 0.2s ease;
}
.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-logo-text { display: none; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.15rem 0.55rem 1rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-logo img   { height: 26px; width: auto; flex-shrink: 0; }
.sidebar-logo:hover { color: var(--text); }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.13s, color 0.13s;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-nav-item:hover        { background: var(--surface-3); color: var(--text); }
.sidebar-nav-item.active       { background: var(--accent-dim); color: var(--accent); }
.sidebar-nav-item.danger:hover { background: var(--danger-dim); color: var(--danger-text); }

.sidebar-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.7; }
.sidebar-nav-item.active .sidebar-icon,
.sidebar-nav-item:hover  .sidebar-icon { opacity: 1; }

.sidebar-spacer { flex: 1; }
.sidebar-sep    { height: 1px; background: var(--border); margin: 0.5rem 0; }

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  align-self: flex-end;
  margin-top: 0.5rem;
  transition: background 0.13s;
}
.sidebar-toggle:hover { background: var(--surface-3); color: var(--text); }
.sidebar-toggle svg { transition: transform 0.2s; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.page-content {
  flex: 1;
  padding: 2rem;
  max-width: 1240px;
  width: 100%;
  min-width: 0;
}

/* ══════════════════════════════════════════════
   SHARED COMPONENTS
   ══════════════════════════════════════════════ */

/* ── Flash messages ── */
.flash-list { list-style: none; margin-bottom: 1.4rem; display: flex; flex-direction: column; gap: 0.4rem; }
.flash-list li {
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  border: 1px solid transparent;
}
.flash-list li.success { background: var(--success-dim); border-color: var(--success); color: var(--success-text); }
.flash-list li.error   { background: var(--danger-dim);  border-color: var(--danger);  color: var(--danger-text); }
.flash-list li.warning { background: var(--warn-dim);    border-color: #fdd835;        color: var(--warn-text); }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}
.page-header h1       { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.page-header-meta     { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.1rem; }
.page-header-back     { display: flex; flex-direction: column; gap: 0.1rem; }

/* ── Search ── */
.search-form { display: flex; gap: 0.4rem; }
.search-form input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  outline: none;
  width: 240px;
  transition: border-color 0.15s;
}
.search-form input:focus { border-color: var(--accent); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.13s, border-color 0.13s, color 0.13s, opacity 0.13s;
  line-height: 1.4;
}
.btn:hover  { text-decoration: none; }
.btn:active { opacity: 0.82; }

.btn-primary       { background: var(--accent);       border-color: var(--accent);       color: #000; font-weight: 700; }
.btn-primary:hover { background: var(--accent-hover);  border-color: var(--accent-hover); color: #000; }

.btn-danger        { background: transparent; border-color: var(--border-2); color: var(--text-muted); }
.btn-danger:hover  { background: var(--danger-dim); border-color: var(--danger); color: var(--danger-text); }

.btn-ghost         { background: var(--surface-3); border-color: var(--border); color: var(--text); }
.btn-ghost:hover   { border-color: var(--border-2); background: var(--surface-2); }

.btn-outline       { background: transparent; border-color: var(--border-2); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm   { padding: 0.32rem 0.75rem;  font-size: 0.8rem; }
.btn-xs   { padding: 0.2rem  0.5rem;   font-size: 0.74rem; }
.btn-lg   { padding: 0.7rem  1.6rem;   font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Table ── */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1.75rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead { background: var(--surface-2); }
th {
  padding: 0.7rem 1.1rem;
  text-align: left;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

.td-mono     { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-truncate { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-empty td { text-align: center; color: var(--text-faint); padding: 2.5rem; font-size: 0.88rem; }

/* ── Actions cell ── */
.actions { display: flex; gap: 0.35rem; align-items: center; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-blue  { background: var(--accent-dim);  color: var(--accent);       border: 1px solid rgba(0,215,243,0.2); }
.badge-green { background: var(--success-dim); color: var(--success-text); border: 1px solid rgba(67,160,71,0.2); }
.badge-red   { background: var(--danger-dim);  color: var(--danger-text);  border: 1px solid rgba(229,57,53,0.2); }
.badge-gray  { background: var(--surface-3);   color: var(--text-muted);   border: 1px solid var(--border-2); }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; gap: 0.5rem; }
.card-header h2,
.card h2 { font-size: 0.98rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 1.1rem; color: var(--text); }
.card-header h2 { margin-bottom: 0; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--font);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--accent); }
.form-group input[type="file"] { padding: 0.32rem 0.55rem; cursor: pointer; color: var(--text-muted); }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-group select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23666' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.2rem;
}
.form-actions { display: flex; gap: 0.5rem; margin-top: 1.1rem; flex-wrap: wrap; }

/* ── Toggle / checkbox label ── */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  user-select: none;
}
.toggle-label input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

/* ── Checkbox grid ── */
.checkbox-grid { display: flex; flex-direction: column; gap: 0.45rem; }
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s;
}
.checkbox-item:hover { background: var(--surface-3); }
.checkbox-item input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; margin: 0; }
.checkbox-item.checked { border-color: var(--border); }

/* ── Permission rows ── */
.perm-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 0.85rem; }
.perm-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.perm-row:last-child { border-bottom: none; }
.perm-name       { flex: 1; font-family: var(--font-mono); font-size: 0.83rem; color: var(--text); min-width: 100px; }
.perm-inherited  { font-size: 0.7rem; color: var(--text-faint); }
.perm-row-actions { margin-left: auto; flex-shrink: 0; }
.perm-badge-right { margin-left: auto; }

/* ── Section label ── */
.section-label {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

/* ── Stat grid ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
}
.stat-card { background: var(--surface); padding: 1.4rem 1.6rem; text-decoration: none; color: var(--text); display: block; transition: background 0.13s; }
.stat-card:hover    { background: var(--surface-2); color: var(--text); text-decoration: none; }
.stat-card .num     { font-size: 2.1rem; font-weight: 800; color: var(--accent); letter-spacing: -0.03em; line-height: 1; }
.stat-card .label   { font-size: 0.73rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-top: 0.4rem; }

/* ── Two-column layout grids ── */
.two-col-grid      { display: grid; grid-template-columns: 1fr 1fr;      gap: 1.1rem; align-items: start; }
.two-col-grid-wide { display: grid; grid-template-columns: 1fr 360px;    gap: 1.1rem; align-items: start; }
.col-stack         { display: flex; flex-direction: column; gap: 1.1rem; }

/* ── Edit grid ── */
.edit-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.1rem; }
.dash-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; max-width: 700px; }
.dash-grid .card p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1rem; line-height: 1.5; }
.dash-grid .card .btn-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ── Form card ── */
.form-card        { max-width: 500px; }
.card-desc        { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }
.empty-msg        { font-size: 0.84rem; color: var(--text-faint); padding: 0.45rem 0; }
.danger-zone-text { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }
.inline-form      { display: inline; margin: 0; padding: 0; }

/* ── Info block ── */
.info-block { background: var(--surface-2); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.info-row { display: flex; align-items: baseline; gap: 0.55rem; padding: 0.32rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.info-row:last-child { border-bottom: none; }
.info-row .info-key { flex-shrink: 0; width: 120px; font-size: 0.73rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.info-row .info-val { color: var(--text); word-break: break-all; }

/* ── Chat list (admin) ── */
.chat-list { display: flex; flex-direction: column; gap: 0.45rem; }
.chat-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.9rem; font-size: 0.88rem; }
.chat-item .chat-name { font-weight: 600; color: var(--text); }
.chat-item .chat-meta { color: var(--text-muted); font-size: 0.77rem; margin-top: 0.1rem; }

/* ── Rating dots (dashboard) ── */
.rating      { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; }
.rating-dots { display: flex; gap: 2px; }
.rating-dot  { width: 9px; height: 9px; border-radius: 50%; background: var(--border-2); }
.rating-dot.filled { background: var(--accent); }
.rating-num  { color: var(--text-muted); font-size: 0.75rem; }

/* ── Star rating (admin opinions) ── */
.star-cell {
  display: inline-flex;
  gap: 3px;
  user-select: none;
  align-items: center;
}
.star-cell .star     { width: 18px; height: 18px; display: inline-block; flex-shrink: 0; }
.star-cell .star svg { width: 100%; height: 100%; display: block; }
.rating-score {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  font-family: var(--font-mono);
  margin-left: 6px;
  white-space: nowrap;
}

/* ── Chat room (dashboard) ── */
.chat-room { display: flex; flex-direction: column; height: calc(100vh - 2 * 2rem); max-height: 800px; }
.chat-room h1 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.85rem; }
.chat-messages {
  flex: 1; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.1rem; display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 0.85rem;
}
.chat-message   { font-size: 0.9rem; }
.chat-message b { color: var(--accent); }
.chat-timestamp { font-size: 0.73rem; color: var(--text-faint); margin-top: 0.1rem; }
.chat-input-row { display: flex; gap: 0.45rem; }
.chat-input-row input {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 0.5rem 0.85rem; border-radius: var(--radius); font-size: 0.9rem; outline: none; transition: border-color 0.15s;
}
.chat-input-row input:focus { border-color: var(--accent); }

/* ── Chat list (dashboard) ── */
.chat-list-page { max-width: 500px; }
.chat-list-page ul { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.1rem; }
.chat-list-page ul li a {
  display: block; padding: 0.6rem 0.9rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 0.9rem; font-weight: 500; transition: background 0.13s, border-color 0.13s;
}
.chat-list-page ul li a:hover { background: var(--surface-3); border-color: var(--border-2); }
.chat-list-page ul li.admin-chat a { color: var(--accent); }

/* ── Opinions (dashboard user-facing) ── */
.star           { color: var(--accent); margin: 2px; }
.opinion-cards  { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 1.4rem; }
.opinion-card   { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem 1.3rem; }
.opinion-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.45rem; }
.opinion-sender  { font-size: 0.92rem; font-weight: 700; }
.opinion-content { font-size: 0.88rem; color: var(--text-muted); line-height: 1.65; }

/* ── File cards (premium / free zone) ── */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.85rem; }
.file-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem 1.3rem; display: flex; flex-direction: column; gap: 0.45rem; }
.file-card p             { font-size: 0.88rem; color: var(--text-muted); }
.file-card p:first-child { font-weight: 600; color: var(--text); font-size: 0.92rem; }

/* ── Auth pages ── */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 2.5rem 2.25rem; width: 380px; box-shadow: var(--shadow);
}
.auth-card .auth-logo { display: flex; justify-content: center; margin-bottom: 1.4rem; }
.auth-card .auth-logo img { height: 36px; }
.auth-title  { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; text-align: center; margin-bottom: 0.3rem; }
.auth-sub    { text-align: center; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.75rem; }
.auth-links  { text-align: center; margin-top: 1.1rem; font-size: 0.84rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 0.4rem; }
.auth-error  { background: var(--danger-dim); border: 1px solid var(--danger); color: var(--danger-text); border-radius: var(--radius); padding: 0.55rem 0.85rem; font-size: 0.84rem; text-align: center; margin-bottom: 1.1rem; }

/* ── Login admin variant ── */
.login-wrap  { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 2.5rem 2.25rem; width: 380px; box-shadow: var(--shadow); }
.login-card .login-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; text-align: center; margin-bottom: 0.35rem; }
.login-card .login-sub   { text-align: center; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.75rem; }
.login-error { background: var(--danger-dim); border: 1px solid var(--danger); color: var(--danger-text); border-radius: var(--radius); padding: 0.55rem 0.85rem; font-size: 0.84rem; text-align: center; margin-bottom: 1.1rem; }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

/* ── Link result card ── */
.link-result-card {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--accent-dim); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 0.65rem 1rem; margin-bottom: 1.1rem; font-size: 0.88rem; flex-wrap: wrap;
}
.link-result-label { color: var(--accent); font-weight: 700; white-space: nowrap; }
.link-result-url   { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); word-break: break-all; flex: 1; }

/* ── Input group ── */
.input-group       { display: flex; gap: 0.35rem; align-items: center; }
.input-group input { flex: 1; }
.btn-icon {
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted); cursor: pointer; padding: 0.38rem 0.6rem; font-size: 0.9rem; line-height: 1;
  transition: background 0.13s, color 0.13s;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

/* ── 404 / centre-wrap ── */
.center-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--header-h)); text-align: center; gap: 0.85rem;
}
.center-wrap .big-code { font-size: 5.5rem; font-weight: 900; color: var(--text-faint); letter-spacing: -0.05em; line-height: 1; }
.center-wrap h2 { font-size: 1.3rem; color: var(--text); }
.center-wrap p  { color: var(--text-muted); font-size: 0.9rem; }

/* ── Error / maintenance page ── */
.error-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.error-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 2.75rem 2.25rem; max-width: 500px; width: 90%; text-align: center;
}
.error-card h1  { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.55rem; }
.error-card p   { font-size: 0.9rem; color: var(--text-muted); }
.error-card img { margin: 1.4rem auto 0; display: block; width: 170px; opacity: 0.7; }

/* ══════════════════════════════════════════════
   PUBLIC WEBSITE — shared with pub-header/footer
   ══════════════════════════════════════════════ */

/* ── Public header ── */
.pub-header {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 2rem; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
}
.pub-header .pub-logo     { display: flex; align-items: center; gap: 0.6rem; }
.pub-header .pub-logo img { height: 28px; }
.pub-header .pub-logo-text { font-size: 1rem; font-weight: 700; color: var(--text); }
.pub-header nav           { display: flex; align-items: center; gap: 4px; }
.pub-header nav a {
  color: var(--text-muted); font-size: 0.88rem; font-weight: 500;
  padding: 0.4rem 0.85rem; border-radius: var(--radius); transition: background 0.13s, color 0.13s;
}
.pub-header nav a:hover  { background: var(--surface-3); color: var(--text); }
.pub-header nav a.active { background: var(--accent-dim); color: var(--accent); }
.pub-burger {
  display: none; background: none; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: var(--radius); padding: 0.4rem 0.6rem; cursor: pointer; font-size: 1.2rem;
  transition: background 0.13s, color 0.13s;
}
.pub-burger:hover { background: var(--surface-3); color: var(--text); }

/* ── Public footer ── */
.pub-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 0.85rem; font-size: 0.82rem; color: var(--text-faint);
}
.pub-footer nav       { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.pub-footer nav a     { color: var(--text-muted); }
.pub-footer nav a:hover { color: var(--text); }

/* ── Public page main ── */
.pub-main { flex: 1; }

/* ── Hero section ── */
.pub-hero {
  padding: 5rem 2rem 4rem;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}
.pub-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.1rem;
  color: var(--text);
}
.pub-hero h1 span { color: var(--accent); }
.pub-hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}
.pub-hero-actions { display: flex; gap: 0.85rem; justify-content: center; flex-wrap: wrap; }

/* ── Feature / advantage cards ── */
.pub-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 2rem 3rem;
}
.pub-feature-card {
  background: var(--surface);
  padding: 1.75rem 1.6rem;
  transition: background 0.13s;
}
.pub-feature-card:hover { background: var(--surface-2); }
.pub-feature-icon {
  font-size: 1.75rem;
  margin-bottom: 0.85rem;
  display: block;
}
.pub-feature-card h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text);
}
.pub-feature-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }

/* ── Stats strip ── */
.pub-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 2rem 3rem;
}
.pub-stat-card {
  background: var(--surface);
  padding: 1.6rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  display: flex; flex-direction: column; align-items: center;
  transition: background 0.13s;
}
.pub-stat-card:hover { background: var(--surface-2); }
.pub-stat-card img   { width: 32px; height: 32px; margin-bottom: 0.7rem; opacity: 0.7; }
.pub-stat-card .num  { font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: -0.03em; line-height: 1; }
.pub-stat-card .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-top: 0.35rem; }

/* ── FAQ ── */
.pub-faq { padding: 0 2rem 3rem; max-width: 820px; margin: 0 auto; }
.pub-faq h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 1.4rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 0.5rem; overflow: hidden; }
.faq-question {
  width: 100%; text-align: left; background: var(--surface);
  border: none; color: var(--text); font-size: 0.95rem; font-weight: 600;
  padding: 1.1rem 1.3rem; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  transition: background 0.13s;
}
.faq-question::after { content: '+'; color: var(--accent); font-size: 1.2rem; font-weight: 300; flex-shrink: 0; }
.faq-question:hover { background: var(--surface-2); }
.faq-item.active .faq-question { background: var(--surface-2); }
.faq-item.active .faq-question::after { content: '−'; }
.faq-answer {
  display: none; padding: 0 1.3rem 1.1rem;
  background: var(--surface-2); font-size: 0.9rem;
  color: var(--text-muted); line-height: 1.7;
}
.faq-item.active .faq-answer { display: block; }

/* ── Opinions section (public index) ── */
.pub-opinions { padding: 0 2rem 4rem; }
.pub-opinions h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 1.4rem; text-align: center; }
.pub-opinion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}
.pub-opinion-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.3rem 1.4rem;
}
.pub-opinion-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.55rem; }
.pub-opinion-sender { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.pub-opinion-stars  { display: flex; gap: 2px; }
.pub-opinion-star   { width: 15px; height: 15px; }
.pub-opinion-body   { font-size: 0.88rem; color: var(--text-muted); line-height: 1.65; }

/* ── Offer cards ── */
.pub-offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 0 2rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}
.pub-offer-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.6rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.7rem;
  transition: border-color 0.15s;
}
.pub-offer-card:hover { border-color: var(--border-2); }
.pub-offer-card.featured { border-color: var(--accent); }
.pub-offer-card h2 { font-size: 1.05rem; font-weight: 800; color: var(--text); margin: 0; }
.pub-offer-card > p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.55; }
.pub-offer-card ul { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.pub-offer-card ul li {
  font-size: 0.88rem; color: var(--text-muted); padding-left: 1.1rem; position: relative;
}
.pub-offer-card ul li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-size: 0.75rem; top: 0.1rem; }
.pub-offer-price { margin-top: auto; padding-top: 0.85rem; border-top: 1px solid var(--border); }
.pub-offer-price .price-main { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.pub-offer-price .price-setup { font-size: 0.82rem; color: var(--text-faint); margin-top: 0.15rem; }
.pub-offer-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── About sections ── */
.pub-about-section {
  padding: 2.5rem 2rem;
  max-width: 820px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}
.pub-about-section:last-child { border-bottom: none; }
.pub-about-section h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.85rem; color: var(--text); }
.pub-about-section p  { font-size: 0.95rem; color: var(--text-muted); line-height: 1.75; }

/* ── Contact form ── */
.pub-contact-wrap {
  display: flex; justify-content: center; align-items: flex-start;
  padding: 3rem 2rem;
}
.pub-contact-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 2.25rem 2rem;
  width: 100%; max-width: 520px; box-shadow: var(--shadow-sm);
}
.pub-contact-card h1 { font-size: 1.35rem; font-weight: 800; margin-bottom: 1.5rem; }

/* ── Privacy policy ── */
.pub-privacy { max-width: 820px; margin: 0 auto; padding: 2.5rem 2rem; }
.pub-privacy h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.5rem; }
.pub-privacy h2 { font-size: 1.05rem; font-weight: 700; margin: 1.75rem 0 0.5rem; color: var(--text); }
.pub-privacy p  { font-size: 0.92rem; color: var(--text-muted); line-height: 1.75; margin-bottom: 0.75rem; }
.pub-privacy ul { list-style: disc; padding-left: 1.5rem; display: flex; flex-direction: column; gap: 0.35rem; }
.pub-privacy ul li { font-size: 0.92rem; color: var(--text-muted); }
.pub-privacy-langs { display: flex; gap: 0.5rem; margin-bottom: 2rem; }

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

/* Tablet */
@media (min-width: 721px) and (max-width: 1100px) {
  .two-col-grid-wide { grid-template-columns: 1fr 1fr; }
  .stat-grid         { grid-template-columns: repeat(3, 1fr); }
  main, .page-content, .pub-main { padding: 1.4rem; }
  .pub-features, .pub-stats, .pub-faq, .pub-opinions,
  .pub-offer-grid { padding-left: 1.4rem; padding-right: 1.4rem; margin-left: 0; margin-right: 0; }
  .pub-hero { padding-left: 1.4rem; padding-right: 1.4rem; }
  .pub-stats { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile */
@media (max-width: 720px) {
  /* Header */
  header, .pub-header { padding: 0 1.1rem; height: var(--header-h); flex-wrap: nowrap; }
  .nav-hamburger, .pub-burger { display: flex; align-items: center; }

  header nav {
    display: none; position: fixed; top: var(--header-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 0.6rem 1.1rem 0.9rem;
    gap: 2px; z-index: 199; box-shadow: var(--shadow);
  }
  header nav.open { display: flex; }
  header nav a    { padding: 0.65rem 0.85rem; font-size: 0.92rem; }

  .pub-header nav {
    display: none; position: fixed; top: var(--header-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 0.6rem 1.1rem 0.9rem;
    gap: 2px; z-index: 199; box-shadow: var(--shadow);
  }
  .pub-header nav.open { display: flex; }
  .pub-header nav a    { padding: 0.65rem 0.85rem; font-size: 0.92rem; }

  .nav-sep { width: 100%; height: 1px; margin: 0.4rem 0; }

  /* Content */
  main, .page-content { padding: 1.1rem; }
  .pub-main { padding: 0; }

  /* Page header */
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.7rem; }
  .page-header .search-form { width: 100%; }
  .page-header .search-form input { width: 100%; flex: 1; }
  .page-header .btn { align-self: flex-start; }

  /* Tables */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table       { min-width: 540px; }

  /* Grids */
  .stat-grid                        { grid-template-columns: repeat(2, 1fr); }
  .two-col-grid, .two-col-grid-wide { grid-template-columns: 1fr; }
  .edit-grid, .dash-grid            { grid-template-columns: 1fr; max-width: 100%; }
  .form-card                        { max-width: 100%; }
  .card                             { padding: 1.1rem; }

  /* Perm rows */
  .perm-row-actions { width: 100%; margin-left: 0; margin-top: 0.3rem; }
  .perm-name        { width: 100%; }
  .actions          { flex-wrap: wrap; }

  /* Auth */
  .auth-card, .login-card { width: 100%; max-width: 380px; padding: 1.9rem 1.4rem; }
  .auth-wrap, .login-wrap { padding: 1.1rem; align-items: flex-start; padding-top: 3rem; }

  /* Misc */
  .flash-list li          { font-size: 0.88rem; }
  .info-row               { flex-wrap: wrap; }
  .info-row .info-key     { width: auto; min-width: 85px; }
  .link-result-card       { flex-direction: column; align-items: flex-start; }

  /* Sidebar */
  .sidebar { width: 56px; }
  .sidebar .sidebar-label,
  .sidebar .sidebar-logo-text { display: none; }
  .app-shell { flex-direction: row; }

  /* Public sections */
  .pub-hero { padding: 3rem 1.1rem 2.5rem; }
  .pub-hero h1 { font-size: 2rem; }
  .pub-features { margin: 0 0 2rem; grid-template-columns: 1fr; }
  .pub-stats    { margin: 0 0 2rem; grid-template-columns: 1fr; }
  .pub-faq      { padding: 0 1.1rem 2.5rem; }
  .pub-opinions { padding: 0 1.1rem 3rem; }
  .pub-offer-grid { padding: 0 1.1rem 2.5rem; grid-template-columns: 1fr; }
  .pub-about-section { padding: 2rem 1.1rem; }
  .pub-contact-wrap  { padding: 2rem 1.1rem; }
  .pub-privacy       { padding: 2rem 1.1rem; }
  .pub-footer        { padding: 1rem 1.1rem; }
  .pub-hero-actions  { flex-direction: column; align-items: center; }
  .pub-offer-actions { flex-direction: column; }
}

/* ══════════════════════════════════════════════
   OFFER PAGE — inline style removal fix
   ══════════════════════════════════════════════ */

/* offer.html had style="display:flex;justify-content:center" on main —
   pub-offer-grid is already centered via max-width + margin:auto */
.pub-offer-section { padding: 0 2rem 3rem; }

/* Ensure the hero on sub-pages has less bottom padding */
.pub-hero--compact { padding-bottom: 1.5rem; }

/* ══════════════════════════════════════════════
   CONTACT form — reuse form-group labels nicely
   in the white-card context (pub-contact-card)
   ══════════════════════════════════════════════ */
.pub-contact-card .form-group label { color: var(--text-muted); }
.pub-contact-card .form-group input,
.pub-contact-card .form-group textarea { background: var(--surface-2); }

/* ══════════════════════════════════════════════
   PRIVACY — lang buttons row
   ══════════════════════════════════════════════ */
.pub-privacy-langs { margin-bottom: 2rem; }

/* ══════════════════════════════════════════════
   TOUCH / MOBILE — extra polish
   ══════════════════════════════════════════════ */

/* Larger tap targets on mobile for nav links */
@media (max-width: 720px) {
  .pub-header nav a,
  header nav a {
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
    border-radius: var(--radius);
    display: block;
  }

  /* Hero tighter on small screens */
  .pub-hero { padding: 2.5rem 1.25rem 2rem; }
  .pub-hero h1 { font-size: 1.75rem; }
  .pub-hero p  { font-size: 0.95rem; }

  /* Feature grid single column with more breathing room */
  .pub-features { grid-template-columns: 1fr; margin: 0 0 2rem; }
  .pub-feature-card { padding: 1.4rem; }

  /* Stats single column */
  .pub-stats { grid-template-columns: 1fr; margin: 0 0 2rem; }
  .pub-stat-card { padding: 1.25rem; }
  .pub-stat-card .num { font-size: 1.75rem; }

  /* FAQ full width */
  .pub-faq { padding: 0 1.25rem 2.5rem; }
  .pub-faq h2 { font-size: 1.25rem; }
  .faq-question { font-size: 0.9rem; padding: 0.9rem 1rem; }
  .faq-answer   { padding: 0 1rem 0.9rem; font-size: 0.88rem; }

  /* Opinions full width */
  .pub-opinions { padding: 0 1.25rem 3rem; }
  .pub-opinions h2 { font-size: 1.25rem; }
  .pub-opinion-grid { grid-template-columns: 1fr; }

  /* Offer full width */
  .pub-offer-grid {
    grid-template-columns: 1fr;
    padding: 0 1.25rem 2.5rem;
  }

  /* About */
  .pub-about-section { padding: 1.75rem 1.25rem; }
  .pub-about-section h2 { font-size: 1.15rem; }

  /* Contact */
  .pub-contact-wrap { padding: 1.75rem 1.25rem; }
  .pub-contact-card { padding: 1.6rem 1.25rem; }

  /* Privacy */
  .pub-privacy { padding: 1.75rem 1.25rem; }
  .pub-privacy h1 { font-size: 1.3rem; }

  /* Footer stacks */
  .pub-footer { flex-direction: column; align-items: flex-start; gap: 0.65rem; }

  /* Buttons full width inside hero on mobile */
  .pub-hero-actions .btn { width: 100%; justify-content: center; }

  /* Offer card actions stack */
  .pub-offer-actions { flex-direction: column; }
  .pub-offer-actions .btn { justify-content: center; }

  /* Center-wrap (404) */
  .center-wrap .big-code { font-size: 4rem; }
  .center-wrap h2 { font-size: 1.1rem; }

  /* Error card */
  .error-card { padding: 2rem 1.25rem; }

  /* Admin stat-grid on very small screens */
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* Make admin table cells slightly smaller on mobile */
  td, th { padding: 0.6rem 0.75rem; }

  /* Bigger touch targets for buttons in tables */
  .btn-sm { padding: 0.4rem 0.75rem; font-size: 0.82rem; }
  .btn-xs { padding: 0.3rem 0.55rem; font-size: 0.78rem; }
}

/* Very small screens (< 380px) */
@media (max-width: 380px) {
  html { font-size: 14px; }
  .pub-hero h1 { font-size: 1.5rem; }
  .pub-features { margin: 0 0 1.5rem; }
  .pub-stats    { margin: 0 0 1.5rem; }
  header, .pub-header { padding: 0 0.85rem; }
  main, .page-content { padding: 0.85rem; }
}

/* ── pub-content-narrow: dashboard public pages (register, login, contact…) ── */
.pub-content-narrow {
  flex: 1;
  padding: 2rem 2rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}
@media (max-width: 720px) {
  .pub-content-narrow { padding: 1.25rem; }
}
