* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans Arabic", "Tajawal", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

html[dir="ltr"] body {
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

img {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.app-layout {
  min-height: 100vh;
  display: flex;
  background: var(--color-bg);
}

.app-sidebar {
  width: 300px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-inline-end: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
  padding: var(--space-6) var(--space-4);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  transition: width 0.3s ease;
}

/* Custom Scrollbar for Sidebar */
.app-sidebar::-webkit-scrollbar {
  width: 5px;
}
.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}
.app-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.lang-form {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.brand {
  font-weight: 600;
  letter-spacing: 0.3px;
}

.content {
  padding: var(--space-6);
}

.content-inner {
  max-width: 1360px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.page-title {
  font-size: 1.6rem;
  margin: 0;
}

.page-subtitle {
  margin: var(--space-1) 0 0;
  color: var(--color-muted);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: var(--space-5);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

textarea {
  min-height: 120px;
}

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

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

.btn, .btn-primary {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover, .btn-primary:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  background: rgba(15, 108, 93, 0.05);
}

.btn-success {
  background: var(--color-success);
  color: white;
  border: none;
}
.btn-success:hover {
  background: #166440;
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

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

.btn-danger:hover {
  background: #b42318;
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

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

.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-type {
  border: 1px solid transparent;
}

.badge-type-discussion {
  background: rgba(14, 116, 144, 0.12);
  color: #0e7490;
  border-color: rgba(14, 116, 144, 0.25);
}

.badge-type-vote {
  background: rgba(147, 51, 234, 0.12);
  color: #7e22ce;
  border-color: rgba(147, 51, 234, 0.25);
}

.badge-type-approval {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.25);
}

.badge-type-info {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.25);
}

.badge-success {
  background: rgba(31, 122, 79, 0.12);
  color: var(--color-success);
}

.badge-warning {
  background: rgba(161, 98, 7, 0.12);
  color: var(--color-warning);
}

.badge-danger {
  background: rgba(180, 35, 24, 0.12);
  color: var(--color-danger);
}

.badge-info {
  background: rgba(29, 78, 216, 0.12);
  color: var(--color-info);
}

.badge-muted {
  background: rgba(107, 114, 128, 0.12);
  color: var(--color-muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 28, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  z-index: 999;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  width: min(1100px, 96vw);
  max-height: 90vh;
  overflow: auto;
  padding: var(--space-5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
}

.modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-4);
}

.modal-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-bg);
}

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

.agenda-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.agenda-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
  background: white;
  transition: all 0.3s ease;
}

.agenda-card.active-item {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(15, 108, 93, 0.1), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
  transform: scale(1.01);
}

.agenda-card.is-focus {
  border-color: var(--color-primary);
  box-shadow: 0 12px 30px rgba(15, 108, 93, 0.18);
  transform: translateY(-2px);
}

.agenda-card.is-dim {
  opacity: 0.55;
}

.agenda-focus-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(15, 108, 93, 0.12);
  color: var(--color-primary);
  font-weight: 600;
}

.agenda-focus-dot {
  color: #ef4444;
  font-size: 0.9rem;
}

.agenda-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.agenda-order {
  font-weight: 700;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.agenda-title {
  flex: 1;
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-indicator {
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  animation: pulse 2s infinite;
}

.vote-section {
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

.vote-open {
  background: #ecfdf5;
  border: 1px dashed var(--color-success);
}

.live-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(15, 108, 93, 0.12), rgba(15, 108, 93, 0.02));
  border: 1px solid rgba(15, 108, 93, 0.2);
  margin-bottom: 20px;
  gap: 16px;
}

.live-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.live-hero__title {
  margin: 0;
  font-size: 1.8rem;
}

.live-hero__subtitle {
  margin: 6px 0 0;
  color: var(--color-muted);
}

.live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--color-danger);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 76, 76, 0.12);
  animation: pulse 1.5s infinite;
}

.live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: 16px;
}

