/* =============================================
   Comunidade I.A — Stylesheet
   ============================================= */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0f0f11;
  --bg-card: #18181b;
  --surface: #1e1e22;
  --border: #2a2a2e;
  --text: #f0f0f2;
  --text-secondary: #a1a1aa;
  --text-muted: #63636b;
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-bg: rgba(139, 92, 246, 0.12);
  --premium-bg: #fbbf24;
  --premium-text: #18181b;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.4);
  --transition: 200ms ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 17, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  color: var(--text);
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--accent);
}

.logo-text strong {
  color: var(--accent);
}

.header-nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-bg);
}

/* --- Hero --- */
.hero {
  padding: 64px 0 40px;
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  margin-top: 16px;
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Filters --- */
.filters-section {
  padding-bottom: 32px;
}

.search-bar {
  position: relative;
  margin-bottom: 32px;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  background: var(--bg-card);
  color: var(--text);
  transition: all var(--transition);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.filter-groups {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
}

.chip:hover {
  border-color: var(--accent-light);
  color: var(--accent);
  background: var(--accent-bg);
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.chip.active:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: #fff;
}

/* Active Filters Bar */
.active-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.active-filters-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
}

.active-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background var(--transition);
}

.active-chip-remove:hover {
  background: rgba(255,255,255,0.4);
}

.clear-filters {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--danger);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}

.clear-filters:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* --- Gallery --- */
.gallery-section {
  padding: 16px 0 64px;
}

.gallery-header {
  margin-bottom: 24px;
}

.gallery-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* --- Card --- */
.card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: all 300ms ease;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-image-wrapper {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.card:hover .card-image {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.1) 0%,
    transparent 30%,
    transparent 50%,
    rgba(0,0,0,0.7) 100%
  );
}

.card-top {
  display: flex;
  justify-content: flex-end;
}

.badge-premium {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--premium-bg);
  color: var(--premium-text);
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-model {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  transition: all var(--transition);
}

.btn-icon:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.btn-like.liked {
  color: var(--danger);
}

.btn-like.liked svg {
  fill: var(--danger);
  stroke: var(--danger);
}

.btn-copy.copied {
  color: var(--success);
}

.like-count {
  font-variant-numeric: tabular-nums;
}

.view-count {
  font-variant-numeric: tabular-nums;
}

.btn-views {
  cursor: default;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  margin: 0 auto 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
}

/* --- Detail Page --- */
.detail-section {
  padding: 32px 0 64px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
  padding: 8px 0;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--accent);
}

.detail-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 48px;
  align-items: start;
}

.detail-image-wrapper {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.detail-image {
  width: 100%;
  height: auto;
  display: block;
}

.badge-premium-detail {
  position: absolute;
  top: 16px;
  right: 16px;
}

.detail-info-panel {
  position: sticky;
  top: 88px;
}

.detail-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.detail-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat svg {
  color: var(--text-muted);
}

.detail-block {
  margin-bottom: 28px;
}

.detail-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.detail-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.detail-block-header .detail-label {
  margin-bottom: 0;
}

.detail-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface);
  padding: 16px;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
}

.btn-copy-detail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all var(--transition);
}

.btn-copy-detail:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-copy-detail.copied {
  border-color: var(--success);
  color: var(--success);
}

/* Params Grid */
.params-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.param {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.param-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.param-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-detail {
  background: var(--surface);
  border-color: transparent;
}

.chip-detail:hover {
  background: var(--accent-bg);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}

.site-footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
}

.footer-nav a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--accent);
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--premium-bg);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: all 300ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-layout {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .detail-info-panel {
    position: static;
  }

  .detail-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .params-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeIn 400ms ease both;
}

