/* ===================================================================
   MasterPlan Admin Dashboard — Styles
   =================================================================== */

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

[x-cloak] { display: none !important; }

/* --- Custom Properties --- */
:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-tertiary: #242731;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.12);
  --success: #22c55e;
  --success-hover: #16a34a;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --warning-hover: #d97706;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #2d3140;
  --border-light: #383c4d;
  --sidebar-width: 240px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
  --transition: 150ms ease;
}

/* --- Light Theme --- */
[data-theme="light"] {
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef0f4;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.08);
  --success: #16a34a;
  --success-hover: #15803d;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --warning: #d97706;
  --warning-hover: #b45309;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* --- Midnight Theme --- */
[data-theme="midnight"] {
  --bg-primary: #0b1224;
  --bg-secondary: #111a33;
  --bg-tertiary: #182342;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-glow: rgba(56, 189, 248, 0.12);
  --success: #34d399;
  --success-hover: #10b981;
  --danger: #f87171;
  --danger-hover: #ef4444;
  --warning: #fbbf24;
  --warning-hover: #f59e0b;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e2d50;
  --border-light: #2a3a5c;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* --- Base --- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

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

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

/* --- Typography --- */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 0.9375rem; font-weight: 600; }

/* --- Utility --- */
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===================================================================
   LOGIN PAGE
   =================================================================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-card);
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand h1 {
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.login-brand span {
  color: var(--accent);
}

.login-brand p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.login-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.login-tab {
  flex: 1;
  padding: 0.625rem 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.login-tab:hover { color: var(--text-secondary); }
.login-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.login-info {
  padding: 0.625rem 0.75rem;
  background: var(--accent-glow);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 1.25rem;
}

.form-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  color: var(--success);
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

.forgot-link {
  text-align: right;
  margin-bottom: 0.75rem;
}
.forgot-link a {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color var(--transition);
}
.forgot-link a:hover {
  color: var(--accent);
}
.forgot-link-back {
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 0;
}

/* ===================================================================
   FORMS
   =================================================================== */
.form-group {
  position: relative;
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.char-counter {
  position: absolute;
  right: 4px;
  bottom: -18px;
  font-size: 0.6875rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
}
.char-counter.at-limit {
  color: var(--danger);
  font-weight: 600;
}

.form-input.at-limit {
  border-color: var(--danger);
}
.form-input.at-limit:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 5.793L8 9.293l3.5-3.5.707.707L8 10.707 3.793 6.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  padding-right: 2.25rem;
}

.form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.8125rem;
  padding: 0.625rem 0.875rem;
  margin-bottom: 1rem;
}

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
  white-space: nowrap;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  opacity: 1;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: var(--success-hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

.btn-warning {
  background: var(--warning);
  color: #000;
}

.btn-warning:hover:not(:disabled) {
  background: var(--warning-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-sm {
  padding: 0.3125rem 0.625rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  padding: 0.5rem;
}

/* ===================================================================
   APP LAYOUT
   =================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand h2 {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.sidebar-brand span {
  color: var(--accent);
}

.sidebar-brand p {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  margin: 0.125rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: calc(100% - 1rem);
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.0625rem 0.4375rem;
  border-radius: 999px;
  min-width: 1.25rem;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-footer .btn {
  width: 100%;
  justify-content: flex-start;
}

/* Theme switcher */
.theme-switcher {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 0.1875rem;
}

.theme-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.6875rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.theme-btn:hover {
  color: var(--text-secondary);
}

.theme-btn.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.theme-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* --- Mobile sidebar toggle --- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  padding: 0 1rem;
  align-items: center;
  gap: 0.75rem;
}

.hamburger {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger svg {
  width: 24px;
  height: 24px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

/* --- Main content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-width: 0;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin-bottom: 0.25rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ===================================================================
   STAT CARDS
   =================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.stat-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-card-hover);
}

.stat-card.highlight {
  border-color: var(--warning);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ===================================================================
   CARDS GRID (objects)
   =================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.object-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s ease;
}

.object-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-card-hover);
}

.object-card.removing {
  opacity: 0;
  transform: scale(0.95);
}

.object-card-image {
  width: 100%;
  height: 160px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.object-card-image img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  padding: 1rem;
}

.object-card-body {
  padding: 1rem;
}

.object-card-name {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
}

.object-card-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.object-card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}

.object-card-actions .btn {
  flex: 1;
}

/* ===================================================================
   TABLE
   =================================================================== */
.table-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.table-toolbar .form-input {
  max-width: 280px;
}

.plan-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  white-space: nowrap;
}

tbody td {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--bg-tertiary);
}

tbody tr:last-child td {
  border-bottom: none;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===================================================================
   BADGES
   =================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 999px;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.badge-pro {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-hover);
}

.badge-admin {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.badge-free {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}

.badge-private {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-approved {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.badge-role-staff {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.badge-role-admin {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.badge-role-superadmin {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.badge-tier-free {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}

.badge-tier-pro {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.badge-tier-architect {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

/* ===================================================================
   PROGRESS BAR (storage)
   =================================================================== */
.progress-bar {
  width: 100%;
  max-width: 120px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.progress-bar-fill.high {
  background: var(--warning);
}

.progress-bar-fill.critical {
  background: var(--danger);
}

/* ===================================================================
   PAGINATION
   =================================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
}

.pagination-info {
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  gap: 0.375rem;
}

.pagination-controls .btn {
  min-width: 2rem;
}

/* ===================================================================
   EMPTY STATE
   =================================================================== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: var(--text-muted);
}

.empty-state h3 {
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.empty-state p {
  font-size: 0.875rem;
}

/* ===================================================================
   LOADING
   =================================================================== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===================================================================
   THUMBNAIL (table)
   =================================================================== */
.thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
}

/* ===================================================================
   FILTER BAR
   =================================================================== */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar .form-input {
  max-width: 280px;
}

/* ===================================================================
   TOAST / NOTIFICATION
   =================================================================== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  box-shadow: var(--shadow-card-hover);
  animation: toastIn 0.25s ease;
  max-width: 360px;
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--danger);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================================================
   NAV SECTION LABELS
   =================================================================== */
.nav-section-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1rem 1.25rem 0.375rem;
  margin-top: 0.25rem;
}

/* ===================================================================
   TAB BAR
   =================================================================== */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.tab-item {
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  font-family: inherit;
}

.tab-item:hover {
  color: var(--text-primary);
}

.tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===================================================================
   FEEDBACK STYLES
   =================================================================== */
.feedback-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  margin-bottom: 0.625rem;
  transition: border-color var(--transition);
  cursor: pointer;
}

.feedback-item:hover {
  border-color: var(--border-light);
}

.vote-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  width: 2.75rem;
  height: 3rem;
  transition: all var(--transition);
  flex-shrink: 0;
}

.vote-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.vote-button.voted {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}

.vote-button .vote-arrow {
  font-size: 0.875rem;
  line-height: 1;
}

.feedback-item-content {
  flex: 1;
  min-width: 0;
}

.feedback-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.feedback-item-title {
  font-weight: 600;
  font-size: 0.875rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.feedback-detail {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.feedback-detail-message {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 1rem;
}

.feedback-reply {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  font-size: 0.8125rem;
}

.feedback-reply.admin {
  border-left: 3px solid #f59e0b;
}

.author-link.admin-author,
strong.admin-author {
  color: #d97706;
  font-weight: 700;
}

.feedback-reply-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.feedback-reply-header strong {
  color: var(--text-primary);
}

.feedback-reply-message {
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Status badges */
.badge-open, .badge-select-open {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-hover);
}

.badge-under_review, .badge-select-under_review {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.badge-in_progress, .badge-select-in_progress {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-resolved, .badge-select-resolved {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge-closed, .badge-select-closed {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}

/* --- Status select (inline dropdown styled as badge) --- */
.badge-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.4;
  outline: none;
  transition: all var(--transition);
}
.badge-select:hover { border-color: var(--border-light); }
.badge-select:focus { border-color: var(--accent); }
.badge-select option { background: var(--bg-secondary); color: var(--text-primary); }

/* --- Severity badges --- */
.badge-severity-critical {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-weight: 600;
}

.badge-severity-high {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
}

.badge-severity-medium {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.badge-severity-low {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge-severity-trivial {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
}

/* --- Feedback type badges --- */
.badge-bug       { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-feature   { background: rgba(99,102,241,0.15); color: var(--accent-hover); }

/* --- Forum category badges --- */
.badge-general   { background: rgba(107,114,128,0.15); color: #9ca3af; }
.badge-tips      { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-help      { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-showcase  { background: rgba(139,92,246,0.15); color: #a78bfa; }
.badge-pinned    { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-locked    { background: rgba(239,68,68,0.15); color: #f87171; }

.reply-count-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 2.5rem;
  flex-shrink: 0;
  text-align: center;
}

.reply-count-col .reply-label {
  font-size: 0.5625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ===================================================================
   MARKDOWN EDITOR & RENDERED CONTENT
   =================================================================== */
.md-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.md-editor .md-textarea {
  border: none;
  border-radius: 0;
  border-top: 1px solid var(--border);
}

/* Contenteditable WYSIWYG editor */
.ce-editor {
  min-height: 120px;
  padding: 0.625rem 0.75rem;
  border-top: 1px solid var(--border);
  outline: none;
  cursor: text;
  font-size: 0.875rem;
}
.ce-editor-sm {
  min-height: 60px;
  flex: 1;
}
.ce-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}
.ce-editor:focus {
  box-shadow: inset 0 0 0 1px var(--accent);
}
.ce-editor img {
  max-width: 100%;
  border-radius: 4px;
  margin: 0.25rem 0;
  cursor: pointer;
}
.ce-editor.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: rgba(59, 130, 246, 0.05);
}

.md-toolbar {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.25rem 0.375rem;
  background: var(--bg-tertiary);
  flex-wrap: wrap;
}
.md-toolbar button, .md-toolbar label {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.md-toolbar button:hover, .md-toolbar label:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.md-toolbar button.active {
  background: var(--accent);
  color: #fff;
}
.md-toolbar-sep {
  width: 1px;
  height: 1rem;
  background: var(--border);
  margin: 0 0.25rem;
}

/* Drag-over state */
.md-textarea.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: rgba(59, 130, 246, 0.05);
}

/* Rendered markdown */
.md-content {
  line-height: 1.6;
  word-break: break-word;
}
.md-content p { margin: 0 0 0.5rem; }
.md-content p:last-child { margin-bottom: 0; }
.md-content a { color: var(--accent); text-decoration: underline; }
.md-content a:hover { opacity: 0.8; }
.md-content strong { font-weight: 600; }
.md-content em { font-style: italic; }
.md-content ul, .md-content ol { margin: 0.25rem 0 0.5rem 1.25rem; }
.md-content li { margin-bottom: 0.125rem; }
.md-content blockquote {
  margin: 0.25rem 0 0.5rem;
  padding: 0.375rem 0.75rem;
  border-left: 3px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.md-content code {
  background: var(--bg-tertiary);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.85em;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.md-content pre {
  background: var(--bg-tertiary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0.25rem 0 0.5rem;
}
.md-content pre code {
  background: none;
  padding: 0;
}
.md-content img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 0.375rem 0;
  cursor: pointer;
}
.md-content h1, .md-content h2, .md-content h3, .md-content h4 {
  margin: 0.75rem 0 0.375rem;
  font-weight: 600;
  line-height: 1.3;
}
.md-content h1 { font-size: 1.25em; }
.md-content h2 { font-size: 1.125em; }
.md-content h3 { font-size: 1em; }
.md-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.5rem 0;
}

/* Markdown live preview */
.md-preview {
  margin-top: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
}
.md-preview-sm { max-height: 150px; }
.md-preview-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}

/* Reply vote button */
.reply-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 0.15rem 0.4rem;
  font-size: 0.6875rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.reply-vote-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.reply-vote-btn.voted {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* --- Detail Hero Post (first post in feedback/forum detail) --- */
.detail-hero {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.detail-hero-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.625rem;
  line-height: 1.35;
}

.detail-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.detail-hero-meta .author-info {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.detail-hero-body {
  padding: 0.25rem 0;
}

.detail-hero-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
}

.detail-hero-footer .vote-button {
  flex-direction: row;
  width: auto;
  height: auto;
  padding: 0.375rem 0.75rem;
  gap: 0.375rem;
  font-size: 0.8125rem;
}

.detail-hero-footer .vote-button .vote-arrow {
  font-size: 0.75rem;
}

/* ===================================================================
   PLAN DETAIL STYLES
   =================================================================== */
.plan-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.plan-info-row {
  display: flex;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
}
.plan-info-label {
  color: var(--text-muted);
  min-width: 100px;
  flex-shrink: 0;
  font-weight: 500;
}
.plan-floor-section {
  margin-bottom: 1.5rem;
}
.plan-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.plan-section-title svg {
  color: var(--accent);
  flex-shrink: 0;
}
.plan-canvas-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.plan-canvas-wrapper canvas {
  display: block;
}
.plan-areas-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.plan-area-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}
.plan-samples-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.plan-sample-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.plan-sample-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.plan-sample-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.plan-sample-status {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: capitalize;
}
.plan-sample-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0.25rem 0;
  line-height: 1.5;
}
.plan-sample-fields {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.plan-field-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.plan-sample-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.plan-photo-container {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  line-height: 0;
}
.plan-photo-container:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-card-hover);
}
.plan-photo-canvas {
  display: block;
}
@media (max-width: 600px) {
  .plan-info-row {
    flex-direction: column;
    gap: 0.125rem;
  }
  .plan-info-label {
    min-width: unset;
  }
  .plan-sample-photo {
    width: 80px;
    height: 60px;
  }
}

/* ===================================================================
   GALLERY STYLES
   =================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.gallery-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.gallery-card:hover { box-shadow: var(--shadow-card-hover); }

.gallery-card-thumb {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: repeating-conic-gradient(var(--bg-tertiary) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}
.gallery-card-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gallery-card-body {
  padding: 0.5rem 0.625rem;
}

.gallery-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.gallery-card-fav {
  font-size: 0.6875rem;
  color: var(--accent);
}

.gallery-card-author {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ===================================================================
   ANNOUNCEMENT STYLES
   =================================================================== */
.announcement-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}

.announcement-card h3 {
  margin-bottom: 0.375rem;
}

.announcement-card .announcement-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.announcement-card .announcement-body {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ===================================================================
   ACCOUNT INFO GRID
   =================================================================== */
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.account-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.account-card h3 {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.account-field {
  margin-bottom: 0.75rem;
}

.account-field:last-child {
  margin-bottom: 0;
}

.account-field-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.account-field-value {
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* Storage bar (wide) */
.storage-bar-wide {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.375rem;
}

.storage-bar-wide .progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 1.25rem;
    padding-top: calc(56px + 1.25rem);
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar .form-input {
    max-width: none;
    flex: 1;
    min-width: 150px;
  }

  .pagination {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    text-align: center;
  }

  .pagination-controls {
    justify-content: center;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-toolbar .form-input {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .object-card-actions {
    flex-direction: column;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }
}

/* === Author Link === */
.author-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.author-link:hover {
  text-decoration: underline;
}

/* === Member Chips (plan collaborators) === */
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.member-chip:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}
.member-chip-role {
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.7;
}
.member-chip-owner { border-color: var(--success); }
.member-chip-owner .member-chip-role { color: var(--success); }
.member-chip-editor { border-color: var(--accent); }
.member-chip-editor .member-chip-role { color: var(--accent); }
.member-chip-viewer { border-color: var(--text-muted); }
.member-chip-viewer .member-chip-role { color: var(--text-muted); }

/* === Profile Popup Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 400px;
  max-width: 90vw;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.profile-popup {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 420px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.profile-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.profile-popup-header h3 { margin: 0; }
.profile-popup-body {
  padding: 1.25rem 1.5rem;
}
.profile-field {
  margin-bottom: 0.75rem;
}
.profile-field-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.125rem;
}
.profile-field-value {
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* === Privacy Toggles === */
/* --- Account Edit Form --- */
.account-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.account-edit-form .form-group {
  margin-bottom: 0;
}
.account-edit-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.account-logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.account-logo-preview {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.account-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.account-logo-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-danger-outline {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger-outline:hover {
  background: var(--danger);
  color: #fff;
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0;
}

.privacy-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.privacy-toggle:last-child { border-bottom: none; }
.privacy-toggle input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* --- Detail action links (Edit, Delete, Report in footers and reply bars) --- */
.detail-action {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.detail-action:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}
.detail-action-danger:hover {
  color: var(--danger) !important;
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

/* Grouped actions row in footers and reply bars */
.detail-actions-group {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  margin-left: auto;
}
.detail-actions-sep {
  width: 1px;
  height: 0.75rem;
  background: var(--border);
  margin: 0 0.25rem;
}

/* Reply form bottom row (hint + submit) */
.reply-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.375rem;
}
.reply-form-footer .reply-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* --- Report reason option (radio-like toggle) --- */
.report-reason-option {
  display: block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.report-reason-option:hover {
  border-color: var(--accent);
}
.report-reason-option.selected {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

/* --- Admin report cards --- */
.report-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  background: var(--bg-secondary);
}
.report-card-left {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  flex-shrink: 0;
  min-width: 5.5rem;
}
.report-reason-badge {
  display: inline-block;
  padding: 0.1875rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: capitalize;
  text-align: center;
}
.reason-inappropriate { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.reason-spam          { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.reason-copyright     { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.reason-other         { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }

.report-count-badge {
  font-size: 0.625rem;
  color: var(--warning);
  font-weight: 600;
  text-align: center;
}
.report-card-center {
  flex: 1;
  min-width: 0;
}
.report-content-type {
  font-size: 0.6875rem;
  text-transform: capitalize;
  color: var(--text-muted);
  margin-bottom: 0.125rem;
}
.report-preview {
  font-size: 0.8125rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}
.report-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}
.report-description {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.375rem;
  font-style: italic;
}
.report-card-actions {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .report-card { flex-direction: column; }
  .report-card-actions { align-self: flex-end; }
}
