:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --surface: #ffffff;
  --surface-2: #f0ece5;
  --ink: #171411;
  --muted: #6f675e;
  --line: #ded6ca;
  --brand: #0f7b68;
  --brand-dark: #075847;
  --accent: #c99a2e;
  --danger: #b42318;
  --radius: 8px;
  --shadow: 0 18px 40px rgb(23 20 17 / 10%);
}

* { box-sizing: border-box; }
html { direction: rtl; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Tajawal", "Noto Kufi Arabic", system-ui, sans-serif;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
button, input, textarea, select { font: inherit; }
.container { width: min(1120px, calc(100% - 24px)); margin-inline: auto; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgb(247 244 238 / 92%);
  backdrop-filter: blur(16px);
}
.nav { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.2rem; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: var(--radius); color: #fff; background: var(--brand);
  box-shadow: inset 0 -8px 18px rgb(0 0 0 / 16%);
}
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-weight: 800; }
.button {
  min-width: 44px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  padding: 12px 18px; font-weight: 900; cursor: pointer;
}
.button.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.button.ghost { background: transparent; }
.hero { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: center; padding: 28px 0 20px; }
.hero h1, .page-title { margin: 0; font-size: clamp(2rem, 12vw, 3rem); line-height: 1.12; letter-spacing: 0; overflow-wrap: anywhere; }
.hero p, .lead { color: var(--muted); font-size: 1.08rem; line-height: 1.9; }
.hero-visual {
  display: none; min-height: 460px; border: 10px solid #171411; border-radius: 34px;
  background: linear-gradient(145deg, rgb(15 123 104 / 12%), rgb(201 154 46 / 12%)), linear-gradient(145deg, #e8f1ed, #f4ead1);
  box-shadow: var(--shadow); overflow: hidden; align-items: flex-end;
}
.preview-sheet { width: calc(100% - 28px); margin: 14px; background: rgb(255 255 255 / 94%); border-radius: 20px; padding: 18px; }
.preview-row { height: 12px; border-radius: 999px; background: var(--surface-2); margin-block: 10px; }
.section { padding: 28px 0; }
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 16px; min-width: 0;
}
.card h3, .card h2 { margin: 0 0 10px; }
.muted { color: var(--muted); }
.price { font-size: 2rem; font-weight: 950; }
.badge {
  display: inline-flex; align-items: center; min-height: 28px; border-radius: 999px;
  padding: 4px 10px; background: var(--surface-2); color: var(--brand-dark);
  font-weight: 900; font-size: 0.86rem;
}
.dashboard { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 18px 0 88px; }
.sidebar { display: none; position: sticky; top: 92px; align-self: start; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 10px; }
.sidebar a { display: flex; align-items: center; justify-content: space-between; min-height: 48px; border-radius: var(--radius); padding: 10px 12px; color: var(--muted); font-weight: 900; }
.sidebar a:hover { background: var(--surface-2); color: var(--ink); }
.dashboard-content { min-width: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.toolbar.compact { margin-bottom: 8px; }
.toolbar.compact h3 { margin: 0; }
.stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.field { display: grid; gap: 7px; }
.field span, .field label { color: var(--muted); font-size: 0.92rem; font-weight: 900; }
.input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); padding: 10px 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-width: 100%; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { border-bottom: 1px solid var(--line); padding: 13px; text-align: right; vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--muted); font-size: 0.88rem; }
.public-shell { min-height: 100vh; background: #fff; overflow-x: clip; }
.profile-cover { min-height: 168px; background: linear-gradient(120deg, rgb(15 123 104 / 92%), rgb(201 154 46 / 74%)); }
.profile-main { margin-top: -48px; padding-bottom: 28px; }
.avatar { width: 96px; height: 96px; border: 4px solid #fff; border-radius: var(--radius); background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 2.4rem; font-weight: 950; }
.locked { opacity: 0.58; position: relative; }
.locked::after { content: "مقفل"; position: absolute; inset-inline-start: 12px; top: 12px; border-radius: 999px; padding: 3px 9px; background: #fff3cd; color: #7a4d00; font-size: 0.8rem; font-weight: 900; }
.notice { border: 1px solid #f0dfb0; border-radius: var(--radius); background: #fff8e6; color: #71520c; padding: 12px; font-weight: 800; }
.notice.danger { border-color: #f2c7c2; background: #fff0ee; color: var(--danger); }
.auth-card { max-width: 540px; margin-inline: auto; }
.qr-image { width: 240px; height: 240px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 10px; }

@media (max-width: 480px) {
  .container { width: min(100% - 20px, 1120px); }
  .nav { align-items: flex-start; flex-direction: column; padding-block: 12px; }
  .nav-links { width: 100%; gap: 8px; }
  .nav-links > * { flex: 1 1 auto; }
  .page-title { font-size: 2rem; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar.compact { align-items: flex-start; }
  table { min-width: 560px; }
}
@media (min-width: 768px) {
  .container { width: min(1120px, calc(100% - 40px)); }
  .hero { grid-template-columns: 1fr 0.75fr; gap: 28px; padding: 42px 0 28px; }
  .hero h1, .page-title { font-size: clamp(2.25rem, 6vw, 4rem); }
  .hero-visual { display: flex; min-height: 500px; width: min(100%, 340px); justify-self: center; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-cover { min-height: 220px; }
  .profile-main { margin-top: -68px; padding-bottom: 36px; }
  .avatar { width: 112px; height: 112px; }
}
@media (min-width: 1024px) {
  .container { width: min(1120px, calc(100% - 56px)); }
  .hero { grid-template-columns: 1.05fr 0.95fr; gap: 36px; padding: 54px 0 28px; }
  .hero-visual { width: min(100%, 380px); }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard { grid-template-columns: 260px minmax(0, 1fr); gap: 18px; padding: 22px 0 36px; }
  .sidebar { display: block; }
}

