/* Morar Casa dashboard. One style sheet for both instances: warm paper background, soft cards, one clear primary action
   per screen. Everything is RTL-first, and the small screens get the same layout with fewer columns rather than a cut-down one. */
:root {
  --bg: #f7f5f1; --bg2: #efece5; --card: #fff; --ink: #1b2430; --ink2: #3d4757; --muted: #6b7688; --line: #e6e2d9;
  --brand: #17356b; --brand-soft: #e9eefb; --gold: #b8873b; --ok: #0f7a4e; --okbg: #e6f4ec; --warn: #b0661a;
  --warnbg: #fdf1e0; --bad: #b3261e; --badbg: #fbeae8; --chart: #2f5bea;
  --sh: 0 1px 2px rgba(27, 36, 48, .05), 0 8px 24px -18px rgba(27, 36, 48, .35); --r: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c; --bg2: #171b24; --card: #1a1f29; --ink: #eef1f7; --ink2: #cfd6e4; --muted: #9aa3b5; --line: #2a3040;
    --brand: #9db4ff; --brand-soft: #202a44; --gold: #d8a75c; --ok: #4ade80; --okbg: #10291c; --warn: #fbbf24;
    --warnbg: #2c2210; --bad: #f87171; --badbg: #321516; --chart: #8da6ff;
    --sh: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -20px rgba(0, 0, 0, .9);
  }
}
* { box-sizing: border-box }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 -apple-system, system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- top bar ---------- */
header {
  display: flex; align-items: center; gap: 18px; padding: 12px 22px; background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px }
.brand .mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; font-weight: 700; font-size: 15px;
  background: linear-gradient(140deg, var(--brand), #2b5bb5); letter-spacing: .5px;
}
header h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -.2px }
header .tag { font-size: 12.5px; color: var(--muted) }
.navwrap { flex: 1 1 520px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain; touch-action: pan-x; cursor: grab; scroll-behavior: smooth; padding-bottom: 2px }
.navwrap.dragging { cursor: grabbing; scroll-behavior: auto }
.navwrap::-webkit-scrollbar { height: 6px }
.navwrap::-webkit-scrollbar-track { background: transparent }
.navwrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px }
nav { display: flex; gap: 4px; padding: 4px; background: var(--bg2); border-radius: 14px; width: max-content; margin: 0 }
nav button {
  border: 0; background: transparent; color: var(--ink2); padding: 8px 14px; border-radius: 10px; font: inherit; font-size: 14.5px;
  cursor: pointer; white-space: nowrap; transition: background .15s, color .15s;
}
nav button::before { content: attr(data-icon); margin-inline-end: 6px; opacity: .8 }
nav button:hover { background: color-mix(in srgb, var(--card) 70%, transparent) }
nav button.on { background: var(--card); color: var(--brand); font-weight: 700; box-shadow: var(--sh) }
.who { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px }
.who .mail { direction: ltr }

/* ---------- layout ---------- */
main { max-width: 1140px; margin: 0 auto; padding: 26px 18px 90px }
h2 { font-size: 22px; margin: 34px 0 4px; letter-spacing: -.3px }
h3 { font-size: 16.5px; margin: 0 0 10px; letter-spacing: -.2px }
.sub { color: var(--muted); font-size: 14.5px; margin: 0 0 14px }
.grid { display: grid; gap: 14px }
.cards { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) }
.projects { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)) }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sh) }

/* ---------- hero ---------- */
.hero {
  display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 24px 26px;
  border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--sh);
  background: radial-gradient(120% 160% at 100% 0, var(--brand-soft), transparent 55%), var(--card);
}
.hero .eyebrow { margin: 0 0 4px; font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold); font-weight: 700 }
.hero h2 { margin: 0 0 6px; font-size: 26px }
.hero-sub { margin: 0; color: var(--ink2); font-size: 15.5px; max-width: 52ch }
.hero-nums { display: flex; gap: 12px; flex-wrap: wrap }
/* Numbers sit on the hero itself, separated by a hairline instead of their own tiles. */
.hero-nums .n { min-width: 100px; padding: 2px 16px; border-inline-start: 1px solid var(--line) }
.hero-nums .n:first-child { border-inline-start: 0; padding-inline-start: 2px }
.hero-nums b { display: block; font-size: 24px; line-height: 1.15 }
.hero-nums span { font-size: 12.5px; color: var(--muted) }