.gallery-grid .card:nth-child(1) { animation-delay: 0ms; }
.gallery-grid .card:nth-child(2) { animation-delay: 50ms; }
.gallery-grid .card:nth-child(3) { animation-delay: 100ms; }
.gallery-grid .card:nth-child(4) { animation-delay: 150ms; }
.gallery-grid .card:nth-child(5) { animation-delay: 200ms; }
.gallery-grid .card:nth-child(6) { animation-delay: 250ms; }
.gallery-grid .card:nth-child(7) { animation-delay: 300ms; }
.gallery-grid .card:nth-child(8) { animation-delay: 350ms; }
.gallery-grid .card:nth-child(9) { animation-delay: 400ms; }
.gallery-grid .card:nth-child(10) { animation-delay: 450ms; }
.gallery-grid .card:nth-child(11) { animation-delay: 500ms; }
.gallery-grid .card:nth-child(12) { animation-delay: 550ms; }

/* --- Auth Pages --- */
.auth-section {
  padding: 80px 0;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 200px);
  align-items: flex-start;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary:hover {
  background: var(--accent-light);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: var(--border);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-link {
  color: var(--accent);
  font-weight: 600;
  transition: color var(--transition);
}

.auth-link:hover {
  color: var(--accent-light);
}

/* --- User Menu --- */
.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
  cursor: pointer;
}

.user-menu-btn:hover {
  background: var(--surface);
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  z-index: 200;
}

.user-dropdown.open {
  display: block;
}

.dropdown-user-info {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.dropdown-user-info strong {
  color: var(--text);
  font-weight: 600;
}

.dropdown-user-info small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.dropdown-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.dropdown-item {
  display: block;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: all var(--transition);
}

.dropdown-item:hover {
  background: var(--surface);
  color: var(--text);
}

.dropdown-logout {
  color: var(--danger);
}

.dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.nav-register {
  background: var(--accent);
  color: #fff !important;
}

.nav-register:hover {
  background: var(--accent-light) !important;
  color: #fff !important;
}

.nav-admin {
  color: var(--premium-text) !important;
  background: var(--premium-bg);
}

.nav-admin:hover {
  opacity: 0.9;
}

/* --- Like button on detail page --- */
.btn-like-detail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}

.btn-like-detail:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-like-detail.liked {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-like-detail.liked svg {
  fill: var(--danger);
  stroke: var(--danger);
}

/* --- Likes Page --- */
.likes-section {
  padding: 48px 0 64px;
}

.likes-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.likes-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* --- Admin Panel --- */
.admin-section {
  padding: 32px 0 64px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.admin-title {
  font-size: 1.75rem;
  font-weight: 800;
}

.admin-table-wrapper {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(139, 92, 246, 0.06);
}

.title-cell {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.actions-cell {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.loading-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px !important;
}

.btn-sm {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
}

.btn-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-delete {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--surface);
  color: var(--text);
}

.modal-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

.admin-tags-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-tag-category {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-tag-cat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  min-width: 80px;
}

.admin-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}

.admin-tag-item:hover {
  background: var(--accent-bg);
}

.admin-tag-item input[type="checkbox"] {
  accent-color: var(--accent);
}

/* --- Admin Tabs --- */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.admin-tab {
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
  background: none;
  font-family: var(--font);
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

.admin-tab-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

/* --- Category Cards --- */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition);
}

.cat-card:hover {
  border-color: var(--accent);
}

.cat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cat-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cat-card-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.cat-card-order {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

.cat-card-actions {
  display: flex;
  gap: 8px;
}

.cat-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-tag-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-bg);
  color: var(--accent-light);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Category Tag Editor (modal) --- */
.cat-tags-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
}

.cat-tag-editable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
}

.cat-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  border: none;
  padding: 0;
  line-height: 1;
  transition: background var(--transition);
}

.cat-tag-remove:hover {
  background: rgba(255,255,255,0.4);
}

.cat-tag-add {
  display: flex;
  gap: 8px;
}

.cat-tag-add .form-input {
  flex: 1;
}

.btn-add-tag {
  white-space: nowrap;
}
