* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy: #123a6d; --navy-dark: #0c2a50; --bg: #f3f5f8; --card: #ffffff;
  --text: #1b2430; --muted: #67707d; --green: #0e7a3d; --red: #b91c1c;
  --amber: #b45309; --border: #e3e8ef;
}
html, body { height: 100%; }
body { font-family: 'CairoF', 'Segoe UI', Tahoma, Arial, sans-serif; background: var(--bg); color: var(--text); }
.app { max-width: 1080px; margin: 0 auto; min-height: 100%; padding: 64px 16px 48px; }
.screen { display: flex; flex-direction: column; gap: 18px; }
.hidden { display: none !important; }
.brand { text-align: center; padding-top: 20px; }
.brand-badge { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px;
  background: linear-gradient(145deg, var(--navy), var(--navy-dark)); color: #fff;
  font-size: 36px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(18,58,109,.25); }
h1 { font-size: 24px; margin-bottom: 8px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.7; }
.hint { color: var(--muted); font-size: 12px; text-align: center; }
.tabs { display: flex; gap: 8px; background: #e9edf3; padding: 6px; border-radius: 14px;
  max-width: 520px; margin: 0 auto; width: 100%; }
.tab { flex: 1; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px;
  padding: 10px; border-radius: 10px; border: none; cursor: pointer; font-family: inherit; }