.live-panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-1);
  padding: 16px;
}

.live-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.live-overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.live-overview__card {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.live-overview__title {
  font-weight: 600;
  margin-bottom: 8px;
}

@media (max-width: 980px) {
  .live-grid {
    grid-template-columns: 1fr;
  }
  .live-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

.vote-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-vote {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-vote:active {
  transform: scale(0.98);
}

.btn-vote.yes {
  background: var(--color-success);
  color: white;
}

.btn-vote.no {
  background: var(--color-danger);
  color: white;
}

.btn-vote.abstain {
  background: #e5e7eb;
  color: #374151;
}

.vote-feed {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.vote-chip {
  font-size: 0.75rem;
  background: white;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}

.input,
.select,
.textarea,
input[type="text"],
input[type="date"],
input[type="email"],
input[type="number"],
select,
textarea {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  background: #f8fafc;
  color: var(--color-text);
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
  outline: none;
  width: 100%; /* Ensure full width mostly */
}

.input:focus,
.select:focus,
.textarea:focus,
input[type="text"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  background: white;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(15, 108, 93, 0.15);
}

.input:hover,
.select:hover,
.textarea:hover,
input[type="text"]:hover,
input[type="date"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover {
  background: white;
  border-color: #cbd5e1;
}

/* Fix select caret/arrow */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

[dir="rtl"] select {
  background-position: left 0.5rem center;
  padding-right: 12px;
  padding-left: 2.5rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-3);
}

.table + .table {
  margin-top: var(--space-4);
}

.table th,
.table td {
  text-align: start;
  padding: 12px 10px;
  border-bottom: 1px solid var(--color-border);
}

.table-row-hover tbody tr:hover {
  background: var(--table-row-hover);
}

.table-clickable tbody tr {
  cursor: pointer;
}

.table-form .input,
.table-form .select,
.table-form .textarea,
.table-form input[type="text"],
.table-form input[type="date"],
.table-form input[type="email"],
.table-form input[type="number"],
.table-form select,
.table-form textarea {
  width: 100%;
  box-sizing: border-box;
}

.filters-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.filters-bar__form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: flex-end;
}

.filters-bar__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 180px;
  flex: 1 1 220px;
}

.filters-bar__actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.filters-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filters-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.filters-bar--advanced .filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.filters-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.filters-label {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.filters-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.filter-pill {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.filter-pill.is-active {
  border-color: rgba(15, 108, 93, 0.4);
  background: rgba(15, 108, 93, 0.08);
  color: var(--color-primary);
}

@media (max-width: 720px) {
  .filters-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-actions {
    justify-content: flex-start;
  }
}

.meeting-detail-hero {
  position: relative;
  padding: 32px;
  border-radius: 24px;
  background: white;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: var(--space-6);
  overflow: hidden;
  isolation: isolate;
}

@media (min-width: 1024px) {
  .meeting-detail-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

/* ... decorative background elements ... */
.meeting-detail-hero::before {
  content: "";
  position: absolute;
  top: -100px;
  inset-inline-end: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(15, 108, 93, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.meeting-detail-hero::after {
  content: "";
  position: absolute;
  bottom: -50px;
  inset-inline-start: -50px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(178, 138, 63, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.meeting-detail-hero__content,
.meeting-detail-hero__actions {
  position: relative;
  z-index: 2;
}

.meeting-detail-hero__actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-top: 8px;
  width: 100%;
  max-width: 340px;
}

.meeting-detail-hero__actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

/* Make primary actions span full width if needed, or keep grid */
/* Let's make "Host Panel" span 2 cols if it's the first one? No, grid is fine. */

[dir="rtl"] .meeting-detail-hero__actions {
  /* RTL support handled by grid direction */
}

.meeting-detail-title {
  margin: 16px 0 8px;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  background: linear-gradient(135deg, #1b1f24 0%, #3e444b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.meeting-detail-subtitle {
  margin: 0 0 24px;
  color: var(--color-muted);
  font-size: 1.1rem;
  font-weight: 500;
}

.meeting-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meeting-detail-badges .badge {
  padding: 6px 12px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.meeting-detail-badges .badge-success {
  background: #ecfdf5;
  color: #047857;
  border-color: #d1fae5;
}

.meeting-detail-badges .badge-warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.meeting-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.meeting-meta-item {
  background: white;
  border: 1px solid #edf2f7;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.meeting-meta-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  border-color: var(--color-primary);
}

.meeting-meta-item .meta-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.meeting-meta-item .meta-value {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-text);
  word-break: break-word;
}

.meeting-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 32px;
}

.meeting-detail-main,
.meeting-detail-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  border: none;
  border-radius: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.card-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
}

.card-body {
  padding: 24px;
  background: white;
}

.meeting-agenda-text {
  margin: 0;
  line-height: 1.8;
  color: #475569;
  font-size: 1.05rem;
}

.meeting-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.meeting-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.meeting-list li:hover {
  background: white;
  border-color: var(--color-primary);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transform: scale(1.01);
}

.meeting-list__title {
  font-weight: 600;
  color: #334155;
}

.meeting-list__meta {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Compact list for attendees */
.meeting-list--compact li {
  align-items: center;
  flex-direction: row;
  padding: 12px;
}

.meeting-list--compact .meeting-list__title {
  font-size: 0.95rem;
}

.meeting-attendee-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-inline-start: auto;
}

.meeting-inline-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 1024px) {
  .meeting-detail-hero {
    grid-template-columns: 1fr;
  }

  .meeting-detail-hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .meeting-detail-grid {
    grid-template-columns: 1fr;
  }

  .meeting-meta-grid {
    grid-template-columns: 1fr;
  }
}

.meeting-new-hero {
  position: relative;
  margin-bottom: var(--space-5);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f6f2ea 0%, #e9f0ee 60%, #f2f6f4 100%);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.meeting-new-hero::before,
.meeting-new-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(20, 92, 75, 0.08);
  z-index: 0;
}

.meeting-new-hero::before {
  inset-inline-end: -60px;
  top: -80px;
}

.meeting-new-hero::after {
  inset-inline-start: -80px;
  bottom: -100px;
  background: rgba(201, 153, 70, 0.12);
}

.meeting-new-hero__content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.meeting-new-hero__title {
  margin: 0 0 var(--space-2);
  font-size: 32px;
  letter-spacing: -0.5px;
}

.meeting-new-hero__subtitle {
  margin: 0;
  color: var(--color-muted);
  font-size: 16px;
}

.meeting-new-card {
  border: 1px solid rgba(20, 92, 75, 0.12);
  box-shadow: var(--shadow-1);
}

.meeting-new-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-4) 0;
}

.meeting-new-grid {
  padding: var(--space-4);
  align-items: start;
}

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.form-section-title {
  margin: 0 0 var(--space-2);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.meeting-new-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.meeting-new-field label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 600;
  color: var(--color-text);
}

.meeting-new-field .input,
.meeting-new-field .select,
.meeting-new-field .textarea {
  background: #fff;
  border: 1px solid rgba(20, 92, 75, 0.18);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.meeting-new-field .input:focus,
.meeting-new-field .select:focus,
.meeting-new-field .textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(20, 92, 75, 0.18);
}

.meeting-new-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: var(--space-3);
}

.form-error {
  border-color: rgba(182, 49, 49, 0.35);
  background: rgba(182, 49, 49, 0.06);
}

.form-error-text {
  color: #9b2c2c;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .meeting-new-hero {
    padding: var(--space-5);
  }

  .meeting-new-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .meeting-new-actions {
    justify-content: stretch;
  }

  .meeting-new-actions .btn {
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.8rem;
}

.empty-state {
  text-align: center;
  padding: var(--space-6);
  color: var(--color-muted);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-4);
}

.tab {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--color-muted);
}

.tab.active {
  background: rgba(15, 108, 93, 0.12);
  color: var(--color-primary);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding: 0 var(--space-2);
  font-weight: 800;
  font-size: 1.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
  position: relative;
}

/* Optional: Add a subtle logo decorative element */
.sidebar-brand::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(178, 138, 63, 0.2);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  position: relative;
  perspective: 1000px;
}

