:root {
  --color-bg: #f3f5f9;
  --color-surface: #ffffff;
  --color-border: #d5d9e2;
  --color-muted: #6b7280;
  --color-text: #1f2933;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-danger: #dc2626;
  --color-success: #16a34a;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-md: 0 10px 30px rgba(30, 64, 175, 0.08);
  --shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.08);
  --font-sans: 'Tajawal', 'Cairo', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: linear-gradient(135deg, #f0f4ff 0%, #fdfdfd 100%);
  color: var(--color-text);
  min-height: 100vh;
}

body[dir='rtl'] {
  direction: rtl;
  text-align: right;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
  color: var(--color-text);
}

p {
  margin: 0 0 0.75rem;
  color: var(--color-muted);
}

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

a:hover,
a:focus {
  text-decoration: underline;
}

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

.page--home .content {
  padding: 2.5rem clamp(1rem, 6vw, 5rem) 4rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.page--form .content,
.page--detail .content {
  padding: 2rem clamp(1rem, 4vw, 3.5rem) 4rem;
}

.content--narrow {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.topbar,
.subbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(209, 213, 219, 0.6);
  padding: 1.25rem clamp(1rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar__logo {
  font-size: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

.topbar__nav,
.subbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

body[dir='rtl'] .topbar__brand,
body[dir='rtl'] .topbar__nav,
body[dir='rtl'] .subbar__actions {
  flex-direction: row-reverse;
}

body[dir='rtl'] .topbar__subtitle {
  text-align: right;
}

.language-toggle {
  display: inline-flex;
  background: rgba(37, 99, 235, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
  gap: 0.25rem;
}

.language-toggle__btn {
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.8rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.language-toggle__btn:hover {
  color: var(--color-primary);
}

.language-toggle__btn.is-active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.language-toggle__btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}

.button {
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.4);
  outline-offset: 3px;
}

.button--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  box-shadow: var(--shadow-sm);
}

.button--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.button--ghost {
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary);
}

.button--ghost:hover {
  background: rgba(37, 99, 235, 0.16);
}

.button--danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--color-danger);
}

.button--danger:hover {
  background: rgba(220, 38, 38, 0.2);
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0));
  padding: 0 0 2.5rem;
}

.hero__strip {
  background: linear-gradient(120deg, #1d4ed8, #2563eb);
  color: #fff;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 1.1rem clamp(1rem, 6vw, 4rem);
  box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.2);
}

.hero__content {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 2rem;
  padding: 0 clamp(1rem, 6vw, 4rem);
}

.hero__text {
  flex: 1 1 360px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  box-shadow: var(--shadow-md);
}

.hero__eyebrow {
  font-size: 0.95rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 1rem;
}

