@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Anton&display=swap");

:root {
  color-scheme: light;
  --bg: #f8f9fa;
  --ink: #171717;
  --muted: #6b7280;
  --accent: #D2D648;
  --accent-hover: #bfc233;
  --accent-soft: #f5f6e0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --panel: #ffffff;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --sidebar-width: 260px;
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Anton', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { background: #0d0d0d; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-heading); font-weight: 400; letter-spacing: 0.02em; }

body[data-theme="dark"] {
  --bg: #0d0d0d;
  --ink: #f0f0f0;
  --muted: #9ca3af;
  --accent: #D2D648;
  --accent-hover: #bfc233;
  --accent-soft: #2a2b14;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --panel: #171717;
  --card: #1e1e1e;
  --border: #2e2e2e;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
}

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

body.flow-page .content {
  min-width: 0;
}

body.flow-page .panel {
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.breadcrumb {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
}

.title {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}

/* ─── Sidebar ──────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  z-index: 40;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.sidebar-header .brand-logo-mark {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: 0 0 auto;
}

.sidebar-header .brand-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: 0;
  white-space: nowrap;
}

.sidebar-toggle {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  font-size: 16px;
  transition: background var(--transition);
}

.sidebar-toggle:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 12px;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.nav-section {
  margin-bottom: 4px;
}

.nav-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 6px 12px 2px;
  user-select: none;
}

.nav-label-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .15s;
}
.nav-label-toggle:hover { color: var(--text); }
.nav-label-toggle .nav-chevron {
  margin-left: auto;
  transition: transform .2s;
  transform: rotate(-90deg);
}
.nav-group-open .nav-label-toggle .nav-chevron {
  transform: rotate(0deg);
}
.nav-section-collapsible .nav-group-items {
  display: none;
  padding-left: 0;
}
.nav-section-collapsible.nav-group-open .nav-group-items {
  display: block;
}
.nav-group-items-nested {
  display: grid;
  gap: 10px;
}
.nav-sub-squad {
  margin: 8px 0 0;
  padding: 8px 0 8px 8px;
  border-left: 1px solid var(--border);
}
.nav-sub-squad .nav-label {
  margin-bottom: 6px;
}

/* Squad view tabs (Calendario | Board | Minhas Tasks) */
.squad-view-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.squad-view-tab {
  padding: 10px 20px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.squad-view-tab:hover { color: var(--text); border-bottom-color: var(--border); }
.squad-view-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.squad-overview-groups {
  display: grid;
  gap: 18px;
}

.squad-overview-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 16px;
}

.squad-overview-group-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.squad-overview-group-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.squad-overview-group-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.squad-overview-group-head > span {
  min-width: 32px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 700;
}

.squad-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.squad-overview-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card) 88%, var(--bg) 12%);
}

.squad-overview-card-main strong {
  display: block;
  margin-bottom: 6px;
}

.squad-overview-tags,
.squad-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.squad-overview-tags span {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  border: none;
}

.sidebar-nav a:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

.sidebar-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  transition: color var(--transition);
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-nav a:hover .nav-icon {
  color: var(--ink);
}

.sidebar-nav a.active .nav-icon {
  color: var(--accent);
}

.sidebar-footer {
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
}

.sidebar-user:hover {
  background: var(--accent-soft);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #171717;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
}

.user-avatar-img {
  background: var(--card);
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.profile-preview > div {
  display: grid;
  gap: 4px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--accent-soft);
}

.profile-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 800;
  font-size: 22px;
}

.profile-avatar-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: 50%;
}
.profile-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #171717;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.profile-avatar-wrapper:hover .profile-avatar-edit {
  opacity: 1;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.user-role-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-left: auto;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--muted);
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.logout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  transition: all var(--transition);
}

.logout-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.actions {
  display: flex;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  background: var(--accent);
  color: #171717;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-hover);
}

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

.btn-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

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

.distribution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.distribution-day {
  display: grid;
  gap: 14px;
  align-content: start;
}

.distribution-day-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.distribution-day-header h3 {
  margin: 0;
}

.distribution-day-total {
  min-width: 40px;
  text-align: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 700;
}

.distribution-loading-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 120px;
}

.distribution-spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid rgba(99, 102, 241, 0.18);
  border-top-color: var(--accent);
  animation: distribution-spin 0.9s linear infinite;
  flex: 0 0 auto;
}

@keyframes distribution-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.distribution-section {
  display: grid;
  gap: 8px;
}

.distribution-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.distribution-task {
  align-items: start;
}

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

.btn-danger:hover {
  background: #dc2626;
}

.link-button {
  border: none;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

body[data-theme="dark"] .link-button {
  color: var(--accent);
}

.user-badge {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
}

/* Dark-mode overrides now handled by CSS variables in :root / body[data-theme="dark"] */

.content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.panel {
  background: var(--panel);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.auth-panel {
  max-width: 400px;
  margin: 15vh auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  grid-column: 1 / -1;
}

.auth-panel .card {
  border: none;
  box-shadow: none;
  padding: 0;
}

.auth-panel form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-panel form label {
  display: block;
  font-weight: 600;
  font-size: 14px;
}

.auth-panel input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color var(--transition);
}

.auth-panel input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-panel form .btn {
  margin-top: 8px;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.panel-header h2 {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-weight: 400;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.card h3 {
  margin-top: 0;
  font-family: var(--font-sans);
}

label {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--muted);
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.mono {
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* BUG FIX: was width:100% which made every button full-width including
     inline/icon buttons. Use auto; apply .btn-block for full-width needs. */
  width: auto;
  padding: 12px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #171717;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Explicit full-width button — opt-in only */
.btn-block { width: 100%; }

button:hover {
  transform: translateY(-2px);
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fbfcff;
  transition: border-color 0.2s ease;
}

.metric {
  display: grid;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.metric strong {
  font-size: 32px;
  font-family: var(--font-sans);
}

.error {
  color: #c0392b;
  font-weight: 600;
  margin: 8px 0 0;
}

body[data-theme="dark"] .error {
  color: #ff7b7b;
}

body[data-theme="dark"] .list-item {
  background: #1c1c1c;
  border-color: #3a3a3a;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  pointer-events: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(23, 23, 23, 0.5);
  z-index: 50;
}

.modal.open {
  display: flex;
  pointer-events: auto;
}

.modal-card {
  width: min(420px, 90vw);
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-family: var(--font-sans);
  font-size: 20px;
}

.modal-message {
  margin: 0;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

.modal-close {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
  /* BUG FIX (Bug 8): reset leaked properties from global button rule */
  box-shadow: none;
  text-transform: none;
  letter-spacing: 0;
}

.modal[data-level="error"] .modal-title {
  color: #c0392b;
}

.list-item ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.muted {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.status-pill {
  display: none;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 600;
}

.status-pill[data-running="true"] {
  display: inline-flex;
}

.js-sync-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.progress-squad-list {
  margin-top: 24px;
}

.progress-filter-form {
  min-width: 260px;
}

.progress-week-nav {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.progress-refresh-form {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.progress-stop-form {
  display: inline-flex;
  align-items: center;
}

.progress-card {
  display: grid;
  gap: 16px;
}

.progress-card-head,
.progress-line-head,
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-badge,
.progress-line-percent {
  font-weight: 700;
  white-space: nowrap;
}

.progress-badge {
  font-size: 24px;
  font-family: var(--font-sans);
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #9fb11f);
}

.progress-bar-small {
  height: 10px;
}

.progress-line-item {
  display: grid;
  gap: 10px;
}

.progress-line-item--pending {
  border-color: #d97706;
  background: #fff7ed;
}

.progress-line-item--in_progress {
  border-color: #2563eb;
  background: #eff6ff;
}

.progress-line-item--done {
  border-color: #16a34a;
}

.progress-line-item--meeting-minute {
  border-left-width: 5px;
  border-left-color: #2563eb;
}

.progress-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.progress-line-origin {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 4px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.progress-line-overdue {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.progress-task-list {
  display: grid;
  gap: 8px;
}

.progress-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.progress-task-row--overdue {
  border-left: 3px solid #dc2626;
  padding-left: 8px;
}

.progress-task-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.08);
  color: #475569;
}

.progress-task-status.is-done {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
}

.progress-task-status.is-open {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.progress-task-meta {
  font-size: 12px;
  color: var(--muted);
}

.progress-task-overdue {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.progress-inline-form {
  display: inline-flex;
}

.progress-delete-btn {
  width: auto;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.progress-link:hover {
  text-decoration: underline;
}

body[data-theme="dark"] .progress-link {
  color: var(--accent);
}

body[data-theme="dark"] .progress-task-status {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

body[data-theme="dark"] .progress-task-status.is-done {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

body[data-theme="dark"] .progress-task-status.is-open {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
}

body[data-theme="dark"] .progress-line-origin {
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
}

body[data-theme="dark"] .progress-line-overdue,
body[data-theme="dark"] .progress-task-overdue {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
}

body[data-theme="dark"] .progress-line-item--pending {
  border-color: #f59e0b;
  background: #2e220d;
}

body[data-theme="dark"] .progress-line-item--in_progress {
  border-color: #60a5fa;
  background: #132235;
}

body[data-theme="dark"] .progress-line-item--done {
  border-color: #22c55e;
}

.squad-card {
  display: flex;
  align-items: stretch;
  gap: 16px;
}

.squad-card > div:first-child {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.squad-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  min-width: 220px;
}

.squad-actions .run-form button,
.squad-actions .btn {
  width: auto;
}

.squad-menu {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
}

.squad-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 200px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  display: none;
  z-index: 5;
}

.squad-menu.open .squad-menu-panel {
  display: grid;
  gap: 8px;
}

.squad-menu-panel form {
  width: 100%;
}

.squad-menu-panel .btn,
.squad-menu-panel button,
.squad-menu-panel .run-form button {
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
  position: sticky;
  top: 0;
}

@media (max-width: 720px) {
  .topbar {
    padding: 20px;
  }

  .nav {
    gap: 8px;
  }

  .squad-card {
    flex-direction: column;
  }

  .squad-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .squad-actions .run-form button,
  .squad-actions .btn {
    width: 100%;
  }
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand.compact .title {
  font-size: 22px;
}

.brand.compact {
  flex-direction: column;
  align-items: flex-start;
}

.brand.compact .brand-logo {
  width: 96px;
}

.brand-logo {
  width: 120px;
  height: auto;
  object-fit: contain;
}

body[data-theme="dark"] .brand-logo {
  filter: brightness(1.1);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    top: auto;
    align-self: auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .sidebar-header {
    border-bottom: none;
    padding-bottom: 0;
  }

  .sidebar-nav {
    overflow: visible;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
  }

  .nav-section {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .nav-label { display: none; }

  .sidebar-nav a {
    font-size: 12px;
    padding: 6px 10px;
  }
}


.task-block {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.08);
}

.inline-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.inline-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}

.mapping-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.tag-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.btn-inline {
  width: auto;
  padding: 8px 14px;
  text-transform: none;
  letter-spacing: 0;
}

.btn-icon {
  width: auto;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.flow-form {
  display: grid;
  gap: 16px;
}

.flow-builder-card {
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

.flow-builder-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.flow-hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.flow-stat {
  min-width: 92px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.flow-stat strong {
  font-size: 26px;
}

.flow-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.flow-canvas {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.025);
}

.flow-start-node {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(255, 255, 255, 0.03));
}

.flow-start-kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.flow-items {
  position: relative;
  display: grid;
  gap: 18px;
  padding-left: 28px;
}

.flow-items::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 11px;
  width: 2px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.8), rgba(99, 102, 241, 0.15));
}

.flow-item {
  position: relative;
  display: grid;
  gap: 12px;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(16, 18, 22, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

.flow-item::before {
  content: "";
  position: absolute;
  top: 24px;
  left: -23px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.flow-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.flow-node-headline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.flow-node-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
}

.flow-priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.priority-critical {
  background: rgba(239, 68, 68, 0.18);
  color: #ff7b7b;
}

.priority-high {
  background: rgba(249, 115, 22, 0.18);
  color: #ffb15e;
}

.priority-medium {
  background: rgba(59, 130, 246, 0.18);
  color: #7ab8ff;
}

.priority-low {
  background: rgba(34, 197, 94, 0.18);
  color: #69dfa0;
}

.flow-node-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.flow-node-notes {
  grid-column: 1 / -1;
}

.flow-sidebar-preview {
  position: sticky;
  top: 24px;
}

.flow-preview-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 28%),
    rgba(10, 12, 16, 0.55);
}

.flow-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.flow-week-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.flow-day-column {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  min-height: 120px;
}

.flow-day-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.flow-day-body {
  display: grid;
  gap: 8px;
  align-content: start;
}

.flow-chip {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
}

.flow-chip strong {
  font-size: 12px;
}

.flow-chip span {
  font-size: 11px;
  color: var(--muted);
}

.flow-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.flow-profile {
  display: grid;
  gap: 10px;
}

.flow-summary {
  display: grid;
  gap: 8px;
}

.flow-summary-diagram {
  position: relative;
  gap: 14px;
  padding-left: 28px;
}

.flow-summary-diagram::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 11px;
  width: 2px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.72), rgba(99, 102, 241, 0.12));
}

.flow-summary-item {
  position: relative;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.flow-summary-item::before {
  content: "";
  position: absolute;
  top: 18px;
  left: -23px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.flow-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.flow-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .flow-builder-hero,
  .flow-layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .flow-node-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .flow-node-grid,
  .flow-week-grid {
    grid-template-columns: 1fr;
  }
}

/* Flow Builder Clean UI */
.flow-builder-clean {
  display: grid;
  gap: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    rgba(18, 19, 23, 0.92);
}

.flow-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.flow-topbar-copy h3 {
  margin: 0;
}

.flow-topbar-metrics {
  display: flex;
  gap: 10px;
}

.flow-mini-stat {
  min-width: 96px;
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.flow-mini-stat strong {
  font-size: 24px;
}

.flow-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.flow-editor,
.flow-preview-panel {
  display: grid;
  gap: 14px;
}

.flow-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.flow-items {
  padding-left: 0;
  gap: 14px;
}

.flow-items::before,
.flow-item::before,
.flow-summary-diagram::before,
.flow-summary-item::before {
  display: none;
}

.flow-step-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.flow-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.flow-step-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.flow-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
}

.flow-step-priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.flow-step-grid {
  display: grid;
  gap: 12px;
}

/* ── Flow light-mode overrides ─────────────────────────────── */
body:not([data-theme="dark"]) .flow-builder-card {
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.08), transparent 34%),
    var(--card);
}
body:not([data-theme="dark"]) .flow-stat {
  border-color: var(--border);
  background: var(--bg);
}
body:not([data-theme="dark"]) .flow-canvas {
  background: var(--bg);
}
body:not([data-theme="dark"]) .flow-start-node {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), var(--card));
  border-color: rgba(99, 102, 241, 0.25);
}
body:not([data-theme="dark"]) .flow-item {
  border-color: var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}
body:not([data-theme="dark"]) .flow-preview-card {
  border-color: var(--border);
  background: var(--card);
}
body:not([data-theme="dark"]) .flow-day-column {
  border-color: var(--border);
  background: var(--bg);
}
body:not([data-theme="dark"]) .flow-chip {
  background: var(--bg);
  border-color: var(--border);
}
body:not([data-theme="dark"]) .flow-builder-clean {
  background: var(--card);
}
body:not([data-theme="dark"]) .flow-mini-stat {
  background: var(--bg);
}
body:not([data-theme="dark"]) .flow-step-card {
  background: var(--card);
}
body:not([data-theme="dark"]) .priority-critical {
  background: rgba(239, 68, 68, 0.10);
  color: #dc2626;
}
body:not([data-theme="dark"]) .priority-high {
  background: rgba(249, 115, 22, 0.10);
  color: #ea580c;
}
body:not([data-theme="dark"]) .priority-medium {
  background: rgba(59, 130, 246, 0.10);
  color: #2563eb;
}
body:not([data-theme="dark"]) .priority-low {
  background: rgba(34, 197, 94, 0.10);
  color: #16a34a;
}

.flow-step-grid-primary {
  grid-template-columns: minmax(0, 1.8fr) 120px 160px;
}

.flow-step-grid-secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flow-step-notes input {
  width: 100%;
}

.flow-role-limits {
  display: grid;
  gap: 10px;
}

.flow-field-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.flow-role-limits-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flow-preview-panel {
  position: sticky;
  top: 24px;
}

.flow-workspace-diagram {
  grid-template-columns: 1fr;
}

.flow-editor-diagram {
  gap: 18px;
}

.flow-editor-full {
  width: 100%;
}

.flow-capacity-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.flow-capacity-banner strong {
  margin-right: 8px;
}

.flow-capacity-banner span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 700;
}

.flow-diagram-builder {
  overflow-x: auto;
  min-height: 540px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0) 0 0/18px 18px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.flow-preview-subheader {
  margin-top: 22px;
}

.flow-diagram {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0) 0 0/18px 18px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.flow-canvas {
  display: flex;
  align-items: flex-start;
  gap: 72px;
  min-width: max-content;
}

.flow-canvas-step {
  content: "";
  position: relative;
  display: grid;
  gap: 16px;
  width: 340px;
  cursor: grab;
}

.flow-canvas-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 72px;
  left: calc(100% + 8px);
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.6));
}

.flow-canvas-step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 67px;
  right: -20px;
  width: 12px;
  height: 12px;
  border-top: 2px solid rgba(255, 255, 255, 0.6);
  border-right: 2px solid rgba(255, 255, 255, 0.6);
  transform: rotate(45deg);
}