.menu-link,
.menu-group summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
}

.menu-link:hover,
.menu-group summary:hover {
  background: white;
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  color: var(--color-primary);
}

.menu-link .label,
.menu-group summary .label {
  flex: 1;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Active State (Top Level) */
.menu-item.active > .menu-link,
.menu-item.active > .menu-group > summary {
  background: var(--gradient-primary);
  color: var(--color-primary-contrast);
  box-shadow: 0 10px 20px -8px rgba(15, 108, 93, 0.5);
  transform: scale(1.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-item.active > .menu-link .icon,
.menu-item.active > .menu-group > summary .icon {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-primary-contrast);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: rotate(-5deg);
}

/* Children Container */
.menu-children {
  margin-top: 6px;
  padding-inline-start: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

/* Vertical guide line */
.menu-children::before {
  content: "";
  position: absolute;
  inset-inline-start: 36px;
  top: 0;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(180deg, var(--color-border) 0%, transparent 100%);
  border-radius: 2px;
}

.menu-children .menu-link,
.menu-children .menu-group summary {
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--color-muted);
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
}

.menu-children .menu-link:hover,
.menu-children .menu-group summary:hover {
  color: var(--color-primary);
  background: rgba(15, 108, 93, 0.04);
  transform: translateX(3px);
  box-shadow: none;
}

/* Child Active State */
.menu-children .menu-item.active > .menu-link,
.menu-children .menu-item.active > .menu-group > summary {
  background: white;
  color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-weight: 700;
  transform: none;
}

.menu-children .menu-item.active > .menu-link::before {
  content: "";
  position: absolute;
  inset-inline-start: -14px; /* Align with guide line */
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 108, 93, 0.2);
}

.menu-children .menu-item.active > .menu-link .icon,
.menu-children .menu-item.active > .menu-group > summary .icon {
  background: var(--gradient-primary);
  color: white;
  transform: none;
}

.menu-group summary::-webkit-details-marker {
  display: none;
}

/* Chevron */
.menu-group summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-inline-start: auto;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0.5;
}