.tab.active { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.pane { display: flex; flex-direction: column; gap: 14px; background: var(--card); padding: 20px;
  border-radius: 16px; border: 1px solid var(--border); max-width: 520px; margin: 0 auto; width: 100%; }
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: #fbfcfe; direction: rtl; }
input:focus, select:focus { outline: none; border-color: var(--navy); }
button { font: inherit; cursor: pointer; border: none; border-radius: 12px; padding: 13px; font-weight: 700; font-size: 15px; }
button.primary { background: var(--navy); color: #fff; }
button.primary:disabled { opacity: .6; }
button.ghost { background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; }
.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: 30px; max-width: 520px; margin-inline: auto; width: 100%; }
.status-icon { width: 84px; height: 84px; border-radius: 50%; background: var(--amber); }
.status-icon.pending { background: var(--red); }
.status-icon.approved { background: var(--green); }
.status-icon.approved::after { content: '\2713'; color: #fff; font-size: 40px; display: flex; align-items: center; justify-content: center; }
.status-icon.pending::after { content: '…'; color: #fff; font-size: 40px; display: flex;
  height: 100%; align-items: center; justify-content: center; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--navy);
  border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dash-header { display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px;
  text-align: center; }
.stat .num { font-size: 20px; font-weight: 800; color: var(--navy); }
.stat .lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }
.block { background: transparent; }
.count { color: var(--muted); font-weight: 400; font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 8px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; }
.card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card .who { font-weight: 700; font-size: 15px; }
.card .meta { font-size: 12.5px; color: var(--muted); line-height: 1.9; }
.card .actions { display: flex; gap: 8px; }
.btn-approve { flex: 1; background: var(--green); color: #fff; padding: 10px; }
.btn-reject { flex: 1; background: #fdeaea; color: var(--red); padding: 10px; }
.btn-undo { flex: 1; background: #eef2f7; color: var(--muted); padding: 10px; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.pending { background: #fef3e2; color: var(--amber); }
.badge.approved { background: #e8f5ec; color: var(--green); }
.badge.rejected { background: #fdeaea; color: var(--red); }
.perms { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--muted); }
.perms label { flex-direction: row; align-items: center; gap: 5px; font-weight: 400; cursor: pointer; }
.empty { color: var(--muted); font-size: 13px; background: var(--card); border: 1px dashed var(--border);
  border-radius: 12px; padding: 16px; text-align: center; grid-column: 1 / -1; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text);
  color: #fff; padding: 12px 22px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); z-index: 50; }

/* 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(--navy); 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; }

/* live map */
#map { height: 52vh; min-height: 320px; border-radius: 16px; border: 1px solid var(--border); z-index: 1; }
.dash-actions { display: flex; gap: 8px; align-items: center; }
.leaflet-container { font-family: inherit; }

/* status colors: pending red, approved green */
.badge.pending { background: #fdeaea; color: #c0392b; }
.badge.approved { background: #e6f7ec; color: #1e8e4e; }
.stat.st-pending .num { color: #c0392b; }
.stat.st-approved .num { color: #1e8e4e; }
.card.st-approved { background: #e2f6e9; border-color: #93d3a8; }
.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 { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.mc-form input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; box-sizing: border-box; }

/* refresh button */
.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); } }

/* 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; }

/* person-shaped technician map marker */
.tech-marker { background: none; border: none; }
.tm-wrap { position: relative; width: 46px; text-align: center; }
.tm-person { position: relative; width: 30px; height: 34px; margin: 0 auto; }
.tm-person::before { content: ''; position: absolute; top: 0; left: 9px; width: 12px; height: 12px; border-radius: 50%; background: #1d4ed8; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); box-sizing: border-box; }
.tm-person::after { content: ''; position: absolute; top: 14px; left: 5px; width: 20px; height: 17px; border-radius: 10px 10px 5px 5px; background: #1d4ed8; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); box-sizing: border-box; }
.tm-off .tm-person::before, .tm-off .tm-person::after { background: #9ca3af; }
.tm-count { position: absolute; top: -4px; right: -2px; background: #15803d; color: #fff; font-size: 10px; font-weight: 800; min-width: 16px; height: 16px; line-height: 16px; border-radius: 999px; border: 1.5px solid #fff; box-sizing: border-box; }
.tm-name { display: inline-block; margin-top: 2px; background: rgba(255,255,255,.92); border-radius: 6px; padding: 1px 5px; font-size: 10.5px; font-weight: 700; color: #111; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* online techs: tap dropdown menu */
.card.clickable { cursor: pointer; }
.tech-menu { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.tech-menu.hidden { display: none; }
.tm-btn { padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; text-align: start; }
.tm-btn:active { transform: scale(.98); }
.tm-faults { padding: 4px 2px; }
.tm-faults.hidden { display: none; }
.tm-count-line { font-weight: 800; font-size: 13.5px; margin: 4px 0 8px; }
.tm-faults .fault-card { background: #fff; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--border); }
.tm-faults .fault-title { font-weight: 700; font-size: 13.5px; }
.tm-faults .fault-meta, .tm-faults .fault-empty { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rb-arrow { display: inline-block; }
.refresh-btn.spin .rb-arrow { animation: rb-spin .7s ease; }


/* marker colors (user spec): online=green, offline=dark, overdue>2h=red */
.tm-person::before, .tm-person::after { background: #15803d; }
.tm-off .tm-person::before, .tm-off .tm-person::after { background: #374151; }
.tm-red .tm-person::before, .tm-red .tm-person::after { background: #b91c1c; }
.tm-count { background: #111827; }
.pm-refresh { margin-top: 6px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; font-weight: 700; font-size: 12.5px; cursor: pointer; }

/* online tech info rows */
#map-list .card.clickable { cursor: pointer; }
.tech-info { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.tech-info.hidden { display: none; }
.ti-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ti-row span { color: var(--muted); }
.ti-row b { font-weight: 800; }
.flash-green { animation: flashGreen 0.5s ease-in-out 5; transform-origin: 50% 70%; }
.flash-top { z-index: 100000 !important; }
@keyframes flashGreen {
  0%, 100% { filter: none; transform: scale(1); }
  50% { filter: drop-shadow(0 0 12px #22c55e) brightness(1.25) saturate(1.5); transform: scale(1.18); }
}
.flash-card-green { animation: flashCardGreen 0.5s ease-in-out 5; }
@keyframes flashCardGreen {
  0%, 100% { background: var(--card, #ffffff); box-shadow: none; }
  50% { background: #dcfce7; box-shadow: 0 0 0 2px #22c55e; }
}
.drawer-nav { display: block; width: 100%; text-align: start; padding: 12px 14px; margin-bottom: 10px; background: var(--green); color: #fff; border-radius: 10px; font-weight: 700; border: none; font-family: inherit; font-size: 15px; cursor: pointer; }
.o-extra { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.badge.received { background: #dbeafe; color: #1d4ed8; }
.badge.finished { background: #e5e7eb; color: #4b5563; }
.card.order-overdue { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.stat.st-received .num { color: #1d4ed8; }
.stat.st-finished .num { color: #4b5563; }
.new-order-btn { margin: 4px 0 12px; }
.new-order-form { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; max-width: 520px; }
.no-ok { color: var(--green); font-weight: 700; font-size: 13px; }

.act-wrap { margin-top: 10px; }
.act-btn { width: 100%; padding: 9px; border: 1px solid var(--border); border-radius: 10px; background: #f4f6f8; font-weight: 700; font-size: 13px; cursor: pointer; }
.act-menu { margin-top: 6px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.act-menu.hidden { display: none; }
.act-item { display: block; width: 100%; text-align: right; padding: 11px 12px; border: none; border-bottom: 1px solid var(--border); background: #fff; font-size: 14px; cursor: pointer; }
.act-item:last-child { border-bottom: none; }
.act-panel { margin-top: 6px; font-size: 13.5px; }
.act-panel button { margin: 6px 4px 0 0; padding: 8px 16px; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; }
.act-yes { background: #c62828; color: #fff; }
.act-no { background: #e0e0e0; }
.act-sel { width: 100%; padding: 9px; border-radius: 8px; border: 1px solid var(--border); font-size: 14px; }

.ack-line { font-weight: 700; color: #9a6a00; }
.ack-line.ack-yes { color: #1b7a3d; }

.ocard, .ocard * { text-align: center; font-weight: 700; }
.ocard .top { flex-direction: column; align-items: center; }
.ocard .badge { margin-top: 6px; }
.ocard .act-item, .ocard .act-sel, .ocard .act-btn { text-align: center; }

.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; }

.faults-entry { display: block; width: 100%; margin: 12px 0 4px; padding: 14px; border-radius: 14px; border: none; background: #f5c518; color: #1a1a1a; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; }

.area-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin: 6px 0; }
.area-chip { padding: 12px 4px; border-radius: 10px; border: 2px solid var(--navy); background: #fff; color: var(--navy); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-align: center; }
.area-chip.cur { opacity: .55; }
.area-chip.on { background: var(--navy); color: #fff; opacity: 1; }

.area-chip, .area-chip.cur, .area-chip.on { }
.area-ov { position: fixed; inset: 0; z-index: 10000; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 12px; }
.area-panel { background: #fff; border-radius: 18px; width: min(100%, 420px); max-height: 96vh; padding: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 10px; }
.area-title { text-align: center; font-weight: 800; font-size: 16px; color: #1d4ed8; }
.area-panel .area-grid { margin: 0; grid-template-columns: repeat(3, 1fr); grid-auto-rows: clamp(54px, 10.5vh, 92px); gap: 8px; }
.area-panel .area-chip { height: 100%; width: 100%; padding: 4px; display: flex; align-items: center; justify-content: center; border: 2px solid #1d4ed8; color: #1d4ed8; background: #fff; border-radius: 12px; font-size: 13px; line-height: 1.25; word-break: break-word; }
.area-panel .area-chip.cur { opacity: .5; }
.area-panel .area-chip.on { background: #1d4ed8; color: #fff; opacity: 1; }
.area-btns { display: flex; gap: 8px; }
.area-btns button { flex: 1; padding: 12px; border-radius: 10px; border: none; font: inherit; font-weight: 800; cursor: pointer; }
.area-btns .btn-approve, .area-btns .act-yes { background: #1d4ed8; color: #fff; }
.area-btns .btn-undo, .area-btns .act-no { background: #e5e7eb; color: #1b2430; }

.area-ov { background: rgba(15,23,42,.18) !important; display: block !important; padding: 0 !important; }
.area-panel { position: fixed !important; width: min(92vw, 300px) !important; padding: 10px !important; gap: 8px !important; border-radius: 14px !important; max-height: none !important;
  transform: perspective(600px) rotateX(-28deg) scale(.82); opacity: 0; transition: transform .22s cubic-bezier(.2,.8,.3,1.1), opacity .18s ease; }
.area-panel.in { transform: perspective(600px) rotateX(0) scale(1); opacity: 1; }
.area-title { font-size: 13px !important; }
.area-panel .area-grid { grid-auto-rows: 44px !important; gap: 6px !important; }
.area-panel .area-chip { font-size: 11.5px !important; border-radius: 10px !important; padding: 2px !important; }
.area-btns button { padding: 9px !important; font-size: 13px !important; }

.area-panel .area-chip { background: #1d4ed8 !important; color: #fff !important; border: 2px solid #1d4ed8 !important; font-weight: 800 !important; font-size: 10.5px !important; height: 44px !important; min-height: 44px; max-height: 44px; overflow: hidden; }
.area-panel .area-chip.cur { opacity: .4 !important; }
.area-panel .area-chip.on { background: #0b2a8a !important; border-color: #f5c518 !important; box-shadow: 0 0 0 2px #f5c518 inset; opacity: 1 !important; }
.area-panel .area-grid { grid-auto-rows: 44px !important; }

.faults-entry { background: #1d4ed8 !important; color: #fff !important; padding: 22px 14px !important; font-size: 19px !important; border-radius: 16px !important; box-shadow: 0 4px 14px rgba(29,78,216,.35); }
.faults-entry:active { transform: scale(.98); }

.area-panel { width: min(94vw, 340px) !important; }
.area-panel .area-chip { word-break: normal !important; overflow-wrap: normal !important; hyphens: none !important; white-space: normal; font-size: 10px !important; line-height: 1.2 !important; padding: 2px 4px !important; text-align: center; height: 46px !important; min-height: 46px; max-height: 46px; overflow: hidden; }
.area-panel .area-grid { grid-auto-rows: 46px !important; }

.th-box { background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 10px; padding: 10px; margin-top: 8px; font-size: 13px; font-weight: 700; text-align: center; line-height: 1.7; color: #1b2430; }
.th-title { color: #1d4ed8; font-weight: 800; margin-bottom: 4px; }
.th-btn { width: 100%; margin-top: 8px; padding: 10px; border-radius: 10px; border: 1px solid #1d4ed8; background: #fff; color: #1d4ed8; font: inherit; font-weight: 800; cursor: pointer; }

.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; }

.act-btn { background: #fff !important; border: 1.5px solid #1d4ed8 !important; color: #1d4ed8 !important; font-weight: 800 !important; font-size: 14px !important; border-radius: 10px !important; padding: 10px !important; }
.unack-red .act-btn { background: #fff !important; }

.filter-row { margin: 8px 0; }
.fault-sort { width: 100%; padding: 12px; border-radius: 12px; border: 1.5px solid #1d4ed8; background: #fff; color: #1d4ed8; font: inherit; font-weight: 800; font-size: 14px; text-align: center; text-align-last: center; }
.area-head { background: #1d4ed8; color: #fff; font-weight: 800; padding: 8px; border-radius: 10px; text-align: center; margin: 8px 0 2px; }

.stat-tap { cursor: pointer; }
.stat-on { outline: 2.5px solid #1d4ed8; background: #eaf0ff; }

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

.fault-search { width: 100%; box-sizing: border-box; padding: 12px; border-radius: 12px; border: 1.5px solid #1d4ed8; background: #fff; color: #111; font: inherit; font-size: 14px; text-align: center; }

.search-top { margin: 0 0 10px; display: flex; justify-content: center; }
.search-top .fault-search { max-width: 520px; margin: 0 auto; text-align: center; }

#screen-orders .dash-header { flex-wrap: wrap; }
.search-in { flex: 0 0 100%; order: 3; margin: 6px 0 0; display: flex; justify-content: center; }
.search-in .fault-search { max-width: 520px; margin: 0 auto; }

#screen-orders .dash-header { flex-wrap: wrap !important; }
#screen-orders .search-in { flex: 0 0 100% !important; width: 100%; box-sizing: border-box; }
#screen-orders .search-in .fault-search { width: 100%; }

.tstat-ov { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.tstat-box { background: #fff; border-radius: 16px; width: 100%; max-width: 380px; padding: 14px 16px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.tstat-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 17px; }
.tstat-x { background: transparent; border: none; font-size: 22px; cursor: pointer; width: 36px; height: 36px; }
.tstat-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid #e5e7eb; font-size: 15px; }
.tstat-row:last-child { border-bottom: none; }
.tstat-row b { color: #1d4ed8; font-size: 17px; white-space: nowrap; }
.tstat-row small { color: #6b7280; font-weight: 600; font-size: 12px; }
.tstat-note { text-align: center; color: #6b7280; padding: 12px 0 4px; }

#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; }

.tstat-inline { margin-top: 8px; padding: 4px 8px; background: #f8fafc; border: 1px solid #dbe3f0; border-radius: 12px; text-align: start; }
.tstat-inline .tstat-row { padding: 8px 2px; font-size: 14px; }

.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; }
#orders-list { align-items: start; }

.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; }

.ackbox { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; }
.ackbox::before { content: ''; flex: 0 0 auto; width: 26px; height: 26px; box-sizing: border-box; border-radius: 6px; border: 3px solid #dc2626; background: #fff; color: #fff; font-size: 20px; line-height: 20px; text-align: center; }
.ackbox.ack-no::before { border-color: #dc2626; background: #fff; }
.ackbox.ack-yes::before { content: '✓'; border-color: #16a34a; background: #16a34a; color: #fff; font-weight: 900; }
.ackbox.ack-yes, .ackbox.ack-yes * { color: #166534 !important; }
.ackbox.ack-no, .ackbox.ack-no * { color: #b91c1c !important; }

.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; }

.sender-line { margin-top: 10px; padding-top: 8px; border-top: 1px solid #e5e7eb; }

.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; }

@keyframes etaPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,.9), 0 0 10px 2px rgba(245,158,11,.7); } 50% { box-shadow: 0 0 0 6px rgba(245,158,11,.25), 0 0 22px 6px rgba(245,158,11,.9); } }
.eta-new { border: 2px solid #f59e0b !important; animation: etaPulse 1.4s ease-in-out infinite; }
.eta-badge { margin-top: 8px; background: #fef3c7; color: #92400e; border-radius: 10px; padding: 8px; font-weight: 800; text-align: center; }

.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; }

.sender-line .sender-name { color: #000; font-weight: 900; }

.ocard-flash { outline: 4px solid #f59e0b; box-shadow: 0 0 18px rgba(245,158,11,.8); transition: box-shadow .3s; }

.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; }

.stat.st-mail .num { color: #b45309; }
.badge.finished { }
.review-box { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border: 2px solid #f59e0b; background: #fff7d6; border-radius: 10px; font-weight: 800; font-size: 14px; color: #000; cursor: pointer; }
.review-box input { width: 22px; height: 22px; accent-color: #1d4ed8; }
.tm-wrap .tm-name { position: absolute; top: 36px; left: 50%; transform: translateX(-50%); display: block; margin: 0; max-width: none; overflow: visible; text-overflow: clip; text-align: center; }
.tm-wrap .tm-count { font-size: 15px; min-width: 24px; height: 24px; line-height: 21px; top: -9px; right: -9px; border-width: 2px; z-index: 2; }
.act-item { display: flex !important; align-items: center; justify-content: center; text-align: center !important; gap: 8px; font-weight: 700; }
.act-panel { text-align: center; }
.ocard:not(.unack-red):not(.order-overdue) { border: 1.5px solid #5aa9ff; box-shadow: 0 0 6px rgba(59,130,246,.55), 0 0 16px rgba(59,130,246,.22); }

/* uniform ticket cards, smaller status font, tech name raised */
.ocard { display: flex !important; flex-direction: column; min-height: 400px; }
.ocard .o-extra, .ocard .meta { font-size: 11.5px !important; line-height: 1.55; }
.ocard .o-extra { margin-top: 6px; }
.ocard .th-btn { margin-top: auto; }
.ocard .om, .ocard .tech-line { font-size: 13px !important; margin-top: -6px; margin-bottom: 4px; }
.ocard .sender-line { margin-top: 8px; }
.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; }

/* chat button gets its own strip above the card so it never covers the ticket number */
.ocard:has(.chat-btn) { padding-top: 38px !important; }
.ocard .chat-btn { min-width: 0 !important; height: 26px !important; padding: 0 10px !important; font-size: 12px !important; border-radius: 13px !important; top: 6px !important; right: 6px !important; box-shadow: none !important; }
.ocard { padding-top: 38px !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; }

/* smaller buttons so the ticket card is shorter */
.ocard { min-height: 330px !important; }
.ocard .th-btn, .ocard .act-btn { padding: 5px 8px !important; font-size: 12px !important; border-radius: 8px !important; margin-top: 4px; line-height: 1.25; }
.ocard .th-btn { margin-top: auto; }
.ocard .act-item, .ocard .act-sel { padding: 6px 8px !important; font-size: 12px !important; }
.ocard .act-menu { margin-top: 4px; }
/* 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; }

.route-sec { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #cbd5e1; display: flex; flex-direction: column; gap: 6px; }
.route-day { padding: 6px 8px; border: 1.5px solid #1d4ed8; border-radius: 8px; font: inherit; font-size: 13px; background: #fff; color: #111; }
.route-btn { padding: 7px 10px; border-radius: 8px; border: 1.5px solid #1d4ed8; background: #fff; color: #1d4ed8; font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; }
.route-ov { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 10px; }
.route-box { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; height: 80vh; display: flex; flex-direction: column; overflow: hidden; }
.route-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; font-weight: 800; background: #eef3ff; color: #111; }
.route-head span { color: #1d4ed8; }
.route-head button { border: 0; background: #1d4ed8; color: #fff; padding: 6px 10px; border-radius: 8px; font: inherit; font-weight: 800; cursor: pointer; }
.route-map { flex: 1; min-height: 240px; }

/* ticket details: tidy label / value rows */
.th-box { text-align: start !important; padding: 8px 10px !important; line-height: 1.4 !important; }
.th-box .th-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 2px; border-bottom: 1px solid #dbe3f5; font-size: 12.5px; }
.th-box .th-k { color: #475569; font-weight: 700; }
.th-box .th-v { color: #111827; font-weight: 800; direction: ltr; unicode-bidi: isolate; text-align: end; }
.th-box .th-chip { margin-top: 8px; padding: 6px 8px; border-radius: 8px; text-align: center; font-size: 12.5px; font-weight: 800; }
.th-box .th-chip.ok { background: #dcfce7; color: #166534; }
.th-box .th-chip.bad { background: #fee2e2; color: #991b1b; }
.th-box .th-chip.note { background: #e0e7ff; color: #1e3a8a; }
.th-box .th-row:last-of-type { border-bottom: 0; }
.order-overdue:not(.unack-red) .th-box, .order-overdue:not(.unack-red) .th-box * { color: inherit; }
.order-overdue:not(.unack-red) .th-box .th-k { color: #475569 !important; }
.order-overdue:not(.unack-red) .th-box .th-v { color: #111827 !important; }
.order-overdue:not(.unack-red) .th-box .th-chip.ok { color: #166534 !important; }
.order-overdue:not(.unack-red) .th-box .th-chip.bad { color: #991b1b !important; }
.order-overdue:not(.unack-red) .th-box .th-chip.note { color: #1e3a8a !important; }

/* machine number on the left, name (and area) on the right */
.mblock { display: grid !important; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; direction: ltr; }
.mblock .mb-num { grid-column: 1; grid-row: 1 / span 2; text-align: left; align-self: center; }
.mblock .mb-name { grid-column: 2; grid-row: 1; text-align: right; margin-top: 0 !important; }
.mblock .mb-area { grid-column: 2; grid-row: 2; text-align: right; }
.mblock .mb-box { grid-column: 1 / -1; justify-self: center; }

/* ticket history: labels on one side, values flush on the other, aligned */
.th-box .th-row { align-items: center !important; gap: 12px !important; }
.th-box .th-k { flex: 1 1 auto; min-width: 0; text-align: start !important; }
.th-box .th-v { flex: 0 0 auto; white-space: nowrap; text-align: end !important; font-variant-numeric: tabular-nums; min-width: 8.5em; }
.th-box .th-title { text-align: start; }

.st-body { display: flex; flex-direction: column; gap: 18px; margin-top: 12px; }
.st-body.hidden { display: none; }
#st-toggle { background: var(--green); color: #fff; border: 0; border-radius: 10px; padding: 12px 14px; font-weight: 700; }

.tech-marker, .tech-marker *, .leaflet-marker-icon, #map-list .card { -webkit-tap-highlight-color: transparent; outline: none; }
.tech-marker { transition: none !important; }

/* 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; } }

.th-box .th-v.th-v-red, .order-overdue:not(.unack-red) .th-box .th-v.th-v-red { background: #dc2626 !important; color: #fff !important; border-radius: 6px; padding: 2px 8px; }

@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; }

#screen-dash .dash-header, #screen-dash .dash-header > div { text-align: center; }
#screen-dash .dash-header { justify-content: center; }

/* 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; }

/* Night theme: invert the whole page, then restore photos/logos/icons */
html.dark { filter: invert(1) hue-rotate(180deg); background: #fff; }
html.dark img, html.dark video, html.dark .leaflet-marker-pane img, html.dark .leaflet-marker-shadow { filter: invert(1) hue-rotate(180deg); }
html.dark #top-clock .atm-mark .am-eagle { animation: none; filter: invert(1) hue-rotate(180deg) drop-shadow(0 0 6px rgba(245,158,11,.7)); }

/* ===== Design layer: rounded cards, gradient tiles, floating bottom nav ===== */
.card, .fault-card, .ocard, .order-card, .stat, .status-card, .tm-faults .fault-card { border-radius: 20px; }
form { border-radius: 22px; }
.fault-tile { border-radius: 22px; }
.stat { border-radius: 18px; }
.ic { display: inline-block; vertical-align: middle; flex: none; }
.menu-btn { display: flex; align-items: center; justify-content: center; }
.rb-arrow { display: inline-flex; vertical-align: middle; }
.drawer-nav .ic, .seg-btn .ic { margin-inline-end: 6px; }
#bnav { position: fixed; left: 14px; right: 14px; bottom: max(12px, env(safe-area-inset-bottom)); max-width: 452px; margin: 0 auto; height: 62px; border-radius: 24px; background: rgba(255,255,255,.94); border: 1px solid #e5e7eb; box-shadow: 0 10px 30px rgba(20,30,60,.18); display: flex; justify-content: space-around; align-items: center; z-index: 40; }
#bnav button { width: 48px; height: 48px; border: 0; background: transparent; color: #64748b; border-radius: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
#bnav button.on { background: linear-gradient(135deg, #2563eb, #38bdf8); color: #fff; box-shadow: 0 6px 14px rgba(37,99,235,.35); }
body.has-nav .menu-btn { display: none; }
body.has-nav .app { padding-bottom: 100px; }
/* night look (pre-inversion values: they render as the dark navy palette) */
html.dark { --card: #dadeed; --bg: #e9ebf3; --border: #cfd4e6; }
html.dark body { background: radial-gradient(120% 55% at 80% 0%, #d5dcfa 0%, #e9ebf3 58%) fixed; }
html.dark :where(.fault-card, .ocard, .order-card) { background: #dadeed; }
html.dark #bnav button.on, html.dark .fault-tile, html.dark .stat { filter: invert(1) hue-rotate(180deg); }
html.dark #bnav { background: rgba(207,212,230,.95); border-color: #c4cadf; }
html.dark .fault-tile { border: 0; color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
html.dark .ft-received { background: linear-gradient(135deg, #2563eb, #38bdf8); }
html.dark .ft-ongoing { background: linear-gradient(135deg, #f857a6, #ff8a5c); }
html.dark .ft-finished { background: linear-gradient(135deg, #059669, #34d399); }
html.dark .stat { border: 0; color: #fff; background: linear-gradient(135deg, #6a5cff, #b06bff); }
html.dark .stat.st-pending { background: linear-gradient(135deg, #f857a6, #ff8a5c); }
html.dark .stat.st-approved { background: linear-gradient(135deg, #059669, #34d399); }
html.dark .stat.st-received { background: linear-gradient(135deg, #2563eb, #38bdf8); }
html.dark .stat.st-finished { background: linear-gradient(135deg, #475569, #94a3b8); }
html.dark .stat.st-mail { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
html.dark .stat .num, html.dark .stat .lbl { color: #fff !important; }

/* ===== Purple glass palette + charts + tabs + bell (blend design) ===== */
html.dark { --card: #e4e0f3; --bg: #ece9f5; --border: #d6d0ed; }
html.dark body { background: radial-gradient(90% 40% at 100% 0%, #d6c6ff 0%, transparent 70%) fixed, radial-gradient(80% 40% at 0% 45%, #ded5f6 0%, transparent 70%) fixed, #ece9f5 !important; }
html.dark :where(.fault-card, .ocard, .order-card) { background: #e4e0f3; }
html.dark #bnav { background: rgba(224,219,241,.95); border-color: #d6d0ed; }
html.dark #bnav button.on { background: linear-gradient(135deg, #7c5cff, #38bdf8); }
/* charts */
.ds-charts { display: flex; flex-direction: column; gap: 10px; }
.ds-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 24px; padding: 14px; box-shadow: 0 6px 18px rgba(20,30,60,.07); }
.ds-donut { display: flex; align-items: center; gap: 14px; }
.ds-legs { flex: 1; }
.ds-leg { display: flex; justify-content: space-between; font-size: 12px; margin: 6px 0; }
.ds-leg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 7px; }
.ds-track { stroke: rgba(0,0,0,.07); }
.ds-num { fill: #111; } .ds-sub { fill: #6b7280; }
.ds-wt { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.ds-bars { display: flex; justify-content: space-between; align-items: flex-end; height: 74px; padding: 0 6px; }
.ds-bar { width: 7px; border-radius: 4px; background: linear-gradient(#14b8a6, rgba(20,184,166,.08)); }
.ds-lab { display: flex; justify-content: space-between; font-size: 9.5px; color: #6b7280; margin-top: 4px; }
html.dark .ds-donut svg, html.dark .ds-bar { filter: invert(1) hue-rotate(180deg); }
html.dark .ds-track { stroke: rgba(255,255,255,.1); }
html.dark .ds-num { fill: #fff; } html.dark .ds-sub { fill: #9b94b5; }
/* fanni: fault tiles become stacked colored tabs */
.fault-tiles { display: block !important; margin: 4px -16px 6px; padding: 0; }
.fault-tile { display: flex !important; flex-direction: row-reverse !important; justify-content: space-between !important; align-items: flex-start !important; width: 100% !important; aspect-ratio: auto !important; height: 76px; border: 0 !important; border-radius: 30px 30px 0 0 !important; padding: 14px 28px 0 !important; margin: 0 0 -24px !important; grid-column: auto !important; position: relative; box-shadow: 0 -4px 14px rgba(20,30,60,.08); }
.fault-tile .ft-title { font-size: 16px; font-weight: 700; }
.fault-tile .ft-count { font-size: 18px; font-weight: 800; }
.fault-tile.ft-ongoing { background: linear-gradient(90deg, #fde68a, #fbcfe8) !important; color: #3b2a07 !important; z-index: 1; }
.fault-tile.ft-received { background: linear-gradient(90deg, #c4b5fd, #8b5cf6) !important; color: #fff !important; z-index: 2; }
.fault-tile.ft-finished { background: #1d1a2b !important; color: #f1eefb !important; z-index: 3; height: 84px; margin-bottom: 8px !important; }
html.dark .ft-ongoing { background: linear-gradient(90deg, #fde68a, #fbcfe8) !important; }
html.dark .ft-received { background: linear-gradient(90deg, #c4b5fd, #8b5cf6) !important; }
html.dark .ft-finished { background: #1d1a2b !important; }
/* stats: purple / teal / rose tones */
html.dark .stat { background: linear-gradient(160deg, #2a2342, #5a3fa8); }
html.dark .stat.st-approved { background: linear-gradient(160deg, #1f2a33, #2f8f7c); }
html.dark .stat.st-pending { background: linear-gradient(160deg, #2f2230, #a14a74); }
html.dark .stat.st-received { background: linear-gradient(160deg, #1e2a52, #3b6fe0); }
/* bell */
.bell-btn { width: 42px !important; height: 42px !important; border: 1px solid rgba(124,92,255,.25) !important; background: rgba(255,255,255,.92) !important; color: #5b4bd6; display: flex !important; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(60,40,140,.18) !important; }
.bell-btn.hidden { display: none !important; }
.bell-badge { background: linear-gradient(135deg, #f857a6, #ff5858) !important; box-shadow: 0 0 0 2px #fff; }
.bell-panel { background: #fff !important; border: 1px solid #e5e7eb !important; border-radius: 22px !important; box-shadow: 0 16px 40px rgba(40,30,90,.25) !important; padding-bottom: 8px; overflow-x: hidden; }
.bell-hd { background: linear-gradient(135deg, #6d5dfc, #8b5cf6) !important; color: #fff !important; }
.bell-item { background: #f8f7ff !important; border: 1px solid #ece9ff !important; border-inline-start: 4px solid #8b5cf6 !important; border-radius: 14px !important; }
.bell-item.bell-new { background: #f1ecff !important; border-inline-start-color: #6d5dfc !important; }
.bell-empty { color: #6b7280 !important; }
html.dark .bell-hd { filter: invert(1) hue-rotate(180deg); }
html.dark .bell-badge { filter: invert(1) hue-rotate(180deg); box-shadow: 0 0 0 2px #1f1b2e; }
html.dark .bell-btn { background: rgba(224,219,241,.95) !important; }
html.dark .ds-card { background: #e4e0f3; border-color: #d6d0ed; }
html.dark .ds-leg i { filter: invert(1) hue-rotate(180deg); }
html.dark .bell-panel { background: #e4e0f3 !important; border-color: #d6d0ed !important; }
html.dark .bell-item { background: #e0dbf1 !important; border-color: #d6d0ed !important; }
html.dark .bell-item.bell-new { background: #d8d0f2 !important; }

/* profile photo */
.av-card{display:flex;align-items:center;gap:14px;padding:14px;margin-bottom:12px;border-radius:20px;background:linear-gradient(160deg,#ffffff22,#ffffff0d);border:1px solid #ffffff2a}
.av-big,.av-sm{border-radius:50%;background:linear-gradient(135deg,#f472b6,#7c3aed) center/cover no-repeat;color:#fff;display:grid;place-items:center;font-weight:700;flex:none;box-shadow:0 0 18px #a855f766;border:2px solid #ffffff55}
.av-big{width:64px;height:64px;font-size:26px}.av-sm{width:40px;height:40px;font-size:17px}
.av-act{display:flex;flex-direction:column;gap:4px;align-items:flex-start;min-width:0}.av-name{font-size:15px}
.av-btn{border:0;background:#7c3aed;color:#fff;border-radius:10px;padding:5px 12px;font-size:12px;cursor:pointer}.av-del{background:#6b7280}
.av-msg{font-size:11px}

/* calls */
.call-ui{position:fixed;inset:0;z-index:10080;background:rgba(10,5,25,.72);display:flex;align-items:center;justify-content:center;padding:18px;backdrop-filter:blur(6px)}
.call-ui.hidden{display:none}
.call-card{position:relative;width:100%;max-width:360px;max-height:85vh;overflow:auto;border-radius:26px;padding:22px 18px;text-align:center;color:#efeaff;background:linear-gradient(160deg,#3b1d7a,#1a1033);border:1px solid #ffffff30;box-shadow:0 20px 60px rgba(0,0,0,.5)}
.call-x{position:absolute;top:10px;inset-inline-start:12px;border:0;background:transparent;color:#cfc6ee;font-size:20px;cursor:pointer}
.call-title{font-size:19px;font-weight:700;margin-bottom:12px}.call-status{font-size:15px;margin:16px 0;color:#d8ccff}
.call-note{font-size:12px}.call-list{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.call-row{display:flex;align-items:center;gap:12px;border:1px solid #ffffff22;background:#ffffff12;border-radius:16px;padding:10px 12px;color:inherit;cursor:pointer;text-align:start;font:inherit}
.call-nm{flex:1;display:flex;flex-direction:column}.call-nm small{color:#b9aee0;font-size:11px}.call-go{font-size:20px;color:#34d399}
.call-btns{display:flex;gap:12px;justify-content:center;margin-top:10px}.call-btn{border:0;border-radius:14px;padding:12px 22px;font:inherit;font-size:15px;color:#fff;background:#6d28d9;cursor:pointer}
.call-btn.red{background:#dc2626}.call-btn.green{background:#16a34a}

/* ===== desktop dashboard layer (>=1100px) ===== */
@media (min-width: 1100px) {
  .app { max-width: none; padding: 28px 24px 120px; }
  #bnav { max-width: 520px; }
  #dk-panel { position: fixed; top: 22px; bottom: 100px; left: 22px; width: 330px; display: flex; flex-direction: column; gap: 16px; z-index: 30; overflow: auto; }
  #dk-panel.hidden { display: none; }
  #dk-panel { transform: translateX(-120%); transition: transform .28s ease; z-index: 70; pointer-events: none; }
  #dk-panel.dk-open { transform: none; pointer-events: auto; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
  .dk-prof { position: relative; }
  .dk-x { position: absolute; top: 10px; inset-inline-end: 12px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; font-size: 14px; }
  .dk-card { background: var(--card); border: 1px solid var(--border); border-radius: 24px; padding: 18px; box-shadow: 0 10px 30px rgba(60,30,120,.12); }
  .dk-prof { text-align: center; }
  .dk-av { width: 84px; height: 84px; font-size: 32px; margin: 0 auto 10px; }
  .dk-name { display: block; font-size: 17px; }
  .dk-role { display: block; font-size: 12px; margin-top: 2px; }
  .dk-qa { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
  .dk-qa button { border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 14px; padding: 10px 0; font: inherit; font-size: 12px; cursor: pointer; }
  .dk-qa i { display: block; width: 26px; height: 26px; border-radius: 9px; margin: 0 auto 6px; background: linear-gradient(135deg,#a855f7,#6d28d9); }
  .dk-act { flex: 1; }
  .dk-act h3 { font-size: 15px; margin-bottom: 6px; }
  .dk-row { display: flex; align-items: center; gap: 12px; border-radius: 14px; padding: 9px 10px; margin-top: 8px; background: rgba(124,58,237,.07); }
  .dk-row i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-size: 11px; flex: none; }
  .dk-row b { display: block; font-size: 13px; } .dk-row span { font-size: 11px; color: var(--muted); }
  .dk-row em { margin-inline-start: auto; font-style: normal; font-size: 12px; font-weight: 700; }
  #screen-dash .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  #screen-dash .stat { padding: 18px 20px; border-radius: 22px; }
  #screen-dash .stat .num { font-size: 34px; }
  .ds-charts { display: grid !important; grid-template-columns: 1fr 1.6fr; gap: 16px; }
  .ds-card { border-radius: 24px; padding: 20px; }
  #screen-dash .cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
  #top-clock { max-width: none; }
}

@media (min-width: 1100px) {
  #dk-panel { top: 74px; }
  #screen-dash .dash-header { order: -3; }
  #screen-dash .stats { order: -2; }
  #screen-dash #ds-charts { order: -1; }
}

/* live map: header bar removed */
#screen-map > .dash-header{display:none!important}
#screen-map #map{margin-top:12px!important}
#screen-map .block{text-align:center}
#screen-map .block h3{text-align:center}
#screen-map #map-list .card{text-align:center;justify-content:center}
#screen-map #map-list .card .top{justify-content:center;gap:14px;text-align:center}
#screen-map #map-list .card .meta{text-align:center}
#screen-map > .block:first-of-type{margin-top:-48px}

/* mobile: no refresh button */
@media (max-width:1099px){.refresh-btn{display:none!important}}

/* WhatsApp-style live location marker */
.tm-person{width:38px!important;height:46px!important;margin:0 auto!important}
.tm-person::before,.tm-person::after{all:unset}
.tm-person{--c:#15803d}
.tm-red .tm-person{--c:#b91c1c}
.tm-off .tm-person{--c:#6b7280}
.tm-person::before{content:'';position:absolute;left:50%;top:0;width:36px;height:36px;margin-left:-18px;border-radius:50%;background:var(--c);border:3px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,.35);box-sizing:border-box;z-index:2}
.tm-person::after{content:'';position:absolute;left:50%;top:33px;margin-left:-6px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:9px solid #fff;z-index:1}
.tm-person span{position:absolute;left:50%;top:0;width:36px;height:36px;margin-left:-18px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:16px;z-index:3}
.tm-person i{position:absolute;left:50%;top:0;width:36px;height:36px;margin-left:-18px;border-radius:50%;background:var(--c);opacity:.5;z-index:0;animation:tm-pulse 1.8s ease-out infinite}
.tm-off .tm-person i{display:none}
@keyframes tm-pulse{0%{transform:scale(1);opacity:.55}100%{transform:scale(2.3);opacity:0}}
.tm-person::after{background:transparent!important;border-radius:0!important}
.tm-person::before{background:var(--c)!important}
.tm-wrap .tm-name{margin-top:8px!important}
.tm-wrap.tm-red{background:none!important}

/* WhatsApp-style overlapping people */
.tm-cl{position:relative;width:64px;height:48px}
.tm-cl-av{position:absolute;top:6px;width:36px;height:36px;border-radius:50%;background:#15803d;border:3px solid #fff;box-sizing:border-box;box-shadow:0 2px 6px rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:15px}
.tm-cl-av:nth-child(2){background:#1d4ed8}
.tm-cl-av:nth-child(1){background:#7c3aed}
.tm-cl-pulse{position:absolute;left:14px;top:6px;width:36px;height:36px;border-radius:50%;background:#15803d;opacity:.4;animation:tm-pulse 1.8s ease-out infinite;z-index:0}
.tm-cl-n{position:absolute;right:0;top:0;min-width:20px;height:20px;border-radius:10px;background:#111827;color:#fff;font-size:11px;font-weight:800;display:flex;align-items:center;justify-content:center;padding:0 5px;border:2px solid #fff;box-sizing:border-box;z-index:9}

/* photo inside the live-location circle, ring colour = state */
.tm-person.has-ph::before{background:#fff!important;border-color:var(--c)!important}
.tm-ph{position:absolute;left:50%;top:3px;width:30px;height:30px;margin-left:-15px;border-radius:50%;background-size:cover;background-position:center;z-index:3}
.tm-cl-av{background-size:cover;background-position:center}
/* keep live-map markers in their true colours (ring green/red/gray, real photo) in night mode */
html.dark .leaflet-marker-pane{filter:invert(1) hue-rotate(180deg)}
/* WhatsApp-style ring: coloured ring around the photo + white outline */
.tm-person.has-ph::before{display:none}
.tm-ph{top:0!important;width:38px!important;height:38px!important;margin-left:-19px!important;border:4px solid var(--c)!important;box-sizing:border-box;background-clip:padding-box;background-color:#fff;box-shadow:0 0 0 2px #fff,0 2px 7px rgba(0,0,0,.4)}
.tm-person.has-ph::after{top:36px}

/* sections under design: حساباتي (idara/owner) + أوبر */
.soon-ov{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:100001;display:flex;align-items:center;justify-content:center;padding:20px}
.soon-box{position:relative;background:var(--card,#fff);color:var(--text,#111827);border-radius:20px;padding:28px 22px 22px;width:100%;max-width:340px;text-align:center}
.soon-x{position:absolute;top:8px;inset-inline-end:8px;background:transparent;border:none;font-size:20px;width:40px;height:40px;cursor:pointer;color:inherit}
.soon-ic{font-size:44px;line-height:1}
.soon-box h3{margin:10px 0 8px;font-size:20px}
.soon-tag{display:inline-block;background:#fef3c7;color:#92400e;font-weight:800;font-size:13px;border-radius:999px;padding:4px 14px}
.soon-box p{margin:12px 0 0;font-size:13.5px;color:#6b7280}
@media (min-width:1100px){.soon-entry{display:none!important}}

/* side menu order: Faults first, Live Map first (also in bottom bar), Share App at the very bottom */
#drawer .drawer-body{display:flex;flex-direction:column}
#drawer .drawer-body > *{flex:none}

/* compact notification list: small, auto-hides after 10s, swipe an item left/right to dismiss */
.bell-panel { width: min(250px, 80vw) !important; max-height: 38vh !important; border-radius: 14px !important; top: 58px !important; }
.bell-hd { padding: 6px 10px !important; font-size: 12px !important; }
.bell-clear { padding: 1px 8px !important; font-size: 11px !important; }
.bell-item { padding: 6px 9px !important; margin: 5px 6px 0 !important; border-radius: 9px !important; touch-action: pan-y; user-select: none; }
.bell-tx { font-size: 12px !important; line-height: 1.4 !important; }
.bell-tm { font-size: 10px !important; margin-top: 1px !important; }
.bell-empty { padding: 12px !important; font-size: 12px !important; }

/* home background: rotating eagle photos + a soft veil so text stays readable */
#bgrot { position: fixed; inset: 0; z-index: 0; pointer-events: none; display: none; overflow: hidden; }
body.bg-on #bgrot { display: block; }
#bgrot .bgr { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.6s ease; }
#bgrot .bgr.on { opacity: 1; }
#bgrot .bgr-ov { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.62) 45%, rgba(255,255,255,.72) 100%); }
html.dark #bgrot { filter: invert(1) hue-rotate(180deg); }
body.bg-on { background: transparent !important; }

/* keep the header clock above the rotating background */
#top-clock { position: relative; z-index: 2; }
/* sidebar order v2 */
#drawer .av-card{order:-100}
#drawer-orders{order:-50}
#drawer-map{order:-49}
#drawer-requests{order:-48}
#drawer-repl{order:-47}
#drawer-acct{order:-30}
#drawer-uber{order:-29}
#drawer-machreg{order:-28}
#drawer .drawer-block:has(#st-toggle){order:90}
#drawer .drawer-contact{order:95}
#drawer-share{order:100}
#drawer .drawer-bottom{order:200}
/* ===== dark collapsible sidebar ===== */
#drawer{--card:#2a2e66;--text:#e8eaff;--border:#ffffff2e;--muted:#a9afd8;background:linear-gradient(185deg,#1a1e48,#2a1f58);color:var(--text);width:320px;transition:transform .25s ease,width .22s ease;box-shadow:0 18px 50px rgba(5,5,30,.55)}
html.dark #drawer{filter:invert(1) hue-rotate(180deg)}
#drawer.sb-rail{width:84px}
#drawer .drawer-head{border-bottom:0;padding:16px 16px 4px;justify-content:flex-start;gap:10px}
#drawer .drawer-head h3{display:none}
#drawer .sb-eagle{height:44px;width:auto;filter:none!important;margin-inline-end:auto}
html.dark #drawer .sb-eagle{filter:none}
#drawer .drawer-close,#drawer .sb-collapse{background:#ffffff1c;color:#e8eaff;border:0;width:30px;height:30px;border-radius:50%;padding:0;display:grid;place-items:center;font-size:14px;cursor:pointer;flex:none}
#drawer .sb-collapse{background:#2b7bff;color:#fff}
#drawer .sb-collapse svg{width:16px;height:16px}
[dir=rtl] #drawer.sb-rail .sb-collapse svg,[dir=ltr] #drawer:not(.sb-rail) .sb-collapse svg{transform:rotate(180deg)}
#drawer.sb-rail .drawer-head{flex-direction:column;align-items:center;padding:14px 0 4px}
#drawer.sb-rail .sb-eagle{margin:0;height:34px}
#drawer.sb-rail .drawer-close{display:none}
#drawer .drawer-body{padding:8px 14px 16px;gap:4px;color:var(--text)}
#drawer .av-card{background:transparent;border:0;border-bottom:1px solid #ffffff2a;border-radius:0;padding:8px 4px 14px;margin-bottom:8px;color:#e8eaff}
#drawer .av-card .av-big{width:54px;height:54px;border:2px solid #7c6cff;box-shadow:none}
#drawer .av-name{font-size:17px;font-weight:700;color:#fff}
#drawer .drawer-nav,#drawer .mc-toggle[data-sb],#drawer #drawer-logout{display:flex;align-items:center;gap:14px;width:100%;margin:0;padding:11px 12px;background:transparent;color:#e8eaff;border:0;border-radius:12px;font-size:16px;font-weight:600;text-align:start;box-shadow:none;position:relative}
#drawer .drawer-nav:hover,#drawer .mc-toggle[data-sb]:hover,#drawer #drawer-logout:hover{background:#ffffff1f}
#drawer .drawer-block:has(> .mc-toggle[data-sb]){gap:0}
#drawer .mc-toggle[data-sb] > span:not(.sb-ic){flex:1;display:flex;justify-content:space-between;align-items:center}
#drawer .mc-toggle[data-sb] .mc-arrow{font-size:12px;color:#a9afd8}
#drawer .sb-ic{width:24px;height:24px;flex:none;display:grid;place-items:center}
#drawer .sb-ic svg{width:22px;height:22px}
#drawer .drawer-ic,#drawer .ic-ord,#drawer .ic-map,#drawer .ic-pkg,#drawer .lb-ic{display:none!important}
#drawer .drawer-nav .soon-badge{background:#f5b53d;color:#222;border-radius:6px;padding:1px 7px;font-size:11px;font-weight:700;margin-inline-start:auto}
#drawer .sb-bd{margin-inline-start:auto;min-width:22px;height:22px;padding:0 7px;border-radius:7px;background:#f5b53d;color:#1d1d1d;font-size:13px;font-weight:800;display:grid;place-items:center}
#drawer .sb-bd.hidden{display:none}
#drawer #drawer-logout{color:#ff9aa8!important;font-weight:700}
#drawer .drawer-bottom{border-top:1px solid #ffffff22;margin-top:auto;padding-top:10px}
#drawer .drawer-version{color:#8f95c4}
#drawer .st-body{padding:6px 4px 2px}
#drawer .drawer-label{color:#a9afd8}
#drawer .seg{border-color:#ffffff33}
#drawer .seg-btn{background:#ffffff14;color:#e8eaff}
#drawer .seg-btn.active{background:#6c5ce7;color:#fff}
#drawer input,#drawer select{background:#ffffff14;color:#fff;border-color:#ffffff33}
#drawer .info-box{background:#ffffff12;color:#dfe2ff;border-color:#ffffff22}
#drawer .latest-btn{background:#ffffff14!important;border:0!important;color:#9ec2ff!important}
#drawer .lc-no{background:#ffffff22;color:#fff}
/* rail */
#drawer.sb-rail .drawer-body{padding:8px 10px 14px;overflow-x:hidden}
#drawer.sb-rail .drawer-nav,#drawer.sb-rail .mc-toggle[data-sb],#drawer.sb-rail #drawer-logout{font-size:0;justify-content:center;padding:11px 0;gap:0}
#drawer.sb-rail .mc-toggle[data-sb] > span:not(.sb-ic),#drawer.sb-rail .soon-badge,#drawer.sb-rail .mc-arrow{display:none}
#drawer.sb-rail .sb-bd{position:absolute;top:1px;inset-inline-end:3px;min-width:18px;height:18px;font-size:11px;padding:0 4px;margin:0}
#drawer.sb-rail .av-card{justify-content:center;padding:6px 0 12px}
#drawer.sb-rail .av-card .av-act{display:none}
#drawer.sb-rail .av-card .av-big{width:44px;height:44px}
#drawer.sb-rail .st-body,#drawer.sb-rail .drawer-version,#drawer.sb-rail #drawer-latest,#drawer.sb-rail #drawer-latest-msg,#drawer.sb-rail .logout-confirm{display:none!important}
/* profile photo tap menu */
#drawer #av-pick,#drawer #av-del{display:none!important}
#drawer .av-big{cursor:pointer}
#sb-avmenu{position:absolute;z-index:5;background:#fff;color:#1a1e48;border-radius:12px;box-shadow:0 8px 24px #0006;padding:4px}
#sb-avmenu button{background:transparent;border:0;color:#1a1e48;font:inherit;font-weight:700;font-size:14px;padding:10px 16px;white-space:nowrap;cursor:pointer}
html.dark #drawer #sb-avmenu{filter:none}
#drawer .av-title{display:block;font-size:13px;color:#a9afd8;font-weight:600;margin-top:-2px}
#drawer #drawer-close{display:none!important}
#bgrot{z-index:-1!important}

/* map first, big; technicians list below */
#screen-map #map{height:calc(100vh - 190px)!important;min-height:420px;margin-top:8px!important;margin-bottom:12px}
#screen-map .block{margin-top:4px}

.new-order-form input, .new-order-form select { text-align: center; text-align-last: center; }
.new-order-form input::placeholder { text-align: center; }
.new-order-form input { padding-left: 8px; padding-right: 8px; }
.new-order-form input::placeholder { font-size: 11.5px; }
.new-order-form { width: 100%; max-width: 520px; margin-left: auto; margin-right: auto; box-sizing: border-box; }

/* photo avatars: undo night-mode inversion */
html.dark .has-img, html.dark .tm-ph, html.dark .tm-cl-av { filter: invert(1) hue-rotate(180deg); }

/* sidebar is already double-inverted (page + drawer): photo must not be inverted a third time */
html.dark #drawer .has-img, html.dark #drawer .tm-ph, html.dark #drawer .tm-cl-av { filter: none !important; }

/* new-fault form: Cairo font (Arabic + Latin), everything centered */
@font-face{font-family:'CairoF';font-weight:200 1000;font-display:swap;src:url(cairo-ar.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+FB50-FDFF,U+FE70-FEFC,U+200C-200E}
@font-face{font-family:'CairoF';font-weight:200 1000;font-display:swap;src:url(cairo-lat.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+2000-206F,U+20AC,U+2122}
#new-order-form,#new-order-form *{font-family:'CairoF',system-ui,sans-serif}
#new-order-form{text-align:center}
#new-order-form label{display:block;text-align:center;font-weight:700}
#new-order-form input,#new-order-form select{text-align:center;text-align-last:center}
#new-order-form input::placeholder{text-align:center}
#new-order-form #no-msg,#new-order-form #no-error{text-align:center}
#new-order-form .accs-h{justify-content:center}#new-order-form .accs-h .accs-t{flex:0 1 auto;text-align:center}#new-order-form .accs-i{text-align:center}#new-order-form .accs-ch{position:absolute;inset-inline-end:16px}#new-order-form .accs-h{position:relative}
#new-order-form input{width:100%;box-sizing:border-box;margin-top:4px}

.no-btn-row{display:flex;gap:8px}.no-btn-row .new-order-btn{flex:1;min-width:0;margin:4px 0 12px}

#slm-form,#slm-form *{font-family:'CairoF',system-ui,sans-serif}
#slm-form{text-align:center}
#slm-form label{display:block;text-align:center;font-weight:700}
#slm-form input,#slm-form select{text-align:center;text-align-last:center}
#slm-form input::placeholder{text-align:center}
#slm-form #no-msg,#slm-form #no-error{text-align:center}
#slm-form .accs-h{justify-content:center}#slm-form .accs-h .accs-t{flex:0 1 auto;text-align:center}#slm-form .accs-i{text-align:center}#slm-form .accs-ch{position:absolute;inset-inline-end:16px}#slm-form .accs-h{position:relative}
#slm-form input{width:100%;box-sizing:border-box;margin-top:4px}
#slm-form #sv-msg,#slm-form #sv-error{text-align:center}#slm-form input[readonly]{opacity:.75}

.no-btn-row{gap:6px}.no-btn-row .new-order-btn{padding:12px 4px;font-size:clamp(10px,3vw,14px);white-space:nowrap;letter-spacing:0;direction:ltr}
.no-btn-row #btn-tmr-ticket{flex:1.7}.no-btn-row .new-order-btn{font-size:clamp(9px,2.7vw,13px)}

#tmr-form,#tmr-form *{font-family:'CairoF',system-ui,sans-serif}
#tmr-form{text-align:center}
#tmr-form label{display:block;text-align:center;font-weight:700}
#tmr-form input,#tmr-form select{text-align:center;text-align-last:center}
#tmr-form input::placeholder{text-align:center}
#tmr-form #no-msg,#tmr-form #no-error{text-align:center}
#tmr-form .accs-h{justify-content:center}#tmr-form .accs-h .accs-t{flex:0 1 auto;text-align:center}#tmr-form .accs-i{text-align:center}#tmr-form .accs-ch{position:absolute;inset-inline-end:16px}#tmr-form .accs-h{position:relative}
#tmr-form input{width:100%;box-sizing:border-box;margin-top:4px}
#tmr-form #tm-msg,#tmr-form #tm-error{text-align:center}
.tm-tag{display:block;width:fit-content;margin:0 auto 6px;padding:2px 12px;border-radius:6px;background:#1faa59;color:#fff;font-weight:800;font-size:.8em;letter-spacing:.3px}.tm-tag.tm-old{background:#e08a00}

.stat.st-tm .num{color:#1faa59}html.dark .stat.st-tm{background:linear-gradient(135deg,#1faa59,#4ade80)}

.ft-manage{display:block;width:100%;margin:-4px 0 12px;padding:8px;border:1.5px dashed var(--border,#99a);border-radius:10px;background:transparent;color:inherit;font-weight:700;font-size:.85em;cursor:pointer}
#ft-panel{text-align:center}#ft-panel input{text-align:center}

/* header chip: bigger photo, smaller text pushed to far left */
#drawer .av-card .av-big{width:108px;height:108px}
#drawer .av-card .av-act{margin-right:auto;margin-left:0;align-items:flex-start;text-align:left;direction:ltr;gap:2px;flex:1 1 auto}
#drawer .av-name{font-size:13px}
#drawer .av-title{font-size:11px}
#drawer.sb-rail .av-card .av-big{width:60px;height:60px}
#drawer .av-code{display:block;font-size:11px;color:#a9afd8;font-weight:700;margin-top:-1px}
#drawer .av-code:empty{display:none}
#drawer .av-title{margin-top:6px}
#drawer .av-code{align-self:stretch;text-align:center;margin-top:3px}
#drawer .av-card .av-act{align-items:center;text-align:center;margin-right:0;margin-left:0}
#drawer .av-card .av-act>*{text-align:center;align-self:center}
.ds-leg i.ds-live{position:relative;box-shadow:0 0 6px 2px var(--lc,#c084fc);animation:dsLive 1.4s ease-in-out infinite}
.ds-leg i.ds-live::after{content:'';position:absolute;inset:-3px;border-radius:50%;border:2px solid var(--lc,#c084fc);opacity:.7;animation:dsRing 1.4s ease-out infinite}
@keyframes dsLive{0%,100%{transform:scale(1);box-shadow:0 0 4px 1px var(--lc,#c084fc)}50%{transform:scale(1.25);box-shadow:0 0 12px 4px var(--lc,#c084fc)}}
@keyframes dsRing{0%{transform:scale(.8);opacity:.8}100%{transform:scale(2.2);opacity:0}}


.leaflet-popup-content{text-align:center}.pm-ph{display:block;width:64px;height:64px;margin:2px auto 6px;border-radius:50%;background-size:cover;background-position:center;border:3px solid #16a34a;box-shadow:0 2px 8px rgba(0,0,0,.3)}
html.dark .pm-ph{filter:invert(1) hue-rotate(180deg)}@media (prefers-reduced-motion:reduce){.leaflet-popup{animation:none}}
/* smaller live map so the technicians list shows under it without scrolling */
#screen-map #map{height:clamp(220px,calc(100vh - 470px),440px)!important;min-height:220px!important;margin-bottom:10px!important}
.route-replay{border:0;border-radius:10px;background:#1d4ed8;color:#fff;font-weight:700;padding:6px 10px;margin-inline:6px;cursor:pointer}.route-replay:disabled{opacity:.6}.route-none{position:absolute;z-index:1000;top:12px;left:50%;transform:translateX(-50%);background:#fff;border-radius:10px;padding:8px 14px;font-weight:700;box-shadow:0 2px 8px rgba(0,0,0,.3);color:#b91c1c}.route-map{position:relative}
.leaflet-popup-content-wrapper{animation:popWrap .45s cubic-bezier(.2,.9,.3,1.2);transform-origin:50% 100%}@keyframes popWrap{0%{opacity:0;transform:translateY(-14px) scale(.8)}100%{opacity:1;transform:none}}
#map-list{align-items:start!important;align-content:start}#map-list .card{align-self:flex-start!important;height:auto!important;min-height:0!important}

/* side menu dropdowns (Settings, change password, ...): smooth slide-down with staggered items */
#drawer .st-body,#drawer .mc-form{overflow:hidden;max-height:1000px;opacity:1;visibility:visible;transition:max-height .55s cubic-bezier(.2,.8,.2,1),opacity .35s ease,margin .3s ease,visibility 0s}
#drawer .st-body.hidden{display:block!important;max-height:0;opacity:0;margin-top:0!important;margin-bottom:0!important;padding-top:0!important;padding-bottom:0!important;visibility:hidden;pointer-events:none;transition:max-height .4s cubic-bezier(.4,0,.2,1),opacity .25s ease,visibility 0s .4s}
#drawer .mc-form.hidden{display:flex!important;max-height:0;opacity:0;margin-top:0!important;margin-bottom:0!important;padding-top:0!important;padding-bottom:0!important;visibility:hidden;pointer-events:none;transition:max-height .4s cubic-bezier(.4,0,.2,1),opacity .25s ease,visibility 0s .4s}
#drawer .st-body:not(.hidden)>*,#drawer .mc-form:not(.hidden)>*{animation:drDrop .5s cubic-bezier(.2,.9,.3,1.1) both}
#drawer .st-body:not(.hidden)>*:nth-child(1),#drawer .mc-form:not(.hidden)>*:nth-child(1){animation-delay:.04s}
#drawer .st-body:not(.hidden)>*:nth-child(2),#drawer .mc-form:not(.hidden)>*:nth-child(2){animation-delay:.1s}
#drawer .st-body:not(.hidden)>*:nth-child(3),#drawer .mc-form:not(.hidden)>*:nth-child(3){animation-delay:.16s}
#drawer .st-body:not(.hidden)>*:nth-child(4),#drawer .mc-form:not(.hidden)>*:nth-child(4){animation-delay:.22s}
#drawer .st-body:not(.hidden)>*:nth-child(5),#drawer .mc-form:not(.hidden)>*:nth-child(5){animation-delay:.28s}
#drawer .st-body:not(.hidden)>*:nth-child(n+6),#drawer .mc-form:not(.hidden)>*:nth-child(n+6){animation-delay:.34s}
@keyframes drDrop{0%{opacity:0;transform:translateY(-14px)}100%{opacity:1;transform:none}}
#drawer .mc-toggle .mc-arrow{transition:transform .35s cubic-bezier(.2,.8,.2,1)}
@media (prefers-reduced-motion:reduce){#drawer .st-body,#drawer .mc-form,#drawer .st-body>*,#drawer .mc-form>*{transition:none!important;animation:none!important}}

/* bell always on the right edge, any language/direction */
html .bell-btn{left:auto !important;right:12px !important}
html .bell-panel{left:auto !important;right:8px !important}
button,input,select,textarea{font-family:inherit}