.flow-canvas-step.is-dragging {
  opacity: 0.52;
  cursor: grabbing;
}

.flow-canvas-step.is-drop-target .flow-diagram-node {
  border-color: rgba(142, 184, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(142, 184, 255, 0.12), 0 18px 38px rgba(0, 0, 0, 0.28);
}

.flow-diagram-node {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 36%),
    rgba(23, 26, 31, 0.92);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.flow-diagram-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.flow-diagram-node-main {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.flow-node-gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 18px;
  color: #8eb8ff;
  cursor: pointer;
}

.flow-node-gear:hover {
  border-color: rgba(142, 184, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(142, 184, 255, 0.12);
}

.flow-diagram-copy {
  display: grid;
  gap: 10px;
}

.flow-diagram-order {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.flow-diagram-site {
  font-size: 18px;
  line-height: 1.2;
}

.flow-diagram-meta,
.flow-diagram-capacity {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-diagram-meta span,
.flow-diagram-capacity span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.flow-diagram-note {
  margin: 0;
  font-size: 13px;
  color: var(--text);
}

.flow-diagram-note-canvas {
  padding: 0 4px;
}

.flow-diagram-tools {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 16px;
}

.flow-diagram-tools::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 12px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.25);
}

.flow-diagram-tool {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
}

.flow-diagram-tool::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 2px;
  height: 12px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.22);
}

.flow-diagram-tool-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.flow-diagram-tool strong {
  font-size: 18px;
}

.flow-diagram-tool small {
  font-size: 11px;
  color: var(--muted);
}

.flow-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.62);
  backdrop-filter: blur(4px);
  z-index: 40;
}

.flow-modal {
  width: min(760px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(25, 28, 33, 0.98), rgba(19, 21, 26, 0.98));
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
  z-index: 50;
}

.flow-modal::backdrop {
  background: transparent;
}

.flow-modal-shell {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.flow-modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.flow-modal-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flow-modal-role-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flow-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.flow-week-header {
  margin-top: 8px;
}

.flow-week-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.flow-day-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.flow-day-card header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.flow-day-list {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 72px;
}

.flow-day-chip {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
}

.flow-day-chip strong {
  font-size: 12px;
}

.flow-day-chip span {
  font-size: 11px;
  color: var(--muted);
}

.flow-profile-clean {
  display: grid;
  gap: 10px;
}

.flow-profile-steps {
  display: grid;
  gap: 10px;
}

.flow-profile-step {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.flow-profile-step-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

@media (max-width: 980px) {
  .flow-workspace,
  .flow-workspace-diagram,
  .flow-topbar {
    grid-template-columns: 1fr;
    display: grid;
  }

  .flow-preview-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .flow-step-grid-primary,
  .flow-step-grid-secondary,
  .flow-role-limits-grid,
  .flow-modal-grid,
  .flow-modal-role-grid,
  .flow-diagram-tools,
  .flow-week-grid {
    grid-template-columns: 1fr;
  }

  .flow-canvas {
    gap: 24px;
  }

  .flow-canvas-step {
    width: 240px;
  }
}

/* ===== Squad Calendar ===== */
.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.calendar-view-toggle,
.calendar-export-menu,
.calendar-avatar-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.calendar-overdue-banner {
  display: block;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.09);
  color: #b91c1c;
  font-weight: 700;
  text-decoration: none;
}

.calendar-progress {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

.calendar-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.calendar-progress-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.16);
}

.calendar-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.calendar-progress-good .calendar-progress-bar span { background: #16a34a; }
.calendar-progress-warn .calendar-progress-bar span { background: #d97706; }
.calendar-progress-danger .calendar-progress-bar span { background: #dc2626; }

.calendar-avatar-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
}

.calendar-avatar-chip.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.16);
}

.calendar-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.calendar-filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.calendar-filters select,
.calendar-filters input[type="date"] {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.calendar-grid-review {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.calendar-grid-month .calendar-day {
  min-height: 180px;
}

.calendar-day-month {
  cursor: pointer;
}

.calendar-day {
  min-height: 200px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  display: flex;
  flex-direction: column;
}
.calendar-day.drag-over {
  background: rgba(99,102,241,.06);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99,102,241,.2);
}

.calendar-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.calendar-review-day {
  border-color: rgba(234, 179, 8, 0.55);
  background: rgba(234, 179, 8, 0.06);
}

.calendar-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.calendar-weekday {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.calendar-date {
  font-size: 13px;
  font-weight: 600;
}

.calendar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
}

.calendar-day-tasks {
  display: grid;
  gap: 8px;
  min-height: 80px;
  flex: 1;
  align-content: start;
}

.calendar-task-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.calendar-task-card.task-ready-to-launch {
  order: -20;
}

.calendar-task-card.task-review-pending {
  order: -30;
  border-color: rgba(239, 68, 68, 0.38);
  border-left: 4px solid rgba(239, 68, 68, 0.72);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, var(--card) 100%);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.08);
}

.calendar-task-card.task-review-resolved {
  order: -8;
  border-color: rgba(14, 165, 233, 0.3);
  border-left: 4px solid rgba(14, 165, 233, 0.62);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.09) 0%, var(--card) 100%);
}

.calendar-task-card.calendar-notification-highlight {
  animation: calendar-review-highlight 1.15s ease-in-out 0s 7;
  border-color: rgba(59, 130, 246, 0.85) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22), 0 16px 34px rgba(59, 130, 246, 0.22) !important;
}

@keyframes calendar-review-highlight {
  0%, 100% { transform: translateY(0); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18); }
  50% { transform: translateY(-2px); box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.28); }
}

.calendar-task-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.calendar-task-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.task-blocked {
  border-left: 3px solid #ef4444;
  opacity: 0.75;
  order: 15;
}

.task-unlocked {
  border-left: 3px solid #22c55e;
}

/* PRONTA PARA SUBIR — glow verde pulsante suave para alertar o media buyer */
.task-ready-to-launch {
  border-left: 4px solid #22c55e;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18) 0%, var(--card) 100%);
  animation: pulse-ready 4s ease-in-out infinite !important;
  will-change: box-shadow;
}
.task-ready-to-launch:hover {
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.55);
}
@keyframes pulse-ready {
  0%, 100% { box-shadow: 0 0 6px rgba(34, 197, 94, 0.2); }
  50% { box-shadow: 0 0 14px rgba(34, 197, 94, 0.45); }
}

.task-card-ready-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: 4px;
  display: inline-block;
}
body[data-theme="dark"] .task-ready-to-launch {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, var(--card) 100%);
}

.task-normal {
  border-left: 3px solid var(--accent);
}

/* ---------- Role-based ordering & coloring ---------- */
/* Designer tasks: yellow accent + prioritized at top */
.calendar-task-card.role-design {
  border-left: 4px solid #eab308 !important;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.14) 0%, var(--card) 100%) !important;
  order: -10;
}
/* Content tasks: prioritized at top (same order tier as design) */
.calendar-task-card.role-conteudo {
  order: -10;
}
/* Traffic manager tasks: pushed to bottom (before done) */
.calendar-task-card.role-trafego {
  order: 10;
}

.calendar-task-card.task-review-pending {
  order: -30 !important;
  border-color: rgba(239, 68, 68, 0.38) !important;
  border-left-color: rgba(239, 68, 68, 0.72) !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, var(--card) 100%) !important;
}

.calendar-task-card.task-review-resolved {
  order: -8 !important;
  border-color: rgba(14, 165, 233, 0.3) !important;
  border-left-color: rgba(14, 165, 233, 0.62) !important;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.09) 0%, var(--card) 100%) !important;
}

.calendar-task-card.task-done {
  order: 20;
  opacity: 0.58;
  border-left-color: #94a3b8;
  background: rgba(148, 163, 184, 0.08);
  filter: saturate(0.65);
}

.calendar-task-card.task-done:hover {
  opacity: 0.82;
  filter: saturate(0.85);
}

.calendar-task-card.task-done .task-card-title,
.calendar-task-card.task-done .task-card-project,
.calendar-task-card.task-done .task-card-assigned {
  color: var(--muted);
}

.calendar-task-card.task-done .task-card-title {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(148, 163, 184, 0.75);
}

body[data-theme="dark"] .calendar-task-card.task-done {
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.28);
  border-left-color: #64748b;
}

.calendar-task-card.task-review-pending.task-done {
  order: -30 !important;
  opacity: 0.82;
  filter: saturate(0.9);
}

.calendar-task-card.task-review-resolved.task-done {
  order: -8 !important;
  opacity: 0.72;
  filter: saturate(0.8);
}

/* Preview banner */
.preview-banner {
  margin-bottom: 16px;
  padding: 14px 20px;
  border: 2px solid #3b82f6;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.04) 100%);
}

.preview-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  flex-wrap: wrap;
}

.preview-banner-content strong {
  color: #3b82f6;
}

body[data-theme="dark"] .preview-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
}

/* Preview toolbar: sort buttons + draft-only toggle */
.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  flex-wrap: wrap;
}

.preview-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.preview-toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
}

.preview-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.preview-toggle-label input[type="checkbox"] {
  accent-color: #3b82f6;
  width: 16px;
  height: 16px;
}

.preview-week-edge-controls {
  align-items: stretch;
  gap: 8px;
}

.preview-edge-card {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.06);
}

.preview-edge-card strong {
  font-size: 12px;
  color: var(--text);
}

.preview-edge-card label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.preview-edge-card input {
  width: 48px;
  min-height: 28px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
}

/* Date conflict visual reinforcement: count badges */
.count-warning {
  background: rgba(245, 158, 11, 0.3) !important;
  color: #92400e !important;
  border: 1px solid #f59e0b;
}

.count-overload {
  background: rgba(239, 68, 68, 0.3) !important;
  color: #991b1b !important;
  border: 1px solid #ef4444;
  animation: pulse-red 1.5s ease-in-out infinite;
}

body[data-theme="dark"] .count-warning {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fcd34d !important;
}

body[data-theme="dark"] .count-overload {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #fca5a5 !important;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); }
}

/* Past day indicator */
.calendar-past-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
  padding: 2px 0;
  opacity: 0.6;
}

/* Draft card extra info */
.task-card-niche {
  font-size: 10px;
  color: #8b5cf6;
  font-weight: 600;
  margin-top: 2px;
}

.task-card-function {
  font-size: 10px;
  color: #0ea5e9;
  font-weight: 500;
}

/* Task type tag — shown below the title on each card */
.task-type-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 10px;
  margin-bottom: 4px;
  /* default: neutral blue-grey */
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Per-type color overrides */
.task-type-new-funnel      { background: rgba(34, 197, 94, 0.15);  color: #86efac; border-color: rgba(34, 197, 94, 0.35); }
.task-type-new-campaign    { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border-color: rgba(59, 130, 246, 0.35); }
.task-type-new-creatives   { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; border-color: rgba(168, 85, 247, 0.35); }
.task-type-optimize        { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border-color: rgba(245, 158, 11, 0.35); }
.task-type-off             { background: rgba(239, 68, 68, 0.15);  color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }
.task-type-relink          { background: rgba(20, 184, 166, 0.15); color: #5eead4; border-color: rgba(20, 184, 166, 0.35); }
.task-type-duplicate       { background: rgba(251, 146, 60, 0.15); color: #fdba74; border-color: rgba(251, 146, 60, 0.35); }
.task-type-broad           { background: rgba(236, 72, 153, 0.15); color: #f9a8d4; border-color: rgba(236, 72, 153, 0.35); }
.task-type-new-article     { background: rgba(14, 165, 233, 0.15); color: #7dd3fc; border-color: rgba(14, 165, 233, 0.35); }

/* Light theme overrides */
body[data-theme="light"] .task-type-tag          { background: rgba(99, 102, 241, 0.08);  color: #4f46e5; border-color: rgba(99, 102, 241, 0.25); }
body[data-theme="light"] .task-type-new-funnel   { background: rgba(22, 163, 74, 0.1);   color: #15803d; border-color: rgba(22, 163, 74, 0.3); }
body[data-theme="light"] .task-type-new-campaign { background: rgba(37, 99, 235, 0.1);   color: #1d4ed8; border-color: rgba(37, 99, 235, 0.3); }
body[data-theme="light"] .task-type-new-creatives{ background: rgba(126, 34, 206, 0.1);  color: #7e22ce; border-color: rgba(126, 34, 206, 0.3); }
body[data-theme="light"] .task-type-optimize     { background: rgba(180, 83, 9, 0.1);    color: #b45309; border-color: rgba(180, 83, 9, 0.3); }
body[data-theme="light"] .task-type-off          { background: rgba(185, 28, 28, 0.1);   color: #b91c1c; border-color: rgba(185, 28, 28, 0.3); }
body[data-theme="light"] .task-type-relink       { background: rgba(15, 118, 110, 0.1);  color: #0f766e; border-color: rgba(15, 118, 110, 0.3); }

/* Day overload badge (volume/role threshold) */
.task-card-overload-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #d97706;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 4px;
  display: inline-block;
}

.task-card-review-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #991b1b;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 4px;
  padding: 1px 6px;
  margin-bottom: 4px;
  display: inline-block;
}

.task-card-reviewed-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0369a1;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 4px;
  padding: 1px 6px;
  margin-bottom: 4px;
  display: inline-block;
}

body[data-theme="dark"] .task-card-review-badge {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.42);
}

body[data-theme="dark"] .task-card-reviewed-badge {
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 165, 233, 0.36);
}

body[data-theme="dark"] .task-card-overload-badge {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

/* Person conflict badge (same person > threshold tasks/day) */
.task-card-conflict-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 4px;
  display: inline-block;
}

body[data-theme="dark"] .task-card-conflict-badge {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Trafego misplaced warning */
.task-card-trafego-warning {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 4px;
  display: inline-block;
  animation: pulse-amber 1.5s ease-in-out infinite;
}

@keyframes pulse-amber {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1); }
}

body[data-theme="dark"] .task-card-trafego-warning {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
}

/* Draft task card: dashed border, draggable */
.task-draft {
  border: 2px dashed #3b82f6;
  opacity: 0.85;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(59, 130, 246, 0.04) 8px,
    rgba(59, 130, 246, 0.04) 16px
  );
  cursor: grab;
}

.task-draft.task-draft-grouped {
  position: relative;
  padding-left: 16px;
  border-left: 5px solid var(--draft-group-color, #3b82f6);
}

.task-draft.task-already-launched {
  order: 30 !important;
  cursor: default;
  opacity: 0.46;
  border-style: solid;
  border-width: 1px;
  border-color: rgba(148, 163, 184, 0.42);
  border-left: 5px solid rgba(148, 163, 184, 0.7);
  background: rgba(148, 163, 184, 0.08);
  filter: saturate(0.55);
}

.task-draft.task-already-launched:hover {
  opacity: 0.62;
  box-shadow: none;
}

.task-card-draft-group-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  margin-bottom: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--draft-group-color, #3b82f6) 45%, transparent);
  background: color-mix(in srgb, var(--draft-group-color, #3b82f6) 16%, transparent);
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 700;
}

.task-card-draft-group-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--draft-group-color, #3b82f6);
}

.task-draft:active {
  cursor: grabbing;
}

.task-draft.dragging {
  opacity: 0.4;
  transform: scale(0.96);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}

.task-card-draft-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3b82f6;
  margin-bottom: 2px;
  padding: 2px 6px;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  display: inline-block;
}

.task-card-launched-badge {
  color: #475569;
  border-color: rgba(100, 116, 139, 0.45);
  background: rgba(148, 163, 184, 0.14);
}

body[data-theme="dark"] .task-card-launched-badge {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.12);
}

/* Out of order: trafego scheduled BEFORE its dependencies */
.task-out-of-order {
  border-left: 4px solid #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, var(--card) 100%);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

.task-card-warning-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ef4444;
  margin-bottom: 2px;
}

.task-card-gam-warning {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ef4444;
  margin-top: 3px;
}

.task-card-internal-meta {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--card) 88%, var(--bg) 12%);
}

.task-card-internal-meta div {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  font-size: 10px;
  line-height: 1.25;
}

.task-card-internal-meta span {
  color: var(--muted);
  font-weight: 600;
}

.task-card-internal-meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
}

/* Highlight: shared multi-role task with media buyer on the same day */
.task-highlight {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, var(--card) 100%);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.task-card-highlight-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #f59e0b;
  margin-bottom: 2px;
}

/* Priority tasks (funil/chatbot/shein) — subtle left accent */
.task-priority.task-normal {
  border-left: 4px solid #8b5cf6;
}

.task-card-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.task-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.task-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-published {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
}