.menu-group[open] > summary::after {
  transform: rotate(225deg);
}

html[dir="rtl"] .app-sidebar {
  border-inline-end: 0;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.6);
}

html[dir="rtl"] .menu-link,
html[dir="rtl"] .menu-group summary {
  direction: rtl;
  text-align: right;
  justify-content: flex-start;
}

html[dir="rtl"] .menu-link .label,
html[dir="rtl"] .menu-group summary .label {
  text-align: right;
}

html[dir="rtl"] .menu-link .icon,
html[dir="rtl"] .menu-group summary .icon {
  order: 1;
}

html[dir="rtl"] .menu-link .label,
html[dir="rtl"] .menu-group summary .label {
  order: 2;
}

html[dir="rtl"] .menu-children {
  padding-inline-start: 16px;
  padding-inline-end: 24px;
}

html[dir="rtl"] .menu-children::before {
  inset-inline-start: auto;
  inset-inline-end: 36px;
}

html[dir="rtl"] .menu-children .menu-item.active > .menu-link::before {
  inset-inline-start: auto;
  inset-inline-end: -14px;
}

html[dir="rtl"] .page-header,
html[dir="rtl"] .topbar {
  text-align: right;
}

.icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 10px;
  background: linear-gradient(145deg, #ffffff, #f0f2f5);
  color: var(--color-muted);
  flex-shrink: 0;
  transition: all 0.3s ease;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.03), -2px -2px 5px rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.6);
}

.menu-link:hover .icon,
.menu-group summary:hover .icon {
  color: var(--color-primary);
  transform: scale(1.05);
}
.muted {
  color: var(--color-muted);
}