.hero__description {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.hero__status {
  font-size: 0.95rem;
  color: var(--color-muted);
}

.hero__preview {
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-card {
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 320px;
  width: 100%;
  position: relative;
  box-shadow: 0 18px 35px rgba(17, 24, 39, 0.25);
}

.preview-card__badge {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  background: rgba(96, 165, 250, 0.85);
  color: #fff;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

body[dir='rtl'] .preview-card__badge {
  left: auto;
  right: 1.2rem;
}

.preview-card h2 {
  margin-top: 1.8rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.preview-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
}

.section {
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 3rem);
  box-shadow: var(--shadow-md);
}

.section__title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 0.75rem;
}

.section__subtitle {
  margin-bottom: 2rem;
  font-size: 1rem;
  color: var(--color-muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.card {
  position: relative;
  padding: 1.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(248, 250, 255, 0.75);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card__badge {
  position: absolute;
  top: 1.2rem;
  left: 1.5rem;
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary);
  padding: 0.2rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

body[dir='rtl'] .card__badge {
  left: auto;
  right: 1.5rem;
}

.card h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.card p {
  margin: 0;
  line-height: 1.8;
}

.section--highlight {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(59, 130, 246, 0.04));
}

.highlight {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
}

.highlight__content h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 1rem;
}

.highlight__content p {
  margin: 0;
  line-height: 1.9;
}

.highlight__list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.highlight__item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.highlight__icon {
  font-size: 1.8rem;
}

.section--updates {
  background: rgba(37, 99, 235, 0.06);
}

.updates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.update-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.update-card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
}

.update-card p {
  margin: 0;
  line-height: 1.8;
}

.section__footer {
  margin: 0;
  font-weight: 600;
  color: var(--color-primary);
}

.footer {
  padding: 2rem clamp(1rem, 6vw, 4rem);
  text-align: center;
  color: var(--color-muted);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .hero__strip {
    letter-spacing: 0.02em;
  }

  .hero__text {
    padding: 1.5rem;
  }

  .preview-card {
    max-width: 260px;
    padding: 1.6rem;
  }

  .card {
    padding: 1.5rem;
  }

  .card__badge {
    top: 1rem;
    left: 1.2rem;
  }

  body[dir='rtl'] .card__badge {
    left: auto;
    right: 1.2rem;
  }
}

.button--small {
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
}

.button--full {
  width: 100%;
}

.menu-search {
  position: relative;
  min-width: clamp(220px, 28vw, 320px);
}

.menu-search__input {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.menu-search__dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  display: none;
  max-height: 320px;
  overflow-y: auto;
  z-index: 20;
}

.menu-search__dropdown.active {
  display: block;
}

.menu-search__item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.menu-search__item:last-child {
  border-bottom: none;
}

.menu-search__item:hover,
.menu-search__item:focus {
  background: rgba(37, 99, 235, 0.08);
}

.menu-search__empty {
  padding: 1rem;
  color: var(--color-muted);
}

.panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.panel__title {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.panel__description {
  margin-bottom: 1.5rem;
  max-width: 620px;
}

.panel__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.warehouse-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.warehouse-card:hover,
.warehouse-card:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.inventory-header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.inventory-search {
  position: relative;
}

.inventory-search__input {
  min-width: 220px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.95);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.inventory-search__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.inventory-table-wrapper {
  margin-top: 1rem;
  overflow-x: auto;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.inventory-table th,
.inventory-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.inventory-table th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-muted);
}

.inventory-table td {
  font-size: 0.95rem;
  color: var(--color-text);
}

.inventory-table__quantity {
  width: 120px;
  text-align: center;
  font-weight: 600;
}

.inventory-table__expiration {
  width: 160px;
  white-space: nowrap;
  color: var(--color-muted);
}

.inventory-table__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.inventory-table__adjust,
.inventory-table__manage {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.inventory-table__action-button {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.inventory-table__btn {
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary);
  font-weight: 700;
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.inventory-table__btn:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.inventory-table__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.inventory-table__btn--increment {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
}

.inventory-table__btn--increment:hover:not(:disabled) {
  box-shadow: var(--shadow-sm);
}

.inventory-empty {
  margin: 1.25rem 0 0;
  color: var(--color-muted);
  font-style: italic;
}

.card-list {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.family-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(237, 242, 255, 0.75));
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid rgba(37, 99, 235, 0.12);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.family-card--actionable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.family-card--actionable:hover,
.family-card--actionable:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.family-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.family-card__title {
  font-size: 1.2rem;
}

.family-card__tag {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
}

.family-card__meta {
  font-size: 0.9rem;
}

.family-card__note {
  font-size: 0.85rem;
  color: var(--color-muted);
  min-height: 2.5rem;
}

.family-card__footer {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
}

.form-card,
.detail-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.form-card h2,
.detail-card h2 {
  font-size: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.input-group label {
  font-weight: 600;
  font-size: 0.95rem;
}

.input-group input,
.input-group textarea,
.input-group select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.95);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.date-input {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
}

.date-input [data-date-input] {
  flex: 1;
}

.date-input__button {
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: rgba(226, 232, 240, 0.6);
  color: var(--color-primary);
  padding: 0 0.85rem;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.date-input__button:hover {
  background: rgba(226, 232, 240, 0.9);
}

.date-input__button:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.date-input__icon {
  font-size: 1.1rem;
  line-height: 1;
}

.date-input__native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  border: 0;
  padding: 0;
}

.input-group input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid--two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  margin: 0.5rem 0;
}

.switch input {
  display: none;
}

.switch__slider {
  width: 46px;
  height: 26px;
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.switch__slider::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.switch input:checked + .switch__slider {
  background: rgba(37, 99, 235, 0.4);
}

.switch input:checked + .switch__slider::after {
  transform: translateX(20px);
}

.switch__label {
  font-weight: 600;
}

.spouse-fields {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.05);
}

.hidden {
  display: none !important;
}

.section-help {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: -0.5rem;
  margin-bottom: 0.75rem;
}

.children-list {
  display: grid;
  gap: 1rem;
}

.child-card {
  border: 1px solid rgba(191, 219, 254, 0.8);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background: rgba(239, 246, 255, 0.75);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.child-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.child-card__remove {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-muted);
  transition: color 0.2s ease;
}

.child-card__remove:hover {
  color: var(--color-danger);
}

.child-card__note {
  font-size: 0.85rem;
  color: var(--color-primary-dark);
  background: rgba(37, 99, 235, 0.1);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}

.child-card--static {
  background: var(--color-surface);
  border-color: rgba(148, 163, 184, 0.4);
}

.child-card__status {
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 999px;
  color: var(--color-primary);
}

.child-card__meta,
.child-card__footer {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.detail-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.25rem;
}

.detail-list dt {
  font-weight: 600;
  color: var(--color-muted);
}

.detail-list dd {
  margin: 0;
  font-size: 0.95rem;
}

.detail-list--compact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.benefit-detail {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.benefit-detail h3,
.benefit-detail h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
}

.benefit-detail__list {
  display: grid;
  gap: 0.75rem;
}

.benefit-detail__item {
  border: 1px solid rgba(191, 219, 254, 0.6);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  background: rgba(237, 242, 255, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.benefit-detail__meta {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--color-muted);
  font-size: 0.9rem;
  list-style: disc;
}

.benefit-picker {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.benefit-picker__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
  display: none;
  margin-top: 0.35rem;
  z-index: 25;
}

.benefit-picker__dropdown.active {
  display: block;
}

.benefit-option {
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.benefit-option:last-child {
  border-bottom: none;
}

.benefit-option:hover {
  background: rgba(37, 99, 235, 0.08);
}

.benefit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.benefit-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(37, 99, 235, 0.14);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  color: var(--color-primary);
  font-size: 0.85rem;
}

.benefit-tag button {
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}
.member-benefits {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.benefit-entry-list {
  display: grid;
  gap: 1rem;
}

.benefit-entry {
  border: 1px solid rgba(191, 219, 254, 0.7);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: rgba(37, 99, 235, 0.06);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.form-feedback {
  min-height: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-danger);
}

.form-feedback[data-state='saving'] {
  color: var(--color-muted);
}

.form-feedback[data-state='success'] {
  color: var(--color-success);
}

.form-feedback[data-state='error'] {
  color: var(--color-danger);
}

.optional {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.auth {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  gap: 2rem;
  min-height: 100vh;
  padding: clamp(2rem, 8vw, 5rem);
}

.auth__intro {
  color: var(--color-text);
  max-width: 420px;
}

.auth__intro h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 0.5rem;
}

.auth__intro ul {
  padding-left: 1.2rem;
  color: var(--color-muted);
  line-height: 1.6;
}

.auth__card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 5vw, 2.5rem);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(37, 99, 235, 0.12);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth__card header h2 {
  font-size: 1.7rem;
}

.auth__toggle {
  text-align: center;
}

.auth__toggle button {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
}

.modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-md);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
}

.modal__content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.modal__actions--split {
  align-items: center;
}

.modal__actions--split .modal__delete {
  margin-right: auto;
}

.modal__meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.benefit-tags li::marker {
  content: '';
}

.benefit-tags li {
  list-style: none;
}

.benefit-tags li::before {
  content: '';
}

.benefit-tags li {
  display: inline-flex;
  align-items: center;
}

.benefit-tags li button {
  margin-left: 0.35rem;
}

.benefit-tags li button:hover {
  color: var(--color-danger);
}

.detail-card strong {
  color: var(--color-text);
}

.detail-card dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.75rem 1rem;
}

