/* ==========================================================================
   INTRA — Premium Design System & Styles
   Inspired by Linear, Notion, Raycast & Vercel
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;

  /* Theme: Dark (Default) */
  --bg-primary: #09090b;
  --bg-secondary: #121215;
  --bg-surface: #18181b;
  --bg-surface-hover: #222226;
  --bg-surface-active: #27272a;
  --bg-elevated: #1f1f23;
  --bg-input: #141417;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-default: rgba(255, 255, 255, 0.12);
  --border-focus: #6366f1;

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverse: #09090b;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.15);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #38bdf8;
  --info-bg: rgba(56, 189, 248, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f8fafc;
  --bg-surface-active: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-input: #ffffff;

  --border-subtle: #e2e8f0;
  --border-default: #cbd5e1;
  --border-focus: #4f46e5;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-light: rgba(79, 70, 229, 0.08);
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);

  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.1);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.1);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);
  --info: #0284c7;
  --info-bg: rgba(2, 132, 199, 0.1);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);
}

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

html, body {
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app-root {
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  cursor: pointer;
}
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: var(--shadow-glow);
}
.brand-name {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.brand-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.header-center {
  flex: 1;
  max-width: 480px;
}
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}
.search-input {
  width: 100%;
  padding: 0.45rem 2.2rem 0.45rem 2.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
}
.search-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-input);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.search-shortcut {
  position: absolute;
  right: 0.6rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: var(--bg-surface-active);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Catalog Search Bar (Full Width above filters) */
.catalog-search-container {
  width: 100%;
  margin-bottom: 1.25rem;
}

.catalog-search-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.catalog-search-input {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 2.8rem 0.65rem 2.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

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

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  font-size: 1rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.search-clear-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

/* User Profile Badge & Dropdown */
.user-dropdown-wrapper {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s ease;
  outline: none;
}
.user-menu-btn:hover,
.user-menu-btn:focus-visible {
  background: var(--bg-surface-hover);
  border-color: var(--border-default);
}
.dropdown-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.user-dropdown-wrapper.open .dropdown-chevron {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 250px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  padding: 0.5rem 0;
  display: none;
  animation: modalIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.user-dropdown-menu.open {
  display: block;
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}
.user-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  overflow: hidden;
}
.user-dropdown-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-dropdown-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-dropdown-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.2rem;
}
.user-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.4rem 0;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: all 0.15s ease;
}
.user-dropdown-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.user-dropdown-item.user-dropdown-danger {
  color: var(--danger);
}
.user-dropdown-item.user-dropdown-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}
.user-menu:hover {
  background: var(--bg-surface-hover);
}
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.user-name {
  font-size: 0.8125rem;
  font-weight: 600;
}
.user-role-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  background: var(--bg-surface-active);
  color: var(--text-secondary);
  border-radius: 4px;
}

/* Visibility and responsive text helpers */
.btn-text-desktop {
  display: inline;
}
.btn-text-mobile {
  display: none;
}
.desktop-only-inline {
  display: inline-flex;
}
.desktop-only {
  display: block;
}
.mobile-only {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
  text-decoration: none;
  line-height: 1.25;
}
.btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  border-radius: var(--radius-lg);
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-focus);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-icon {
  padding: 0.45rem;
  border-radius: var(--radius-md);
}

/* Layout Container */
.app-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

/* Page Headers */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.view-title-group h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.view-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Filter & Control Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