.alert {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface);
  margin-bottom: var(--space-4);
}

@media (max-width: 1100px) {
  .app-layout {
    flex-direction: column;
  }

  .app-sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .content {
    padding: var(--space-4);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

@media print {
  .app-sidebar,
  .app-topbar,
  .topbar-actions,
  .btn,
  .no-print {
    display: none !important;
  }

  .app-layout {
    display: block;
    background: white;
  }

  .app-main {
    margin: 0;
    padding: 0;
  }

  .content {
    padding: 0;
    max-width: 100%;
  }

  .content-inner {
    max-width: 100%;
    margin: 0;
  }

  body {
    background: white;
    color: black;
    font-size: 12pt;
    line-height: 1.5;
  }

  .card {
    box-shadow: none;
    border: none;
    padding: 0;
    margin-bottom: 2rem;
  }

  .card-header {
    border-bottom: 2px solid #000;
    padding: 0 0 10px 0;
    margin-bottom: 1rem;
  }

  .card-header h3 {
    font-size: 16pt;
    color: #000;
  }

  .meeting-detail-hero {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 2rem;
    display: block;
  }

  .meeting-detail-hero::before,
  .meeting-detail-hero::after {
    display: none;
  }

  .meeting-detail-title {
    font-size: 24pt;
    color: #000;
    background: none;
    -webkit-text-fill-color: black;
  }

  .meeting-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
  }

  .meeting-meta-item {
    border: none;
    box-shadow: none;
    padding: 10px;
    background: none;
  }

  .table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #000;
  }

  .table th,
  .table td {
    border: 1px solid #000;
    padding: 8px;
    text-align: left;
  }

  .table th {
    background-color: #f0f0f0 !important;
    font-weight: bold;
    -webkit-print-color-adjust: exact;
  }

  /* Force page breaks */
  h1, h2, h3 {
    page-break-after: avoid;
  }

  .page-break {
    page-break-before: always;
  }

  /* Signature lines */
  .signature-section {
    margin-top: 50px;
    display: flex;
    justify-content: space-between;
    page-break-inside: avoid;
  }

  .signature-box {
    width: 40%;
    border-top: 1px solid #000;
    padding-top: 10px;
  }
}
/* Mandate tree editor */
.mandate-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mandate-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.mandate-toolbar .toolbar-left {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.mandate-toolbar h3 {
  margin: 0;
}
.mandate-status {
  font-size: 12px;
  color: #475569;
}
.mandate-status.is-saving {
  color: #b45309;
}
.mandate-status.is-error {
  color: #b91c1c;
}
.mandate-retry {
  margin-inline-start: 6px;
}
.mandate-legacy textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px;
  background: #f8fafc;
}
.tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tree-node {
  margin: 0;
  padding: 0;
}
.tree-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}
.tree-row:hover {
  background: #f8fafc;
}
.tree-row:focus-within {
  background: #f1f5f9;
}
.tree-row--new {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}
.tree-node--new .tree-row--new {
  width: 100%;
}
.tree-inline-error {
  margin-inline-start: 36px;
  margin-top: 4px;
  font-size: 12px;
  color: #b91c1c;
}
.tree-toggle,
.tree-toggle-placeholder {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.tree-toggle {
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
}
.tree-node.is-collapsed > .tree-children {
  display: none;
}
.tree-node.is-collapsed .tree-toggle {
  transform: rotate(-90deg);
}
.tree-children {
  margin-inline-start: 20px;
  padding-inline-start: 10px;
  border-inline-start: 1px solid #e2e8f0;
}
.code-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 12px;
  color: #1f2937;
  white-space: nowrap;
}
.tree-title {
  flex: 1;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  resize: none;
  overflow: hidden;
  background: transparent;
}
.tree-title:focus {
  border-color: #cbd5e1;
  background: #fff;
}
.tree-title.readonly {
  padding: 6px 8px;
}
.tree-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.tree-row:hover .tree-actions,
.tree-row:focus-within .tree-actions {
  opacity: 1;
}
.icon-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  cursor: pointer;
}
.tree-menu {
  position: relative;
}
.tree-menu-list {
  position: absolute;
  top: 28px;
  inset-inline-end: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
}
.tree-menu-list button {
  background: transparent;
  border: none;
  text-align: left;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}
