:root {
  --green: #0F4C3A; --green-2: #176B50; --gold: #D97706; --bg: #F6F8F7; --surface: #FFFFFF; --ink: #17211D;
  --muted: #5d6b65; --line: #dfe7e3; --soft: #e8f1ed; --gold-soft: #fdf3e6; --red: #b42318; --red-soft: #fdecea;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,76,58,.06), 0 6px 20px rgba(15,76,58,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'IBM Plex Sans Arabic', Tajawal, Tahoma, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.7; font-size: 16px; }
a { color: var(--green-2); }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 10px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.i { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: embed; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--green); color: #fff; border: 0; border-radius: 10px; padding: 11px 20px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--green-2); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(217,119,6,.45); outline-offset: 2px; }
.btn.gold { background: var(--gold); } .btn.gold:hover { background: #b86304; }
.btn.ghost { background: transparent; color: var(--green); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: var(--red); }
.btn.sm { padding: 7px 12px; font-size: 14px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; }
textarea { min-height: 90px; resize: vertical; }
input.invalid, select.invalid { border-color: var(--red); background: var(--red-soft); }
.field { margin-bottom: 14px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.check input { width: auto; margin-top: 6px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.choice { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; display: flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 700; background: #fff; }
.choice input { width: auto; accent-color: var(--green); }
.choice:has(input:checked) { border-color: var(--green); background: var(--soft); }
.error { color: var(--red); font-weight: 700; min-height: 1em; }

/* Header and footer */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.top .wrap { display: flex; align-items: center; gap: 18px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); font-weight: 700; font-size: 20px; }
.brand img { width: 38px; height: 38px; }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; line-height: 1.2; }
.nav { display: flex; gap: 18px; margin-inline-start: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--green-2); }
.site-footer { background: var(--green); color: #d6e6df; padding: 40px 0 24px; margin-top: 60px; font-size: 14px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer-grid h4 { color: #fff; margin: 0 0 8px; }
.footer-grid a { display: block; text-decoration: none; margin: 4px 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 24px; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.notice { background: var(--gold-soft); border: 1px solid #f3d3a6; color: #7a4504; border-radius: 12px; padding: 12px 16px; font-size: 14px; }

/* Landing */
.hero { background: linear-gradient(135deg, var(--green) 0%, #0b3a2c 100%); color: #fff; padding: 64px 0; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -80px -120px auto; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(217,119,6,.18); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); margin-bottom: 14px; }
.hero h1 em { font-style: normal; color: #fbbf24; }
.hero p.lead { font-size: 18px; color: #d6e6df; margin: 0 0 24px; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: 14px; color: #d6e6df; padding: 0; list-style: none; }
.hero .badges li::before { content: "✓"; color: #fbbf24; margin-inline-end: 6px; font-weight: 700; }
.eyebrow { display: inline-block; background: var(--gold-soft); color: #92400e; border-radius: 99px; padding: 4px 14px; font-weight: 700; font-size: 13px; }
.hero .eyebrow { background: rgba(255,255,255,.12); color: #fde68a; }
.section { padding: 64px 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 32px; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 34px); margin: 10px 0 8px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.feature .ic, .step .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--soft); color: var(--green); display: grid; place-items: center; margin-bottom: 10px; }
.feature .ic .i, .step .ic .i { width: 24px; height: 24px; }
.feature h3, .step h3 { font-size: 17px; margin-bottom: 4px; }
.feature p, .step p { margin: 0; color: var(--muted); font-size: 15px; }
.step { position: relative; }
.step .n { position: absolute; top: 16px; inset-inline-end: 16px; color: var(--gold); font-weight: 700; font-size: 22px; }
.calc { background: #fff; color: var(--ink); border-radius: 18px; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.calc h3 { color: var(--green); }
.calc .lines div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.calc .lines .total { font-weight: 700; font-size: 18px; border-bottom: 0; color: var(--green); }
.calc .req { margin: 12px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.calc .req li::before { content: "•"; color: var(--gold); margin-inline-end: 6px; }
.pkg { display: flex; flex-direction: column; }
.pkg .tag { align-self: flex-start; background: var(--soft); color: var(--green); border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.pkg p { color: var(--muted); flex: 1; }
.b2b { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { padding: 6px 0; padding-inline-start: 28px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: #fff; background: var(--green-2); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; top: 10px; }
details.faq { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
details.faq summary { font-weight: 700; cursor: pointer; }
details.faq p { color: var(--muted); margin: 10px 0 0; }

/* App shell (customer and staff) */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 67px); }
.side { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 16px 10px; position: sticky; top: 67px; height: calc(100vh - 67px); overflow-y: auto; }
.side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; margin-bottom: 2px; }
.side a:hover { background: var(--soft); }
.side a.on { background: var(--green); color: #fff; }
.side .badge { margin-inline-start: auto; background: var(--gold); color: #fff; border-radius: 99px; font-size: 12px; padding: 0 8px; }
.side .sep { border-top: 1px solid var(--line); margin: 10px 4px; }
.main { padding: 24px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 24px; margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi b { display: block; font-size: 26px; color: var(--green); line-height: 1.3; }
.kpi span { color: var(--muted); font-size: 14px; }
.kpi.warn b { color: var(--gold); } .kpi.bad b { color: var(--red); }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th { background: #f9fbfa; color: var(--muted); font-weight: 700; position: sticky; top: 0; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #f6faf8; }
.pill { display: inline-block; border-radius: 99px; padding: 1px 10px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--green); white-space: nowrap; }
.pill.gold { background: var(--gold-soft); color: #92400e; } .pill.red { background: var(--red-soft); color: var(--red); } .pill.gray { background: #eef0ef; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 140px; padding: 8px 10px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .i { width: 40px; height: 40px; color: var(--line); display: block; margin: 0 auto 8px; }
.skeleton { background: linear-gradient(90deg, #eef2f0 25%, #f7f9f8 50%, #eef2f0 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; height: 18px; margin: 10px 0; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }

/* Tracker */
.tracker { list-style: none; padding: 0; margin: 0; }
.tracker li { position: relative; padding: 0 0 18px; padding-inline-start: 34px; }
.tracker li::before { content: ""; position: absolute; inset-inline-start: 11px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.tracker li:last-child::before { display: none; }
.tracker .dot { position: absolute; inset-inline-start: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; color: #fff; }
.tracker li.done .dot { background: var(--green-2); border-color: var(--green-2); }
.tracker li.now .dot { background: var(--gold); border-color: var(--gold); }
.tracker li.done::before { background: var(--green-2); }
.tracker b { display: block; font-size: 15px; } .tracker small { color: var(--muted); }
.tracker li.todo b { color: var(--muted); font-weight: 500; }

/* Wizard */
.wizard-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 20px; counter-reset: s; overflow-x: auto; }
.wizard-steps li { flex: 1; min-width: 110px; text-align: center; font-size: 13px; color: var(--muted); padding-top: 34px; position: relative; }
.wizard-steps li::before { counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; }
.wizard-steps li.on { color: var(--green); font-weight: 700; } .wizard-steps li.on::before { background: var(--green); border-color: var(--green); color: #fff; }
.wizard-steps li.done::before { content: "✓"; background: var(--green-2); border-color: var(--green-2); color: #fff; }
.wizard-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }

/* Documents */
.docs { display: grid; gap: 10px; }
.doc { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.doc .name { font-weight: 700; }
.doc .meta { font-size: 13px; color: var(--muted); }
.doc .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.doc .reason { grid-column: 1 / -1; background: var(--red-soft); color: var(--red); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.doc.missing { border-style: dashed; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: #eef3f1; border-radius: 12px; padding: 10px; min-height: 200px; }
.kcol h4 { margin: 0 0 8px; font-size: 14px; display: flex; justify-content: space-between; }
.kcard { background: #fff; border-radius: 10px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; font-size: 13px; }
.kcard b { display: block; }

/* Modal, toast */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10,30,24,.5); }
dialog .dh { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
dialog .dh h3 { margin: 0; font-size: 18px; }
dialog .db { padding: 20px; max-height: 70vh; overflow-y: auto; }
dialog .df { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.x { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 14px; }
.toast.ok { background: var(--green-2); } .toast.bad { background: var(--red); }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 10px; }
.chart div { flex: 1; background: var(--green-2); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.chart div:hover { background: var(--gold); }
.bars .bar { display: grid; grid-template-columns: 140px 1fr 60px; gap: 8px; align-items: center; font-size: 14px; margin: 6px 0; }
.bars .bar span:nth-child(2) { background: var(--soft); border-radius: 6px; height: 12px; position: relative; overflow: hidden; }
.bars .bar i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--green-2); border-radius: 6px; }
.menu-btn { display: none; }

@media (max-width: 900px) {
  .hero-grid, .b2b, .cols, .footer-grid { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 67px 0 0 auto; width: 260px; z-index: 40; transform: translateX(100%); transition: transform .2s; box-shadow: -10px 0 30px rgba(0,0,0,.1); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main { padding: 16px; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .bars .bar { grid-template-columns: 100px 1fr 44px; }
  .section { padding: 44px 0; }
  .hero { padding: 44px 0; }
}
@media print { .top, .side, .site-footer, .btn { display: none !important; } .shell { display: block; } }
