@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-soft: #eef3f4;
  --surface-mid: #e5ecef;
  --text: #172026;
  --muted: #5f6e78;
  --border: #d6e0e5;
  --brand: #0b7a68;
  --brand-strong: #082f2b;
  --brand-soft: #d9f8ef;
  --sidebar: #f2f6f7;
  --sidebar-border: #dde7eb;
  --danger: #b4232b;
  --danger-soft: #ffe0dd;
  --warning: #956000;
  --warning-soft: #fff0d9;
  --info: #2c6173;
  --info-soft: #d8eef7;
  --success: #1d6f62;
  --success-soft: #daf7ef;
  --shadow: 0 18px 38px rgba(15, 23, 42, 0.07);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body.rtl {
  font-family: "Cairo", Tahoma, "Segoe UI", sans-serif;
}

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

button,
input,
select,
textarea,
a {
  transition: 0.2s ease;
}

.page-shell {
  min-height: 100vh;
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-inline-end: 1px solid var(--sidebar-border);
  padding: 22px 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand-block h2 {
  margin: 0;
  font-size: 18px;
  color: #0f332e;
}

.brand-mark-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(8, 47, 43, 0.18);
  flex: 0 0 auto;
}

.brand-mark-row span {
  display: grid;
  gap: 1px;
}

.brand-mark-row strong {
  color: var(--brand-strong);
  font-size: 17px;
  line-height: 1.1;
}

.brand-mark-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.brand-kicker {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.brand-block p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.nav-links {
  display: grid;
  gap: 8px;
  align-content: start;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: 0.2s ease;
}

.nav-link:hover {
  background: rgba(15, 107, 96, 0.07);
  color: var(--brand-strong);
}

.nav-link.active {
  background: linear-gradient(180deg, rgba(15, 107, 96, 0.1), rgba(15, 107, 96, 0.06));
  color: var(--brand-strong);
  border-color: rgba(15, 107, 96, 0.14);
  box-shadow: inset 3px 0 0 var(--brand-strong);
}

.nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 107, 96, 0.08);
  color: var(--brand-strong);
  font-size: 9px;
  font-weight: 800;
  flex: 0 0 auto;
}

.nav-copy {
  display: grid;
  gap: 2px;
}

.nav-copy strong {
  font-size: 13px;
}

.nav-copy span {
  font-size: 11px;
}

.sidebar-footer {
  display: grid;
  gap: 16px;
}

.primary-cta {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #16907f);
  color: #fff;
  font-weight: 800;
  border: none;
  box-shadow: 0 10px 24px rgba(15, 107, 96, 0.22);
}

.language-row {
  display: flex;
  gap: 8px;
}

.lang-button {
  flex: 1;
}

.lang-button.active {
  background: var(--brand);
  color: #fff;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--sidebar-border);
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #64c3b2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.profile-copy {
  overflow: hidden;
}

.profile-copy strong,
.profile-copy span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-copy strong {
  font-size: 13px;
}

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

.main-panel {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(219, 228, 232, 0.9);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  flex: 1;
}

.topbar-left h1 {
  margin: 0;
  font-size: 16px;
  color: #102722;
  white-space: nowrap;
}

.search-shell {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.search-shell input {
  padding-inline-start: 40px;
  background: #f1f5f7;
  border: 1px solid transparent;
}

.search-shell::before {
  content: "⌕";
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.user-menu-wrap {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  background: #f1f5f7;
  color: var(--text);
  padding: 8px 10px;
  border: 1px solid rgba(214, 224, 229, 0.9);
}

.user-menu-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #64c3b2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.user-menu-text {
  display: grid;
  text-align: left;
}

.user-menu-text strong,
.user-menu-text small {
  display: block;
  line-height: 1.2;
}

.user-menu-text small {
  color: var(--muted);
  font-size: 11px;
}

.user-menu-caret {
  color: var(--muted);
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
  gap: 6px;
  z-index: 30;
}

.user-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
}

.user-menu-item:hover {
  background: #eef4f6;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f1f5f7;
  color: var(--muted);
  border: none;
}

.icon-button:hover {
  background: #e7eef2;
}

.page {
  padding: 24px;
}

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

.page-header {
  margin-bottom: 18px;
}

.page-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

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

.breadcrumbs a {
  color: var(--brand-strong);
  font-weight: 600;
}

.breadcrumbs .sep {
  color: #93a1aa;
}

.page-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.5;
  font-size: 13px;
}

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