dt {
  font-weight: 600;
  color: var(--color-muted);
}

dd {
  margin: 0;
  color: var(--color-text);
}

.benefit-tags li {
  background: rgba(37, 99, 235, 0.1);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  color: var(--color-primary);
  font-weight: 600;
}

html[dir='rtl'] body {
  direction: rtl;
}

html[dir='rtl'] .topbar,
html[dir='rtl'] .subbar,
html[dir='rtl'] .auth,
html[dir='rtl'] .content,
html[dir='rtl'] .auth__intro ul {
  text-align: right;
}

html[dir='rtl'] .topbar__brand,
html[dir='rtl'] .topbar__nav,
html[dir='rtl'] .subbar__actions {
  flex-direction: row-reverse;
}

html[dir='rtl'] .topbar__brand > div {
  text-align: right;
}

html[dir='rtl'] input,
html[dir='rtl'] textarea,
html[dir='rtl'] select {
  text-align: right;
}

html[dir='rtl'] .date-input {
  flex-direction: row-reverse;
}

.translation-editor {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.translation-group {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.translation-group[open] {
  box-shadow: var(--shadow-sm);
}

.translation-group__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.translation-group__summary::-webkit-details-marker {
  display: none;
}

.translation-group__summary::after {
  content: '▾';
  font-size: 0.9rem;
  color: var(--color-muted);
  transition: transform 0.2s ease;
}

.translation-group[open] .translation-group__summary::after {
  transform: rotate(180deg);
}

.translation-group__summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}

.translation-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(248, 250, 252, 0.7);
}