.tree-menu-list button:hover {
  background: #f1f5f9;
}
.tree-new-root {
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}
.tree-new-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
}
.tree-confirm {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  margin: 6px 0 0 36px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 12px;
}
.tree-confirm button {
  border: 1px solid #fed7aa;
  background: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
}

/* Roles and responsibilities table */
.roles-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.roles-table th,
.roles-table td {
  text-align: start;
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid #e2e8f0;
}
.roles-table thead th {
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
}
.roles-table tbody tr:hover {
  background: #f8fafc;
}

.section-subtitle {
  margin-top: 16px;
  font-size: 14px;
  color: #475569;
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.builder-canvas {
  min-height: 520px;
  position: relative;
}

.workflow-canvas {
  height: 520px;
}

.workflow-canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-4);
  pointer-events: none;
}

.builder-sidebar {
  display: grid;
  gap: var(--space-3);
}

.builder-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.builder-preview {
  background: rgba(255, 255, 255, 0.04);
  padding: var(--space-2);
  border-radius: var(--radius-md);
}

.builder-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 2fr) 320px;
  gap: var(--space-4);
  align-items: start;
}

.builder-banner {
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(30, 41, 59, 0.9);
  color: #fca5a5;
}

.builder-banner.hidden {
  display: none;
}

.builder-banner.is-success {
  border-color: rgba(74, 222, 128, 0.4);
  color: #86efac;
}

