* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f2f5f8;
  --card: #ffffff;
  --primary: #1a3a5c;
  --accent: #0e7c5b;
  --danger: #b3372f;
  --text: #1c2733;
  --muted: #6b7a8a;
  --border: #dde5ec;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Tahoma, "Noto Kufi Arabic", sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh;
}
#app { max-width: 720px; margin: 0 auto; padding-bottom: 90px; }

/* top bar */
.topbar {
  background: var(--primary); color: #fff;
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 19px; flex: 1; }
.topbar .back {
  background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 0 4px;
}
.sync-state { font-size: 12px; opacity: .85; }

/* search + filter */
.toolbar { padding: 12px 16px 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 160px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 16px; font-family: inherit; background: #fff;
}
.chip {
  border: 1px solid var(--border); background: #fff; border-radius: 20px;
  padding: 8px 14px; font-size: 14px; cursor: pointer; font-family: inherit; color: var(--muted);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* cards + lists */
.list { padding: 10px 16px; display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; cursor: pointer;
}
.card:active { background: #f6f9fb; }
.card h3 { font-size: 17px; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 13px; line-height: 1.7; }
.badge {
  display: inline-block; background: #fdf1e7; color: #a05a12; border-radius: 8px;
  font-size: 12px; padding: 2px 8px; margin-top: 6px;
}
.badge.late { background: #fbe9e7; color: var(--danger); }
.badge.done { background: #e6f4ef; color: var(--accent); }

/* section titles */
.section { padding: 18px 16px 6px; display: flex; align-items: center; }
.section h2 { font-size: 16px; flex: 1; color: var(--primary); }
.add-mini {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 6px 12px; font-size: 14px; cursor: pointer; font-family: inherit;
}

/* engineer rows */
.person { display: flex; align-items: center; gap: 10px; }
.person .info { flex: 1; }
.person .info b { display: block; font-size: 15px; }
.person .info span { color: var(--muted); font-size: 13px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  text-decoration: none;
}
.icon-btn.call { background: #e7f0fa; }
.icon-btn.wa { background: #e6f4ef; }

/* fab */
.fab {
  position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; border: none; border-radius: 30px;
  padding: 14px 28px; font-size: 17px; font-weight: bold; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); font-family: inherit; z-index: 20;
}

/* bottom nav */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff;
  border-top: 1px solid var(--border); display: flex; z-index: 15;
}
.bottomnav a {
  flex: 1; text-align: center; padding: 10px 0 12px; color: var(--muted);
  text-decoration: none; font-size: 13px;
}
.bottomnav a.on { color: var(--primary); font-weight: bold; }
.bottomnav a .ico { display: block; font-size: 20px; margin-bottom: 2px; }

/* forms */
.form { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.form label { font-size: 14px; color: var(--muted); margin-bottom: -8px; }
.form input, .form textarea, .form select {
  padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 16px; font-family: inherit; background: #fff; width: 100%;
}
.form textarea { min-height: 90px; resize: vertical; }
.btn {
  background: var(--primary); color: #fff; border: none; border-radius: 10px;
  padding: 13px; font-size: 16px; font-weight: bold; cursor: pointer; font-family: inherit;
}
.btn.ghost { background: #fff; color: var(--danger); border: 1px solid var(--danger); }

/* empty + login */
.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 15px; line-height: 2; }
.login {
  max-width: 340px; margin: 18vh auto 0; background: #fff; border-radius: 14px;
  padding: 26px 22px; border: 1px solid var(--border); text-align: center;
}
.login h1 { color: var(--primary); font-size: 20px; margin-bottom: 18px; }
.login input {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 16px; margin-bottom: 12px; font-family: inherit;
}
.login .err { color: var(--danger); font-size: 13px; margin-top: 10px; }
.offline-note {
  background: #fdf1e7; color: #a05a12; text-align: center; font-size: 13px; padding: 6px;
}