/* Select Dropdown */
.select-input {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}
.select-input:focus {
  border-color: var(--border-focus);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.badge-atualizado {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-atualizado .badge-dot {
  background: var(--success);
}
.badge-revisar {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.badge-revisar .badge-dot {
  background: var(--warning);
}
.badge-obsoleto {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.badge-obsoleto .badge-dot {
  background: var(--danger);
}
.badge-rascunho {
  background: rgba(161, 161, 170, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(161, 161, 170, 0.2);
}
.badge-rascunho .badge-dot {
  background: var(--text-secondary);
}
.badge-archived {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}
.badge-archived .badge-dot {
  background: #c084fc;
}

.pill {
  font-size: 0.7rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: var(--bg-surface-active);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* Cards & Procedures Grid */
.procedures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}

.procedure-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.procedure-card:hover {
  border-color: var(--border-default);
  background: var(--bg-surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.procedure-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.procedure-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.procedure-slug {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.procedure-snippet {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.procedure-snippet mark {
  background: rgba(234, 179, 8, 0.25);
  color: #fbbf24;
  padding: 0.05rem 0.2rem;
  border-radius: 2px;
}
.procedure-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.procedure-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.procedure-footer-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ==========================================================================
   VIEW MODES (CARDS VS LIST) & BULK ACTIONS
   ========================================================================== */

.view-header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.15rem;
  gap: 0.15rem;
}

.view-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-mode-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.view-mode-btn.active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.admin-catalog-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Bulk Selection Checkboxes */
.procedure-checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.procedure-select-cb,
.trash-select-cb {
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
  accent-color: var(--accent);
  border-radius: 4px;
}

/* Selected Procedure Highlights */
.procedure-card.selected,
.procedure-list-item.selected {
  border-color: var(--accent) !important;
  background: rgba(99, 102, 241, 0.04) !important;
  box-shadow: 0 0 0 1px var(--accent);
}

/* Bulk Actions Floating/Sticky Bar */
.bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bulk-actions-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bulk-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.bulk-count-badge {
  display: inline-flex;
  align-items: center;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.bulk-actions-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* List View Container & Items */
.procedures-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.procedure-list-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.procedure-list-item:hover {
  border-color: var(--border-default);
  background: var(--bg-surface-hover);
  transform: translateX(2px);
}

.procedure-list-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.procedure-list-content {
  flex: 1;
  min-width: 0;
}

.procedure-list-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.procedure-list-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 450px;
}

.procedure-list-sub {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.15rem;
  font-size: 0.75rem;
}

.procedure-snippet-inline {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 350px;
}

.procedure-list-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.procedure-list-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.procedure-list-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

/* Trash Table Selected State */
.trash-table tr.row-selected td {
  background: rgba(99, 102, 241, 0.05);
}

/* ==========================================================================
   TIPTAP VISUAL EDITOR
   ========================================================================== */

.editor-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

/* Sticky Toolbar */
.editor-toolbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  border-top-left-radius: calc(var(--radius-xl) - 1px);
  border-top-right-radius: calc(var(--radius-xl) - 1px);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  position: sticky;
  top: 62px;
  z-index: 30;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .editor-toolbar {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 0.35rem;
  border-right: 1px solid var(--border-subtle);
}
.toolbar-group:last-child {
  border-right: none;
}

.tb-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
  line-height: 1;
}
.tb-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.tb-btn.is-active {
  background: var(--accent-light);
  color: var(--accent);
}

.tb-save-btn {
  margin-left: 0.35rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.4);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.tb-save-btn:hover {
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.55);
}
.tb-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toolbar Dropdowns & Color Pickers */
.toolbar-dropdown-wrapper {
  position: relative;
  display: inline-flex;
}

.tb-btn-picker {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0.25rem 0.4rem;
}

.tb-color-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.tb-color-icon .tb-letter {
  font-weight: 700;
  font-size: 0.8125rem;
}

.tb-color-bar {
  display: block;
  width: 14px;
  height: 3px;
  border-radius: 1px;
  margin-top: 2px;
  transition: background-color 0.15s ease;
}

.tb-chevron {
  font-size: 0.625rem;
  opacity: 0.7;
}

.color-popover {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  padding: 0.625rem;
  z-index: 50;
  min-width: 175px;
}

.toolbar-dropdown-wrapper.is-open .color-popover {
  display: block;
}

.color-popover-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.color-palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.color-swatch:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.color-swatch.reset-swatch {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: bold;
  border: 1px dashed var(--border-subtle);
}

.color-swatch.reset-swatch:hover {
  background: var(--bg-surface-hover);
  color: var(--accent-danger);
}

.color-custom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.color-custom-row input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.color-custom-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-custom-row input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}

.ProseMirror mark {
  background-color: #fef08a;
  color: #111827;
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Editor Prose Area */
.editor-content-area {
  min-height: 400px;
  max-height: min(72vh, 800px);
  overflow-y: auto;
  resize: vertical;
  background: var(--bg-surface);
  cursor: text;
  display: flex;
  flex-direction: column;
  border-bottom-left-radius: calc(var(--radius-xl) - 1px);
  border-bottom-right-radius: calc(var(--radius-xl) - 1px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

[data-theme="light"] .editor-content-area {
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.editor-content-area::-webkit-scrollbar {
  width: 8px;
}
.editor-content-area::-webkit-scrollbar-track {
  background: var(--bg-surface);
  border-bottom-right-radius: calc(var(--radius-xl) - 1px);
}
.editor-content-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}
.editor-content-area::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
[data-theme="light"] .editor-content-area::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .editor-content-area::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.ProseMirror {
  outline: none;
  min-height: 100%;
  padding: 2rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-primary);
  flex: 1;
  cursor: text;
}

/* ProseMirror Typographic Formatting */
.ProseMirror p {
  margin-bottom: 1rem;
}
.ProseMirror h1 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}
.ProseMirror h2 {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.ProseMirror h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}
.ProseMirror ul, .ProseMirror ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.ProseMirror li {
  margin-bottom: 0.35rem;
}
.ProseMirror blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.25rem 0;
  font-style: italic;
  color: var(--text-secondary);
}
.ProseMirror code {
  font-family: var(--font-mono);
  background: var(--bg-surface-active);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: #38bdf8;
}
[data-theme="light"] .ProseMirror code {
  background: #e2e8f0;
  color: #0284c7;
}

.ProseMirror pre,
pre.wp-block-preformatted,
.wp-block-preformatted {
  background: #0d0d10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  margin: 0.85rem 0;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}
[data-theme="light"] .ProseMirror pre,
[data-theme="light"] pre.wp-block-preformatted,
[data-theme="light"] .wp-block-preformatted {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}
.ProseMirror pre code,
pre.wp-block-preformatted code,
.wp-block-preformatted code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
}
[data-theme="light"] .ProseMirror pre code,
[data-theme="light"] pre.wp-block-preformatted code,
[data-theme="light"] .wp-block-preformatted code,
[data-theme="light"] .ProseMirror pre *,
[data-theme="light"] pre.wp-block-preformatted * {
  color: #0f172a;
}

/* Code Block with Copy Action Header */
.code-block-wrapper {
  margin: 0.85rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: #0d0d12;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.code-block-wrapper + p {
  margin-top: 0.75rem;
}
[data-theme="light"] .code-block-wrapper {
  background: #f8fafc;
  border-color: #cbd5e1;
}
[data-theme="light"] .code-block-wrapper pre {
  color: #0f172a !important;
}
[data-theme="light"] .code-block-wrapper pre code {
  color: #0f172a !important;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
}
[data-theme="light"] .code-block-header {
  background: #f1f5f9;
  border-bottom-color: #e2e8f0;
  color: #475569;
}

.code-block-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}
.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}
.code-copy-btn.copied {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

[data-theme="light"] .code-copy-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}
[data-theme="light"] .code-copy-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}
[data-theme="light"] .code-copy-btn.copied {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #059669;
}

.code-block-wrapper pre {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 1rem 1.25rem !important;
}
.ProseMirror hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 2rem 0;
}
.ProseMirror a.editor-link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.ProseMirror img.editor-image {
  max-width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  margin: 1.5rem 0;
  display: block;
  box-shadow: var(--shadow-md);
}

/* Task Lists */
.ProseMirror ul[data-type="taskList"] {
  list-style: none;
  padding-left: 0;
}
.ProseMirror li[data-type="taskItem"] {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.ProseMirror li[data-type="taskItem"] input[type="checkbox"] {
  margin-top: 0.3rem;
  cursor: pointer;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
.ProseMirror li[data-type="taskItem"][data-checked="true"] > div {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Tables in Editor */
.ProseMirror table.editor-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}
.ProseMirror th, .ProseMirror td {
  border: 1px solid var(--border-default);
  padding: 0.6rem 0.85rem;
  text-align: left;
}
.ProseMirror th {
  background: var(--bg-surface-active);
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   Procedure Reading / Detail View Typography & Spacing
   ========================================================================== */
.procedure-detail-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pill-slug {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
}

.procedure-detail-body,
.procedure-detail-body.ProseMirror,
article.procedure-detail-body {
  white-space: normal !important;
  cursor: default !important;
  user-select: text;
  min-height: auto;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
}

.procedure-detail-body *,
.procedure-detail-body p,
.procedure-detail-body li,
.procedure-detail-body span,
.procedure-detail-body a,
.procedure-detail-body strong,
.procedure-detail-body em {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.procedure-detail-body pre,
.procedure-detail-body pre code,
.procedure-detail-body .code-block-wrapper pre {
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  box-sizing: border-box;
}

.procedure-detail-body code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.procedure-detail-body img {
  max-width: 100% !important;
  height: auto !important;
}

.procedure-detail-body table {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
}

.procedure-detail-body > *:first-child {
  margin-top: 0 !important;
}

.procedure-detail-body > hr:first-child,
.procedure-detail-body > .wp-block-separator:first-child {
  display: none !important;
}

.procedure-detail-body p:empty {
  display: none !important;
}

/* Harmonious reading spacing similar to document/WordPress standard */
.procedure-detail-body p {
  margin-bottom: 0.85rem;
}

.procedure-detail-body h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.procedure-detail-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 1.35rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.procedure-detail-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 1.15rem;
  margin-bottom: 0.4rem;
  line-height: 1.35;
}

.procedure-detail-body h4,
.procedure-detail-body h5,
.procedure-detail-body h6 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.procedure-detail-body ul,
.procedure-detail-body ol {
  margin-bottom: 0.85rem;
  padding-left: 1.5rem;
}

.procedure-detail-body li {
  margin-bottom: 0.3rem;
}

.procedure-detail-body hr {
  margin: 1.5rem 0;
}

/* ==========================================================================
   CALLOUTS & HIGHLIGHT CARDS (MINERVA KB & NATIVE)
   ========================================================================== */

.callout,
.mkb-tip,
.mkb-info,
.mkb-warning {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border: 1px solid;
  font-size: 0.95rem;
  line-height: 1.6;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.callout-icon,
.mkb-tip__icon,
.mkb-info__icon,
.mkb-warning__icon {
  font-size: 1.4rem;
  line-height: 1.2;
  flex-shrink: 0;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.callout-body,
.mkb-tip__content,
.mkb-info__content,
.mkb-warning__content {
  flex: 1;
  min-width: 0;
  color: inherit;
}

.callout-body p,
.mkb-tip__content p,
.mkb-info__content p,
.mkb-warning__content p {
  margin-bottom: 0.5rem;
}

.callout-body p:last-child,
.mkb-tip__content p:last-child,
.mkb-info__content p:last-child,
.mkb-warning__content p:last-child {
  margin-bottom: 0;
}

/* Tip / Dica (Amarelo / Dourado - Lâmpada) */
.callout-tip,
.mkb-tip {
  background-color: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fef08a;
}
[data-theme="light"] .callout-tip,
[data-theme="light"] .mkb-tip {
  background-color: #fef9c3;
  border-color: #fde047;
  color: #713f12;
}

/* Info / Informação (Azul / Ciano - Ícone i) */
.callout-info,
.mkb-info {
  background-color: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}
[data-theme="light"] .callout-info,
[data-theme="light"] .mkb-info {
  background-color: #e0f2fe;
  border-color: #bae6fd;
  color: #0c4a6e;
}

/* Warning / Atenção (Vermelho - Alerta) */
.callout-warning,
.mkb-warning {
  background-color: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
[data-theme="light"] .callout-warning,
[data-theme="light"] .mkb-warning {
  background-color: #fee2e2;
  border-color: #fecaca;
  color: #7f1d1d;
}

/* WordPress Block File Downloads */
.wp-block-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-active);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  gap: 1rem;
}
.wp-block-file a:first-child {
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wp-block-file a:first-child::before {
  content: "📎";
}
.wp-block-file .wp-block-file__button {
  background: var(--accent);
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.wp-block-file .wp-block-file__button:hover {
  opacity: 0.9;
}

/* WordPress Gutenberg Utility Colors */
.has-vivid-cyan-blue-color { color: #06b6d4 !important; }
.has-luminous-vivid-orange-color { color: #f97316 !important; }
.has-luminous-vivid-amber-color { color: #f59e0b !important; }
.has-vivid-red-color { color: #ef4444 !important; }
.has-vivid-green-cyan-color { color: #10b981 !important; }
.has-vivid-purple-color { color: #8b5cf6 !important; }
.has-very-dark-gray-color { color: #334155 !important; }
.has-cyan-bluish-gray-color { color: #64748b !important; }

/* Placeholder */
.ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: var(--text-muted);
  pointer-events: none;
  height: 0;
}

/* Bubble Menu */
.bubble-menu {
  display: flex;
  background: rgba(18, 18, 21, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  gap: 0.2rem;
  box-shadow: var(--shadow-lg);
  z-index: 40;
}

/* Form Fields */
.form-group {
  margin-bottom: 1.25rem;
}
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.form-input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}
.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.form-input-lg {
  font-size: 1.4rem;
  font-weight: 700;
  padding: 0.65rem 1rem;
  letter-spacing: -0.02em;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

/* ==========================================================================
   ATTACHMENTS & MEDIA MANAGER
   ========================================================================== */

.attachments-section {
  margin-top: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
}

.attachments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.attachments-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.dropzone-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.dropzone-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}
.dropzone-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Attachments Cards Grid */
.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.attachment-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all 0.15s ease;
}
.attachment-card:hover {
  border-color: var(--border-default);
  background: var(--bg-surface-hover);
}
.attachment-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-active);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 1.25rem;
}
.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attachment-info {
  flex: 1;
  min-width: 0;
}
.attachment-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-details {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
}
.attachment-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-secondary);
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 150;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast-success {
  border-left: 4px solid var(--success);
}
.toast-error {
  border-left: 4px solid var(--danger);
}
.toast-info {
  border-left: 4px solid var(--info);
}
.toast-warning {
  border-left: 4px solid var(--warning);
}

/* ==========================================================================
   SETTINGS & USER MANAGEMENT
   ========================================================================== */

.settings-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

.settings-header {
  margin-bottom: 1.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.settings-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.settings-back-link:hover {
  color: var(--accent);
}

.settings-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.settings-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  max-width: 600px;
}

.settings-nav-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.75rem;
}

.settings-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

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

.settings-tab-badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background: var(--bg-surface-active);
  color: var(--text-secondary);
  font-weight: 600;
}

.settings-nav-tab.active .settings-tab-badge {
  background: var(--accent-light);
  color: var(--accent);
}

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.settings-toolbar {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.settings-toolbar-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  flex-wrap: wrap;
}

.settings-search-input {
  min-width: 260px;
  max-width: 380px;
  flex: 1;
}

/* User Table */
.data-table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  padding: 0.85rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--bg-surface-hover);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.user-username {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-email-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.badge-you {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.role-badges-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

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

.badge-role-gerencia {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-role-tecnico {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-role-administrativo {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status-active {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-status-inactive {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Mobile Data Cards (Native App Experience) */
.mobile-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
}

.mobile-data-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, background 0.2s;
}

.mobile-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.mobile-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.mobile-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  overflow: hidden;
}

.mobile-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mobile-card-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.mobile-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.mobile-card-actions .btn {
  flex: 1;
  min-width: 80px;
  justify-content: center;
  min-height: 38px;
}

.roles-checkbox-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.role-checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.role-checkbox-card:hover {
  border-color: var(--border-default);
  background: var(--bg-surface-hover);
}

.role-checkbox-card input[type="checkbox"] {
  margin-top: 0.2rem;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.role-checkbox-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.role-checkbox-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.role-checkbox-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.form-help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.custom-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}

.custom-switch input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Responsive Mobile App Experience */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  .desktop-only-inline {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }
  .btn-text-desktop {
    display: none !important;
  }
  .btn-text-mobile {
    display: inline !important;
  }

  /* Anti-leak & Safe areas */
  html, body, #app-root {
    overflow-x: hidden !important;
    overflow-x: clip !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .app-container {
    padding: 1rem 0.85rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  /* Header mobile adjustments */
  .app-header {
    flex-wrap: nowrap;
    padding: 0.65rem 0.85rem;
    padding-top: max(0.65rem, env(safe-area-inset-top));
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
  }
  .brand {
    gap: 0.5rem;
    flex-shrink: 0;
  }
  .brand-logo {
    width: 28px;
    height: 28px;
    font-size: 0.95rem;
  }
  .brand-name {
    font-size: 1.05rem;
  }
  .brand-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
  }
  .header-actions {
    gap: 0.4rem;
    flex-shrink: 0;
  }
  .header-new-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }
  .user-menu-btn {
    padding: 0.25rem;
    border-radius: 50%;
    gap: 0;
  }
  .user-menu-btn .user-name,
  .user-menu-btn .user-role-badge,
  .user-menu-btn .dropdown-chevron {
    display: none !important;
  }
  .user-dropdown-menu {
    right: 0;
    width: min(290px, calc(100vw - 1.5rem));
  }

  /* Catalog search mobile */
  .catalog-search-container {
    margin-bottom: 0.85rem;
  }
  .catalog-search-input {
    min-height: 44px;
    font-size: 0.9rem;
    padding: 0.6rem 2.4rem 0.6rem 2.4rem;
  }
  .search-shortcut {
    display: none !important;
  }
  .search-input {
    padding-right: 1rem;
    font-size: 0.85rem;
  }

  /* Filter bar mobile */
  .filter-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.85rem;
  }
  .filter-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    width: 100%;
  }
  .filter-group .select-input {
    width: 100%;
    min-height: 40px;
  }
  #clear-filter-container {
    width: 100%;
  }
  #clear-filter-container .btn {
    width: 100%;
    justify-content: center;
  }

  /* Settings Page Mobile */
  .settings-container {
    padding: 1rem 0.85rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
  .settings-header {
    margin-bottom: 1rem;
  }
  .settings-back-link {
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
    margin-left: -0.5rem;
    margin-bottom: 0.4rem;
  }
  .settings-title {
    font-size: 1.3rem;
    gap: 0.4rem;
    line-height: 1.3;
  }
  .settings-title svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }
  .settings-desc {
    font-size: 0.8rem;
    line-height: 1.4;
    margin-top: 0.25rem;
  }
  .settings-nav-tabs {
    display: flex;
    gap: 0.35rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    flex-wrap: nowrap;
  }
  .settings-nav-tabs::-webkit-scrollbar {
    display: none;
  }
  .settings-nav-tab {
    white-space: nowrap;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    flex-shrink: 0;
  }
  .settings-card {
    border-radius: var(--radius-lg);
  }
  .settings-toolbar {
    padding: 1rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .settings-toolbar-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    width: 100%;
  }
  .settings-search-input {
    min-width: 100%;
    max-width: 100%;
    width: 100%;
  }
  .settings-toolbar-filters .select-input {
    width: 100%;
    min-height: 40px;
  }
  .settings-toolbar .btn-primary {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }

  /* Modals Mobile */
  .modal-backdrop {
    padding: 0.5rem;
    align-items: flex-end;
  }
  .modal-window {
    max-height: 90vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin: 0;
    width: 100%;
    max-width: 100vw;
  }
  .modal-body {
    max-height: calc(90vh - 130px);
    padding: 1rem;
  }
  .modal-footer {
    padding: 0.75rem 1rem;
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  .modal-footer .btn {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }

  /* Procedures List Mobile */
  .procedures-grid {
    grid-template-columns: 1fr;
  }
  .procedure-card {
    padding: 1rem;
  }
  .procedure-title {
    font-size: 1rem;
  }

  .view-header-controls {
    width: 100%;
    justify-content: space-between;
  }

  .procedure-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem;
  }
  .procedure-list-left {
    width: 100%;
  }
  .procedure-list-title {
    max-width: 100%;
    white-space: normal;
  }
  .procedure-snippet-inline {
    display: none;
  }
  .procedure-list-right {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.5rem;
  }
  .bulk-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .bulk-actions-right {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  /* Procedure Detail Mobile */
  .procedure-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-bottom: 1.25rem !important;
  }
  .procedure-action-bar .btn-ghost {
    justify-content: flex-start;
    padding-left: 0.25rem;
    font-size: 0.85rem;
  }
  .procedure-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }
  .procedure-action-buttons .btn {
    flex: 1;
    min-width: 80px;
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
    justify-content: center;
  }

  /* Procedure Header Mobile */
  .procedure-detail-header {
    margin-bottom: 1.5rem !important;
    padding-bottom: 1.15rem !important;
  }
  .procedure-meta-badges {
    gap: 0.4rem !important;
    margin-bottom: 0.65rem !important;
    flex-wrap: wrap !important;
  }
  .pill-slug {
    display: inline-block;
    max-width: 100%;
    font-size: 0.68rem;
    line-height: 1.35;
    padding: 0.2rem 0.45rem;
    overflow-wrap: anywhere;
    word-break: break-all;
    white-space: normal;
  }
  .procedure-detail-title {
    font-size: 1.45rem !important;
    line-height: 1.28 !important;
    letter-spacing: -0.02em !important;
    margin-bottom: 0.75rem !important;
  }
  .procedure-meta-dates {
    gap: 0.4rem 0.85rem !important;
    font-size: 0.75rem !important;
  }
  .procedure-meta-tags {
    margin-top: 0.75rem !important;
    gap: 0.35rem !important;
  }

  /* Procedure Body Mobile Typography & Layout */
  .procedure-detail-body,
  .procedure-detail-body.ProseMirror,
  article.procedure-detail-body {
    padding: 0 !important;
    font-size: 0.9375rem !important;
    line-height: 1.6 !important;
    margin-bottom: 2rem !important;
  }
  .procedure-detail-body p,
  .procedure-detail-body li {
    font-size: 0.9375rem !important;
    line-height: 1.6 !important;
  }
  .procedure-detail-body h1 {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.5rem !important;
  }
  .procedure-detail-body h2 {
    font-size: 1.2rem !important;
    line-height: 1.3 !important;
    margin-top: 1.15rem !important;
    margin-bottom: 0.45rem !important;
  }
  .procedure-detail-body h3 {
    font-size: 1.05rem !important;
    line-height: 1.35 !important;
    margin-top: 1rem !important;
    margin-bottom: 0.4rem !important;
  }
  .procedure-detail-body h4,
  .procedure-detail-body h5,
  .procedure-detail-body h6 {
    font-size: 0.95rem !important;
    line-height: 1.35 !important;
    margin-top: 0.85rem !important;
    margin-bottom: 0.35rem !important;
  }
  .procedure-detail-body ul,
  .procedure-detail-body ol {
    padding-left: 1.2rem !important;
    margin-bottom: 0.75rem !important;
  }
  .procedure-detail-body li {
    margin-bottom: 0.35rem !important;
  }

  /* Callouts & Highlights on Mobile */
  .callout,
  .mkb-tip,
  .mkb-info,
  .mkb-warning {
    padding: 0.75rem 0.85rem !important;
    gap: 0.65rem !important;
    margin: 1rem 0 !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
  }
  .callout-icon,
  .mkb-tip__icon,
  .mkb-info__icon,
  .mkb-warning__icon {
    font-size: 1.2rem !important;
  }

  /* Code blocks & Pre on Mobile */
  .code-block-wrapper {
    margin: 0.75rem 0 !important;
  }
  .code-block-header {
    padding: 0.4rem 0.65rem !important;
    font-size: 0.7rem !important;
  }
  .code-block-wrapper pre {
    padding: 0.75rem 0.85rem !important;
    font-size: 0.8125rem !important;
    line-height: 1.45 !important;
  }
  pre.wp-block-preformatted,
  .wp-block-preformatted {
    padding: 0.75rem 0.85rem !important;
    font-size: 0.8125rem !important;
    line-height: 1.45 !important;
    margin: 0.75rem 0 !important;
  }

  /* Attachments on Mobile */
  .attachments-section {
    margin-top: 2rem !important;
  }
  .attachments-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }
  .attachment-card {
    padding: 0.75rem !important;
  }

  /* Editor Mobile */
  .editor-content-area {
    padding: 0;
    min-height: 320px;
    max-height: 60vh;
    -webkit-overflow-scrolling: touch;
  }
  .editor-toolbar {
    top: 56px;
    padding: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .editor-toolbar::-webkit-scrollbar {
    display: none;
  }
  .toolbar-group {
    flex-shrink: 0;
  }
  .ProseMirror {
    padding: 1rem;
    min-height: 320px;
  }
  .tb-save-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* Category pill hover & interaction */
.pill-category {
  transition: all 0.15s ease;
}
.pill-category:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}

/* Spin animation for loading buttons */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
