* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green: #0e7a3d; --green-dark: #0a5c2e; --bg: #f4f6f5; --card: #ffffff;
  --text: #1c2420; --muted: #6b7672; --amber: #b45309; --red: #b91c1c;
  --border: #e2e8e4;
}
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 480px; margin: 0 auto; min-height: 100%; padding: 64px 16px 40px; }
.screen { display: flex; flex-direction: column; gap: 20px; }
.hidden { display: none !important; }
.brand { text-align: center; padding-top: 24px; }
.brand-badge {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px;
  background: linear-gradient(145deg, var(--green), var(--green-dark));
  color: #fff; font-size: 36px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(14,122,61,.25);
}
h1 { font-size: 24px; margin-bottom: 8px; }
h2 { font-size: 20px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.7; }
form { display: flex; flex-direction: column; gap: 14px; background: var(--card);
  padding: 20px; border-radius: 16px; border: 1px solid var(--border); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
input, select {
  font: inherit; font-weight: 400; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 10px; background: #fbfdfc; direction: rtl;
}
input:focus, select:focus { outline: none; border-color: var(--green); }
button { font: inherit; cursor: pointer; border: none; border-radius: 12px; padding: 14px;
  font-weight: 700; font-size: 16px; }
button.primary { background: var(--green); color: #fff; }
button.primary:disabled { opacity: .6; }
button.ghost { background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.error { color: var(--red); font-size: 13px; }
.status-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 36px 24px; text-align: center; display: flex; flex-direction: column; gap: 14px;
  align-items: center; margin-top: 40px; }
.status-icon { width: 84px; height: 84px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 40px; font-weight: 700; color: #fff; }
.status-icon.pending { background: var(--red); }
.status-icon.pending::after { content: '…'; }
.status-icon.approved { background: var(--green); }
.status-icon.approved::after { content: '✓'; }
.status-icon.rejected { background: var(--red); }
.status-icon.rejected::after { content: '✕'; }
.info-box { background: #f8faf9; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; font-size: 13px; color: var(--muted); width: 100%;
  display: flex; flex-direction: column; gap: 4px; }
.info-box b { color: var(--text); }
.spinner { width: 26px; height: 26px; border: 3px solid var(--border);
  border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.home-header { display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.online-pill { display: flex; align-items: center; gap: 6px; background: #e8f5ec;
  color: var(--green-dark); font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.home-empty { text-align: center; padding: 48px 20px; display: flex; flex-direction: column;
  gap: 12px; align-items: center; }
.big-check { width: 72px; height: 72px; border-radius: 50%; background: var(--green);
  color: #fff; font-size: 36px; display: flex; align-items: center; justify-content: center; }
.offline-bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--red);
  color: #fff; text-align: center; padding: 10px; font-size: 13px; font-weight: 600; }

/* settings drawer */
.menu-btn { position: fixed; top: 12px; inset-inline-start: 12px; z-index: 40;
  width: 44px; height: 44px; border-radius: 12px; background: var(--card);
  border: 1px solid var(--border); font-size: 20px; color: var(--text); padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; }
.drawer { position: fixed; top: 0; bottom: 0; width: 300px; max-width: 84vw; z-index: 60;
  background: var(--card); box-shadow: 0 0 24px rgba(0,0,0,.18);
  display: flex; flex-direction: column; transition: transform .25s ease; }
[dir="rtl"] .drawer { right: 0; transform: translateX(105%); border-radius: 16px 0 0 16px; }
[dir="ltr"] .drawer { left: 0; transform: translateX(-105%); border-radius: 0 16px 16px 0; }
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center;
  padding: 18px; border-bottom: 1px solid var(--border); }
.drawer-close { background: transparent; color: var(--muted); font-size: 18px; padding: 6px 10px; }
.drawer-body { padding: 18px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; flex: 1; }
.drawer-block { display: flex; flex-direction: column; gap: 10px; }
.drawer-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.seg { display: flex; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg-btn { flex: 1; padding: 10px; background: var(--card); color: var(--text); font-size: 14px; font-weight: 600; border-radius: 0; }
.seg-btn.active { background: var(--green); color: #fff; }
.drawer .info-box { font-size: 13px; }
.drawer-version { text-align: center; font-size: 12px; color: var(--muted); }
button.small { padding: 10px; font-size: 14px; }
.mc-form { display: flex; flex-direction: column; gap: 10px; background: transparent; border: none; padding: 0; }

/* branding */
.brand-logo { width: 230px; max-width: 70vw; margin: 0 auto 14px; display: block; }
body::before { content: ''; position: fixed; inset: 0;
  background: url(bg.png) center / min(82vw, 430px) no-repeat;
  opacity: .07; pointer-events: none; z-index: 0; }
.app { position: relative; z-index: 1; }

/* forced GPS blocker */
.gps-blocker { position: fixed; inset: 0; background: var(--bg); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.gps-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 32px 24px; text-align: center; display: flex; flex-direction: column; gap: 14px;
  align-items: center; max-width: 360px; width: 100%; }
.gps-icon { font-size: 44px; }

option.area-cairo { color: var(--green); font-weight: 600; }
option.area-gov { color: #1d4ed8; font-weight: 600; }

.notif-bar { background: var(--green); color: #fff; padding: 12px 14px; border-radius: 10px; margin-bottom: 10px; font-weight: 600; }

#btn-go-register { color: #000; font-weight: 700; }
.role-tag { display: inline-block; font-size: 10.5px; font-weight: 700; background: #eef2f7; color: #475569; border-radius: 999px; padding: 2px 8px; margin-inline-start: 6px; vertical-align: middle; }
.mc-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.mc-arrow { transition: transform .2s; }
.mc-toggle.open .mc-arrow { transform: rotate(180deg); }
.mc-form { margin-top: 10px; }
.mc-form input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; box-sizing: border-box; }
.link-btn { background: none; border: none; color: var(--muted); font: inherit; font-size: 13px; margin-top: 10px; cursor: pointer; text-decoration: underline; }

/* faults section + refresh */
.refresh-btn { display: block; margin: 12px auto 4px; padding: 9px 26px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.refresh-btn.spin { animation: rb-spin .7s ease; }
@keyframes rb-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.faults { margin-top: 8px; }
.faults-title { margin: 6px 0 10px; text-align: center; font-size: 18px; }
.fault-group { margin-bottom: 12px; border-radius: 14px; padding: 10px 12px; border: 1px solid var(--border); background: var(--card); }
.fault-group h4 { margin: 0 0 8px; font-size: 14px; }
.fg-received { border-color: #93c5fd; background: #eff6ff; }
.fg-received h4 { color: #1d4ed8; }
.fg-ongoing { border-color: #86efac; background: #f0fdf4; }
.fg-ongoing h4 { color: #15803d; }
.fg-finished { border-color: #fca5a5; background: #fef2f2; }
.fg-finished h4 { color: #b91c1c; }
.fault-card { background: #fff; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--border); }
.fault-title { font-weight: 700; font-size: 14px; }
.fault-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fault-when { font-size: 11px; color: var(--muted); margin-top: 2px; }
.fault-card { cursor: pointer; }
.ack-btn { width: 100%; margin-top: 8px; padding: 10px; border: none; border-radius: 8px; background: var(--green, #0e7a3d); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }
.ack-btn:disabled { opacity: .6; cursor: default; }
.order-modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.order-modal.hidden { display: none; }
.order-card { background: #fff; border-radius: 12px; padding: 16px; width: 100%; max-width: 380px; max-height: 80vh; overflow-y: auto; }
.order-card h3 { margin: 0 0 10px; font-size: 16px; }
.order-rows { margin-bottom: 12px; }
.orow { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.orow:last-child { border-bottom: none; }
.orow .olabel { color: var(--muted); flex-shrink: 0; }
.orow .oval { font-weight: 600; text-align: left; word-break: break-word; }
.fault-empty { font-size: 12.5px; color: var(--muted); padding: 6px 2px; }
.track-note { text-align: center; margin-top: 10px; font-size: 12px; }

/* drawer bottom + logout confirm */
.drawer-body { display: flex; flex-direction: column; height: 100%; }
.drawer-bottom { margin-top: auto; padding-top: 16px; }
.logout-red { color: #c0392b !important; font-weight: 700; width: 100%; }
.logout-confirm { text-align: center; font-weight: 700; color: #c0392b; font-size: 14px; }
.lc-btns { display: flex; gap: 8px; margin-top: 8px; }
.lc-yes { flex: 1; padding: 10px; border: none; border-radius: 10px; background: #c0392b; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.lc-no { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }

/* fault tiles (square icon buttons) */
.fault-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.fault-tile { aspect-ratio: 1 / 1; border-radius: 14px; border: 1.5px solid; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: inherit; cursor: pointer; padding: 6px; }
.ft-received { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.ft-ongoing { border-color: #86efac; background: #f0fdf4; color: #15803d; }
.ft-finished { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.ft-count { font-size: 24px; font-weight: 800; line-height: 1; }
.ft-title { font-size: 11.5px; font-weight: 700; text-align: center; line-height: 1.3; }
.fault-tile.active { box-shadow: 0 0 0 3px rgba(29,78,216,.25); }
.ft-ongoing.active { box-shadow: 0 0 0 3px rgba(21,128,61,.25); }
.ft-finished.active { box-shadow: 0 0 0 3px rgba(185,28,28,.25); }

/* GPS note emphasis (user request) */
.track-note { color: #000 !important; font-weight: 800 !important; font-size: 15px !important; }
.rb-arrow { display: inline-block; }
.refresh-btn.spin .rb-arrow { animation: rb-spin .7s ease; }

/* tracking status dot */
.ts-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; margin-inline-end: 6px; vertical-align: middle; }
.ts-ok { background: #15803d; }
.ts-wait { background: #d97706; }
.ts-err { background: #b91c1c; }

/* apk download link in drawer */
.drawer-link { display: block; text-align: center; padding: 11px; margin-bottom: 8px; border: 1.5px solid #15803d; border-radius: 12px; color: #15803d; font-weight: 800; font-size: 14px; text-decoration: none; }
.apk-gate { position: fixed; inset: 0; z-index: 9999; background: var(--bg, #f7f5ef); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px; gap: 12px; }
.apk-gate.hidden { display: none; }
.apk-gate-logo { width: 110px; height: 110px; border-radius: 24px; }
.apk-gate-btn { background: var(--green, #0e7a3d); color: #fff; font-weight: 800; padding: 14px 22px; border-radius: 12px; text-decoration: none; font-size: 17px; }
.apk-gate-skip { background: none; border: none; color: var(--muted, #67707d); text-decoration: underline; font-size: 13px; font-family: inherit; cursor: pointer; }

.eta-box { background: #fff7e0; border-radius: 10px; padding: 10px; margin-bottom: 10px; font-size: 14px; }
.eta-in { width: 100%; box-sizing: border-box; padding: 9px; margin: 8px 0; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }

.fault-card, .fault-card * { text-align: center; font-weight: 700; }

.tm { display: inline-block; padding: 6px 16px; border-radius: 20px; font-weight: 800; font-size: 16px; letter-spacing: 1px; margin: 6px auto; direction: ltr; text-align: center; }
.tm-wait { background: #9e9e9e; color: #fff; }
.tm-green { background: #1b9e4b; color: #fff; }
.tm-yellow { background: #f5c400; color: #222; }
.tm-red { background: #d32f2f; color: #fff; }
.tm-black { background: #111; color: #fff; }
.tm-row { text-align: center; }

.ticket-box { display: block; width: fit-content; margin: 0 auto 8px; padding: 4px 18px; background: #ffd400; color: #111; border: 2px solid #c9a700; border-radius: 8px; font-weight: 800; font-size: 18px; letter-spacing: 1px; direction: ltr; text-align: center; }

.notif-bar { padding: 6px; }
.notif-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.25); }
.notif-item:last-child { border-bottom: none; }
.notif-x { background: transparent; border: none; color: #fff; font-size: 18px; cursor: pointer; }

.upd-bar { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 9999; background: #123a6d; color: #fff; padding: 12px 14px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.upd-bar button { background: #f5c518; color: #1a1a1a; border: none; border-radius: 8px; padding: 9px 14px; font: inherit; font-weight: 800; cursor: pointer; }
.upd-bar button:disabled { opacity: .6; }

.unack-red { background: #fee2e2 !important; border: 2px solid #dc2626 !important; box-shadow: 0 0 0 2px rgba(220,38,38,.15); }
.unack-red, .unack-red * { color: #7f1d1d; }
.unack-red .ticket-box { color: #1a1a1a; }
.unack-red .tm { color: #fff; }
.unack-red .th-box { background: #fff; border-color: #fca5a5; }
.unack-red .act-btn, .unack-red .th-btn { background: #fff; }

.notif-bar { padding: 8px !important; border-radius: 14px !important; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.notif-item { padding: 16px 12px !important; font-size: 18px !important; line-height: 1.6 !important; font-weight: 800 !important; }
.notif-item span { flex: 1; text-align: center; }
.notif-x { font-size: 26px !important; width: 40px; height: 40px; line-height: 1; }

#om-body { text-align: center; }
#om-body .orow { flex-direction: column; align-items: center; gap: 2px; text-align: center; }
#om-body .orow .oval { text-align: center; font-weight: 800; }
#om-title { text-align: center; }
.om-actions { display: flex; gap: 8px; align-items: stretch; margin-top: 12px; flex-wrap: wrap; }
.fin-btn { flex: 1; padding: 14px; border: none; border-radius: 12px; background: #0e7a3d; color: #fff; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; }
.att-btn { width: 54px; display: flex; align-items: center; justify-content: center; border: 2px solid #1d4ed8; border-radius: 12px; font-size: 24px; cursor: pointer; background: #fff; }
.fin-q { width: 100%; text-align: center; font-weight: 800; }
.fin-yes, .fin-no { flex: 1; padding: 12px; border: none; border-radius: 10px; font: inherit; font-weight: 800; cursor: pointer; }
.fin-yes { background: #0e7a3d; color: #fff; }
.fin-no { background: #e5e7eb; color: #1b2430; }
.om-msg { text-align: center; font-weight: 700; margin-top: 8px; font-size: 13px; }
.ph-strip { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.ph-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; }
.ph-ov { position: fixed; inset: 0; z-index: 20000; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; }
.ph-ov img { max-width: 96vw; max-height: 92vh; }

#notif-bar { position: fixed !important; top: 8px; left: 8px; right: 8px; z-index: 99999; margin: 0 !important; max-height: 70vh; overflow-y: auto; }
#notif-bar.hidden { display: none !important; }

.ticket-box, .unack-red .ticket-box { background: #000 !important; color: #fff !important; border: 2px solid #000 !important; }

#top-clock { text-align: center; padding: 10px 56px 8px; margin: 0 auto; max-width: 560px; line-height: 1.35; }
#top-clock .tc-time { font-size: 26px; font-weight: 800; letter-spacing: 1px; direction: ltr; color: #111; font-variant-numeric: tabular-nums; }
#top-clock .tc-date { font-size: 13px; font-weight: 700; color: #374151; }
#top-clock .tc-hijri { font-size: 12.5px; font-weight: 700; color: #6b7280; }
#top-clock .tc-temp { font-size: 13px; font-weight: 700; color: #1d4ed8; min-height: 18px; }

.refresh-btn.busy .rb-arrow { animation: rb-spin .8s linear infinite; }
.rf-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #111; color: #fff; padding: 10px 18px; border-radius: 20px; font-weight: 700; z-index: 100001; }

.perf-ov { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100000; display: flex; align-items: flex-end; justify-content: center; }
.perf-box { background: #f4f6fb; width: 100%; max-width: 560px; height: 92vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; }
.perf-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 4px; font-size: 18px; }
.perf-x { background: transparent; border: none; font-size: 24px; width: 40px; height: 40px; cursor: pointer; }
.perf-nav { display: flex; justify-content: space-between; align-items: center; padding: 4px 16px 8px; }
.perf-nb { background: #fff; border: 1.5px solid #1d4ed8; color: #1d4ed8; border-radius: 10px; width: 44px; height: 38px; font-size: 22px; font-weight: 800; cursor: pointer; }
.perf-mt { font-size: 16px; }
.perf-body { overflow-y: auto; padding: 0 14px 24px; flex: 1; }
.perf-body h4 { margin: 16px 0 6px; font-size: 15px; }
.perf-note { text-align: center; color: #6b7280; padding: 30px 0; }
.perf-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.perf-card { background: #fff; border-radius: 12px; padding: 10px 6px; text-align: center; border: 1px solid #e5e7eb; }
.perf-card b { display: block; font-size: 20px; color: #1d4ed8; }
.perf-card span { font-size: 11px; color: #6b7280; }
.perf-rank { display: flex; align-items: center; gap: 10px; background: #1d4ed8; color: #fff; border-radius: 12px; padding: 10px 14px; margin-top: 10px; }
.perf-rank b { font-size: 24px; }
.perf-cmp { font-weight: 800; margin-top: 6px; }
.perf-cmp2 { color: #374151; font-size: 13px; margin-top: 2px; }
.perf-tw { overflow-x: auto; margin-top: 6px; }
.perf-t { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; font-size: 13px; }
.perf-t th, .perf-t td { padding: 7px 6px; text-align: center; border-bottom: 1px solid #eef0f4; }
.perf-t th { background: #e8edf8; font-size: 12px; }
.perf-t tr.mine td { background: #eaf0ff; font-weight: 800; }
.perf-tk { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px; margin-top: 8px; text-align: center; }
.perf-tk-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.perf-tk .ticket-box.small { font-size: 14px; padding: 2px 12px; margin: 0; }
.perf-chip { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 12px; }
.perf-chip.ok { background: #dcfce7; color: #166534; } .perf-chip.late { background: #fee2e2; color: #991b1b; } .perf-chip.open { background: #e0e7ff; color: #3730a3; }
.perf-tk-t { font-weight: 800; } .perf-tk-m { font-size: 12px; color: #6b7280; margin-top: 2px; }

.perf-dh, .perf-dr { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; text-align: center; align-items: center; }
.perf-dh { background: #e8edf8; border-radius: 10px 10px 0 0; padding: 8px 6px; font-size: 12px; font-weight: 800; }
.perf-day { background: #fff; border-bottom: 1px solid #eef0f4; }
.perf-dr { width: 100%; background: transparent; border: none; padding: 11px 6px; font: inherit; font-size: 13px; cursor: pointer; }
.perf-dr span:first-child { text-align: right; font-weight: 800; color: #1d4ed8; }
.perf-day.open { background: #f8faff; }
.perf-dl { padding: 0 8px 8px; }
.perf-dl.hidden { display: none; }

.perf-pop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100001; display: flex; align-items: center; justify-content: center; padding: 16px; }
.perf-pop-box { background: #fff; border-radius: 16px; padding: 16px; width: 100%; max-width: 420px; max-height: 85vh; overflow-y: auto; text-align: center; }
.perf-pop-box h3 { margin: 0 0 8px; }
.perf-pop-x { margin-top: 12px; width: 100%; background: #1d4ed8; color: #fff; border: none; border-radius: 10px; padding: 11px; font: inherit; font-weight: 800; cursor: pointer; }

.mblock { text-align: center; margin: 6px 0; }
.mblock .mb-num { font-size: 16px; font-weight: 800; direction: ltr; }
.mblock .mb-name { font-size: 13px; font-weight: 700; direction: ltr; color: #374151; margin-top: 2px; }
.mblock .mb-box { display: inline-block; margin-top: 8px; border: 2px solid #1d4ed8; background: #eef3ff; border-radius: 10px; padding: 4px 16px; }
.mblock .mb-box span { font-weight: 800; color: #1d4ed8; }
.unack-red .mblock .mb-box span { color: #1d4ed8; }
.unack-red .mblock .mb-name { color: #7f1d1d; }

.mblock .mb-num { font-size: 24px !important; font-weight: 900 !important; letter-spacing: .5px; }
.mblock .mb-name { font-weight: 800 !important; }
.mblock .mb-area { font-size: 14px; font-weight: 800; color: #1d4ed8; margin-top: 2px; }
.unack-red .mblock .mb-area { color: #7f1d1d; }
.ocard, .ocard * { font-weight: 800; }

.mblock .mb-box { padding: 8px 30px !important; border-radius: 12px !important; margin-top: 10px !important; }
.mblock .mb-box span { font-size: 20px !important; font-weight: 900 !important; }
.mblock { padding-bottom: 12px; border-bottom: 2px solid #d1d5db; margin-bottom: 10px; }

.latest-btn { width: 100%; color: #1d4ed8 !important; font-weight: 700; margin-top: 8px; }
.latest-msg { font-size: 13px; text-align: center; color: #374151; margin: 6px 0; }

/* faults side by side, slightly smaller cards */
.fault-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.fault-list .fault-card { margin-bottom: 0; min-width: 0; padding: 6px 6px; overflow: hidden; }
.fault-list .fault-empty { grid-column: 1 / -1; }
.fault-list .fault-card .ticket-box { font-size: 14px; padding: 3px 10px; }
.fault-list .fault-card .mblock .mb-num { font-size: 18px !important; word-break: break-all; }
.fault-list .fault-card .mblock .mb-name { font-size: 12px !important; }
.fault-list .fault-card .mblock .mb-area { font-size: 12px !important; }
.fault-list .fault-card .mblock .mb-box { padding: 5px 12px !important; margin-top: 6px !important; }
.fault-list .fault-card .mblock .mb-box span { font-size: 15px !important; }
.fault-list .fault-card .tm-row, .fault-list .fault-card .tm-row * { font-size: 12px; }
.fault-list .fault-card .ack-btn { font-size: 12px; padding: 6px 4px; }

.eta-ov { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.eta-dlg { background: #fff; border-radius: 16px; padding: 18px; width: 100%; max-width: 340px; text-align: center; }
.eta-dlg-t { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.eta-dlg-s { font-size: 13px; color: #374151; margin-bottom: 12px; direction: ltr; unicode-bidi: plaintext; }
.eta-dlg-row { display: flex; gap: 8px; }
.eta-dlg-in { flex: 1; min-width: 0; font-size: 20px; text-align: center; padding: 10px; border: 2px solid #1d4ed8; border-radius: 10px; }
.eta-dlg-send { background: #16a34a; color: #fff; border: 0; border-radius: 10px; padding: 0 22px; font-size: 17px; font-weight: 800; }
.eta-dlg-send:disabled { opacity: .5; }
.eta-dlg-err { color: #c62828; font-weight: 700; margin-top: 8px; font-size: 13px; }
.eta-dlg-later { background: none; border: 0; color: #6b7280; margin-top: 12px; font-size: 14px; }

.fault-card, .ocard, .order-card { position: relative; }
.chat-btn { position: absolute; top: 6px; right: 6px; width: 38px; height: 38px; border-radius: 50%; border: 2px solid #1d4ed8; background: #eef3ff; font-size: 18px; line-height: 1; padding: 0; cursor: pointer; z-index: 3; }
.chat-ov { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 10000; display: flex; align-items: flex-end; justify-content: center; }
.chat-box { background: #fff; width: 100%; max-width: 480px; height: 82vh; border-radius: 16px 16px 0 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-hd { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #000; color: #fff; }
.chat-ti { font-weight: 800; font-size: 16px; }
.chat-x { background: none; border: 0; color: #fff; font-size: 20px; }
.chat-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: #f3f4f6; }
.chat-empty { text-align: center; color: #6b7280; margin-top: 30px; }
.chat-msg { max-width: 82%; padding: 8px 10px; border-radius: 12px; word-wrap: break-word; }
.chat-msg.mine { align-self: flex-start; background: #dcfce7; }
.chat-msg.theirs { align-self: flex-end; background: #fff; border: 1px solid #e5e7eb; }
.chat-who { font-size: 11px; font-weight: 800; color: #1d4ed8; margin-bottom: 2px; }
.chat-txt { font-size: 15px; font-weight: 600; white-space: pre-wrap; text-align: right; }
.chat-tm { font-size: 10px; color: #6b7280; margin-top: 3px; direction: ltr; text-align: left; }
.chat-row { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e5e7eb; background: #fff; }
.chat-in { flex: 1; min-width: 0; font-size: 16px; padding: 10px; border: 2px solid #d1d5db; border-radius: 10px; }
.chat-send { background: #1d4ed8; color: #fff; border: 0; border-radius: 10px; padding: 0 18px; font-size: 16px; font-weight: 800; }
.chat-send:disabled { opacity: .5; }

.chat-photo { background: #eef3ff; border: 2px solid #1d4ed8; border-radius: 10px; width: 44px; font-size: 20px; padding: 0; }
.chat-img { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; margin: 2px 0 4px; background: #e5e7eb; min-width: 80px; min-height: 60px; }
.chat-zoom { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 10001; display: flex; align-items: center; justify-content: center; }
.chat-zoom img { max-width: 100%; max-height: 100%; }

/* notification center */
.bell-btn { position: fixed; top: 12px; inset-inline-end: 12px; z-index: 45; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid #d5dbe6; background: #fff; font-size: 20px; line-height: 1; padding: 0; box-shadow: 0 2px 8px rgba(0,0,0,.15); cursor: pointer; }
.bell-btn.hidden, .bell-panel.hidden, .bell-badge.hidden { display: none; }
.bell-badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: #dc2626;
  color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; box-sizing: border-box; }
.bell-panel { position: fixed; top: 58px; inset-inline-end: 8px; z-index: 46; width: min(340px, 94vw); max-height: 70vh; overflow-y: auto;
  background: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.28); border: 1px solid #d5dbe6; }
.bell-hd { padding: 10px 14px; font-weight: 800; border-bottom: 1px solid #e5e9f0; position: sticky; top: 0; background: #fff; }
.bell-empty { padding: 22px; text-align: center; color: #6b7280; }
.bell-item { padding: 10px 14px; border-bottom: 1px solid #eef1f6; cursor: pointer; }
.bell-item.bell-new { background: #eef4ff; }
.bell-tx { font-size: 14px; line-height: 1.5; word-break: break-word; }
.bell-tm { font-size: 11px; color: #6b7280; margin-top: 3px; }
#screen-home .home-header { padding-inline-end: 64px; }

.bell-panel { background: #cfdcf5 !important; border: 2px solid #1d4ed8 !important; padding-bottom: 6px; }
.bell-hd { background: #1d4ed8 !important; color: #fff !important; border-bottom: 0 !important; }
.bell-item { background: #fff !important; margin: 8px 8px 0; border: 1px solid #94a3b8 !important; border-inline-start: 5px solid #1d4ed8 !important; border-radius: 10px; }
.bell-item.bell-new { background: #fff7d6 !important; border-inline-start-color: #f59e0b !important; }
.bell-empty { color: #334155; }

.bell-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bell-clear { border: 1px solid #fff; background: transparent; color: #fff; border-radius: 8px; padding: 3px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }

/* triangle layout: ongoing on top, received + finished below */
.fault-tiles { grid-template-columns: repeat(4, 1fr); }
.fault-tile { grid-column: span 2; aspect-ratio: 1.7 / 1; }
.fault-tile.ft-ongoing { grid-column: 2 / span 2; }
.chat-btn { width: auto !important; min-width: 74px; height: 40px !important; padding: 0 14px !important; border-radius: 20px !important; background: #1d4ed8 !important; color: #fff !important; border: 2px solid #fff !important; font-size: 15px !important; font-weight: 800 !important; box-shadow: 0 2px 8px rgba(29,78,216,.55); white-space: nowrap; }

/* smaller chat button, parked in its own strip so it never covers ticket info */
.ocard:has(.chat-btn) { padding-top: 34px !important; }
.ocard .chat-btn { min-width: 0 !important; height: 24px !important; padding: 0 9px !important; font-size: 11.5px !important; border-radius: 12px !important; top: 6px !important; right: 6px !important; border-width: 1px !important; box-shadow: none !important; }
.ocard { padding-top: 38px !important; }
.fault-card { position: relative; padding-top: 38px !important; }
.fault-card .chat-btn { position: absolute !important; min-width: 0 !important; height: 24px !important; padding: 0 10px !important; font-size: 11.5px !important; border-radius: 12px !important; top: 6px !important; right: 6px !important; box-shadow: none !important; }

/* ticket older than 2 hours: dark red background, white text */
.order-overdue:not(.unack-red) { background: #8b1a1a !important; border: 2px solid #5c0f0f !important; box-shadow: 0 0 0 2px rgba(139,26,26,.25) !important; }
.order-overdue:not(.unack-red), .order-overdue:not(.unack-red) * { color: #fff !important; }
.order-overdue:not(.unack-red) .ticket-box { background: #000 !important; color: #fff !important; }
.order-overdue:not(.unack-red) .chat-btn { color: #fff !important; }
/* overdue (dark red) card: light-background pieces keep dark text so they stay readable */
.order-overdue:not(.unack-red) .mb-box, .order-overdue:not(.unack-red) .mb-box *,
.order-overdue:not(.unack-red) .badge, .order-overdue:not(.unack-red) .badge *,
.order-overdue:not(.unack-red) input, .order-overdue:not(.unack-red) select, .order-overdue:not(.unack-red) textarea,
.order-overdue:not(.unack-red) .th-btn, .order-overdue:not(.unack-red) .th-btn *,
.order-overdue:not(.unack-red) .act-btn, .order-overdue:not(.unack-red) .act-btn *,
.order-overdue:not(.unack-red) .act-menu, .order-overdue:not(.unack-red) .act-menu *,
.order-overdue:not(.unack-red) .ack-btn, .order-overdue:not(.unack-red) .fault-when { color: #111827 !important; }
.order-overdue:not(.unack-red) .th-btn, .order-overdue:not(.unack-red) .act-btn { color: #1d4ed8 !important; background: #fff !important; }
.order-overdue:not(.unack-red) .th-btn *, .order-overdue:not(.unack-red) .act-btn * { color: #1d4ed8 !important; }
.order-overdue:not(.unack-red) .badge { background: #fff !important; font-weight: 800; }
.order-overdue:not(.unack-red) .badge.ongoing, .order-overdue:not(.unack-red) .badge.ongoing * { color: #166534 !important; }
.order-overdue:not(.unack-red) .badge.received, .order-overdue:not(.unack-red) .badge.received * { color: #1d4ed8 !important; }
.order-overdue:not(.unack-red) .ackbox::before { border-color: #fff; }
.order-overdue:not(.unack-red) .chat-btn { color: #fff !important; }
.order-overdue:not(.unack-red) .ticket-box, .order-overdue:not(.unack-red) .ticket-box * { color: #fff !important; }
.order-overdue:not(.unack-red) .tm, .order-overdue:not(.unack-red) .tm * { color: #fff !important; }

/* machine info: one block, code | fault | name */
.mblock .mb-label { font-size: 11.5px; font-weight: 800; color: #6b7280; margin-bottom: 4px; }
.mblock .mb-sep { height: 0; border-top: 2px solid #9ca3af; width: 70%; margin: 8px auto 2px; }
.mblock .mb-box { margin-top: 6px !important; }
.order-overdue:not(.unack-red) .mblock .mb-label { color: #fecaca !important; }
.order-overdue:not(.unack-red) .mblock .mb-sep { border-top-color: #fecaca; }
.unack-red .mblock .mb-label { color: #7f1d1d; }

.st-body { display: flex; flex-direction: column; gap: 18px; margin-top: 12px; }
.st-body.hidden { display: none; }

/* ATM / Italian Co. header mark: black glossy lettering, white glow, gold sweep (same look as the bismillah in the Islam app) */
.atm-mark { text-align: center; margin: 0 auto 12px; line-height: 1; direction: ltr; user-select: none; -webkit-user-select: none; }
.atm-mark .am-l1, .atm-mark .am-l2 { position: relative; display: block; font-family: 'ATMDeco', Georgia, serif; font-weight: 900; color: #000;
  text-shadow: 0 0 .6px #000, 0 0 1px #000, 0 0 2px rgba(255,255,255,.95), 0 0 7px rgba(255,255,255,.55); }
.atm-mark .am-l1 { font-size: 64px; letter-spacing: .12em; padding-left: .12em; }
.atm-mark .am-l2 { font-size: 30px; letter-spacing: .05em; margin-top: 4px; }
.atm-mark .am-l1::after, .atm-mark .am-l2::after { content: attr(data-t); position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, rgba(255,200,40,0) 42%, rgba(255,196,32,.95) 47%, #fff0a8 50%, rgba(255,196,32,.95) 53%, rgba(255,200,40,0) 58%) 0 0 / 300% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; animation: amSweep 5s ease-in-out infinite; }
.atm-mark .am-l2::after { animation-delay: .35s; }
@keyframes amSweep { 0% { background-position: 100% 0; } 40%, 100% { background-position: 0 0; } }

@font-face { font-family: 'ATMDeco'; src: url(atmfont.woff2) format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

/* header: clock on the left, Italian Co. mark in the middle */
#top-clock { display: flex; direction: ltr; align-items: center; justify-content: space-between; gap: 6px; text-align: left; max-width: 560px; }
#top-clock[dir=rtl] { padding: 8px 56px 6px 8px; }
#top-clock[dir=ltr] { padding: 8px 8px 6px 56px; }
#top-clock .tc-clock { flex: 0 0 auto; text-align: left; line-height: 1.25; }
#top-clock .tc-time { font-size: 16px; letter-spacing: .5px; }
#top-clock .tc-date { font-size: 10px; }
#top-clock .tc-hijri { font-size: 10px; }
#top-clock .tc-temp { font-size: 10.5px; min-height: 0; }
#top-clock .atm-mark { flex: 1 1 auto; min-width: 0; margin: 0; }
#top-clock .atm-mark .am-l1 { font-size: 27px; letter-spacing: .04em; padding-left: 0; white-space: nowrap; }
#top-clock .atm-mark .am-l2 { font-size: 11px; letter-spacing: .12em; margin-top: 3px; white-space: nowrap; }

/* clock: black bold with white glow, same look as the bismillah */
#top-clock .tc-time, #top-clock .tc-date, #top-clock .tc-hijri, #top-clock .tc-temp { color: #000 !important; font-weight: 900 !important;
  text-shadow: 0 0 .6px #000, 0 0 1px #000, 0 0 2px rgba(255,255,255,.95), 0 0 7px rgba(255,255,255,.55); }
#top-clock .tc-temp { direction: ltr; unicode-bidi: isolate; }

/* eagle under the header text (blends into the light page) */
#top-clock { align-items: flex-start; }
#top-clock .atm-mark .am-eagle { display: block; height: 64px; width: auto; margin: 2px auto 0; pointer-events: none; }
body::before { display: none !important; }

/* clock block: flush to the far left, lines centered to each other like before */
#top-clock { max-width: none !important; margin: 0 !important; }
#top-clock[dir=rtl] { padding-left: 4px !important; }
#top-clock[dir=ltr] { padding-right: 4px !important; }
#top-clock .tc-clock { text-align: center !important; margin-left: 0; }

/* bigger centered mark: text fills the free width, bigger eagle below it */
#top-clock .tc-time { font-size: 15px; }
#top-clock .tc-date, #top-clock .tc-hijri { font-size: 9.5px; }
#top-clock .tc-temp { font-size: 10px; }
#top-clock .atm-mark .am-l1 { font-size: clamp(24px, calc((100vw - 178px) / 7.1), 38px); letter-spacing: .02em; }
#top-clock .atm-mark .am-l2 { font-size: clamp(11px, calc((100vw - 178px) / 17), 15px); letter-spacing: .1em; }
#top-clock .atm-mark .am-eagle { height: clamp(84px, 26vw, 120px); margin-top: 0; }

/* clock to far right (beside bell/menu button), mark in the middle */
#top-clock { flex-direction: row-reverse !important; }
#top-clock[dir=rtl], #top-clock[dir=ltr] { padding: 8px 54px 6px 54px !important; }

#top-clock .atm-mark { overflow: hidden; }
#top-clock .atm-mark .am-l1 { font-size: clamp(18px, calc((100vw - 250px) / 5.6), 34px) !important; }
#top-clock .atm-mark .am-l2 { font-size: clamp(8px, calc((100vw - 250px) / 14), 13px) !important; letter-spacing: .06em !important; }
#top-clock .atm-mark .am-eagle { height: clamp(70px, 22vw, 105px) !important; }

#top-clock .atm-mark .am-l1 { font-size: clamp(15px, calc((100vw - 250px) / 7.6), 30px) !important; letter-spacing: 0 !important; }
#top-clock .atm-mark .am-l2 { font-size: clamp(7px, calc((100vw - 250px) / 17), 12px) !important; }
#top-clock .tc-date, #top-clock .tc-hijri { font-size: 9px !important; }
#top-clock[dir=rtl], #top-clock[dir=ltr] { padding: 8px 52px 6px 6px !important; }

/* slower light: text sweep 9s, eagle glows gold in sync */
.atm-mark .am-l1::after, .atm-mark .am-l2::after { animation-duration: 9s !important; }
#top-clock .atm-mark .am-eagle { animation: amGlow 9s ease-in-out infinite; }
@keyframes amGlow {
  0%, 55%, 100% { filter: brightness(1) drop-shadow(0 0 0 rgba(255,200,60,0)); }
  22% { filter: brightness(1.35) saturate(1.2) drop-shadow(0 0 6px rgba(255,205,70,.95)) drop-shadow(0 0 14px rgba(255,185,40,.7)); }
}
#top-clock[dir=rtl], #top-clock[dir=ltr] { padding-right: 58px !important; }

#top-clock[dir=rtl], #top-clock[dir=ltr] { padding-right: 78px !important; }
#top-clock .atm-mark .am-l1 { font-size: clamp(14px, calc((100vw - 268px) / 7.6), 30px) !important; }
#top-clock .atm-mark .am-l2 { font-size: clamp(7px, calc((100vw - 268px) / 17), 12px) !important; }

/* restore original clock colors (before the black version) */
#top-clock .tc-time { color: #111 !important; font-weight: 800 !important; text-shadow: none !important; }
#top-clock .tc-date { color: #374151 !important; font-weight: 700 !important; text-shadow: none !important; }
#top-clock .tc-hijri { color: #6b7280 !important; font-weight: 700 !important; text-shadow: none !important; }
#top-clock .tc-temp { color: #1d4ed8 !important; font-weight: 700 !important; text-shadow: none !important; }

/* exact center: clock on its own row at the right, mark centered on the screen below */
#top-clock { display: grid !important; grid-template-columns: 1fr !important; justify-items: center; flex-direction: initial !important; direction: ltr; }
#top-clock[dir=rtl], #top-clock[dir=ltr] { padding: 6px 0 4px 0 !important; }
#top-clock .tc-clock { justify-self: end; margin-right: 66px; margin-bottom: -4px; }
#top-clock .atm-mark { flex: none; width: auto; overflow: visible !important; text-align: center; margin: 0 auto !important; }
#top-clock .atm-mark .am-l1 { font-size: clamp(24px, calc((100vw - 120px) / 8), 36px) !important; }
#top-clock .atm-mark .am-l2 { font-size: clamp(10px, calc((100vw - 120px) / 20), 14px) !important; }
#top-clock .atm-mark .am-eagle { height: clamp(80px, 24vw, 110px) !important; margin: 2px auto 0 !important; }

#top-clock .tc-clock { justify-self: center !important; margin: 0 auto 2px !important; text-align: center !important; }
#top-clock .atm-mark .am-eagle { margin-top: 12px !important; }

/* font 12 (Rye) for the header mark */
@font-face { font-family: 'ATMRye'; src: url(ryefont.ttf) format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
#top-clock .atm-mark .am-l1, #top-clock .atm-mark .am-l2 { font-family: 'ATMRye', serif !important; font-weight: 400 !important; }
#top-clock .atm-mark .am-l1 { font-size: clamp(22px, calc((100vw - 120px) / 9.5), 32px) !important; letter-spacing: .02em !important; }
#top-clock .atm-mark .am-l2 { font-size: clamp(10px, calc((100vw - 120px) / 22), 13px) !important; letter-spacing: .06em !important; }

/* phone change request */
.mc-form select { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; box-sizing: border-box; background: #fff; }
#ph-last { font-size: 12px; margin-top: 4px; }

.ph-modal { position: fixed; inset: 0; z-index: 10050; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 18px; }
.ph-modal.hidden { display: none; }
.ph-card { position: relative; width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 18px 16px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.3); max-height: 90vh; overflow-y: auto; }
.ph-card h3 { margin: 0 0 12px; text-align: center; font-size: 17px; }
.ph-x { position: absolute; top: 8px; inset-inline-start: 10px; border: none; background: transparent; font-size: 20px; cursor: pointer; color: #555; }

.soon-badge { display: inline-block; margin-inline-start: 8px; padding: 2px 8px; border-radius: 999px; background: #f5c518; color: #1a1a1a; font-size: 11px; font-weight: 800; }
.rp-soon { text-align: center; font-size: 26px; font-weight: 800; margin: 8px 0 4px; color: #1d4ed8; }
.rp-sub { text-align: center; }
.drawer-nav { display: block; width: 100%; text-align: start; padding: 12px 14px; margin-bottom: 10px; background: var(--card); color: inherit; border: 1px solid var(--border); border-radius: 12px; font-weight: 700; font-family: inherit; font-size: 15px; cursor: pointer; }
.drawer-nav.hidden { display: none; }
