/* Bleatly – Western/Rustic Theme Variables */
:root {
  --bg:           #2e1e12;
  --bg-card:      #3f2a1f;
  --bg-input:     #1e1109;
  --bg-sidebar:   #251509;
  --bg-hover:     #4a3020;
  --bg-active:    #5a3a22;
  --primary:      #d96c06;
  --primary-dark: #b35800;
  --primary-glow: rgba(217, 108, 6, 0.25);
  --accent:       #a15c3a;
  --text:         #fdf4e3;
  --text-muted:   #b8a08a;
  --text-faint:   #7a6050;
  --link:         #ffb347;
  --danger:       #c0392b;
  --danger-dark:  #962d22;
  --success:      #5a8a3a;
  --border:       rgba(161, 92, 58, 0.3);
  --border-strong: rgba(161, 92, 58, 0.6);
  --shadow:       rgba(0, 0, 0, 0.4);

  /* Role badge colors */
  --role-admin:   #d96c06;
  --role-mod:     #5a8a3a;
  --role-user:    #7a6050;

  --radius:       6px;
  --radius-lg:    10px;
  --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition:   150ms ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  transition: background var(--transition), transform var(--transition);
}
button:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  font-weight: 600;
}
.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
}

input, textarea, select {
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
input::placeholder, textarea::placeholder {
  color: var(--text-faint);
}

select option {
  background: var(--bg-card);
}

.role-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 3px;
}
.role-badge.admin {
  background: var(--role-admin);
  color: #fff;
}
.role-badge.mod {
  background: var(--role-mod);
  color: #fff;
}
.role-badge.user {
  background: transparent;
  color: var(--text-faint);
  border: 1px solid var(--border);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar.sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}
.avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-img.sm {
  width: 24px;
  height: 24px;
}

.error-msg {
  color: #ff6b6b;
  font-size: 13px;
  margin-top: 6px;
  min-height: 18px;
}

.success-msg {
  color: #6bcb77;
  font-size: 13px;
  margin-top: 6px;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ─── Theme: Dark (clean dark mode) ────────────────────────────────────────── */
body.theme-dark {
  --bg:           #1a1b1e;
  --bg-card:      #25262b;
  --bg-input:     #141517;
  --bg-sidebar:   #16171a;
  --bg-hover:     #2c2e33;
  --bg-active:    #343640;
  --primary:      #4c8af0;
  --primary-dark: #3a75d4;
  --primary-glow: rgba(76, 138, 240, 0.25);
  --accent:       #4c8af0;
  --text:         #e8e9ec;
  --text-muted:   #909296;
  --text-faint:   #5c5f66;
  --link:         #74a8f0;
  --danger:       #f03e3e;
  --danger-dark:  #d43030;
  --success:      #40c057;
  --border:       rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.15);
  --shadow:       rgba(0, 0, 0, 0.5);
  --role-admin:   #4c8af0;
  --role-mod:     #40c057;
  --role-user:    #5c5f66;
}

/* ─── Theme: Light ──────────────────────────────────────────────────────────── */
body.theme-light {
  --bg:           #f8f9fa;
  --bg-card:      #ffffff;
  --bg-input:     #f1f3f5;
  --bg-sidebar:   #e9ecef;
  --bg-hover:     #dee2e6;
  --bg-active:    #ced4da;
  --primary:      #c05800;
  --primary-dark: #9a4500;
  --primary-glow: rgba(192, 88, 0, 0.15);
  --accent:       #9a4500;
  --text:         #212529;
  --text-muted:   #495057;
  --text-faint:   #868e96;
  --link:         #c05800;
  --danger:       #c92a2a;
  --danger-dark:  #a81c1c;
  --success:      #2f9e44;
  --border:       rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.2);
  --shadow:       rgba(0, 0, 0, 0.1);
  --role-admin:   #c05800;
  --role-mod:     #2f9e44;
  --role-user:    #868e96;
}

/* ─── Theme: Gameboy ────────────────────────────────────────────────────────── */
body.theme-gameboy {
  --bg:           #0c1a08;
  --bg-card:      #142810;
  --bg-input:     #081404;
  --bg-sidebar:   #0a1c07;
  --bg-hover:     #1c3414;
  --bg-active:    #244020;
  --primary:      #5ca832;
  --primary-dark: #489028;
  --primary-glow: rgba(92, 168, 50, 0.25);
  --accent:       #489028;
  --text:         #a8d840;
  --text-muted:   #7cac28;
  --text-faint:   #508018;
  --link:         #c4f058;
  --danger:       #b84020;
  --danger-dark:  #982d14;
  --success:      #60c030;
  --border:       rgba(92, 168, 50, 0.3);
  --border-strong: rgba(92, 168, 50, 0.6);
  --shadow:       rgba(0, 0, 0, 0.6);
  --role-admin:   #5ca832;
  --role-mod:     #60c030;
  --role-user:    #508018;
  --font:         'Courier New', monospace;
}
