:root {
  --ink: #22332f;
  --muted: #5f6f6b;
  --line: #d8e0dd;
  --canvas: #f4f6f5;
  --surface: #fff;
  --primary: #0b6b5d;
  --primary-dark: #084f46;
  --primary-soft: #e4f2ef;
  --brand: #0f7d6c;
  --brand-soft: #e2f3ef;
  --success: #26734d;
  --warning: #9b6700;
  --danger: #b93827;
  --shadow: 0 2px 6px rgba(67, 89, 113, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--muted); font: 15px/1.55 "Public Sans", "Noto Kufi Arabic", Tahoma, sans-serif; }
button, input, select, textarea { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(11,107,93,.22); outline-offset: 2px; }

.account-header { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; width: min(1180px, calc(100% - 40px)); min-height: 3.875rem; margin: 1.25rem auto 0; padding: .55rem 1rem; border-radius: .5rem; background: var(--surface); box-shadow: var(--shadow); }
.account-brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; }
.account-brand img, .account-brand__mark { width: 2.55rem; height: 2.55rem; object-fit: contain; }
.account-brand__mark { display:grid; flex:0 0 auto; place-items:center; border-radius:.55rem; background:var(--brand); color:#fff; font-weight:900; text-transform:uppercase; }
.account-brand__mark.has-image { background-color:#fff; background-position:center; background-size:contain; background-repeat:no-repeat; color:transparent; }
.account-brand span { display: grid; line-height: 1.05; }
.account-brand strong { font-size: 1.08rem; }
.account-brand small { color: var(--brand); font-weight: 800; }
.account-header nav { display: flex; align-items: center; gap: .6rem; }
.account-header nav a, .account-header nav button { min-height: 2.75rem; border: 1px solid var(--line); border-radius: .375rem; padding: .62rem .85rem; background: var(--surface); color: var(--muted); font-weight: 700; text-decoration: none; cursor: pointer; }
.account-header nav a:hover, .account-header nav button:hover { color: var(--primary-dark); border-color: var(--primary); }
.account-menu-toggle, .account-menu-close, .dashboard-scrim { display: none; }

.account-shell { display: grid; grid-template-columns: minmax(280px,.75fr) minmax(480px,1.25fr); width: min(1180px,calc(100% - 40px)); margin: 1.5rem auto 4rem; overflow: hidden; border-radius: .5rem; background: var(--surface); box-shadow: var(--shadow); }
.account-intro { padding: 3.25rem; background: linear-gradient(150deg,color-mix(in srgb,var(--brand) 45%,#10201c),color-mix(in srgb,var(--brand) 20%,#263b36)); color: #fff; }
.eyebrow { margin: 0; color: var(--primary); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.account-intro .eyebrow { color: #a7e8dc; }
.account-intro h1 { margin: 1rem 0 .8rem; font-size: clamp(2.25rem,5vw,3.4rem); line-height: 1.04; letter-spacing: -.035em; }
.account-intro > p:not(.eyebrow) { color: #d7e1de; }
.account-intro ul { display: grid; gap: .75rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.account-intro li { display: flex; gap: .65rem; }
.account-intro li::before { content: "✓"; color: #a7e8dc; font-weight: 900; }
.auth-card { padding: 2.75rem 3.25rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
.auth-tabs button { min-height: 2.75rem; border: 0; border-bottom: 3px solid transparent; padding: .75rem; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.auth-tabs button.active { border-color: var(--primary); color: var(--primary-dark); }
.auth-form { display: grid; gap: 1rem; }
.form-kicker { margin: 0 0 .45rem !important; color: var(--primary-dark) !important; font-size: .68rem; font-weight: 850; letter-spacing: .11em; }
.form-heading h2, .dashboard h2 { margin: 0; color: var(--ink); font-size: 1.75rem; line-height: 1.15; letter-spacing: -.02em; }
.form-heading p { margin: .45rem 0 .4rem; color: var(--muted); }
label { display: grid; gap: .4rem; color: var(--ink); font-weight: 600; }
input, select, textarea { width: 100%; min-height: 2.875rem; border: 1px solid var(--line); border-radius: .375rem; padding: .7rem .8rem; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(11,107,93,.12); outline: 0; }
.primary { min-height: 2.875rem; border: 0; border-radius: .375rem; padding: .75rem 1rem; background: var(--primary); color: #fff; font-weight: 800; box-shadow: 0 2px 4px rgba(11,107,93,.22); cursor: pointer; }
.primary:hover { background: var(--primary-dark); }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.back-link { justify-self: start; border: 0; padding: .25rem 0; background: transparent; color: var(--primary-dark); font-weight: 750; cursor: pointer; }
.back-link>span[aria-hidden] { display:inline-block; }
[dir=rtl] .back-link>span[aria-hidden] { transform:scaleX(-1); }
.business-invitation { display: grid; grid-template-columns:auto minmax(0,1fr) auto; align-items: center; gap: .8rem; margin-top: 2rem; padding-top: 1.35rem; border-top: 1px solid var(--line); }
.business-invitation__mark { display: grid; width: 2.5rem; height: 2.5rem; place-items: center; border-radius: .5rem; background: var(--primary-soft); color: var(--primary-dark); font-weight: 900; }
.business-invitation div { min-width: 0; }
.business-invitation strong { color: var(--ink); }
.business-invitation p { margin: .15rem 0 0; color: var(--muted); font-size: .8rem; }
.business-invitation button { border: 1px solid var(--primary); border-radius: .375rem; padding: .6rem .75rem; background: #fff; color: var(--primary-dark); font-size: .8rem; font-weight: 800; cursor: pointer; }
.business-invitation button:hover { background: var(--primary-soft); }
.message { margin-top: 1rem; padding: .75rem .9rem; border-inline-start: 3px solid var(--brand); border-radius: .375rem; background: var(--brand-soft); color: #0a594d; font-weight: 700; }
.message.error { border-color: var(--danger); background: #ffe5e0; color: #c33418; }

.dashboard { grid-column: 1/-1; display: grid; grid-template-columns: 16.25rem minmax(0,1fr); min-height: 650px; background: var(--canvas); }
body:has(#dashboard-view:not([hidden])) .account-intro { display: none; }
.dashboard-nav { position: relative; z-index: 10; padding: 1.25rem 1rem; background: #fff; box-shadow: var(--shadow); }
.customer-card { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.25rem; padding: .55rem .65rem 1.1rem; border-bottom: 1px solid var(--line); }
.customer-card > span { display: grid; flex: 0 0 2.55rem; width: 2.55rem; height: 2.55rem; place-items: center; border-radius: .375rem; background: var(--brand); color: #fff; font-weight: 900; }
.customer-card div { display: grid; min-width: 0; }
.customer-card strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.customer-card small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.dashboard-nav > button:not(.account-menu-close) { width: 100%; min-height: 2.75rem; margin-bottom: .2rem; border: 0; border-radius: .375rem; padding: .68rem .85rem; background: transparent; color: var(--muted); font-weight: 700; text-align: start; cursor: pointer; }
.dashboard-nav > button:not(.account-menu-close):hover { background: #f5f5f9; color: var(--ink); }
.dashboard-nav > button.active:not(.account-menu-close) { background: var(--primary); color: #fff; box-shadow: 0 2px 4px rgba(11,107,93,.22); }
.dashboard-nav .logout { margin-top: 1.25rem; color: var(--danger); }
.dashboard-content { min-width: 0; padding: 2rem clamp(1.25rem,3vw,2.5rem); }
.dashboard-content > section { max-width: 1000px; margin: 0 auto; }
.dashboard-content h2 { margin: .3rem 0 1.5rem; }
.welcome-panel { display: grid; grid-template-columns: minmax(0,1fr) minmax(15rem,.7fr); gap: 1rem; }
.welcome-copy,.account-actions,.recent-panel { border-radius: .55rem; background: #fff; box-shadow: var(--shadow); }
.welcome-copy { padding: 1.5rem; }
.welcome-copy h3 { margin: 0; color: var(--ink); font-size: 1.3rem; }
.welcome-copy p { max-width: 38rem; margin: .45rem 0 1.2rem; }
.welcome-copy a { display: inline-flex; min-height: 2.75rem; align-items: center; border-radius: .4rem; padding: .65rem 1rem; background: var(--primary); color: #fff; font-weight: 800; text-decoration: none; }
.account-actions { display: grid; align-content: start; overflow: hidden; }
.account-actions button { display: grid; grid-template-columns:2rem 1fr auto; align-items:center; gap:.7rem; width:100%; border:0; border-bottom:1px solid var(--line); padding:.9rem 1rem; background:#fff; color:var(--ink); text-align:start; cursor:pointer; }
.account-actions button:last-child { border-bottom:0; }
.account-actions button:hover { background:#f3f8f6; }
.account-actions button>span:first-child { display:grid; width:2rem; height:2rem; place-items:center; border-radius:.4rem; background:var(--primary-soft); color:var(--primary-dark); font-weight:900; }
.account-actions button strong { display:block; }
.account-actions button small { display:block; color:var(--muted); font-weight:500; }
.recent-panel { margin-top:1rem; padding:1.25rem; }
.recent-panel h3 { margin:0 0 .8rem; color:var(--ink); }
.recent-panel .record { padding-inline:0; box-shadow:none; }
.section-heading { display: flex; justify-content: space-between; }
.section-heading p:not(.eyebrow) { max-width:34rem; margin:-.9rem 0 1.3rem; color:var(--muted); }
.address-form { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-bottom: 1.25rem; padding: 1.25rem; border-radius: .5rem; background: #fff; box-shadow: var(--shadow); }
.address-form .wide { grid-column: 1/-1; }
.coordinate-details { border:1px solid var(--line); border-radius:.4rem; padding:.75rem .85rem; background:#f8faf9; }
.coordinate-details summary { color:var(--ink); font-weight:750; cursor:pointer; }
.coordinate-details>div { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; margin-top:.8rem; }
.coordinate-details small { display:block; margin-top:.6rem; color:var(--muted); }
.address-map-field { min-width:0; margin:0; border:1px solid var(--line); border-radius:.5rem; padding:1rem; background:#f8faf9; }
.address-map-field legend { padding:0 .35rem; color:var(--ink); font-weight:800; }
.address-map-field>p { margin:.1rem 0 .8rem; color:var(--muted); font-size:.85rem; }
.address-map { width:100%; min-height:290px; overflow:hidden; border:1px solid var(--line); border-radius:.5rem; background:#e8ece9; }
.map-actions { display:flex; align-items:center; gap:.75rem; margin-top:.75rem; }
.map-actions button { min-height:44px; border:1px solid var(--primary); border-radius:.4rem; padding:.55rem .8rem; background:#fff; color:var(--primary-dark); font-weight:750; cursor:pointer; }
.map-actions output { color:var(--muted); font-size:.82rem; }
.coordinate-inputs { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; margin-top:.75rem; }
.address-map-field>small { display:block; margin-top:.65rem; }
.leaflet-container { font:inherit; }
.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: auto; min-height: auto; }
.record-list { display: grid; gap: 0; overflow: hidden; border-radius: .5rem; background: #fff; box-shadow: var(--shadow); }
.record { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); background: #fff; }
.record:last-child { border-bottom: 0; }
.record:hover { background: #fafaff; }
.record strong { display: block; color: var(--ink); }
.record small { display: block; margin-top: .2rem; color: var(--muted); }
.status { display: inline-flex; align-items: center; border-radius: .25rem; padding: .35rem .55rem; background: var(--brand-soft); color: #0a594d; font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.empty { padding: 2rem; border: 1px dashed var(--line); border-radius: .5rem; color: var(--muted); text-align: center; }
.business-links { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-top: 1.5rem; }
.business-links a { display: grid; gap: .45rem; min-height: 8rem; padding: 1.25rem; border: 0; border-radius: .5rem; background: #fff; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.business-links a:hover { box-shadow: 0 0 0 2px var(--primary); }
.business-links small { color: var(--muted); }

[dir=rtl] .dashboard-nav { border: 0; }
[dir=rtl] .dashboard-nav > button { text-align: right; }

@media (max-width: 820px) {
  body.account-menu-open { overflow: hidden; }
  .account-header { width: calc(100% - 24px); margin-top: .75rem; padding: .5rem .65rem; }
  body:has(#dashboard-view:not([hidden])) .account-menu-toggle { display: grid !important; width: 2.75rem; padding: .7rem !important; place-content: center; gap: .22rem; border-color: transparent !important; background: var(--primary-soft) !important; }
  .account-menu-toggle span { display: block; width: 1.15rem; height: 2px; background: var(--primary-dark); }
  .account-shell { grid-template-columns: 1fr; width: calc(100% - 24px); margin-top: .75rem; }
  .dashboard { display: block; }
  .dashboard-nav { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(17rem,86vw); height: 100dvh; overflow-y: auto; transform: translateX(-105%); transition: transform .22s ease; }
  body:not(.account-menu-open) .dashboard-nav { transition: none; }
  [dir=rtl] .dashboard-nav { inset: 0 0 0 auto; transform: translateX(105%); }
  body.account-menu-open .dashboard-nav { transform: translateX(0); }
  .account-menu-close { display: grid; width: 2.5rem; height: 2.5rem; margin: 0 0 .75rem auto; place-items: center; border: 0; border-radius: .375rem; background: var(--canvas); color: var(--muted); font-size: 1.5rem; cursor: pointer; }
  [dir=rtl] .account-menu-close { margin: 0 auto .75rem 0; }
  .dashboard-scrim { position: fixed; z-index: 35; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(34,48,62,.48); opacity: 0; pointer-events: none; }
  body.account-menu-open .dashboard-scrim { display: block; opacity: 1; pointer-events: auto; }
  .dashboard-content { padding: 1.5rem 1rem; }
  .welcome-panel, .business-links { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .account-brand span { display: none; }
  .account-header nav a { display: inline-flex; align-items:center; padding-inline:.65rem; font-size:.8rem; }
  .account-intro { padding: 2rem 1.4rem; }
  .account-intro h1 { font-size: 2.35rem; }
  .account-intro ul { margin-top: 1.4rem; }
  .auth-card { padding: 1.5rem 1.2rem; }
  .two-columns, .address-form { grid-template-columns: 1fr; }
  .address-form .wide { grid-column: auto; }
  .coordinate-details>div { grid-template-columns:1fr; }
  .map-actions { align-items:stretch; flex-direction:column; }
  .coordinate-inputs { grid-template-columns:1fr; }
  .business-invitation { grid-template-columns:auto 1fr; }
  .business-invitation button { grid-column:1/-1; width:100%; }
  .record { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) { .dashboard-nav { transition: none; } }

.account-footer { width:min(1180px,calc(100% - 40px)); margin:-2.5rem auto 2rem; color:var(--muted); font-size:.75rem; font-weight:700; text-align:center; }