.badge-not-started {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.badge-in-progress {
  background: rgba(59, 130, 246, 0.16);
  color: #1e40af;
}

.badge-done {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
}

.badge-default {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
}

.badge-type {
  background: rgba(139, 92, 246, 0.16);
  color: #6d28d9;
}

.badge-group {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.badge-ready {
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.34);
}

.badge-priority-high {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
}

.badge-priority-medium {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.badge-priority-low {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.badge-role {
  border: 1px solid rgba(100, 116, 139, 0.18);
}

.badge-area-conteudo {
  background: rgba(14, 165, 233, 0.15);
  color: #0369a1;
}

.badge-area-design {
  background: rgba(168, 85, 247, 0.15);
  color: #7e22ce;
}

.badge-area-trafego {
  background: rgba(236, 72, 153, 0.15);
  color: #be185d;
}

.badge-area-outros {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.badge-gam-duplicate {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-traffic {
  background: rgba(236, 72, 153, 0.16);
  color: #be185d;
}

.badge-lang {
  background: rgba(14, 165, 233, 0.16);
  color: #0369a1;
}

body[data-theme="dark"] .badge-published { background: rgba(34, 197, 94, 0.18); color: #86efac; }
body[data-theme="dark"] .badge-not-started { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
body[data-theme="dark"] .badge-in-progress { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
body[data-theme="dark"] .badge-done { background: rgba(34, 197, 94, 0.18); color: #86efac; }
body[data-theme="dark"] .badge-default { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }
.badge-draft { background: rgba(59, 130, 246, 0.14); color: #2563eb; border: 1px dashed #3b82f6; }
body[data-theme="dark"] .badge-draft { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border: 1px dashed #60a5fa; }
body[data-theme="dark"] .badge-type { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
body[data-theme="dark"] .badge-group { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.25); }
body[data-theme="dark"] .badge-ready { background: rgba(34, 197, 94, 0.18); color: #86efac; border-color: rgba(34, 197, 94, 0.34); }
body[data-theme="dark"] .badge-priority-high { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
body[data-theme="dark"] .badge-priority-medium { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
body[data-theme="dark"] .badge-priority-low { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }
body[data-theme="dark"] .badge-area-conteudo { background: rgba(14, 165, 233, 0.18); color: #7dd3fc; }
body[data-theme="dark"] .badge-area-design { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }
body[data-theme="dark"] .badge-area-trafego { background: rgba(236, 72, 153, 0.18); color: #f9a8d4; }
body[data-theme="dark"] .badge-area-outros { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }
body[data-theme="dark"] .badge-gam-duplicate { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }
body[data-theme="dark"] .badge-traffic { background: rgba(236, 72, 153, 0.18); color: #f9a8d4; }
body[data-theme="dark"] .badge-lang { background: rgba(14, 165, 233, 0.18); color: #7dd3fc; }

.task-card-project {
  font-size: 11px;
  color: var(--muted);
}

.task-card-assigned {
  font-size: 11px;
  color: var(--muted);
}

.task-owner-role {
  font-weight: 700;
  color: var(--accent);
}

.task-card-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card-context {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 4px;
}

.task-card-context-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  font-size: 10px;
  line-height: 1.3;
}

.task-card-context-row span {
  color: var(--muted);
  font-weight: 700;
}

.task-card-context-row strong {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card-context-warning strong {
  color: #ef4444;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.task-card-blocked-info {
  font-size: 10px;
  color: #ef4444;
  font-weight: 600;
  margin-top: 4px;
}

.task-card-unlocked-info {
  font-size: 10px;
  color: #22c55e;
  font-weight: 600;
  margin-top: 4px;
}

.calendar-empty {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 20px 0;
  pointer-events: none;
}

/* Task Detail Modal — full-width */
.modal-card-fullwidth {
  width: calc(100vw - 48px);
  max-width: 1400px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-sm {
  font-size: 12px;
  padding: 6px 14px;
}

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

.btn-full {
  width: 100%;
  text-align: center;
}

.task-modal-body {
  padding: 20px 28px;
}

.task-modal-loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.td-title-row {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.td-title {
  font-size: 18px;
  margin: 0;
  line-height: 1.3;
}

.td-grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 28px;
}

.td-col-header {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 12px 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.td-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.td-field .td-label {
  min-width: 130px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

.td-value {
  font-size: 13px;
}

.td-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
}

.td-role-statuses {
  display: grid;
  gap: 8px;
}

.td-role-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.td-role-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.td-role-name {
  font-size: 13px;
  font-weight: 600;
}

.td-role-links {
  display: grid;
  gap: 6px;
}

.td-role-link-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.td-role-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.td-role-complete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.td-role-complete-btn:hover:not(:disabled) {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.18);
}

.td-role-complete-btn:disabled,
.td-role-complete-btn.is-done {
  cursor: default;
  opacity: 0.8;
}

.td-role-link:hover {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.16);
}

.td-role-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.role-done {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
}

.role-pending {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

body[data-theme="dark"] .role-done { background: rgba(34, 197, 94, 0.18); color: #86efac; }
body[data-theme="dark"] .role-pending { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
body[data-theme="dark"] .td-role-link {
  border-color: rgba(129, 140, 248, 0.45);
  background: rgba(129, 140, 248, 0.14);
  color: #c7d2fe;
}
body[data-theme="dark"] .td-role-complete-btn {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}
body[data-theme="dark"] .td-role-complete-btn:hover:not(:disabled) {
  border-color: rgba(34, 197, 94, 0.68);
  background: rgba(34, 197, 94, 0.24);
}
body[data-theme="dark"] .td-role-link:hover {
  border-color: rgba(129, 140, 248, 0.7);
  background: rgba(129, 140, 248, 0.22);
}

.unlock-ready {
  padding: 12px;
  border: 1px solid #22c55e;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.1);
  color: #166534;
  font-weight: 600;
  font-size: 13px;
}

.unlock-blocked {
  padding: 12px;
  border: 1px solid #ef4444;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
  font-size: 13px;
}

body[data-theme="dark"] .unlock-ready { background: rgba(34, 197, 94, 0.12); color: #86efac; border-color: rgba(34, 197, 94, 0.4); }
body[data-theme="dark"] .unlock-blocked { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }

.td-actions {
  display: grid;
  gap: 10px;
  padding-top: 8px;
}

.td-description-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.td-description-content {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  min-height: 60px;
}

.td-description-input {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

input[type="date"] {
  cursor: pointer;
}

/* ── Drag & Drop ── */
.calendar-task-card[draggable="true"] {
  cursor: grab;
}

.calendar-task-card[draggable="true"]:active {
  cursor: grabbing;
}

.calendar-task-card.dragging {
  opacity: 0.4;
  transform: scale(0.96);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.calendar-day-tasks.drag-over {
  background: var(--accent-soft);
  border: 2px dashed var(--accent);
  border-radius: 12px;
  min-height: 80px;
  transition: background 0.15s, border 0.15s;
}

@media (max-width: 1100px) {
  .td-grid-3col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .calendar-grid {
    grid-template-columns: 1fr;
  }
  .calendar-day {
    min-height: auto;
  }
  .td-grid-3col {
    grid-template-columns: 1fr;
  }
  .modal-card-fullwidth {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 8px);
  }
}

@media (max-width: 640px) {
  .calendar-controls,
  .calendar-nav,
  .calendar-filters {
    align-items: stretch;
  }
  .calendar-nav {
    width: 100%;
  }
  .calendar-overdue-banner,
  .calendar-progress,
  .calendar-avatar-row {
    margin-bottom: 12px;
  }
}

/* ── Sort Config Modal (Priority Ordering) ── */
.sort-config-body {
  padding: 20px 24px 16px;
}

.sort-config-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.sort-config-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 60px;
}

.sort-config-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: grab;
  user-select: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.sort-config-block:hover {
  background: var(--accent-soft);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sort-config-block:active {
  cursor: grabbing;
}

.sort-config-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.sort-config-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.sort-config-grip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.15s;
}

.sort-config-block:hover .sort-config-grip {
  opacity: 0.8;
}

.sort-config-grip::before,
.sort-config-grip::after {
  content: "⠿";
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
}

.sort-config-grip::after {
  display: none;
}

.sort-dragging {
  opacity: 0.5;
  transform: scale(0.97);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.06);
}

.sort-drop-target {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent);
}

.sort-config-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sort-config-actions .btn {
  min-width: 100px;
}

body[data-theme="dark"] .sort-config-block {
  border-color: #333;
}

body[data-theme="dark"] .sort-config-block:hover {
  background: rgba(99, 102, 241, 0.08);
}

body[data-theme="dark"] .sort-dragging {
  background: rgba(59, 130, 246, 0.12);
  border-color: #60a5fa;
}

body[data-theme="dark"] .sort-drop-target {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent);
}

/* ============================================================
   VISUAL IMPROVEMENTS — appended block
   ============================================================ */

/* ----------------------------------------------------------
   1. SIDEBAR COLLAPSED STATE (SVG icons removed — using emoji)
   ---------------------------------------------------------- */

/* Collapsed sidebar */
.sidebar {
  transition: width 200ms ease;
}

.content {
  transition: margin-left 200ms ease;
}

.sidebar.collapsed {
  width: 64px;
}

.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-user .user-name,
.sidebar.collapsed .sidebar-user .user-role-badge,
.sidebar.collapsed .logout-btn,
.sidebar.collapsed .sidebar-actions {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 14px 8px 10px;
}

.sidebar.collapsed .sidebar-toggle {
  margin: 0 auto;
}

.sidebar.collapsed .sidebar-nav {
  padding: 8px 6px;
}

.sidebar.collapsed .sidebar-nav a {
  justify-content: center;
  padding: 8px;
  border-radius: var(--radius-xs);
}

.sidebar.collapsed .sidebar-nav a .nav-icon {
  width: auto;
}

.sidebar.collapsed .nav-text {
  display: none;
}

.sidebar.collapsed .sidebar-footer {
  padding: 8px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar.collapsed .sidebar-user {
  justify-content: center;
}

.sidebar.collapsed .sidebar-user .user-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.sidebar.collapsed + .content,
.sidebar.collapsed ~ .content {
  margin-left: 64px;
}

/* Tooltip on hover for collapsed items */
.sidebar.collapsed .sidebar-nav a {
  position: relative;
}

.sidebar.collapsed .sidebar-nav a:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 8px;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}

/* ----------------------------------------------------------
   2. SKELETON LOADING
   ---------------------------------------------------------- */

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--border) 25%,
    var(--panel)  50%,
    var(--border) 75%
  );
  background-size: 1200px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 6px;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius);
}

.skeleton-row {
  height: 20px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-row:last-child {
  width: 60%;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   3. MICRO-ANIMATIONS
   ---------------------------------------------------------- */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.panel {
  animation: fadeIn 0.25s ease both;
}

.modal-card.open {
  animation: slideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.task-card {
  animation: scaleIn 0.2s ease both;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* ----------------------------------------------------------
   4. IMPROVED TASK CARDS
   ---------------------------------------------------------- */

.task-card {
  border-left: 4px solid var(--border);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}

.task-card[data-role="content"] {
  border-left-color: #3b82f6;
}

.task-card[data-role="design"] {
  border-left-color: #22c55e;
}

.task-card[data-role="campaign"],
.task-card[data-role="traffic"] {
  border-left-color: #f59e0b;
}

.task-card-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.task-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}

.task-card-priority {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
}

.task-card-priority::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-card-priority.critical::before { background: #ef4444; }
.task-card-priority.high::before     { background: #f97316; }
.task-card-priority.medium::before   { background: #eab308; }
.task-card-priority.low::before      { background: #9ca3af; }

.task-card-priority.critical { color: #ef4444; }
.task-card-priority.high     { color: #f97316; }
.task-card-priority.medium   { color: #eab308; }
.task-card-priority.low      { color: #9ca3af; }

/* ----------------------------------------------------------
   5. COMPACT MODE
   ---------------------------------------------------------- */

body.compact-mode .data-table td,
body.compact-mode .data-table th {
  padding: 4px 8px;
  font-size: 12px;
}

body.compact-mode .task-card {
  padding: 8px;
}

body.compact-mode .panel {
  padding: 12px;
}

.compact-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  font-family: var(--font-sans);
}

.sound-toggle {
  min-width: 40px;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.compact-toggle:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

body.compact-mode .compact-toggle {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* ----------------------------------------------------------
   6. BREADCRUMBS
   ---------------------------------------------------------- */

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item::after {
  content: "›";
  margin: 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.breadcrumb-item:last-child::after {
  display: none;
}

.breadcrumb-item:last-child {
  color: var(--ink);
  font-weight: 500;
}

.breadcrumb-item a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb-item a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ----------------------------------------------------------
   7. CHIP FILTERS
   ---------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
  user-select: none;
  line-height: 1.5;
}

.chip:hover {
  background: var(--panel);
  border-color: var(--muted);
}

.chip.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

.chip.active:hover {
  background: color-mix(in srgb, var(--accent) 85%, #fff);
}

.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  margin-left: 2px;
  transition: background 0.15s;
}

.chip.active .chip-remove {
  background: rgba(0, 0, 0, 0.25);
}

.chip .chip-remove:hover {
  background: rgba(0, 0, 0, 0.4);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ----------------------------------------------------------
   8. DARK MODE REFINEMENT
   ---------------------------------------------------------- */

body[data-theme="dark"] {
  --card-hover: #262626;
  --border-strong: #444444;
  --text-secondary: #a1a1a1;
}

/* topbar dark override removed — handled by CSS variables */

body[data-theme="dark"] .btn {
  border-color: var(--border-strong);
}

body[data-theme="dark"] .btn:hover {
  border-color: var(--accent);
}

body[data-theme="dark"] .data-table thead th {
  background: #1c1c1c;
  color: var(--text-secondary);
  border-bottom-color: var(--border-strong);
}

body[data-theme="dark"] .data-table tbody tr:hover {
  background: var(--card-hover);
}

body[data-theme="dark"] .data-table td,
body[data-theme="dark"] .data-table th {
  border-color: var(--border-strong);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background: #1c1c1c;
  border-color: var(--border-strong);
  color: var(--ink);
}

body[data-theme="dark"] input:focus,
body[data-theme="dark"] select:focus,
body[data-theme="dark"] textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #555;
}

body[data-theme="dark"] .task-card {
  background: var(--card);
  border-bottom-color: var(--border-strong);
}

body[data-theme="dark"] .task-card:hover {
  background: var(--card-hover);
}

/* ----------------------------------------------------------
   9. CAPACITY BAR
   ---------------------------------------------------------- */

.capacity-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.capacity-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.capacity-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}

.capacity-fill.low      { background: #22c55e; }
.capacity-fill.medium   { background: #eab308; }
.capacity-fill.high     { background: #f97316; }
.capacity-fill.critical { background: #ef4444; }

/* ----------------------------------------------------------
   10. EMPTY STATES
   ---------------------------------------------------------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  width: 100%;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  opacity: 0.3;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--muted);
  max-width: 400px;
  line-height: 1.6;
  margin: 0;
}

.empty-state .btn {
  margin-top: 16px;
}

body[data-theme="dark"] .empty-state-title {
  color: var(--text-secondary, #a1a1a1);
}

body[data-theme="dark"] .empty-state-icon {
  filter: brightness(0) invert(1);
  opacity: 0.2;
}

/* ----------------------------------------------------------
   11. NOTIFICATION BADGE & DROPDOWN
   ---------------------------------------------------------- */

.notification-wrapper {
  position: relative;
  display: inline-flex;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 0 2px var(--bg);
}

.notification-dropdown {
  position: fixed;
  top: 52px;
  right: 16px;
  width: 340px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px var(--shadow);
  z-index: 2000;
  display: none;
  flex-direction: column;
}

.notification-dropdown.open {
  display: flex;
  animation: slideUp 0.2s ease both;
}

.notification-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--panel);
}

.notification-item.unread {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-left: 3px solid var(--accent);
}

.notification-item.unread:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.notification-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 4px;
}

.notification-item-body {
  flex: 1;
  min-width: 0;
}

.notification-item-title {
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-item-time {
  font-size: 11px;
  color: var(--muted);
}

body[data-theme="dark"] .notification-dropdown {
  background: #1a1a1a;
  border-color: var(--border-strong, #444);
}

/* ----------------------------------------------------------
   12. BULK TOOLBAR
   ---------------------------------------------------------- */

.bulk-toolbar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px var(--shadow);
  animation: slideUp 0.2s ease both;
}

.bulk-toolbar-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-right: 8px;
  white-space: nowrap;
}

.bulk-toolbar .btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bulk-toolbar-spacer {
  flex: 1;
}

.bulk-toolbar-dismiss {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.bulk-toolbar-dismiss:hover {
  color: var(--ink);
}

body[data-theme="dark"] .bulk-toolbar {
  background: #1a1a1a;
  border-top-color: var(--border-strong, #444);
}

/* ----------------------------------------------------------
   14. SPLIT VIEW
   ---------------------------------------------------------- */

.split-view {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}

.split-view-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.split-view-panel-header {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.split-view-panel-body {
  overflow-y: auto;
  max-height: calc(100vh - 160px);
}

@media (max-width: 900px) {
  .split-view {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------
   15. DRAFT COUNTER BADGE
   ---------------------------------------------------------- */

.draft-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  line-height: 1;
  vertical-align: middle;
}

.draft-counter.zero {
  background: var(--border);
  color: var(--muted);
}

/* ----------------------------------------------------------
   16. LAUNCH SUMMARY MODAL
   ---------------------------------------------------------- */

.launch-summary-modal .modal-card {
  max-width: 680px;
  width: 100%;
}

.launch-summary-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 0;
}

.launch-summary-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.launch-summary-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.launch-summary-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.launch-summary-body {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.launch-summary-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.launch-summary-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.launch-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.launch-summary-row:last-child {
  border-bottom: none;
}

.launch-summary-row-label {
  color: var(--muted);
}

.launch-summary-row-value {
  font-weight: 500;
}

.launch-summary-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 20px;
}

body[data-theme="dark"] .launch-summary-section {
  background: #1c1c1c;
  border-color: var(--border-strong, #444);
}

/* ----------------------------------------------------------
   17. INLINE EDIT FIELD
   ---------------------------------------------------------- */

.inline-edit-field {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 6px;
  color: inherit;
  font-family: var(--font-sans);
  font-size: inherit;
  font-weight: inherit;
  width: 100%;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  outline: none;
  cursor: text;
}

.inline-edit-field:hover {
  border-color: var(--border);
  background: var(--panel);
}

.inline-edit-field:focus {
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  cursor: text;
}

.inline-edit-field:read-only {
  cursor: default;
  pointer-events: none;
}

body[data-theme="dark"] .inline-edit-field:focus {
  background: #1c1c1c;
}

/* ============================================================
   END OF VISUAL IMPROVEMENTS BLOCK
   ============================================================ */

/* ===========================================================
   VISUAL IMPROVEMENTS PACKAGE — 87 enhancements
   Added: 2026-04-12
   =========================================================== */

/* ── V1. Toast Notification System ────────────────────────── */
/* BUG FIX (Bug 5): JS creates #toast-container (ID) but CSS used .toast-container
   (class). Both selectors now share the same rules. */
.toast-container,
#toast-container {
  position: fixed; top: 20px; right: 20px; bottom: auto; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 500; color: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  animation: toastIn .35s cubic-bezier(.4,0,.2,1);
  max-width: 420px;
}
/* BUG FIX (Bug 6): JS adds class "toast-success" etc. (dash-style), original CSS
   used ".toast.success" (space-style). Both are now supported as aliases. */
.toast.success, .toast-success { background: #16a34a; }
.toast.error, .toast-error { background: #dc2626; }
.toast.warning, .toast-warning { background: #d97706; }
.toast.info, .toast-info { background: #2563eb; }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-message { flex: 1; }
.toast-close {
  background: none; border: none; color: rgba(255,255,255,.7);
  cursor: pointer; font-size: 18px; padding: 0 0 0 8px;
  /* BUG FIX (Bug 8): .toast-close was inheriting text-transform/letter-spacing
     from global button rule. Override here. */
  text-transform: none; letter-spacing: 0; box-shadow: none;
}
.toast-close:hover { color: #fff; }
.toast.removing { animation: toastOut .25s ease-in forwards; }
.notification-toast {
  align-items: flex-start;
  min-width: 320px;
  max-width: min(420px, calc(100vw - 32px));
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border: 1px solid rgba(255,255,255,.18);
  cursor: pointer;
}
.notification-toast-body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.notification-toast-body strong {
  font-size: 13px;
  line-height: 1.25;
}
.notification-toast-body span {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255,255,255,.86);
}
.notification-toast-action,
.notification-toast-close {
  border: 0;
  box-shadow: none;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
}
.notification-toast-action {
  flex-shrink: 0;
  align-self: center;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,.18);
  font-size: 12px;
  font-weight: 700;
}
.notification-toast-action:hover {
  background: rgba(255,255,255,.28);
}
.notification-toast-close {
  flex-shrink: 0;
  padding: 0 0 0 2px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  color: rgba(255,255,255,.72);
}
.notification-toast-close:hover {
  color: #fff;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(80px); }
}
@media (max-width: 640px) {
  #toast-container {
    left: 12px;
    right: 12px;
    top: 12px;
  }
  .notification-toast {
    min-width: 0;
    width: 100%;
  }
}

/* ── V2. Tooltips ─────────────────────────────────────────── */
[data-tooltip] {
  position: relative; cursor: help;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) scale(.92);
  background: var(--ink); color: var(--bg); font-size: 12px;
  padding: 6px 12px; border-radius: 8px; white-space: nowrap;
  pointer-events: none; opacity: 0;
  transition: opacity .15s, transform .15s;
  z-index: 1000;
}
[data-tooltip]:hover::after {
  opacity: 1; transform: translateX(-50%) scale(1);
}

/* ── V3. Form validation states ───────────────────────────── */
input.is-valid, select.is-valid, textarea.is-valid {
  border-color: #16a34a !important;
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}
.field-error {
  color: #dc2626; font-size: 12px; margin-top: 4px; display: block;
}
.field-success {
  color: #16a34a; font-size: 12px; margin-top: 4px; display: block;
}
.field-hint {
  color: var(--muted); font-size: 12px; margin-top: 4px; display: block;
}

/* ── V4. Generic loading spinner ──────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-overlay {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  /* BUG FIX (Bug 7): --bg-rgb was never defined. Use explicit rgba values. */
  background: rgba(255,255,255,.7);
  border-radius: inherit; z-index: 10;
}
body[data-theme="dark"] .spinner-overlay {
  background: rgba(15,15,15,.7);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── V5. Tabs component ──────────────────────────────────── */
.tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  color: var(--muted); background: none; border: none;
  cursor: pointer; position: relative;
  transition: color .15s;
  /* BUG FIX (Bug 8): reset leaked styles from global button rule */
  text-transform: none; letter-spacing: 0; box-shadow: none;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ink); font-weight: 600;
}
.tab.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .2s ease; }

/* ── V6. Pagination ──────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 4px;
  justify-content: center; margin: 20px 0;
}
.pagination-btn {
  min-width: 36px; height: 36px; display: flex;
  align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--ink);
  font-size: 14px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.pagination-btn:hover { background: var(--panel); border-color: var(--accent); }
.pagination-btn.active {
  background: var(--accent); color: #000; border-color: var(--accent);
  font-weight: 600;
}
.pagination-btn:disabled { opacity: .4; cursor: not-allowed; }
.pagination-ellipsis { padding: 0 6px; color: var(--muted); }

/* ── V7. Custom checkboxes & radios ──────────────────────── */
.checkbox, .radio {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 14px; user-select: none;
}
.checkbox input, .radio input { display: none; }
.checkbox-mark, .radio-mark {
  width: 20px; height: 20px; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.checkbox-mark { border-radius: 6px; }
.radio-mark { border-radius: 50%; }
.checkbox input:checked + .checkbox-mark {
  background: var(--accent); border-color: var(--accent);
}
.checkbox input:checked + .checkbox-mark::after {
  content: '\2713'; color: #000; font-size: 14px; font-weight: 700;
}
.radio input:checked + .radio-mark::after {
  content: ''; width: 10px; height: 10px;
  background: var(--accent); border-radius: 50%;
}

/* ── V8. Toggle switch ───────────────────────────────────── */
.toggle-switch {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 14px;
}
.toggle-switch input { display: none; }
.toggle-track {
  width: 44px; height: 24px; background: var(--border);
  border-radius: 12px; position: relative;
  transition: background .2s;
}
.toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; background: #fff;
  border-radius: 50%; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-track {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* ── V9. Accordion ───────────────────────────────────────── */
.accordion { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: none; }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: none; border: none;
  font-size: 14px; font-weight: 500; color: var(--ink);
  cursor: pointer; text-align: left;
  transition: background .15s;
}
.accordion-trigger:hover { background: var(--panel); }
.accordion-trigger::after {
  content: '\25B8'; transition: transform .2s; font-size: 12px;
}
.accordion-item.open .accordion-trigger::after { transform: rotate(90deg); }
.accordion-content {
  max-height: 0; overflow: hidden; transition: max-height .3s ease;
  padding: 0 18px;
}
.accordion-item.open .accordion-content {
  max-height: 600px; padding: 0 18px 16px;
}

/* ── V10. Search input ───────────────────────────────────── */
.search-input-wrap {
  position: relative; display: flex; align-items: center;
}
.search-input-wrap .search-icon {
  position: absolute; left: 12px; color: var(--muted);
  font-size: 16px; pointer-events: none;
}
.search-input {
  width: 100%; padding: 10px 12px 10px 38px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: var(--card);
  color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  outline: none;
}
.search-input::placeholder { color: var(--muted); }
.search-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; margin-top: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  max-height: 320px; overflow-y: auto; z-index: 100;
}
.search-result-item {
  padding: 10px 16px; cursor: pointer; font-size: 14px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.search-result-item:hover { background: var(--panel); }
.search-result-item:last-child { border-bottom: none; }

/* ── V11. Avatar & avatar group ──────────────────────────── */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #171717;
  background: var(--accent); flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.avatar-lg { width: 40px; height: 40px; font-size: 16px; }
.avatar-group { display: flex; }
.avatar-group .avatar {
  margin-left: -8px; border: 2px solid var(--bg);
}
.avatar-group .avatar:first-child { margin-left: 0; }

/* ── V12. Badge variants ─────────────────────────────────── */
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: var(--panel); color: var(--muted); }
.badge-outline {
  background: transparent; border: 1px solid currentColor;
}
.badge-dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; display: inline-block; margin-right: 6px;
}
body[data-theme="dark"] .badge-success { background: #052e16; color: #86efac; }
body[data-theme="dark"] .badge-danger { background: #450a0a; color: #fca5a5; }
body[data-theme="dark"] .badge-warning { background: #451a03; color: #fcd34d; }
body[data-theme="dark"] .badge-info { background: #172554; color: #93c5fd; }

/* ── V13. Stepper / Progress indicator ───────────────────── */
.stepper {
  display: flex; align-items: center; gap: 0; margin: 20px 0;
}
.stepper-step {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--muted);
}
.stepper-step.active { color: var(--ink); font-weight: 600; }
.stepper-step.completed { color: #16a34a; }
.stepper-circle {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border); font-size: 12px; font-weight: 600;
  flex-shrink: 0; transition: all .2s;
}
.stepper-step.active .stepper-circle {
  border-color: var(--accent); background: var(--accent); color: #000;
}
.stepper-step.completed .stepper-circle {
  border-color: #16a34a; background: #16a34a; color: #fff;
}
.stepper-line {
  flex: 1; height: 2px; background: var(--border); min-width: 20px;
}
.stepper-step.completed + .stepper-line { background: #16a34a; }

/* ── V14. Date picker wrapper ────────────────────────────── */
.date-picker-wrap {
  position: relative; display: inline-flex; align-items: center;
}
.date-picker-wrap input[type="date"] {
  padding-right: 36px;
}
.date-picker-wrap .date-icon {
  position: absolute; right: 12px; color: var(--muted);
  pointer-events: none;
}

/* ── V15. Alert / Banner component ───────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border-radius: 12px;
  font-size: 14px; margin-bottom: 16px;
}
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-dismiss {
  background: none; border: none; cursor: pointer;
  opacity: .5; font-size: 16px;
}
.alert-dismiss:hover { opacity: 1; }
.alert-info { background: #eff6ff; color: #1e40af; border-left: 4px solid #3b82f6; }
.alert-success { background: #f0fdf4; color: #166534; border-left: 4px solid #22c55e; }
.alert-warning { background: #fffbeb; color: #92400e; border-left: 4px solid #f59e0b; }
.alert-error { background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444; }
body[data-theme="dark"] .alert-info { background: #172554; color: #93c5fd; }
body[data-theme="dark"] .alert-success { background: #052e16; color: #86efac; }
body[data-theme="dark"] .alert-warning { background: #451a03; color: #fcd34d; }
body[data-theme="dark"] .alert-error { background: #450a0a; color: #fca5a5; }

/* ── V16. Focus ring (accessibility) ─────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── V17. Scroll-to-top button ───────────────────────────── */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #000; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 900;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: scale(1.1); }

/* ── V18. Table enhancements ─────────────────────────────── */
.data-table tbody tr:hover { background: rgba(99,102,241,.06); }
.data-table .cell-actions {
  opacity: 0; transition: opacity .15s;
}
.data-table tr:hover .cell-actions { opacity: 1; }
.data-table .sortable { cursor: pointer; user-select: none; }
.data-table .sortable::after { content: ' \2195'; color: var(--muted); font-size: 11px; }
.data-table .sorted-asc::after { content: ' \2191'; color: var(--accent); }
.data-table .sorted-desc::after { content: ' \2193'; color: var(--accent); }
.data-table .cell-truncate {
  max-width: 200px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ── V19. Stat card ──────────────────────────────────────── */
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stat-card-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--ink); }
.stat-card-delta { font-size: 13px; margin-top: 4px; }
.stat-card-delta.up { color: #16a34a; }
.stat-card-delta.down { color: #dc2626; }
.stat-card-delta.neutral { color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

/* ── V20. Sidebar improvements ───────────────────────────── */
.sidebar-section {
  padding: 8px 0; border-top: 1px solid var(--border);
}
.sidebar-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 6px 16px; font-weight: 600;
}
.sidebar-nav a { position: relative; transition: all .15s; }
.sidebar-nav a:hover {
  background: rgba(99,102,241,.08);
  transform: translateX(2px);
}
.sidebar-nav a.active {
  background: rgba(99,102,241,.12);
  font-weight: 600;
}

/* ── V21. Card hover & selection ─────────────────────────── */
.card-interactive {
  cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  border-color: var(--accent);
}
.card-selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}

/* ── V22. Dropdown menu ──────────────────────────────────── */
.dropdown {
  position: relative; display: inline-block;
}
.dropdown-menu {
  position: absolute; top: 100%; right: 0;
  min-width: 200px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  padding: 6px; z-index: 100; display: none;
}
.dropdown.open .dropdown-menu { display: block; animation: fadeIn .15s ease; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 8px; font-size: 14px;
  color: var(--ink); cursor: pointer; border: none;
  background: none; width: 100%; text-align: left;
  transition: background .1s;
}
.dropdown-item:hover { background: var(--panel); }
.dropdown-item-icon { font-size: 16px; width: 20px; text-align: center; }
.dropdown-divider {
  height: 1px; background: var(--border); margin: 4px 0;
}
.dropdown-item.danger { color: #dc2626; }
.dropdown-item.danger:hover { background: #fef2f2; }

/* ── V23. Progress ring ──────────────────────────────────── */
.progress-ring {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring circle {
  fill: none; stroke-width: 4; stroke-linecap: round;
  transition: stroke-dashoffset .5s ease;
}
.progress-ring .track { stroke: var(--border); }
.progress-ring .fill { stroke: var(--accent); }
.progress-ring-label {
  position: absolute; font-size: 12px; font-weight: 600;
}

/* ── V24. Timeline component ─────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 11px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -28px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--bg);
}
.timeline-item.active .timeline-dot {
  border-color: var(--accent); background: var(--accent);
}
.timeline-item.completed .timeline-dot {
  border-color: #16a34a; background: #16a34a;
}
.timeline-time { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.timeline-content { font-size: 14px; color: var(--ink); }
.timeline-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── V25. Tag/label system ───────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 500;
  background: var(--panel); color: var(--ink);
}
.tag-removable { padding-right: 4px; }
.tag-remove {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 14px; padding: 0 2px;
  line-height: 1;
}
.tag-remove:hover { color: #dc2626; }
.tag-input-wrap {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--card);
  min-height: 40px; align-items: center;
}
.tag-input {
  border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--ink); min-width: 80px; flex: 1;
}

/* ── V26. Keyboard shortcut hints ────────────────────────── */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 6px; min-width: 22px; height: 22px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 5px; font-size: 11px; font-weight: 600;
  font-family: monospace; color: var(--muted);
  box-shadow: 0 1px 0 var(--border);
}

/* ── V27. Kanban-free task status pipeline ────────────────── */
.status-pipeline {
  display: flex; align-items: center; gap: 2px;
}
.status-stage {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--border); transition: background .3s;
}
.status-stage.active { background: var(--accent); }
.status-stage.completed { background: #16a34a; }
.status-stage.error { background: #dc2626; }

/* ── V28. Resizable panels ───────────────────────────────── */
.resizable-handle {
  width: 6px; cursor: col-resize; background: transparent;
  position: relative; flex-shrink: 0;
  transition: background .15s;
}
.resizable-handle:hover { background: var(--accent); }
.resizable-handle::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 2px; height: 24px; background: var(--border);
  border-radius: 1px;
}

/* ── V29. Sticky header for tables ───────────────────────── */
.data-table thead th {
  position: sticky; top: 0; z-index: 5;
  background: var(--card);
  box-shadow: 0 1px 0 var(--border);
}

/* ── V30. Gradient accents ───────────────────────────────── */
.gradient-accent {
  background: linear-gradient(135deg, var(--accent), #a3b833);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-bar {
  height: 3px; background: linear-gradient(90deg, var(--accent), #a3b833, var(--accent));
  border-radius: 2px;
}

/* ── V31. Improved form layout ───────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; }
.form-row { display: flex; gap: 16px; }
.form-row > * { flex: 1; }
.form-section {
  border-top: 1px solid var(--border);
  padding-top: 20px; margin-top: 20px;
}
.form-section-title {
  font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--ink);
}
.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 20px; border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* ── V32. Truncated text with expand ─────────────────────── */
.text-truncate {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.text-clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.text-clamp-3 {
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* ── V33. Task card size variants ────────────────────────── */
.calendar-task-card.card-compact {
  padding: 6px 10px; font-size: 12px;
}
.calendar-task-card.card-detailed {
  padding: 14px; font-size: 14px;
}
.calendar-task-card.card-detailed .task-card-meta { display: block; }
.calendar-task-card.card-compact .task-card-meta { display: none; }

/* ── V34. Smooth page transitions ────────────────────────── */
.page-enter { animation: pageSlideIn .3s ease; }
@keyframes pageSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── V35. Hover card preview ─────────────────────────────── */
.hover-card {
  position: absolute; z-index: 200; width: 320px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
  animation: fadeIn .15s ease; pointer-events: auto;
}

/* ── V36. Calendar today highlight ───────────────────────── */
.calendar-today {
  background: rgba(99,102,241,.06) !important;
}
.calendar-today .calendar-day-header {
  border-bottom-color: var(--accent);
}
.calendar-today .calendar-date {
  background: var(--accent); color: #000; border-radius: 50%;
  width: 28px; height: 28px; display: flex;
  align-items: center; justify-content: center; font-weight: 700;
}

/* ── V37. Drag ghost enhancement ─────────────────────────── */
.calendar-task-card.dragging {
  opacity: .35; transform: scale(.98);
  box-shadow: none;
}
.calendar-day-tasks.drag-over {
  background: rgba(99,102,241,.08);
  border-radius: 10px;
}

/* ── V38. Color-coded role borders (enhanced) ────────────── */
.task-card[data-role="content"] { border-left: 3px solid #3b82f6; }
.task-card[data-role="design"] { border-left: 3px solid #a855f7; }
.task-card[data-role="campaign"] { border-left: 3px solid #f97316; }
.task-card[data-role="traffic"] { border-left: 3px solid #f97316; }
body[data-theme="dark"] .task-card[data-role="content"] { border-left-color: #60a5fa; }
body[data-theme="dark"] .task-card[data-role="design"] { border-left-color: #c084fc; }
body[data-theme="dark"] .task-card[data-role="campaign"] { border-left-color: #fb923c; }

/* ── V39. Collapsible sections ───────────────────────────── */
.collapsible-trigger {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.collapsible-arrow {
  font-size: 10px; transition: transform .2s;
}
.collapsible-trigger.open .collapsible-arrow { transform: rotate(90deg); }
.collapsible-body {
  overflow: hidden; max-height: 0;
  transition: max-height .3s ease, padding .3s ease;
}
.collapsible-trigger.open + .collapsible-body {
  max-height: 2000px;
}

/* ── V40. Number input with +/- buttons ──────────────────── */
.number-input {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden;
}
.number-input button {
  width: 36px; height: 36px; border: none;
  background: var(--panel); color: var(--ink);
  font-size: 16px; cursor: pointer;
  transition: background .15s;
}
.number-input button:hover { background: rgba(99,102,241,.15); }
.number-input input {
  width: 50px; text-align: center; border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: 14px; padding: 8px;
}

/* ── V41-V50. Typography scale ───────────────────────────── */
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-success { color: #16a34a; }
.text-danger { color: #dc2626; }
.text-warning { color: #d97706; }

/* ── V51-V60. Spacing utilities ──────────────────────────── */
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }
.p-0 { padding: 0; }
.p-sm { padding: 8px; }
.p-md { padding: 16px; }
.p-lg { padding: 24px; }
.m-0 { margin: 0; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

/* ── V61-V65. Flex utilities ─────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* ── V66-V70. Grid utilities ─────────────────────────────── */
/* NOTE: .grid layout class is at line ~387 with template-columns/gap/margin.
   Utility .u-grid is the reset-only version. Do NOT redefine .grid here. */
.u-grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* ── V71-V75. Border & radius utilities ──────────────────── */
.rounded-sm { border-radius: 6px; }
.rounded { border-radius: 10px; }
.rounded-lg { border-radius: 14px; }
.rounded-xl { border-radius: 18px; }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid var(--border); }
.border-accent { border-color: var(--accent); }
.border-none { border: none; }
.divide-y > * + * { border-top: 1px solid var(--border); }

/* ── V76-V80. Shadow utilities ───────────────────────────── */
.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.shadow { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.shadow-lg { box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.shadow-xl { box-shadow: 0 20px 50px rgba(0,0,0,.18); }

/* ── V81. Improved scrollbar ─────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── V82. Print styles ───────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, .toast-container, .notification-dropdown,
  .compact-toggle, .theme-toggle, .scroll-top { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .content { margin: 0 !important; padding: 20px !important; }
  .card, .panel { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}

/* ── V83. Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  /* Manter pulse suave nas tasks prontas para subir */
  .task-ready-to-launch {
    animation-duration: 4s !important;
  }
}

/* ── V84. High contrast mode ─────────────────────────────── */
@media (prefers-contrast: high) {
  :root {
    --border: #999; --muted: #444;
  }
  .btn { border-width: 2px; }
  .card, .panel { border-width: 2px; }
}

/* ── V85. Skeleton shimmer (enhanced) ────────────────────── */
.skeleton-text {
  height: 14px; width: 80%; border-radius: 4px;
  background: linear-gradient(90deg, var(--border) 25%, rgba(99,102,241,.1) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-heading {
  height: 22px; width: 50%; border-radius: 4px;
  background: linear-gradient(90deg, var(--border) 25%, rgba(99,102,241,.1) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-circle {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(90deg, var(--border) 25%, rgba(99,102,241,.1) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-button {
  height: 38px; width: 120px; border-radius: 8px;
  background: linear-gradient(90deg, var(--border) 25%, rgba(99,102,241,.1) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* ── V86. Calendar week header sticky ────────────────────── */
.calendar-grid { position: relative; }
.calendar-day-header {
  position: sticky; top: 0; z-index: 4;
  background: var(--bg);
}

/* ── V87. Mobile bottom nav (< 640px) ────────────────────── */
@media (max-width: 640px) {
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    height: auto; flex-direction: row; z-index: 100;
    border-top: 1px solid var(--border); border-right: none;
    padding: 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.1);
  }
  .sidebar-nav {
    display: flex; flex-direction: row; gap: 0; width: 100%;
    overflow-x: auto; padding: 0;
  }
  .sidebar-nav a {
    flex: 1; text-align: center; padding: 10px 4px;
    font-size: 10px; min-width: 60px; white-space: nowrap;
  }
  .sidebar-nav a::before { display: block; margin: 0 auto 2px; }
  .brand, .sidebar-footer, .current-page, .sidebar-toggle,
  .sidebar-section-title { display: none; }
  .content { padding-bottom: 64px; margin-left: 0 !important; }
  .app-shell { grid-template-columns: 1fr; }
}

/* ── V42. Typography: font-size scale ──────────────────────── */
.text-xs { font-size: 11px; } .text-sm { font-size: 13px; }
.text-base { font-size: 15px; } .text-lg { font-size: 18px; }
.text-xl { font-size: 22px; } .text-2xl { font-size: 28px; }
.text-3xl { font-size: 36px; }

/* ── V43. Font weights ─────────────────────────────────────── */
.font-normal { font-weight: 400; } .font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }

/* ── V44. Text alignment ───────────────────────────────────── */
.text-left { text-align: left; } .text-center { text-align: center; }
.text-right { text-align: right; }

/* ── V45. Text colors ──────────────────────────────────────── */
.text-muted { color: var(--muted); } .text-primary { color: var(--accent); }
.text-success { color: #16a34a; } .text-danger { color: #dc2626; }
.text-warning { color: #f59e0b; }

/* ── V46. Line heights ─────────────────────────────────────── */
.leading-tight { line-height: 1.25; } .leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.75; }

/* ── V47. Letter spacing ───────────────────────────────────── */
.tracking-tight { letter-spacing: -0.025em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.025em; }

/* ── V48. Text decoration ──────────────────────────────────── */
.underline { text-decoration: underline; }
.no-underline { text-decoration: none; }
.line-through { text-decoration: line-through; }

/* ── V49. Text transform ───────────────────────────────────── */
.uppercase { text-transform: uppercase; } .lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; } .normal-case { text-transform: none; }

/* ── V52. Spacing: margin utilities ────────────────────────── */
.m-0 { margin: 0; } .m-1 { margin: 4px; } .m-2 { margin: 8px; }
.m-3 { margin: 12px; } .m-4 { margin: 16px; } .m-6 { margin: 24px; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; } .mr-auto { margin-right: auto; } .mx-auto { margin-left: auto; margin-right: auto; }

/* ── V53. Spacing: padding utilities ───────────────────────── */
.p-0 { padding: 0; } .p-1 { padding: 4px; } .p-2 { padding: 8px; }
.p-3 { padding: 12px; } .p-4 { padding: 16px; } .p-6 { padding: 24px; }
.px-2 { padding-left: 8px; padding-right: 8px; } .px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; } .py-4 { padding-top: 16px; padding-bottom: 16px; }

/* ── V54. Gap utilities ────────────────────────────────────── */
.gap-0 { gap: 0; } .gap-1 { gap: 4px; } .gap-2 { gap: 8px; }
.gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }

/* ── V55. Width utilities ──────────────────────────────────── */
.w-full { width: 100%; } .w-auto { width: auto; }
.w-1\/2 { width: 50%; } .w-1\/3 { width: 33.333%; } .w-2\/3 { width: 66.666%; }
.max-w-sm { max-width: 24rem; } .max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; } .max-w-xl { max-width: 36rem; }

/* ── V56. Height utilities ─────────────────────────────────── */
.h-full { height: 100%; } .h-auto { height: auto; }
.h-screen { height: 100vh; } .min-h-screen { min-height: 100vh; }

/* ── V57. Display utilities ────────────────────────────────── */
/* NOTE: .hidden/.inline/.grid renamed .d-none/.d-inline/.d-grid to avoid
   conflicts with layout classes .hidden (V60), .inline (V408), .grid (V381) */
.d-none { display: none; } .block { display: block; }
.inline-block { display: inline-block; } .d-inline { display: inline; }
.flex { display: flex; } .inline-flex { display: inline-flex; }
.d-grid { display: grid; }

/* ── V58. Visibility ───────────────────────────────────────── */
.visible { visibility: visible; } .invisible { visibility: hidden; }

/* ── V59. Overflow ─────────────────────────────────────────── */
.overflow-auto { overflow: auto; } .overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; } .overflow-y-auto { overflow-y: auto; }

/* ── V62. Flex direction ───────────────────────────────────── */
.flex-row { flex-direction: row; } .flex-col { flex-direction: column; }
.flex-row-reverse { flex-direction: row-reverse; }

/* ── V63. Flex wrap & grow/shrink ──────────────────────────── */
.flex-wrap { flex-wrap: wrap; } .flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1 1 0%; } .flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; } .grow { flex-grow: 1; } .shrink-0 { flex-shrink: 0; }

/* ── V64. Justify & align ──────────────────────────────────── */
.justify-start { justify-content: flex-start; } .justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; } .justify-between { justify-content: space-between; }
.items-start { align-items: flex-start; } .items-center { align-items: center; }
.items-end { align-items: flex-end; } .items-stretch { align-items: stretch; }

/* ── V67. Grid columns ─────────────────────────────────────── */
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── V68. Grid span ────────────────────────────────────────── */
.col-span-1 { grid-column: span 1; } .col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; } .col-span-full { grid-column: 1 / -1; }

/* ── V69. Responsive grid ──────────────────────────────────── */
@media (max-width: 768px) {
  .md\:grid-cols-1 { grid-template-columns: 1fr; }
}
@media (min-width: 769px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ── V72. Border utilities ─────────────────────────────────── */
.border { border: 1px solid var(--border); }
.border-0 { border: 0; } .border-2 { border-width: 2px; }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-l { border-left: 1px solid var(--border); }

/* ── V73. Border radius utilities ──────────────────────────── */
.rounded-none { border-radius: 0; } .rounded-sm { border-radius: 4px; }
.rounded { border-radius: 8px; } .rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; } .rounded-full { border-radius: 9999px; }

/* ── V74. Border color ─────────────────────────────────────── */
.border-primary { border-color: var(--accent); }
.border-success { border-color: #16a34a; }
.border-danger { border-color: #dc2626; }
.border-warning { border-color: #f59e0b; }

/* ── V77. Shadow utilities ─────────────────────────────────── */
.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.shadow { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.shadow-md { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.shadow-lg { box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.shadow-xl { box-shadow: 0 16px 48px rgba(0,0,0,.15); }

/* ── V78. Opacity utilities ────────────────────────────────── */
.opacity-0 { opacity: 0; } .opacity-25 { opacity: .25; }
.opacity-50 { opacity: .5; } .opacity-75 { opacity: .75; }
.opacity-100 { opacity: 1; }

/* ── V79. Cursor utilities ─────────────────────────────────── */
.cursor-pointer { cursor: pointer; } .cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; } .cursor-grab { cursor: grab; }

/* ── V231. Selection color ──── */
::selection { background: rgba(99,102,241,.3); color: var(--ink); }

/* ── V232. Placeholder styling ──── */
::placeholder { color: var(--muted); opacity: .7; }
input:focus::placeholder { opacity: .4; }

/* ── V233. First letter ──── */
.first-letter-accent::first-letter { font-size: 2em; font-weight: 700; color: var(--accent); float: left; margin-right: 4px; }

/* ── V234. First line ──── */
.first-line-bold::first-line { font-weight: 600; }

/* ── V235. Text indent ──── */
.text-indent-1 { text-indent: 1em; }
.text-indent-2 { text-indent: 2em; }

/* ── V236. Column gap ──── */
.columns-gap-sm { column-gap: 12px; }
.columns-gap-lg { column-gap: 32px; }

/* ── V237. Text shadow ──── */
.text-shadow-sm { text-shadow: 0 1px 2px rgba(0,0,0,.1); }
.text-shadow { text-shadow: 0 2px 4px rgba(0,0,0,.15); }
.text-shadow-lg { text-shadow: 0 4px 8px rgba(0,0,0,.2); }

/* ── V238. Link styles ──── */
.link-subtle { color: inherit; text-decoration: underline; text-decoration-color: var(--border); }
.link-subtle:hover { text-decoration-color: var(--accent); }
.link-bold { color: var(--accent); font-weight: 600; text-decoration: none; }
.link-bold:hover { text-decoration: underline; }

/* ── V239. Abbreviation ──── */
.abbr { border-bottom: 1px dotted var(--muted); cursor: help; }

/* ── V240. Reading progress ──── */
.reading-progress { position: fixed; top: 0; left: 0; height: 2px; background: linear-gradient(to right, var(--accent), #3b82f6); z-index: 9999; }

/* ── V241. Calendar slot sizes ──── */
.calendar-slot-compact .calendar-task { padding: 4px 6px; font-size: 11px; }
.calendar-slot-comfortable .calendar-task { padding: 8px; font-size: 13px; }
.calendar-slot-spacious .calendar-task { padding: 12px; font-size: 14px; min-height: 60px; }

/* ── V242. Calendar role colors ──── */
.calendar-task[data-role="content"] { border-left: 3px solid #3b82f6; }
.calendar-task[data-role="design"] { border-left: 3px solid #8b5cf6; }
.calendar-task[data-role="traffic"] { border-left: 3px solid #f97316; }
.calendar-task[data-role="campaign"] { border-left: 3px solid #ec4899; }

/* ── V243. Calendar mini-month ──── */
.calendar-mini { font-size: 11px; text-align: center; }
.calendar-mini td { padding: 2px; width: 24px; height: 24px; }
.calendar-mini td.today { background: var(--accent); color: #000; border-radius: 9999px; font-weight: 700; }
.calendar-mini th { font-size: 10px; color: var(--muted); font-weight: 400; }

/* ── V244. Calendar today pulse ──── */
.calendar-day.today { position: relative; }
.calendar-day.today::before { content: ''; position: absolute; inset: 0; border: 2px solid var(--accent); border-radius: var(--radius); opacity: .5; animation: today-pulse 2s infinite; }
@keyframes today-pulse { 0%,100% { opacity: .3; } 50% { opacity: .8; } }

/* ── V245. Calendar overdue ──── */
.calendar-task.overdue { background: #fef2f2; border-color: #dc2626; }
.calendar-task.overdue { position: relative; }
.calendar-task.overdue::after { content: '!'; position: absolute; top: 4px; right: 6px; color: #dc2626; font-weight: 700; font-size: 11px; }

/* ── V246. Calendar deadline approaching ──── */
.calendar-task.deadline-soon { border-color: #f59e0b; background: #fffbeb; }
body[data-theme="dark"] .calendar-task.deadline-soon { background: #332b00; border-color: #f59e0b; }

/* ── V247. Calendar priority indicators ──── */
.calendar-task.priority-critical { border-left: 3px solid #dc2626; }
.calendar-task.priority-high { border-left: 3px solid #f97316; }
.calendar-task.priority-medium { border-left: 3px solid #3b82f6; }
.calendar-task.priority-low { border-left: 3px solid #6b7280; }

/* ── V248. Calendar dependency arrows ──── */
.dependency-arrow { stroke: var(--muted); stroke-width: 1.5; fill: none; marker-end: url(#arrowhead); }
.dependency-arrow.critical { stroke: #dc2626; }

/* ── V249. Calendar avatar in task ──── */
.calendar-task-avatar { width: 20px; height: 20px; border-radius: 9999px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #000; flex-shrink: 0; }

/* ── V250. Calendar print ──── */
@media print {
  .calendar-grid { break-inside: avoid; }
  .calendar-task { border: 1px solid #ddd; font-size: 10px; padding: 4px; }
  .calendar-day-header { background: #f5f5f5; font-weight: 700; }
}

/* ── V251. Squad card ──── */
.squad-card { border-left: 4px solid var(--accent); padding: 16px; border-radius: var(--radius-lg); background: var(--card); }
.squad-card-name { font-size: 16px; font-weight: 600; }
.squad-card-meta { font-size: 13px; color: var(--muted); }

/* ── V252. Squad health ──── */
.squad-health { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.squad-health-dot { width: 10px; height: 10px; border-radius: 9999px; }
.squad-health-good .squad-health-dot { background: #16a34a; }
.squad-health-warning .squad-health-dot { background: #f59e0b; }
.squad-health-critical .squad-health-dot { background: #dc2626; }

/* ── V253. Pattern card ──── */
.pattern-card { display: flex; gap: 12px; align-items: flex-start; }
.pattern-card-icon { width: 40px; height: 40px; border-radius: var(--radius); background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }

/* ── V254. Flow card ──── */
.flow-card { position: relative; overflow: hidden; }
.flow-card-progress { position: absolute; bottom: 0; left: 0; height: 3px; background: var(--accent); transition: width .3s; }

/* ── V255. Sheet source card ──── */
.sheet-card { display: flex; gap: 12px; padding: 12px; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); }
.sheet-card-icon { font-size: 20px; color: #16a34a; }

/* ── V256. Run status card ──── */
.run-card { padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.run-card.run-done { border-left: 4px solid #16a34a; }
.run-card.run-error { border-left: 4px solid #dc2626; }
.run-card.run-running { border-left: 4px solid #f59e0b; }

/* ── V257. Notification types ──── */
.notif-task_done { background: #f0fdf4; border-left: 3px solid #16a34a; }
.notif-task_overdue { background: #fef2f2; border-left: 3px solid #dc2626; }
.notif-sync_complete { background: #eff6ff; border-left: 3px solid #3b82f6; }
.notif-warning { background: #fffbeb; border-left: 3px solid #f59e0b; }

/* ── V258. Metric animation ──── */
.metric-animated { transition: all .6s ease; }
.metric-animated .kpi-value { animation: countUp .8s ease-out; }

/* ── V259. Dashboard grid responsive ──── */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
@media (max-width: 640px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ── V260. Chart placeholder ──── */
.chart-placeholder { height: 200px; background: var(--surface-2); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--border); }

/* ── V261. Sync indicator ──── */
.sync-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.sync-indicator.syncing { color: var(--color-warning); }
.sync-indicator.synced { color: var(--color-success); }
.sync-indicator.error { color: var(--color-error); }
.sync-indicator-dot { width: 8px; height: 8px; border-radius: 9999px; }
.sync-indicator.syncing .sync-indicator-dot { animation: pulse-anim 1s infinite; }

/* ── V262. Retry queue item ──── */
.retry-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid var(--border); }
.retry-item.pending { border-left: 3px solid #f59e0b; }
.retry-item.failed { border-left: 3px solid #dc2626; }
.retry-item.done { border-left: 3px solid #16a34a; }

/* ── V263. Webhook item ──── */
.webhook-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.webhook-item.disabled { opacity: .6; }

/* ── V264. API key item ──── */
.api-key-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: var(--surface-2); border-radius: var(--radius); margin-bottom: 8px; }
.api-key-item .key-name { font-weight: 600; }
.api-key-item .key-perms { font-size: 12px; color: var(--muted); }

/* ── V265. Automation rule card ──── */
.automation-rule-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.automation-rule-card.active { border-left: 3px solid var(--accent); }
.rule-trigger { font-size: 12px; background: var(--surface-3); padding: 2px 6px; border-radius: var(--radius-sm); }
.rule-action { font-size: 12px; background: var(--accent-soft); padding: 2px 6px; border-radius: var(--radius-sm); }

/* ── V266. Subtask checklist ──── */
.subtask-list { display: grid; gap: 4px; }
.subtask-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius); }
.subtask-item:hover { background: var(--surface-2); }
.subtask-item.done .subtask-label { text-decoration: line-through; color: var(--muted); }

/* ── V267. Tag input ──── */
.tag-input-container { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-lg); min-height: 40px; align-items: center; }
.tag-input-container:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.tag-input-field { border: none; outline: none; flex: 1; min-width: 80px; padding: 4px; font-size: 14px; background: transparent; }

/* ── V268. Dependency graph ──── */
.dep-graph-container { position: relative; min-height: 200px; }
.dep-node { position: absolute; padding: 8px 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.dep-node.blocked { border-color: #dc2626; background: #fef2f2; }

/* ── V269. Person load bar ──── */
.person-load { display: flex; align-items: center; gap: 12px; }
.person-load-bar { flex: 1; height: 8px; border-radius: 9999px; background: var(--surface-3); overflow: hidden; }
.person-load-fill { height: 100%; border-radius: 9999px; transition: width .3s; }
.person-load-fill.light { background: #22c55e; }
.person-load-fill.moderate { background: #f59e0b; }
.person-load-fill.heavy { background: #dc2626; }

/* ── V270. Weekly report card ──── */
.weekly-report-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.weekly-report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.weekly-report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ── V271. Number input spinner ──── */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { height: auto; }
.number-input-styled { display: flex; border: 1px solid var(--border); border-radius: var(--radius); }
.number-input-styled input { border: none; text-align: center; width: 60px; }
.number-input-btn { width: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: var(--surface-2); }

/* ── V272. Select arrow ──── */
select.select-styled { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23525252' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ── V273. Textarea auto-grow ──── */
.textarea-auto { position: relative; }
.textarea-auto::after { content: attr(data-value); white-space: pre-wrap; visibility: hidden; }
.textarea-auto textarea { position: absolute; inset: 0; resize: none; }

/* ── V274. Date input ──── */
input[type="date"].date-styled { font-family: inherit; }
input[type="date"].date-styled::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
input[type="date"].date-styled::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ── V275. Time input ──── */
input[type="time"].time-styled { font-family: inherit; padding: 10px 12px; }

/* ── V276. Search clearable ──── */
.search-clearable { position: relative; }
.search-clearable input { padding-right: 36px; }
.search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--muted); font-size: 18px; }
.search-clear:hover { color: var(--ink); }

/* ── V277. Editable hover ──── */
.editable-hover { padding: 4px 8px; border-radius: var(--radius); border: 1px solid transparent; }
.editable-hover:hover { border-color: var(--border); background: var(--surface-2); }
.editable-hover.editing { border-color: var(--accent); }

/* ── V278. Drag ghost enhanced ──── */
.drag-ghost { opacity: .8; transform: rotate(2deg); box-shadow: 0 8px 24px rgba(0,0,0,.15); z-index: 1000; }

/* ── V279. Sortable list ──── */
.sortable-list { display: grid; gap: 4px; }
.sortable-item { padding: 8px 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); cursor: grab; }
.sortable-item.dragging { opacity: .4; border-style: dashed; }
.sortable-placeholder { border: 2px dashed var(--accent); background: var(--accent-soft); border-radius: var(--radius); }

/* ── V280. Multi-select tags ──── */
.multi-select { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); min-height: 42px; }
.multi-select-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); padding: 2px 8px; border-radius: 9999px; font-size: 13px; }
.multi-select-tag-remove { cursor: pointer; opacity: .6; font-size: 14px; }
.multi-select-tag-remove:hover { opacity: 1; }

/* ── V281. Responsive table cards ──── */
@media (max-width: 640px) {
  .table-card-view thead { display: none; }
  .table-card-view tbody tr { display: block; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; padding: 12px; }
  .table-card-view td { display: flex; justify-content: space-between; padding: 4px 0; }
  .table-card-view td::before { content: attr(data-label); font-weight: 600; font-size: 13px; }
}

/* ── V282. Responsive form ──── */
@media (max-width: 640px) {
  .form-row-responsive { display: flex; flex-direction: column; gap: 12px; }
  .form-row-responsive > * { width: 100%; }
}

/* ── V283. Safe area ──── */
.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom); }
.safe-area-top { padding-top: env(safe-area-inset-top); }

/* ── V284. Touch targets ──── */
@media (pointer: coarse) {
  .btn, .tab, .nav-pill, .quick-action { min-height: 44px; min-width: 44px; }
  a { padding: 4px; }
}

/* ── V285. Scroll snap ──── */
.snap-x { scroll-snap-type: x mandatory; overflow-x: auto; }
.snap-y { scroll-snap-type: y mandatory; overflow-y: auto; }
.snap-start { scroll-snap-align: start; }
.snap-center { scroll-snap-align: center; }

/* ── V286. Smooth scroll ──── */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── V287. Print report ──── */
@media print {
  .report-page { break-after: page; }
  .report-header { margin-bottom: 24px; }
  .report-table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .report-table th, .report-table td { border: 1px solid #ddd; padding: 6px; }
}

/* ── V288. Print hide ──── */
@media print { .no-print { display: none !important; } }
.print-only { display: none; }
@media print { .print-only { display: block; } }

/* ── V289. Screen reader ──── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── V290. Reduced data ──── */
@media (prefers-reduced-data: reduce) {
  .bg-mesh, .bg-dots, .bg-striped { background: var(--bg); }
  img { loading: lazy; }
}

/* ── V291. Prefers scheme ──── */
@media (prefers-color-scheme: dark) {
  body:not([data-theme]) { --bg: #0f0f0f; --ink: #fff; --card: #1e1e1e; --panel: #171717; --border: #2f2f2f; }
}

/* ── V292. Container queries ──── */
@container (min-width: 400px) { .container-aware-grid { grid-template-columns: repeat(2, 1fr); } }
@container (min-width: 700px) { .container-aware-grid { grid-template-columns: repeat(3, 1fr); } }

/* ── V293. Logical properties ──── */
.p-inline-2 { padding-inline: 8px; }
.p-block-2 { padding-block: 8px; }
.m-inline-auto { margin-inline: auto; }
.border-block { border-block: 1px solid var(--border); }

/* ── V294. Writing mode ──── */
.writing-vertical { writing-mode: vertical-rl; }
.writing-sideways { writing-mode: sideways-rl; }

/* ── V295. Error page ──── */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; }
.error-page-code { font-size: 72px; font-weight: 700; color: var(--accent); }
.error-page-message { font-size: 18px; color: var(--muted); margin-top: 8px; }

/* ── V296. Maintenance page ──── */
.maintenance-page { text-align: center; padding: 60px 20px; }
.maintenance-icon { font-size: 64px; margin-bottom: 16px; }
.maintenance-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.maintenance-text { color: var(--muted); font-size: 16px; }

/* ── V297. Onboarding overlay ──── */
.onboarding-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 10000; }
.onboarding-spotlight { position: absolute; border-radius: var(--radius-lg); box-shadow: 0 0 0 9999px rgba(0,0,0,.5); }
.onboarding-tooltip { position: absolute; background: var(--card); padding: 16px; border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); max-width: 320px; z-index: 10001; }

/* ── V298. Feature tour ──── */
.tour-step { position: relative; }
.tour-step.active { outline: 2px solid var(--accent); outline-offset: 4px; }
.tour-popover { position: absolute; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-xl); z-index: 10000; }
.tour-popover-arrow { width: 12px; height: 12px; background: var(--card); border: 1px solid var(--border); transform: rotate(45deg); position: absolute; }

/* ── V299. Changelog ──── */
.changelog-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.changelog-date { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.changelog-title { font-size: 16px; font-weight: 600; }
.changelog-type { display: inline-block; padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
.changelog-type.feature { background: #eff6ff; color: #3b82f6; }
.changelog-type.fix { background: #fef2f2; color: #dc2626; }
.changelog-type.improvement { background: #f0fdf4; color: #16a34a; }

/* ── V300. Version badge ──── */
.version-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--surface-3); border-radius: 9999px; font-size: 11px; font-weight: 500; }
.version-badge-dot { width: 6px; height: 6px; border-radius: 9999px; background: #16a34a; }
.version-badge-beta .version-badge-dot { background: #f59e0b; }

/* ── V88. Card sizes ──────────────────────────────────────── */
.card-sm { padding: 12px; border-radius: 12px; }
.card-lg { padding: 32px; border-radius: 18px; }
.card-xl { padding: 40px; border-radius: 20px; min-height: 300px; }

/* ── V89. Button sizes ────────────────────────────────────── */
.btn-xs { padding: 4px 8px; font-size: 11px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-xl { padding: 18px 32px; font-size: 18px; }

/* ── V90. Button variants ─────────────────────────────────── */
.btn-success { background: #16a34a; color: #fff; }
.btn-warning { background: #f59e0b; color: #000; }
.btn-info { background: #3b82f6; color: #fff; }
.btn-ghost { background: transparent; border: none; }
.btn-outline { background: transparent; border: 2px solid var(--accent); color: var(--ink); }

/* ── V91. Button group ────────────────────────────────────── */
.btn-group { display: flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group-vertical { display: flex; flex-direction: column; }

/* ── V92. Button loading ──────────────────────────────────── */
.btn-loading { position: relative; color: transparent; pointer-events: none; }
.btn-loading::after { content: ''; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; }

/* ── V93. Input sizes ─────────────────────────────────────── */
.input-sm { padding: 6px 10px; font-size: 13px; }
.input-lg { padding: 14px 16px; font-size: 16px; }

/* ── V94. Input group ─────────────────────────────────────── */
.input-group { display: flex; }
.input-group-prepend, .input-group-append { padding: 8px 12px; background: var(--border); border: 1px solid var(--border); display: flex; align-items: center; font-size: 14px; }
.input-group-prepend { border-radius: 8px 0 0 8px; border-right: none; }
.input-group-append { border-radius: 0 8px 8px 0; border-left: none; }
.input-group input { border-radius: 0; flex: 1; }

/* ── V95. Floating labels ─────────────────────────────────── */
.form-floating { position: relative; }
.form-floating label { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); font-size: 14px; color: var(--muted); pointer-events: none; transition: all .2s; }
.form-floating input:focus ~ label, .form-floating input:not(:placeholder-shown) ~ label { transform: translateY(-20px); font-size: 11px; background: var(--panel); padding: 0 4px; }

/* ── V96. Character counter ───────────────────────────────── */
.char-counter { text-align: right; font-size: 12px; color: var(--muted); }
.char-counter.warning { color: #f59e0b; }
.char-counter.danger { color: #dc2626; }

/* ── V97. File upload zone ────────────────────────────────── */
.upload-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 40px; text-align: center; transition: all .2s; cursor: pointer; }
.upload-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }

/* ── V98. Color swatch ────────────────────────────────────── */
.color-swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); display: inline-block; cursor: pointer; }
.color-swatch-lg { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--border); display: inline-block; cursor: pointer; }

/* ── V99. Range slider ────────────────────────────────────── */
.range-styled { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: var(--border); width: 100%; outline: none; }
.range-styled::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); cursor: pointer; }
.range-styled::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); cursor: pointer; border: none; }

/* ── V100. Star rating ────────────────────────────────────── */
.star-rating { display: inline-flex; gap: 2px; }
.star { font-size: 24px; color: var(--border); cursor: pointer; transition: color .15s; }
.star.active { color: #f59e0b; }
.star:hover { color: #fbbf24; }

/* ── V101. Masonry grid ───────────────────────────────────── */
.masonry-grid { columns: 3; gap: 16px; }
.masonry-grid > * { break-inside: avoid; margin-bottom: 16px; }

/* ── V102. Split pane ─────────────────────────────────────── */
.split-pane { display: flex; height: 100%; }
.split-left, .split-right { flex: 1; overflow: auto; }
.split-divider { width: 4px; background: var(--border); cursor: col-resize; flex-shrink: 0; }

/* ── V103. Full bleed ─────────────────────────────────────── */
.full-bleed { width: 100vw; margin-left: calc(-50vw + 50%); }

/* ── V104. Sticky footer ──────────────────────────────────── */
.sticky-footer-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.sticky-footer-wrap > .content { flex: 1; }

/* ── V105. Layout sidebar ─────────────────────────────────── */
.layout-sidebar { display: grid; grid-template-columns: 280px 1fr; gap: 24px; }

/* ── V106. Container sizes ────────────────────────────────── */
.container-xs { max-width: 480px; margin-left: auto; margin-right: auto; }
.container-sm { max-width: 640px; margin-left: auto; margin-right: auto; }
.container-md { max-width: 768px; margin-left: auto; margin-right: auto; }
.container-lg { max-width: 1024px; margin-left: auto; margin-right: auto; }
.container-xl { max-width: 1280px; margin-left: auto; margin-right: auto; }

/* ── V107. Aspect ratio ───────────────────────────────────── */
.aspect-16-9 { aspect-ratio: 16 / 9; }
.aspect-4-3 { aspect-ratio: 4 / 3; }
.aspect-1-1 { aspect-ratio: 1; }

/* ── V108. Media object ───────────────────────────────────── */
.media { display: flex; gap: 16px; }
.media-img { flex-shrink: 0; }
.media-body { flex: 1; min-width: 0; }

/* ── V109. Centering ──────────────────────────────────────── */
.center-absolute { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.center-flex { display: flex; align-items: center; justify-content: center; }

/* ── V110. Z-index scale ──────────────────────────────────── */
:root { --z-dropdown: 100; --z-sticky: 200; --z-fixed: 300; --z-modal: 400; --z-toast: 500; }

/* ── V111. Responsive visibility ─────────────────────────── */
.show-md { display: none; }
@media (min-width: 769px) { .show-md { display: block; } .hide-md { display: none; } }
.show-lg { display: none; }
@media (min-width: 1025px) { .show-lg { display: block; } .hide-lg { display: none; } }

/* ── V112. Responsive spacing ────────────────────────────── */
@media (min-width: 769px) { .md\:p-4 { padding: 16px; } .md\:p-6 { padding: 24px; } .md\:m-4 { margin: 16px; } }

/* ── V113. Responsive text ───────────────────────────────── */
@media (min-width: 769px) { .md\:text-lg { font-size: 18px; } }
@media (min-width: 1025px) { .lg\:text-xl { font-size: 22px; } .lg\:text-2xl { font-size: 28px; } }

/* ── V114. Responsive flex ───────────────────────────────── */
@media (min-width: 769px) { .md\:flex-row { flex-direction: row; } .md\:flex-col { flex-direction: column; } }

/* ── V115. Container queries ─────────────────────────────── */
@container sidebar (min-width: 300px) { .sidebar-content { display: grid; } }

/* ── V116. Table striped ──────────────────────────────────── */
.table-striped tbody tr:nth-child(even) { background: rgba(0, 0, 0, .02); }

/* ── V117. Table hover ────────────────────────────────────── */
.table-hover tbody tr { transition: background .15s; }
.table-hover tbody tr:hover { background: var(--accent-soft); }

/* ── V118. Table compact ──────────────────────────────────── */
.table-compact td, .table-compact th { padding: 6px 8px; font-size: 13px; }

/* ── V119. Table bordered ─────────────────────────────────── */
.table-bordered td, .table-bordered th { border: 1px solid var(--border); }

/* ── V120. Table responsive ───────────────────────────────── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── V121. Sortable columns ───────────────────────────────── */
.th-sortable { cursor: pointer; user-select: none; }
.th-sortable::after { content: ' \2195'; opacity: .3; }
.th-sortable.asc::after { content: ' \2191'; opacity: 1; }
.th-sortable.desc::after { content: ' \2193'; opacity: 1; }

/* ── V122. Expandable row ─────────────────────────────────── */
.tr-expandable { cursor: pointer; }
.tr-expandable-content { display: none; }
.tr-expandable.open + .tr-expandable-content { display: table-row; }

/* ── V123. Cell status ────────────────────────────────────── */
.cell-status { display: flex; align-items: center; gap: 6px; }
.cell-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cell-status-dot.green { background: #16a34a; }
.cell-status-dot.red { background: #dc2626; }
.cell-status-dot.yellow { background: #f59e0b; }

/* ── V124. Table selectable ───────────────────────────────── */
.table-selectable tbody tr { cursor: pointer; }
.table-selectable tr.selected { background: var(--accent-soft); border-left: 3px solid var(--accent); }

/* ── V125. KPI card ───────────────────────────────────────── */
.kpi-card { padding: 20px; border-radius: var(--radius); text-align: center; }
.kpi-value { font-size: 32px; font-weight: 700; line-height: 1; }
.kpi-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi-trend { font-size: 14px; font-weight: 600; margin-top: 6px; }

/* ── V126. KPI variants ───────────────────────────────────── */
.kpi-success .kpi-trend { color: #16a34a; }
.kpi-danger .kpi-trend { color: #dc2626; }
.kpi-warning .kpi-trend { color: #f59e0b; }

/* ── V127. Mini chart ─────────────────────────────────────── */
.mini-chart { height: 40px; width: 100px; display: inline-block; background: linear-gradient(to right, var(--accent-soft), var(--accent)); border-radius: 4px; }

/* ── V128. Comparison ─────────────────────────────────────── */
.compare-up { color: #16a34a; }
.compare-up::before { content: '\25b2 '; }
.compare-down { color: #dc2626; }
.compare-down::before { content: '\25bc '; }
.compare-neutral { color: var(--muted); }
.compare-neutral::before { content: '\25cf '; }

/* ── V129. Percentage bar ─────────────────────────────────── */
.pct-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.pct-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s ease; }

/* ── V130. Data list ──────────────────────────────────────── */
.data-list { display: grid; gap: 8px; }
.data-list dt { font-size: 13px; color: var(--muted); }
.data-list dd { font-size: 15px; font-weight: 600; margin: 0; }

/* ── V131. Definition card ────────────────────────────────── */
.def-card { border-left: 4px solid var(--accent); padding-left: 16px; }

/* ── V132. Code block ─────────────────────────────────────── */
.code-block { background: #1e1e1e; color: #d4d4d4; padding: 16px; border-radius: 8px; font-family: monospace; overflow-x: auto; font-size: 13px; }

/* ── V133. Log viewer ─────────────────────────────────────── */
.log-viewer { background: #0f0f0f; color: #a3e635; font-family: monospace; padding: 16px; border-radius: 8px; max-height: 400px; overflow-y: auto; font-size: 12px; }
.log-line { padding: 2px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.log-line-number { color: #525252; margin-right: 12px; }

/* ── V134. JSON tree ──────────────────────────────────────── */
.json-tree { font-family: monospace; font-size: 13px; }
.json-key { color: #9cdcfe; }
.json-string { color: #ce9178; }
.json-number { color: #b5cea8; }
.json-bool { color: #569cd6; }
.json-null { color: #808080; }

/* ── V135. Empty state sizes ──────────────────────────────── */
.empty-state-sm { padding: 20px; }
.empty-state-lg { padding: 60px; }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }

/* ── V136. Breadcrumb ─────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; list-style: none; margin: 0; padding: 0; }
.breadcrumb-item { color: var(--muted); }
.breadcrumb-item + .breadcrumb-item::before { content: '/'; color: var(--border); margin-right: 8px; }
.breadcrumb-item.active { color: var(--ink); font-weight: 600; }

/* ── V137. Vertical tabs ──────────────────────────────────── */
.tabs-vertical { flex-direction: column; border-bottom: none; border-right: 2px solid var(--border); }
.tabs-vertical .tab { text-align: left; }
.tabs-vertical .tab.active::after { bottom: auto; right: -2px; top: 0; height: 100%; width: 2px; }

/* ── V138. Nav pills ──────────────────────────────────────── */
.nav-pills { display: flex; gap: 4px; }
.nav-pill { padding: 8px 16px; border-radius: 9999px; font-size: 14px; background: transparent; border: none; cursor: pointer; color: var(--ink); transition: all .2s; }
.nav-pill.active { background: var(--accent); color: #000; font-weight: 600; }

/* ── V139. Mega menu ──────────────────────────────────────── */
.mega-menu { position: absolute; top: 100%; left: 0; right: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,.15); padding: 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; z-index: var(--z-dropdown); }

/* ── V140. Context menu ───────────────────────────────────── */
.context-menu { position: fixed; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,.15); min-width: 180px; z-index: 1000; padding: 4px; }
.context-menu-item { padding: 8px 12px; font-size: 14px; cursor: pointer; border-radius: 8px; }
.context-menu-item:hover { background: var(--accent-soft); }

/* ── V141. Command palette ────────────────────────────────── */
.command-palette { position: fixed; top: 20%; left: 50%; transform: translateX(-50%); width: min(600px, 90vw); background: var(--panel); border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.2); border: 1px solid var(--border); z-index: 1000; overflow: hidden; }
.command-palette-input { padding: 16px; border: none; width: 100%; font-size: 16px; background: transparent; color: var(--ink); outline: none; }

/* ── V142. Side panel ─────────────────────────────────────── */
.side-panel { position: fixed; top: 0; right: -400px; width: 400px; height: 100vh; background: var(--panel); box-shadow: -8px 0 32px rgba(0,0,0,.15); transition: right .3s ease; z-index: var(--z-fixed); overflow-y: auto; }
.side-panel.open { right: 0; }
.side-panel-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: calc(var(--z-fixed) - 1); }

/* ── V143. Bottom sheet ───────────────────────────────────── */
.bottom-sheet { position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 32px rgba(0,0,0,.15); transform: translateY(100%); transition: transform .3s ease; z-index: var(--z-fixed); }
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 8px auto; }

/* ── V144. FAB ────────────────────────────────────────────── */
.fab { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #000; box-shadow: 0 8px 24px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; font-size: 24px; z-index: 100; cursor: pointer; border: none; transition: transform .2s; }
.fab:hover { transform: scale(1.1); }

/* ── V145. Speed dial ─────────────────────────────────────── */
.speed-dial { position: fixed; bottom: 24px; right: 24px; z-index: 100; }
.speed-dial-actions { display: flex; flex-direction: column-reverse; gap: 8px; opacity: 0; transform: scale(.8); transition: all .2s; pointer-events: none; }
.speed-dial.open .speed-dial-actions { opacity: 1; transform: scale(1); pointer-events: auto; }

/* ── V146. Scroll spy ─────────────────────────────────────── */
.scrollspy-active { font-weight: 700; color: var(--accent); }

/* ── V147. Page dots ──────────────────────────────────────── */
.page-dots { display: flex; gap: 8px; justify-content: center; }
.page-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); cursor: pointer; transition: all .2s; }
.page-dot.active { background: var(--accent); transform: scale(1.3); }

/* ── V148. Wizard ─────────────────────────────────────────── */
.wizard { display: flex; gap: 0; }
.wizard-step { flex: 1; text-align: center; position: relative; padding: 16px; }
.wizard-step::before { content: ''; position: absolute; top: 28px; left: 0; right: 0; height: 2px; background: var(--border); z-index: 0; }
.wizard-step.completed::before { background: var(--accent); }
.wizard-step-number { width: 32px; height: 32px; border-radius: 50%; background: var(--card); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; position: relative; z-index: 1; margin: 0 auto 8px; }
.wizard-step.completed .wizard-step-number { background: var(--accent); border-color: var(--accent); color: #000; }

/* ── V149. Tree nav ───────────────────────────────────────── */
.tree-nav { padding-left: 16px; }
.tree-nav-item { padding: 6px 8px; cursor: pointer; border-radius: 6px; font-size: 14px; }
.tree-nav-item:hover { background: var(--accent-soft); }
.tree-nav-item.active { font-weight: 600; color: var(--accent); }
.tree-nav-children { padding-left: 16px; border-left: 1px solid var(--border); }

/* ── V150. Icon nav ───────────────────────────────────────── */
.icon-nav { display: flex; gap: 4px; }
.icon-nav-item { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; font-size: 18px; transition: all .2s; }
.icon-nav-item:hover { background: var(--accent-soft); }
.icon-nav-item.active { background: var(--accent); color: #000; }

/* ── V151. Quick actions ──────────────────────────────────── */
.quick-actions { display: flex; gap: 8px; padding: 8px; background: var(--card); border-radius: 10px; border: 1px solid var(--border); }
.quick-action { padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; background: transparent; border: 1px solid var(--border); color: var(--ink); transition: all .2s; }
.quick-action:hover { background: var(--accent-soft); }

/* ── V152. Secondary toolbar ──────────────────────────────── */
.toolbar-secondary { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; }

/* ── V153. Sticky action bar ──────────────────────────────── */
.action-bar-sticky { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--border); padding: 12px 16px; display: flex; justify-content: flex-end; gap: 8px; z-index: 50; box-shadow: 0 -4px 16px rgba(0,0,0,.08); }

/* ── V154. Notification dot ───────────────────────────────── */
.notif-dot { width: 8px; height: 8px; background: #dc2626; border-radius: 50%; position: absolute; top: -2px; right: -2px; }
.notif-dot.pulse { animation: pulse-dot 1.5s infinite; }
@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .4); } 70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }

/* ── V155. Badge counter ──────────────────────────────────── */
.badge-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 9999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; }
.badge-count.bounce { animation: badge-bounce .4s; }
@keyframes badge-bounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }

/* ── V156. Skeleton paragraph ─────────────────────────────── */
.skeleton-paragraph { display: grid; gap: 8px; }
.skeleton-paragraph .skeleton-line { height: 12px; border-radius: 4px; background: var(--border); animation: shimmer 1.5s infinite; }
.skeleton-paragraph .skeleton-line:last-child { width: 60%; }

/* ── V157. Skeleton table ─────────────────────────────────── */
.skeleton-table { width: 100%; }
.skeleton-table-row { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.skeleton-table-cell { flex: 1; height: 14px; border-radius: 4px; background: var(--border); animation: shimmer 1.5s infinite; }

/* ── V158. Skeleton card ──────────────────────────────────── */
.skeleton-card { padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); }
.skeleton-card-img { height: 120px; border-radius: 8px; background: var(--border); margin-bottom: 12px; animation: shimmer 1.5s infinite; }
.skeleton-card-title { height: 18px; width: 70%; border-radius: 4px; background: var(--border); margin-bottom: 8px; animation: shimmer 1.5s infinite; }


/* ── V159. Content placeholder ────────────────────────────── */
.placeholder-shimmer {
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,.3) 50%, var(--border) 75%);
  background-size: 200%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── V160. Loading bar top ─────────────────────────────────── */
.loading-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 9999;
  transition: width .3s;
}
.loading-bar.active { animation: loading-bar-progress 2s ease infinite; }
@keyframes loading-bar-progress {
  0%   { width: 0; }
  50%  { width: 70%; }
  100% { width: 100%; }
}

/* ── V161. Progress steps ──────────────────────────────────── */
.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
}
.progress-step {
  text-align: center;
  flex: 1;
}
.progress-step.completed .progress-step-circle {
  background: var(--accent);
  border-color: var(--accent);
}
.progress-step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: var(--card);
  position: relative;
  z-index: 1;
}

/* ── V162. Circular progress ───────────────────────────────── */
.circular-progress {
  width: 60px; height: 60px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.circular-progress svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.circular-progress-value {
  font-size: 14px;
  font-weight: 700;
}

/* ── V163. Countdown ───────────────────────────────────────── */
.countdown { display: flex; gap: 12px; text-align: center; }
.countdown-value { font-size: 28px; font-weight: 700; }
.countdown-label { font-size: 11px; color: var(--muted); text-transform: uppercase; }

/* ── V164. Celebration ─────────────────────────────────────── */
.celebration-burst { animation: burst .6s ease-out; }
@keyframes burst {
  0%   { transform: scale(0); opacity: 1; }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 0; }
}

/* ── V165. Shake error ─────────────────────────────────────── */
.shake-error { animation: shake .4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-8px); }
  75%       { transform: translateX(8px); }
}

/* ── V166. Pulse ───────────────────────────────────────────── */
.pulse { animation: pulse-anim 2s infinite; }
@keyframes pulse-anim {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}

/* ── V167. Bounce in ───────────────────────────────────────── */
.bounce-in { animation: bounceIn .5s cubic-bezier(.68,-.55,.27,1.55); }
@keyframes bounceIn {
  0%   { transform: scale(0); }
  80%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ── V168. Slide in ────────────────────────────────────────── */
.slide-in-left  { animation: slideInLeft .3s ease; }
.slide-in-right { animation: slideInRight .3s; }
.slide-in-up    { animation: slideInUp .3s; }
@keyframes slideInLeft  { from { transform: translateX(-30px); opacity: 0; } }
@keyframes slideInRight { from { transform: translateX(30px);  opacity: 0; } }
@keyframes slideInUp    { from { transform: translateY(20px);  opacity: 0; } }

/* ── V169. Fade ────────────────────────────────────────────── */
.fade-in    { animation: fadeIn .3s; }
.fade-out   { animation: fadeOut .3s; }
.fade-in-up { animation: fadeInUp .3s; }
@keyframes fadeIn    { from { opacity: 0; } }
@keyframes fadeOut   { to   { opacity: 0; } }
@keyframes fadeInUp  { from { opacity: 0; transform: translateY(10px); } }

/* ── V170. Scale in ────────────────────────────────────────── */
.scale-in { animation: scaleIn .25s ease; }
@keyframes scaleIn { from { transform: scale(.9); opacity: 0; } }

/* ── V171. Flip card ───────────────────────────────────────── */
.flip-card { perspective: 1000px; }
.flip-card-inner {
  transition: transform .6s;
  transform-style: preserve-3d;
}
.flip-card:hover .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}
.flip-card-back { transform: rotateY(180deg); }

/* ── V172. Ticker ──────────────────────────────────────────── */
.ticker { overflow: hidden; }
.ticker-content {
  display: inline-block;
  white-space: nowrap;
  animation: ticker 15s linear infinite;
}
@keyframes ticker {
  from { transform: translateX(100%); }
  to   { transform: translateX(-100%); }
}

/* ── V173. Typing dots ─────────────────────────────────────── */
.typing-dots { display: inline-flex; gap: 4px; }
.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-bounce 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-6px); }
}

/* ── V174. Ripple ──────────────────────────────────────────── */
.ripple { position: relative; overflow: hidden; }
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  transform: scale(0);
  animation: ripple-spread .6s ease-out;
}
@keyframes ripple-spread { to { transform: scale(4); opacity: 0; } }

/* ── V175. Drag handle ─────────────────────────────────────── */
.drag-handle {
  cursor: grab;
  width: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  padding: 4px;
}
.drag-handle-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--muted);
}
.drag-handle:active { cursor: grabbing; }

/* ── V176. Resize handle ───────────────────────────────────── */
.resize-handle {
  position: absolute;
  bottom: 0; right: 0;
  width: 16px; height: 16px;
  cursor: nwse-resize;
}
.resize-handle::after {
  content: '';
  position: absolute;
  bottom: 2px; right: 2px;
  width: 8px; height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
}

/* ── V177. Selection highlight ─────────────────────────────── */
.selected-highlight {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.selected-highlight-bg { background: var(--accent-soft); }

/* ── V178. Focus trap ──────────────────────────────────────── */
.focus-trap-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 900;
}

/* ── V179. Skip link ───────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px; left: 0;
  padding: 8px 16px;
  background: var(--accent);
  color: #000;
  z-index: 10000;
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ── V180. Scroll progress ─────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 9999;
  width: 0;
  transition: width .1s;
}

/* ── V181. Color palette ───────────────────────────────────── */
:root {
  --color-blue-50: #eff6ff; --color-blue-100: #dbeafe;
  --color-blue-500: #3b82f6; --color-blue-700: #1d4ed8; --color-blue-900: #1e3a8a;
  --color-green-50: #f0fdf4; --color-green-500: #22c55e; --color-green-700: #15803d;
  --color-red-50: #fef2f2; --color-red-500: #ef4444; --color-red-700: #b91c1c;
  --color-orange-50: #fff7ed; --color-orange-500: #f97316;
  --color-purple-50: #faf5ff; --color-purple-500: #a855f7;
  --color-teal-50: #f0fdfa; --color-teal-500: #14b8a6;
  --color-pink-50: #fdf2f8; --color-pink-500: #ec4899;
}

/* ── V182. Background colors ───────────────────────────────── */
.bg-blue-50   { background: var(--color-blue-50); }
.bg-blue-500  { background: var(--color-blue-500); }
.bg-green-50  { background: var(--color-green-50); }
.bg-green-500 { background: var(--color-green-500); }
.bg-red-50    { background: var(--color-red-50); }
.bg-red-500   { background: var(--color-red-500); }
.bg-orange-50  { background: var(--color-orange-50); }
.bg-orange-500 { background: var(--color-orange-500); }
.bg-purple-50  { background: var(--color-purple-50); }
.bg-purple-500 { background: var(--color-purple-500); }

/* ── V183. Text colors ─────────────────────────────────────── */
.text-blue-500   { color: var(--color-blue-500); }
.text-green-500  { color: var(--color-green-500); }
.text-red-500    { color: var(--color-red-500); }
.text-orange-500 { color: var(--color-orange-500); }
.text-purple-500 { color: var(--color-purple-500); }
.text-teal-500   { color: var(--color-teal-500); }
.text-pink-500   { color: var(--color-pink-500); }

/* ── V184. Gradient bg ─────────────────────────────────────── */
.bg-gradient-primary { background: linear-gradient(135deg, var(--accent), #a8b02e); }
.bg-gradient-success { background: linear-gradient(135deg, #16a34a, #22d3ee); }
.bg-gradient-danger  { background: linear-gradient(135deg, #dc2626, #f97316); }
.bg-gradient-info    { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }

/* ── V185. Glass ───────────────────────────────────────────── */
.glass {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.2);
}
body[data-theme="dark"] .glass { background: rgba(0,0,0,.3); }

/* ── V186. Frosted ─────────────────────────────────────────── */
.frosted {
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(20px) saturate(180%);
}
body[data-theme="dark"] .frosted { background: rgba(15,15,15,.85); }

/* ── V187. Neumorphic ──────────────────────────────────────── */
.neumorphic {
  background: var(--bg);
  box-shadow: 8px 8px 16px rgba(0,0,0,.08), -8px -8px 16px rgba(255,255,255,.8);
  border: none;
}
body[data-theme="dark"] .neumorphic {
  box-shadow: 8px 8px 16px rgba(0,0,0,.4), -8px -8px 16px rgba(50,50,50,.2);
}

/* ── V188. Dark mode for new components ────────────────────── */
body[data-theme="dark"] .kpi-card           { background: var(--card); }
body[data-theme="dark"] .code-block         { background: #0f0f0f; }
body[data-theme="dark"] .command-palette    { background: var(--card); }
body[data-theme="dark"] .context-menu       { background: var(--card); }
body[data-theme="dark"] .side-panel         { background: var(--card); }
body[data-theme="dark"] .bottom-sheet       { background: var(--card); }
body[data-theme="dark"] .upload-zone        { border-color: #444; }
body[data-theme="dark"] .table-striped tbody tr:nth-child(even) { background: rgba(255,255,255,.03); }

/* ── V189. Semantic tokens ─────────────────────────────────── */
:root {
  --color-success: #16a34a; --color-error: #dc2626;
  --color-warning: #f59e0b; --color-info: #3b82f6;
  --color-link: #2563eb;
}
body[data-theme="dark"] {
  --color-success: #4ade80; --color-error: #f87171;
  --color-warning: #fbbf24; --color-info: #60a5fa;
  --color-link: #93c5fd;
}

/* ── V190. Surface colors ──────────────────────────────────── */
:root {
  --surface-1: #fff; --surface-2: #f9fafb;
  --surface-3: #f3f4f6; --surface-4: #e5e7eb;
}
body[data-theme="dark"] {
  --surface-1: #1a1a1a; --surface-2: #222;
  --surface-3: #2a2a2a; --surface-4: #333;
}
.surface-1 { background: var(--surface-1); }
.surface-2 { background: var(--surface-2); }
.surface-3 { background: var(--surface-3); }
.surface-4 { background: var(--surface-4); }

/* ── V191. Interactive states ──────────────────────────────── */
:root {
  --hover-bg: rgba(0,0,0,.04);
  --active-bg: rgba(0,0,0,.08);
  --focus-ring: 0 0 0 3px rgba(99,102,241,.4);
}
body[data-theme="dark"] {
  --hover-bg: rgba(255,255,255,.06);
  --active-bg: rgba(255,255,255,.1);
}

/* ── V192. Brand gradient ──────────────────────────────────── */
.brand-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 50%, #3730a3 100%);
}
.brand-gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── V193. Striped bg ──────────────────────────────────────── */
.bg-striped {
  background: repeating-linear-gradient(
    45deg,
    transparent, transparent 10px,
    rgba(0,0,0,.02) 10px, rgba(0,0,0,.02) 20px
  );
}

/* ── V194. Dot pattern ─────────────────────────────────────── */
.bg-dots {
  background: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* ── V195. Mesh gradient ───────────────────────────────────── */
.bg-mesh {
  background:
    linear-gradient(45deg,  rgba(99,102,241,.1) 0%, transparent 50%),
    linear-gradient(135deg, rgba(59,130,246,.1) 0%, transparent 50%),
    linear-gradient(225deg, rgba(168,176,46,.1) 0%, transparent 50%);
}

/* ── V196. Ambient glow ────────────────────────────────────── */
.glow-accent  { box-shadow: 0 0 20px rgba(99,102,241,.3); }
.glow-success { box-shadow: 0 0 20px rgba(22,163,74,.3); }
.glow-danger  { box-shadow: 0 0 20px rgba(220,38,38,.3); }

/* ── V197. Text gradient ───────────────────────────────────── */
.text-gradient {
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── V198. Border gradient ─────────────────────────────────── */
.border-gradient {
  border: 2px solid transparent;
  background-clip: padding-box;
}
.border-gradient::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  border-radius: inherit;
  z-index: -1;
}

/* ── V199. Color mode transition ───────────────────────────── */
body { transition: background-color .3s, color .3s; }
.card, .panel, .sidebar, .btn {
  transition: background-color .3s, color .3s, border-color .3s;
}

/* ── V200. Dark mode auto ──────────────────────────────────── */
body[data-theme="dark"] .surface-1    { background: var(--surface-1); }
body[data-theme="dark"] .bg-blue-50   { background: #1e2a3a; }
body[data-theme="dark"] .bg-green-50  { background: #1a2e1a; }
body[data-theme="dark"] .bg-red-50    { background: #2e1a1a; }

/* ── V201. Dim mode ────────────────────────────────────────── */
body[data-theme="dim"] {
  --bg: #1a1a2e; --ink: #e0e0e0;
  --card: #222240; --panel: #1e1e38; --border: #333355;
}

/* ── V202. AMOLED dark ─────────────────────────────────────── */
body[data-theme="amoled"] {
  --bg: #000; --ink: #fff;
  --card: #0a0a0a; --panel: #050505; --border: #1a1a1a;
}

/* ── V203. Solarized ───────────────────────────────────────── */
body[data-theme="solarized"] {
  --bg: #fdf6e3; --ink: #657b83;
  --card: #eee8d5; --accent: #b58900; --border: #93a1a1;
}

/* ── V204. High contrast warm ──────────────────────────────── */
body[data-theme="high-contrast"] {
  --bg: #fff; --ink: #000;
  --accent: #ff0; --border: #000; --muted: #333;
}

/* ── V205. Color blind safe ────────────────────────────────── */
:root {
  --cb-safe-red: #d55e00; --cb-safe-blue: #0072b2;
  --cb-safe-green: #009e73; --cb-safe-yellow: #f0e442;
  --cb-safe-purple: #cc79a7;
}

/* ── V206. Custom accent override ──────────────────────────── */
:root[data-accent="blue"]   { --accent: #3b82f6; --accent-soft: #eff6ff; }
:root[data-accent="purple"] { --accent: #8b5cf6; --accent-soft: #f5f3ff; }
:root[data-accent="teal"]   { --accent: #14b8a6; --accent-soft: #f0fdfa; }

/* ── V207. Theme illustrations ─────────────────────────────── */
body[data-theme="dark"] .illustration {
  filter: brightness(.85) contrast(1.1);
}

/* ── V208. Dark image handling ─────────────────────────────── */
body[data-theme="dark"] img:not(.brand-logo) { filter: brightness(.9); }
body[data-theme="dark"] .img-invert          { filter: invert(1); }

/* ── V209. Theme shadows ───────────────────────────────────── */
.shadow-themed                         { box-shadow: 0 4px 20px rgba(0,0,0,.08); }
body[data-theme="dark"] .shadow-themed { box-shadow: 0 4px 20px rgba(0,0,0,.4); }

/* ── V210. Print theme ─────────────────────────────────────── */
@media print {
  :root {
    --bg: #fff; --ink: #000;
    --border: #ccc; --card: #fff; --panel: #fff;
  }
}

/* ── V211. Heading classes ─────────────────────────────────── */
.h1 { font-size: 36px; font-weight: 700; }
.h2 { font-size: 28px; font-weight: 700; }
.h3 { font-size: 22px; font-weight: 700; }
.h4 { font-size: 18px; font-weight: 600; }
.h5 { font-size: 16px; font-weight: 600; }
.h6 { font-size: 14px; font-weight: 600; }

/* ── V212. Display headings ────────────────────────────────── */
.display-1 { font-size: 48px; font-weight: 700; line-height: 1.1; }
.display-2 { font-size: 40px; font-weight: 700; }
.display-3 { font-size: 32px; font-weight: 700; }
.display-4 { font-size: 28px; font-weight: 700; }

/* ── V213. Lead paragraph ──────────────────────────────────── */
.lead { font-size: 18px; line-height: 1.6; color: var(--muted); }

/* ── V214. Small text ──────────────────────────────────────── */
.small   { font-size: 13px; }
.smaller { font-size: 11px; }
.tiny    { font-size: 10px; }

/* ── V215. Mark ────────────────────────────────────────────── */
.mark {
  background: rgba(99,102,241,.3);
  padding: 2px 4px;
  border-radius: 3px;
}

/* ── V216. Blockquote ──────────────────────────────────────── */
.blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 16px;
  margin: 16px 0;
  font-style: italic;
  color: var(--muted);
}
.blockquote-footer {
  font-size: 13px;
  font-style: normal;
  margin-top: 8px;
}

/* ── V217. Pull quote ──────────────────────────────────────── */
.pull-quote {
  font-size: 24px;
  font-weight: 300;
  text-align: center;
  padding: 32px;
  color: var(--ink);
  position: relative;
}
.pull-quote::before {
  content: '\201C';
  font-size: 64px;
  color: var(--accent);
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
}

/* ── V218. Drop cap ────────────────────────────────────────── */
.drop-cap::first-letter {
  float: left;
  font-size: 3em;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
  margin-right: 8px;
  margin-top: 4px;
}

/* ── V219. Multi columns ───────────────────────────────────── */
.text-columns-2 { columns: 2; gap: 24px; }
.text-columns-3 { columns: 3; gap: 24px; }

/* ── V220. Hyphens ─────────────────────────────────────────── */
.hyphens { hyphens: auto; -webkit-hyphens: auto; }

/* ── V221. Text balance ────────────────────────────────────── */
.text-balance { text-wrap: balance; }

/* ── V222. Font mono ───────────────────────────────────────── */
.font-mono { font-family: SFMono-Regular, Consolas, 'Liberation Mono', monospace; }

/* ── V223. Font serif ──────────────────────────────────────── */
.font-serif { font-family: Georgia, Cambria, 'Times New Roman', serif; }

/* ── V224. Word break ──────────────────────────────────────── */
.break-word { overflow-wrap: break-word; }
.break-all  { word-break: break-all; }
.break-keep { word-break: keep-all; }

/* ── V225. Whitespace ──────────────────────────────────────── */
.whitespace-nowrap   { white-space: nowrap; }
.whitespace-pre      { white-space: pre; }
.whitespace-pre-wrap { white-space: pre-wrap; }

/* ── V226. List styles ─────────────────────────────────────── */
.list-disc    { list-style: disc;    padding-left: 20px; }
.list-decimal { list-style: decimal; padding-left: 20px; }
.list-none    { list-style: none;    padding: 0; }

/* ── V227. Divider ─────────────────────────────────────────── */
.divider-fancy {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 24px 0;
}

/* ── V228. Badge styles ────────────────────────────────────── */
.badge-pill    { border-radius: 9999px; padding: 4px 12px; }
.badge-dot     { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.badge-outline { background: transparent; border: 1px solid currentColor; }

/* ── V229. Chip ────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--accent-soft);
  font-size: 13px;
}
.chip-close {
  margin-left: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: .6;
}
.chip-close:hover { opacity: 1; }

/* ── V230. Label inline ────────────────────────────────────── */
.label-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-3);
}

/* ── Report Chart (progress_report) ──────────────────────────── */
.report-chart-wrap {
  margin-top: 14px;
  padding: 20px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #101217;
  position: relative;
  overflow: visible;
  min-height: 320px;
}

.report-chart-wrap canvas {
  display: block;
  width: 100%;
  max-width: 100%;
}

.report-chart-tooltip {
  position: fixed;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(244, 247, 251, 0.96);
  color: #101217;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}

@media (prefers-color-scheme: light) {
  .report-chart-wrap {
    border-color: #ccc;
    background: #fff;
  }
}

/* ── Board Detail Modal (shared by Board and Calendar) ───────── */
.board-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  overflow-y: auto;
  padding: 2rem;
}
.board-modal.open { display: flex; }
.board-modal-card {
  width: 100%;
  max-width: 900px;
  margin: 2rem auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  animation: modalIn .15s ease-out;
}
.board-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
}
.board-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}
.board-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary, var(--muted));
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.board-modal-close:hover {
  background: var(--border);
  color: var(--text);
}
.board-modal-body { padding: 18px 22px 22px; }
.bm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}
.bm-col h4,
.bm-desc-section h4 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  margin: 0 0 10px;
}
.bm-field { margin-bottom: 9px; }
.bm-field-spaced { margin-top: 16px; }
.bm-label {
  font-size: .8rem;
  color: var(--text-secondary, var(--muted));
  margin-bottom: 3px;
}
.bm-value {
  font-size: .9rem;
  font-weight: 500;
}
.bm-input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: .85rem;
  width: 100%;
}
.bm-input[readonly],
.bm-input:disabled {
  color: var(--text-secondary, var(--muted));
  opacity: .78;
}
.board-modal select.bm-status-select,
.bm-status-select {
  appearance: none;
  -webkit-appearance: none;
  border-color: var(--accent) !important;
  background-color: var(--accent) !important;
  background-image: linear-gradient(45deg, transparent 50%, #171717 50%), linear-gradient(135deg, #171717 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: #171717 !important;
  font-weight: 700;
  padding-right: 34px;
}
.board-modal select.bm-status-select:focus,
.bm-status-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(210, 214, 72, .18);
}
.board-modal select.bm-status-select option,
.bm-status-select option {
  background: var(--card);
  color: var(--text);
}
.bm-desc-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.bm-desc-section h4 { margin-bottom: 7px; }
.bm-desc-content {
  font-size: .88rem;
  white-space: pre-wrap;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  min-height: 40px;
}
@media (max-width: 780px) {
  .board-modal { padding: 1rem; }
  .bm-grid { grid-template-columns: 1fr; }
}
