:root {
  --bg: #f4efe6;
  --ink: #1c2422;
  --muted: #5c6b66;
  --card: #fffcf7;
  --line: #e4d9c8;
  --teal: #1f6f64;
  --teal-dark: #154f48;
  --sand: #d4a24c;
  --danger: #b42318;
  --ok: #1b7a4a;
  --warn: #b45309;
  --shadow: 0 10px 30px rgba(28, 36, 34, 0.08);
  --radius: 18px;
  --nav: #14332f;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Source Sans 3", "Tajawal", system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #e7d7b0 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
}
a { color: var(--teal-dark); }
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}
.sidebar { display: none !important; }
.brand {
  font-weight: 700;
  letter-spacing: .02em;
  font-size: 1.15rem;
  margin-bottom: 12px;
}
.brand span { color: var(--sand); }
.nav a {
  display: block;
  color: #e8efe9;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: .95rem;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.1); }
.nav .sec { color: #9bb8b2; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; margin: 14px 8px 6px; }
.user-chip { margin-top: auto; font-size: .85rem; color: #c9d9d5; }
.main { flex: 1; padding: 12px 14px 96px; width: 100%; max-width: 100%; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
h1 { font-size: 1.45rem; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { padding: 14px; border-radius: 14px; background: #f7f1e6; }
.stat b { display: block; font-size: 1.4rem; }
.btn, button.btn, input[type=submit].btn {
  appearance: none;
  border: 0;
  background: var(--teal);
  color: white;
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-size: 1rem;
}
.btn:hover { background: var(--teal-dark); }
.btn.secondary { background: #ece4d4; color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn.sand { background: var(--sand); color: #1c2422; }
.btn.big { width: 100%; padding: 18px; font-size: 1.15rem; border-radius: 16px; }
label { display: block; font-size: .88rem; margin: 10px 0 4px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: white;
}
textarea { min-height: 80px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.b-ok { background: #d8f3e3; color: #166534; }
.b-bad { background: #fde2e0; color: #991b1b; }
.b-warn { background: #feecc7; color: #9a3412; }
.b-info { background: #e0eef2; color: #155e75; }
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; }
.flash.ok { background: #d8f3e3; }
.flash.err { background: #fde2e0; }
.flash.warn { background: #feecc7; }
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card { width: min(440px, 100%); }
.demo-box { background: #f7f1e6; border-radius: 12px; padding: 12px; font-size: .9rem; }
.lang-switch { display: flex; gap: 8px; }
.lang-switch a { color: inherit; }
.clock-video {
  width: 100%;
  height: min(42vh, 280px);
  background: #111;
  border-radius: 16px;
  object-fit: cover;
  transform: scaleX(-1);
}
.clock-hint { color: var(--muted); margin: 0 0 12px; font-size: .95rem; line-height: 1.4; }
.punch-btn {
  width: 100%;
  padding: 22px 16px;
  font-size: 1.35rem;
  border-radius: 18px;
  margin-top: 12px;
  min-height: 64px;
}
.clock-status { min-height: 1.4em; font-weight: 600; }
.top-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--nav);
  color: #f4efe6;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
}
.top-strip .brand { margin: 0; font-size: 1rem; }
.top-strip-meta { font-size: .8rem; text-align: end; }
.top-strip a { color: #e8efe9; }
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0f2421;
  padding: 8px 4px calc(10px + env(safe-area-inset-bottom));
  z-index: 30;
}
.bottom-nav:has(a:nth-child(5)) { grid-template-columns: repeat(5, 1fr); }
.bottom-nav a {
  color: #c5d5d1;
  text-decoration: none;
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  padding: 6px 2px;
  line-height: 1.2;
}
.bottom-nav a .ico { display: block; font-size: 1.15rem; margin-bottom: 2px; }
.bottom-nav a.active, .bottom-nav a.clock-tab.active { color: #f3d089; }
.bottom-nav a.clock-tab { color: #fff; }
.more-list { display: flex; flex-direction: column; gap: 8px; }
.more-link, .req-card {
  display: block;
  padding: 16px;
  background: #f7f1e6;
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
}
.request-grid { display: grid; gap: 10px; }
.add-home { margin-top: 16px; font-size: .85rem; }
.map { height: 280px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.selfie { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.checkboxes { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.checkboxes label { display: flex; gap: 6px; align-items: center; margin: 0; color: var(--ink); }
.checkboxes input { width: auto; }
.btn, button.btn { min-height: 48px; }
input, select, textarea { font-size: 16px; min-height: 46px; }

@media (min-width: 900px) {
  .app-shell { flex-direction: row; align-items: stretch; }
  .sidebar {
    display: flex !important;
    width: 250px;
    flex-shrink: 0;
    background: var(--nav);
    color: #f4efe6;
    padding: 22px 16px;
    flex-direction: column;
    gap: 8px;
  }
  .top-strip, .bottom-nav { display: none !important; }
  .main { padding: 22px; max-width: 1180px; padding-bottom: 22px; }
}
