:root {
  --bg: #f1f6fc;
  --bg-strong: #e5eef8;
  --card: rgba(255, 255, 255, 0.92);
  --card-strong: #ffffff;
  --line: rgba(22, 49, 68, 0.12);
  --text: #15314b;
  --muted: #60758a;
  --brand: #0756a8;
  --brand-dark: #064789;
  --accent: #ff695c;
  --danger: #bb3e3e;
  --success: #2f8f5b;
  --shadow: 0 24px 60px rgba(18, 48, 65, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-ui: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  direction: ltr;
}

html[dir="rtl"] {
  direction: rtl;
}

html[lang="ar"] {
  --font-ui: "Cairo", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 105, 92, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(7, 86, 168, 0.12), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

a {
  color: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 140px;
  height: 100px;
  object-fit: contain;
  border-radius: 12px;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-size: 1.05rem;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 28px rgba(18, 48, 65, 0.08);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 28px rgba(18, 48, 65, 0.08);
}

.lang-toggle a {
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease;
}

.lang-toggle a:hover {
  background: rgba(7, 86, 168, 0.08);
  color: var(--text);
}

.lang-toggle a[aria-current="page"] {
  background: linear-gradient(135deg, var(--brand) 0%, #2685d8 100%);
  color: white;
  box-shadow: 0 12px 24px rgba(7, 86, 168, 0.2);
}

.hero {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-panel,
.highlight-panel,
.card,
.profile-card,
.form-card,
.empty-state,
.alert,
.table-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 34px;
  border-radius: var(--radius-xl);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(7, 86, 168, 0.1);
  color: var(--brand-dark);
  font-weight: 700;
  margin-bottom: 18px;
}

.hero h1,
.page-title {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.15;
}

.hero p,
.lead,
.muted {
  color: var(--muted);
}

.hero-actions,
.button-row,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.highlight-panel {
  padding: 28px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.highlight-panel::after {
  content: "";
  position: absolute;
  inset: auto -40px -48px auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 105, 92, 0.16);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.stat,
.mini-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.stat strong,
.mini-card strong {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.5rem;
}

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

.card,
.profile-card,
.form-card,
.table-card,
.empty-state {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card h3,
.profile-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(7, 86, 168, 0.1);
  color: var(--brand-dark);
  font-size: 0.92rem;
  font-weight: 700;
}

.meta {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.meta-item span:first-child {
  color: var(--muted);
}

.button,
button,
input[type="submit"] {
  appearance: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
  transform: translateY(-1px);
}

.button-primary,
button,
input[type="submit"] {
  background: linear-gradient(135deg, var(--brand) 0%, #2685d8 100%);
  color: white;
  box-shadow: 0 16px 32px rgba(7, 86, 168, 0.22);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  border: 1px solid var(--line);
}

.button-danger {
  background: rgba(187, 62, 62, 0.12);
  color: var(--danger);
  border: 1px solid rgba(187, 62, 62, 0.14);
  box-shadow: none;
}

.button-block {
  width: 100%;
}

.stack {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-full {
  grid-column: 1 / -1;
}

label {
  font-weight: 700;
}

input[type="text"],
input[type="tel"],
input[type="password"],
textarea,
input[type="file"] {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(18, 48, 65, 0.14);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  color: var(--text);
}

textarea {
  min-height: 138px;
  resize: vertical;
}

input[type="checkbox"] {
  inline-size: 18px;
  block-size: 18px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.helper {
  color: var(--muted);
  font-size: 0.92rem;
}

.link-preview {
  word-break: break-word;
  padding: 14px;
  border-radius: 16px;
  background: rgba(7, 86, 168, 0.08);
  border: 1px dashed rgba(7, 86, 168, 0.26);
  color: var(--brand-dark);
}

.alert {
  padding: 16px 18px;
  border-radius: 18px;
  margin-bottom: 18px;
}

.alert-success {
  background: rgba(47, 143, 91, 0.12);
  color: #145c36;
}

.alert-warning {
  background: rgba(255, 105, 92, 0.16);
  color: #8b4d12;
}

.alert-error {
  background: rgba(187, 62, 62, 0.12);
  color: #7b2323;
}

.table-card {
  overflow: hidden;
}

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

.responsive-table th,
.responsive-table td {
  padding: 16px 12px;
  text-align: start;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.responsive-table th {
  color: var(--muted);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.42);
}

.responsive-table tr:last-child td {
  border-bottom: 0;
}

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

.profile-header {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.75fr);
  margin-bottom: 24px;
}

.profile-summary {
  padding: 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(7, 86, 168, 0.98) 0%, rgba(4, 71, 137, 0.98) 100%);
  color: white;
  box-shadow: var(--shadow);
}

.profile-summary p,
.profile-summary .muted {
  color: rgba(255, 255, 255, 0.86);
}

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

.audio-box {
  padding: 18px;
  border-radius: 18px;
  background: rgba(7, 86, 168, 0.08);
  border: 1px solid rgba(7, 86, 168, 0.16);
}

.audio-autoplay-note {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

audio {
  width: 100%;
  margin-top: 12px;
}

.footer-note {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero,
  .profile-header,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .responsive-table,
  .responsive-table thead,
  .responsive-table tbody,
  .responsive-table th,
  .responsive-table td,
  .responsive-table tr {
    display: block;
    width: 100%;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tr {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
  }

  .responsive-table td {
    border: 0;
    padding: 8px 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-weight: 700;
  }
}