/* ---------- attention ---------- */
.todo { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 14px }
/* Flat rows, not cards inside a card: a hairline separator and the icon carry the state. */
.todo .item { display: flex; align-items: center; gap: 14px; padding: 14px 2px; border-bottom: 1px solid var(--line) }
.todo .item:last-child { border-bottom: 0 }
.todo .item.zero { opacity: .95 }
.todo .ic { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--warnbg); font-size: 20px }
.todo .item.zero .ic { background: var(--okbg) }
.todo .txt { flex: 1 1 auto; min-width: 0 }
.todo .txt b { display: block; font-size: 15.5px }
.todo .txt span { color: var(--muted); font-size: 13.5px }
.todo .num { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin-inline: 4px 8px }
.done { display: flex; gap: 12px; align-items: center; padding: 18px; border-radius: var(--r); background: var(--okbg);
  border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); font-weight: 600; margin-top: 14px }

/* ---------- kpi ---------- */
.kpi { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh) }
.kpi .kpi-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); font-size: 19px }
.kpi b { display: block; font-size: 23px; line-height: 1.2; letter-spacing: -.4px }
.kpi span { color: var(--muted); font-size: 13.5px }
.kpi.alert .kpi-ic { background: var(--warnbg) }
.kpi.alert b { color: var(--warn) }

/* ---------- project cards ---------- */
.proj-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px }
.proj-head h3 { margin: 0 }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 14px 0 4px }
.mini div { min-width: 0 }
.mini span { display: block; color: var(--muted); font-size: 12.5px }
.mini b { font-size: 16px; letter-spacing: -.2px }
.bar { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin: 10px 0 2px }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--chart)) }
.barlabel { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted) }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line) }
.row:last-child { border: 0 }
.row span:first-child { color: var(--muted) }

/* ---------- badges & chips ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap }
.b-high { background: var(--okbg); color: var(--ok) }
.b-medium { background: var(--warnbg); color: var(--warn) }
.b-low, .b-none { background: var(--badbg); color: var(--bad) }
.b-gray { background: var(--bg2); color: var(--muted) }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px }
.chip { background: var(--warnbg); color: var(--warn); border-radius: 9px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; font-weight: 600 }
.chip.on { outline: 2px solid var(--brand) }
button.chip { border: 0; font: inherit }
.chip.act { outline: 1px dashed var(--brand) }
.alerts { margin: 12px 0 0; padding-inline-start: 4px; color: var(--ink2); font-size: 13.5px; list-style: none }
.alerts li { margin: 6px 0; padding-inline-start: 20px; position: relative }
.alerts li::before { content: "⚠"; position: absolute; inset-inline-start: 0; color: var(--warn) }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--sh) }
table { width: 100%; border-collapse: collapse; background: var(--card) }
th, td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line); font-size: 14.5px; vertical-align: top }
th { background: var(--bg2); font-weight: 700; font-size: 13px; color: var(--ink2); position: sticky; top: 0 }
tbody tr:last-child td { border-bottom: 0 }
tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 45%, transparent) }
/* A dot marks the row; no colored stripe down the cell edge. */
tr.d-red td:first-child, tr.d-amber td:first-child { position: relative; padding-inline-start: 26px }
tr.d-red td:first-child::before, tr.d-amber td:first-child::before {
  content: ""; position: absolute; inset-inline-start: 13px; top: 50%; width: 7px; height: 7px; border-radius: 50%;
  transform: translateY(-50%) }
tr.d-red td:first-child::before { background: var(--bad) }
tr.d-amber td:first-child::before { background: var(--warn) }
tr.sel { background: var(--brand-soft) }
table.clickable tbody tr { cursor: pointer }