.builder-banner .banner-title {
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.builder-banner .banner-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.builder-banner .banner-item {
  cursor: pointer;
}

.builder-banner .banner-item.error {
  color: #fca5a5;
}

.builder-banner .banner-item.warning {
  color: #fcd34d;
}

.builder-library {
  display: grid;
  gap: var(--space-3);
}

.sidebar-tabs {
  display: flex;
  gap: var(--space-2);
}

.sidebar-panel {
  display: grid;
  gap: var(--space-3);
}

.sidebar-panel.hidden {
  display: none;
}

.builder-stepper {
  display: grid;
  gap: 6px;
}

.step-item {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.85rem;
}

.step-item.is-complete {
  border-color: #22c55e;
  background: #ecfdf5;
}

.step-item.is-active {
  border-color: #3b82f6;
  background: #eff6ff;
}

.builder-quick-actions {
  display: grid;
  gap: var(--space-2);
}

.sidebar-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.quick-add-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-add-item {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.builder-summary {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
}

.builder-help-content.hidden {
  display: none;
}

.builder-help-content p {
  margin: 0 0 6px 0;
  color: #475569;
  font-size: 0.85rem;
}

.templates-list {
  display: grid;
  gap: var(--space-2);
}

.template-card {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: var(--space-2);
  display: grid;
  gap: 6px;
}

.template-title {
  font-weight: 600;
}

.template-meta {
  font-size: 0.8rem;
  color: #64748b;
}

.checks-list {
  display: grid;
  gap: 6px;
}

.check-item {
  text-align: left;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.action-add-cta {
  justify-content: center;
  width: 100%;
}

.badge-end {
  background: #e2e8f0;
  color: #334155;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
}

.preview-flow {
  display: grid;
  gap: 6px;
}

.preview-state {
  margin-top: 8px;
}

.preview-action {
  font-size: 0.85rem;
  padding-left: 10px;
}
.library-search {
  padding-bottom: var(--space-2);
}

.library-tabs {
  display: flex;
  gap: var(--space-2);
}

.library-tabs .tab {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.library-tabs .tab.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.library-content {
  display: grid;
  gap: var(--space-2);
}

.library-content.hidden {
  display: none;
}

.library-item {
  text-align: left;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.library-group {
  display: grid;
  gap: 6px;
}

.library-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.builder-grid {
  position: relative;
  min-height: 520px;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.builder-flow {
  display: grid;
  gap: var(--space-3);
}

.builder-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: none;
}

.builder-block {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  position: relative;
}

.builder-block.is-selected {
  outline: 3px solid #2563eb33;
  box-shadow: none;
}

.builder-block.has-issue {
  border-color: #ef4444;
}

.builder-block.is-locked .block-btn[data-action="delete-state"] {
  opacity: 0.4;
  pointer-events: none;
}

.block-content {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.block-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.12);
  display: grid;
  place-items: center;
  color: #1d4ed8;
}

.block-label {
  font-weight: 600;
  color: inherit;
}

.block-meta {
  color: inherit;
  opacity: 0.85;
  font-size: 0.85rem;
}

.block-handle {
  margin-left: auto;
  color: #64748b;
}

.block-controls {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.builder-block:hover .block-controls,
.builder-block.is-selected .block-controls {
  opacity: 1;
}

.block-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 13px;
}

.builder-connector {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  position: relative;
}

.builder-connector.is-selected .connector-body {
  border-color: #2563eb;
}

.builder-connector.has-issue .connector-body {
  border-color: #ef4444;
}

.connector-line {
  width: 0;
  height: 24px;
  border-left: 2px solid #475569;
}

.connector-body {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: #ffffff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
}

.connector-label {
  font-size: 0.85rem;
  color: #0f172a;
}

.connector-badge {
  font-size: 0.75rem;
  color: #475569;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
}

.connector-controls {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.builder-connector:hover .connector-controls,
.builder-connector.is-selected .connector-controls {
  opacity: 1;
}

.connector-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 12px;
}

.connector-add {
  border: 1px dashed #94a3b8;
  background: #ffffff;
  color: #475569;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.connector-branches {
  display: grid;
  gap: 6px;
}

.branch-item {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  cursor: pointer;
}

.branch-item.branch-reject {
  border-style: dashed;
  border-color: #dc2626;
  color: #7f1d1d;
}

.branch-item.branch-return {
  border-style: dashed;
  border-color: #ea580c;
  color: #7c2d12;
}

.branch-item.has-issue {
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.6);
}

.builder-block:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.action-list {
  margin-top: var(--space-2);
  display: grid;
  gap: 6px;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-size: 0.75rem;
  cursor: grab;
}

.action-pill .action-target {
  color: #64748b;
  font-size: 0.7rem;
}

.action-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed #94a3b8;
  background: #ffffff;
  color: #475569;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
}

.state-drop-target {
  outline: 2px dashed #2563eb;
}

.state-draft {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.state-under-review {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e3a8a;
}

.state-committee-approval {
  background: #fefce8;
  border-color: #eab308;
  color: #713f12;
}

.state-approved {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.state-effective {
  background: #f0fdf4;
  border-color: #16a34a;
  color: #14532d;
}

.state-rejected {
  background: #fef2f2;
  border-color: #ef4444;
  color: #7f1d1d;
}

.state-archived {
  background: #f1f5f9;
  border-color: #64748b;
  color: #334155;
}

.state-default {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.connector-primary .connector-line {
  border-left-color: #475569;
}

.connector-approve .connector-line {
  border-left-color: #16a34a;
}

.connector-reject .connector-line {
  border-left-color: #dc2626;
  border-left-style: dashed;
}

.connector-return .connector-line {
  border-left-color: #ea580c;
  border-left-style: dashed;
}

.connector-approve .connector-badge {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

.connector-reject .connector-badge {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.connector-return .connector-badge {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

.builder-properties {
  display: grid;
  gap: var(--space-3);
}

.builder-properties.is-collapsed {
  display: none;
}

.properties-panel.hidden {
  display: none;
}

.builder-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.builder-modal.hidden {
  display: none;
}

.builder-modal-card {
  width: min(520px, 90vw);
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
}

.builder-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.builder-modal-body {
  display: grid;
  gap: var(--space-2);
}

.builder-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.modal-close {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
}

.workflow-inbox {
  display: grid;
  gap: var(--space-4);
}

.workflow-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.04);
}

.workflow-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.workflow-card-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.workflow-card-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: var(--space-1);
}

.workflow-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.workflow-card-meta .label {
  color: var(--text-muted);
  margin-right: var(--space-1);
}

.workflow-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.approvals-hub {
  display: grid;
  gap: var(--space-5);
}

.approvals-hero {
  display: grid;
  gap: var(--space-4);
  padding: clamp(1.5rem, 2vw, 2.5rem);
  border-radius: 24px;
  background: linear-gradient(120deg, rgba(226, 232, 240, 0.9), rgba(219, 234, 254, 0.7));
  border: 1px solid rgba(148, 163, 184, 0.35);
  position: relative;
  overflow: hidden;
}

.approvals-hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -45% auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 70%);
  transform: rotate(-12deg);
}

.approvals-hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
  color: #475569;
  margin: 0 0 var(--space-1);
}

.approvals-hero-title {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.6rem, 2vw, 2.1rem);
  color: #0f172a;
}

.approvals-hero-subtitle {
  margin: 0;
  max-width: 520px;
  color: #334155;
}

.approvals-hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  position: relative;
  z-index: 1;
}