.translation-table th,
.translation-table td {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid rgba(203, 213, 225, 0.6);
  vertical-align: top;
}

.translation-table th {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  color: var(--color-muted);
  background: rgba(241, 245, 249, 0.85);
}

.translation-table__cell--english {
  width: 45%;
}

.translation-table__cell--arabic {
  width: 55%;
}

.translation-english {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--color-text);
}

.translation-english__text {
  font-size: 0.95rem;
  line-height: 1.5;
}

.translation-key {
  font-size: 0.75rem;
  color: var(--color-muted);
  font-family: 'Fira Code', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  background: rgba(37, 99, 235, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  width: fit-content;
}

.translation-input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  resize: vertical;
  line-height: 1.5;
  background: #ffffff;
  color: var(--color-text);
}

.translation-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.translation-input[data-state='error'] {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.change-request__note {
  margin: 0.75rem 0 0;
  color: var(--color-muted);
}

.change-request__diff {
  margin-top: 1rem;
}

.change-request__diff h4 {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.change-request__diff-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.change-request__diff-line {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.change-request__details {
  margin-top: 0.75rem;
}

.change-request__details summary {
  cursor: pointer;
  font-weight: 600;
}

.change-request__details pre {
  margin-top: 0.5rem;
  background: rgba(15, 23, 42, 0.04);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.4;
}

.change-request__resolution {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.change-request__resolution-note {
  margin-top: 0.35rem;
}

.change-request__decision {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.change-request__buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.change-request[data-status='approved'] .family-card__tag {
  background: rgba(34, 197, 94, 0.15);
  color: #166534;
}

.change-request[data-status='denied'] .family-card__tag {
  background: rgba(248, 113, 113, 0.15);
  color: #b91c1c;
}

.change-request[data-status='pending'] .family-card__tag {
  background: rgba(250, 204, 21, 0.15);
  color: #854d0e;
}

@media (max-width: 768px) {
  .translation-group__summary {
    padding-inline: 1rem;
  }

  .translation-table th,
  .translation-table td {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .translation-table tr {
    display: block;
    border-bottom: 1px solid rgba(203, 213, 225, 0.5);
  }

  .translation-table__cell--english {
    padding-bottom: 0.25rem;
  }

  .translation-table__cell--arabic {
    padding-top: 0.25rem;
  }
}

html[dir='rtl'] .menu-search__dropdown,
html[dir='rtl'] .benefit-picker__dropdown,
html[dir='rtl'] .language-toggle {
  text-align: right;
}

@media (max-width: 720px) {
  .topbar,
  .subbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar__nav,
  .subbar__actions {
    width: 100%;
    justify-content: space-between;
  }

  .panel,
  .form-card,
  .detail-card {
    padding: 1.5rem;
  }

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

.content--center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 8rem);
  padding: 2rem;
}

.panel--centered {
  max-width: 32rem;
  margin: 0 auto;
  text-align: center;
}

.panel--centered .panel__title {
  margin-bottom: 1rem;
}

.panel--centered .panel__description {
  margin-bottom: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