/* ---------- controls ---------- */
.btn, nav button, .steps button { font-family: inherit }
.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 9px 16px; border-radius: 11px; cursor: pointer;
  font-size: 14.5px; transition: transform .12s, box-shadow .12s, background .12s }
.btn:hover { box-shadow: var(--sh) }
.btn:active { transform: translateY(1px) }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600 }
.btn.ghost { background: transparent }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none }
a.btn { display: inline-block; text-decoration: none }
input, select, textarea {
  font: inherit; font-size: 14.5px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--ink); max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px }
input.num { width: 150px; direction: ltr; text-align: end }
input.email { width: 260px; direction: ltr }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px }
.steps button { border: 1px solid var(--line); background: var(--card); color: var(--ink2); border-radius: 99px; padding: 8px 16px;
  cursor: pointer; font-size: 14px }
.steps button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700 }

/* ---------- misc ---------- */
.hint { color: var(--muted); font-size: 13.5px; margin: 6px 0 14px }
.ok { color: var(--ok); font-weight: 700 } .err { color: var(--bad); font-weight: 700 }
.empty { color: var(--muted); padding: 22px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r); background: var(--card) }
/* The centred block is the only surface here: no wrapper box around a card. */
.login { display: grid; place-items: center; min-height: 68vh; padding: 0 18px; text-align: center }
.login .card { width: min(430px, 100%); padding: 34px 28px }
.toast { position: fixed; inset-inline: 0; bottom: 20px; margin: auto; width: max-content; max-width: 90%; background: var(--ink);
  color: var(--bg); padding: 11px 20px; border-radius: 12px; z-index: 40; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5) }
svg text { fill: var(--muted); font-size: 11px }
svg { max-height: 240px; width: 100% }
td:nth-child(1), td:nth-child(2) { white-space: nowrap }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; margin: 8px 0 16px;
  border: 2px dashed var(--line); border-radius: 18px; background: var(--card); cursor: pointer; text-align: center; transition: .15s }
.drop b { font-size: 18px } .drop span { color: var(--muted); font-size: 14px }
.drop:hover, .drop:focus, .drop.over { border-color: var(--brand); background: var(--brand-soft); outline: none }
.cands { display: grid; gap: 6px; margin: 8px 0 }
.cand { display: block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer }
.cand:hover { background: var(--brand-soft) }

@media (max-width: 720px) {
  header { padding: 10px 14px; gap: 10px }
  .who .mail { display: none }
  .navwrap { order: 3; flex-basis: 100%; margin: 0 -14px; padding: 0 8px }
  nav { margin: 0 }
  main { padding: 18px 12px 80px }
  h2 { font-size: 20px }
  .hero { padding: 20px; border-radius: 18px }
  .hero h2 { font-size: 22px }
  .mini { grid-template-columns: 1fr 1fr }
  .kpi b { font-size: 20px }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }

.doclink{color:inherit;text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.doclink:hover{opacity:.75}

/* --- screen scaffolding: a plain sentence at the top, numbered steps, and lists that do not look like tables */
.pagehead h2 { margin-bottom: 2px }
.sec { margin: 24px 0 }
.sec > h3 { margin: 0 0 4px }
.sec > .hint { margin-top: 0 }
.stepnum { display: flex; gap: 10px; align-items: flex-start; margin: 24px 0 8px }
.stepnum .numbadge { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px }
.stepnum b { display: block }
.stepnum p { margin: 2px 0 0 }
.cleanlist { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 2px }
.cleanlist li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--line) }
.cleanlist li:last-child { border-bottom: 0 }
.btn.small { padding: 3px 10px; font-size: 13px; line-height: 1.5 }
.steps button { display: flex; align-items: center; gap: 6px }
.card > .row { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; flex-wrap: wrap }
.card > .row h3 { margin: 0 }

.langsw{display:flex;gap:4px;margin-inline-end:10px}.langsw .btn{padding:4px 8px;font-size:12px}.langsw .btn.on{font-weight:700;text-decoration:underline}