.hero-stat {
  padding: var(--space-3);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(203, 213, 225, 0.6);
  display: grid;
  gap: 4px;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: #0f172a;
}

.stat-label {
  font-size: 0.85rem;
  color: #64748b;
}

.approvals-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: var(--space-5);
  align-items: start;
}

.approvals-feed-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.approvals-feed-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.approvals-feed-meta {
  color: #64748b;
  font-size: 0.85rem;
}

.approvals-grid {
  display: grid;
  gap: var(--space-4);
}

.approval-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.approval-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.12);
}

.approval-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}

.approval-card-eyebrow {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 4px;
}

.approval-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
}

.approval-card-subtitle {
  font-size: 0.9rem;
  color: #475569;
  margin-top: 2px;
}

.approval-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.35);
  white-space: nowrap;
}

.approval-card-meta {
  margin: 0;
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.approval-card-meta dt {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.approval-card-meta dd {
  margin: 0;
  font-size: 0.95rem;
  color: #0f172a;
}

.approval-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  justify-content: space-between;
}

.approval-complete {
  font-size: 0.85rem;
  font-weight: 600;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.3);
  padding: 6px 12px;
  border-radius: 999px;
}

.approval-action-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.approval-card-links {
  display: inline-flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.approvals-pagination {
  margin-top: var(--space-4);
}

.approvals-empty {
  padding: var(--space-5);
  border-radius: 20px;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  background: rgba(248, 250, 252, 0.8);
  text-align: center;
}

.approvals-empty h4 {
  margin: 0 0 var(--space-2);
}

.approvals-rail {
  display: grid;
  gap: var(--space-3);
}

.approvals-rail-card {
  background: rgba(15, 23, 42, 0.02);
  border-radius: 18px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  padding: var(--space-3);
  color: #334155;
}

.approvals-rail-card.accent {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.7), rgba(254, 249, 195, 0.9));
  border-color: rgba(251, 191, 36, 0.5);
}

@media (max-width: 1024px) {
  .approvals-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .approval-card-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

.workflow-timeline {
  min-height: 320px;
}

.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-3);
}

.timeline-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: var(--space-3);
  align-items: flex-start;
  position: relative;
}

.timeline-marker {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  margin-top: 6px;
}

.timeline-item.is-current .timeline-marker {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.timeline-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
}

.timeline-meta {
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.workflow-task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-2);
}

.badge-status {
  background: rgba(255, 255, 255, 0.12);
}