.row-actions button {
  min-height: 40px;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.toolbar .field {
  min-width: 180px;
  flex: 1 1 220px;
}

.toolbar .field.compact {
  flex: 0 1 180px;
}

.toolbar .field.compact button,
.toolbar .field.compact select {
  width: 100%;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.pagination .actions {
  gap: 8px;
}

.content-stack {
  display: grid;
  gap: 20px;
}

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

.card:hover {
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.09);
}

.card-header {
  padding: 16px 18px 10px;
  border-bottom: 1px solid rgba(219, 228, 232, 0.7);
}

.card-header h2 {
  margin: 0;
  font-size: 16px;
}

.card-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.card-body {
  padding: 18px;
}

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

.stat {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.stat .label {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.stat .value {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat .hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

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

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px dashed rgba(219, 228, 232, 0.86);
  padding-bottom: 8px;
}

.meta-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.meta-row strong {
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--info-soft);
  color: var(--info);
}

.pill.success {
  background: var(--success-soft);
  color: var(--success);
}

.pill.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cad7dd;
  border-radius: 8px;
  padding: 11px 13px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(12, 95, 85, 0.48);
  box-shadow: 0 0 0 4px rgba(12, 95, 85, 0.12);
}

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

button {
  border: none;
  border-radius: 8px;
  padding: 11px 15px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(12, 95, 85, 0.2);
  outline-offset: 2px;
}

button.secondary {
  background: #e8eef1;
  color: var(--text);
}

button.warn {
  background: #f2a233;
}

button.danger {
  background: var(--danger);
}

.banner {
  padding: 11px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.banner.note {
  background: var(--info-soft);
  color: var(--info);
}

.banner.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.banner.success {
  background: var(--success-soft);
  color: var(--success);
}

.hidden {
  display: none !important;
}

.table-wrap {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f7fafb;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px 15px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(219, 228, 232, 0.82);
}

body.rtl th,
body.rtl td {
  text-align: right;
}

th {
  background: #edf3f5;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

tbody tr:nth-child(even) td {
  background: rgba(247, 251, 252, 0.92);
}

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
}

.feature-grid {
  display: grid;
  gap: 20px;
}

.feature-grid.two {
  grid-template-columns: 1.25fr 0.75fr;
}

.list-stack {
  display: grid;
  gap: 14px;
}

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

.timeline-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
}

.timeline-item strong,
.timeline-item span,
.timeline-item small {
  display: block;
}

.timeline-item strong {
  font-size: 13px;
}

.timeline-item span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 12px;
}

.timeline-item small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.list-item {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.list-item:hover,
.session-card:hover,
.stat:hover {
  transform: translateY(-2px);
}

.list-item .eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.list-item .headline {
  margin: 8px 0 6px;
  font-size: 16px;
  font-weight: 800;
}

.list-item .sub {
  color: var(--muted);
  font-size: 13px;
}

.highlight-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(135deg, #0c5f55 0%, #127b6f 100%);
  color: #fff;
  padding: 28px;
}

.highlight-card h3 {
  margin: 0;
  font-size: 28px;
}

.highlight-card p {
  margin: 12px 0 0;
  max-width: 480px;
  line-height: 1.7;
  opacity: 0.9;
}

.highlight-orb {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  inset-inline-end: -60px;
  bottom: -80px;
}

.token-box,
.empty-box {
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  color: var(--muted);
  background: #f8fbfc;
}

.token-box {
  font-family: Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.empty-box {
  text-align: center;
  line-height: 1.7;
}

.session-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
}

.session-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.session-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.session-title h4 {
  margin: 0;
  font-size: 16px;
}

.session-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  margin: 12px 0;
}

.qr-box {
  min-height: 220px;
  border: 1px dashed #acc2cb;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #fff;
  padding: 12px;
}

.qr-box p {
  margin: 0;
  max-width: 280px;
  text-align: center;
  color: var(--muted);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
}

.auth-layout {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 460px);
  gap: 24px;
  align-items: stretch;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  padding: 34px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.16), transparent 26%),
    linear-gradient(145deg, #0f4d45 0%, #0b6a5f 46%, #133c48 100%);
  color: #fff;
  box-shadow: 0 24px 56px rgba(10, 34, 52, 0.24);
}

.auth-hero .eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.8;
  font-weight: 800;
}

.auth-hero h1 {
  margin: 16px 0 0;
  font-size: 44px;
  line-height: 1.06;
  letter-spacing: -0.04em;
  max-width: 640px;
}

.auth-hero p {
  margin: 16px 0 0;
  max-width: 620px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
}

.auth-feature-list {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}

.auth-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-feature-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 900;
  flex: 0 0 auto;
}

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

.auth-feature-copy strong {
  font-size: 15px;
}

.auth-feature-copy span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.6;
}

.auth-hero-orb {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  inset-inline-end: -70px;
  bottom: -90px;
}

.auth-card {
  max-width: none;
}

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

.auth-card .actions {
  margin-top: 4px;
}

.auth-footnote {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.auth-link {
  color: var(--brand-strong);
  font-weight: 700;
}

.auth-note {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f4f8fa;
  border: 1px solid var(--border);
  color: var(--muted);
  line-height: 1.7;
}

.center-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.loading-card {
  width: min(620px, 100%);
  text-align: center;
}

.loading-card .card-body {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.loading-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 5px solid rgba(12, 95, 85, 0.12);
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto;
  }
  .feature-grid.two,
  .split,
  .stats {
    grid-template-columns: 1fr;
  }
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .auth-hero h1 {
    font-size: 36px;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 18px;
  }
  .page-tools {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar,
  .topbar-left,
  .meta-row,
  .session-head {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar .field,
  .toolbar .field.compact {
    min-width: 0;
    flex: 1 1 auto;
  }
  .actions,
  .row-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .actions button,
  .row-actions button {
    width: 100%;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stat .value {
    font-size: 20px;
  }
  .table-wrap {
    border-radius: 14px;
    -webkit-overflow-scrolling: touch;
  }
  table {
    min-width: 620px;
    font-size: 13px;
  }
  th,
  td {
    padding: 11px 10px;
  }
  .card {
    border-radius: 16px;
  }
  .pagination {
    align-items: stretch;
  }
  .pagination .actions {
    width: 100%;
  }
  .pagination .actions button {
    flex: 1 1 0;
  }
  .session-card {
    padding: 14px;
  }
  .qr-box {
    min-height: 180px;
  }
  .auth-shell {
    padding: 16px;
  }
  .auth-hero,
  .card-body,
  .card-header {
    padding-inline: 18px;
  }
  .auth-hero h1,
  .page-title {
    font-size: 24px;
  }
  .auth-footnote {
    flex-direction: column;
    align-items: flex-start;
  }
  .top-icons {
    padding-inline-start: 0;
  }
  .user-menu-text {
    display: none;
  }
}
