:root {
  --ink: #3e3023;
  --muted: #817160;
  --teal: #9a744e;
  --teal-dark: #785837;
  --teal-soft: #f2e8dc;
  --aqua: #c4a47d;
  --bg: #f7f3ed;
  --surface: #fffdf9;
  --line: #e8ded1;
  --sidebar: #e9dccb;
  --sidebar-soft: #dac4a8;
  --green: #198a61;
  --green-soft: #e8f5ee;
  --amber: #bd7b19;
  --amber-soft: #fff4df;
  --red: #c35353;
  --red-soft: #fff0ef;
  --blue: #4376ac;
  --blue-soft: #edf4fb;
  --shadow: 0 8px 24px rgba(19, 48, 49, .045);
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 0 0 auto; width: 254px; display: flex; flex-direction: column; padding: 24px 16px 16px; color: #403123; background: var(--sidebar); border-left: 1px solid #ddcbb4; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 25px; border-bottom: 1px solid rgba(94,67,39,.14); }
.brand > div:last-of-type { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.brand small { margin-top: 5px; color: #765738; font-size: 8px; font-weight: 700; letter-spacing: 1.5px; direction: ltr; text-align: right; }
.brand-mark { width: 37px; height: 37px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 7px; border: 1px solid rgba(123,91,57,.28); border-radius: 11px; background: linear-gradient(145deg,#c9aa83,#9d7952); }
.brand-mark span { width: 5px; border-radius: 6px 6px 2px 2px; background: #fff3df; }
.brand-mark span:nth-child(1) { height: 11px; opacity: .75; }
.brand-mark span:nth-child(2) { height: 19px; }
.brand-mark span:nth-child(3) { height: 14px; opacity: .85; }
.brand-mark.company-mark { position: relative; display: block; flex: 0 0 auto; width: 56px; height: 55px; padding: 0; overflow: hidden; border: 1px solid #e6d6bc; border-radius: 9px; direction: ltr; background: #fff; }
.brand-mark.company-mark img { position: absolute; top: 0; left: 0; display: block; width: auto; height: 55px; max-width: none; }
.workspace-label { padding: 25px 11px 10px; color: #856f58; font-size: 11px; font-weight: 600; }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 11px; border: 0; border-radius: 9px; color: #66513a; text-align: right; background: transparent; font-size: 13px; font-weight: 500; transition: .18s ease; }
.nav-item:hover { color: #3e3023; background: rgba(255,255,255,.52); }
.nav-item.active { color: #3e3023; background: #d9c3a6; box-shadow: inset -3px 0 #9a744e; }
.nav-icon { width: 22px; color: #8a6e4d; text-align: center; font-size: 19px; line-height: 1; }
.nav-item.active .nav-icon { color: #6f4f2f; }
.nav-count { margin-right: auto; min-width: 22px; padding: 1px 5px; border-radius: 20px; color: #6e4e30; background: rgba(154,116,78,.16); text-align: center; font-size: 10px; }
.sidebar-spacer { flex: 1; min-height: 25px; }
.site-guard { margin: 0 4px 18px; padding: 14px 13px 12px; border: 1px solid rgba(123,91,57,.19); border-radius: 11px; background: linear-gradient(145deg,#f1e7d9,#e5d2bb); }
.guard-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.guard-pin { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #775633; background: rgba(154,116,78,.15); font-size: 18px; }
.guard-dot, .online-dot, .today-dot { width: 7px; height: 7px; border-radius: 50%; background: #50cf9f; box-shadow: 0 0 0 3px rgba(80,207,159,.12); }
.site-guard strong { display: block; font-size: 12px; }
.site-guard p { margin: 6px 0 11px; color: #76634e; font-size: 10px; line-height: 1.75; }
.text-button { padding: 0; border: 0; color: #755536; background: none; font-size: 10px; }
.text-button span { display: inline-block; margin-right: 5px; }
.settings-link { margin-top: 2px; }
.sidebar-foot { display: flex; align-items: center; gap: 9px; padding: 15px 8px 0; border-top: 1px solid rgba(94,67,39,.14); color: #7d6a55; font-size: 10px; }
.sidebar-foot .online-dot { width: 6px; height: 6px; }
.main-area { min-height: 100vh; margin-right: 254px; display: flex; flex-direction: column; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 34px; border-bottom: 1px solid #e8eeec; background: rgba(255,255,255,.88); }
.topbar-start, .topbar-end { display: flex; align-items: center; gap: 17px; }
.crumb { display: flex; align-items: center; gap: 10px; color: #9aa7a8; font-size: 11px; }
.crumb b { color: #c3cecc; font-weight: 400; }
.crumb strong { color: #4a3828; font-size: 12px; font-weight: 600; }
.today-chip { display: flex; align-items: center; gap: 8px; color: #66797b; font-size: 11px; }
.today-dot { background: #19a078; box-shadow: 0 0 0 3px #e5f5ef; }
.role-switch { display: flex; align-items: center; gap: 6px; padding: 5px 8px 5px 5px; border: 1px solid var(--line); border-radius: 8px; color: #829091; font-size: 10px; }
.role-switch select { border: 0; outline: none; color: var(--teal-dark); background: transparent; font-weight: 600; font-size: 11px; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #e2d1bb; border-radius: 50%; color: #795a39; background: #f2e7d9; font-size: 12px; font-weight: 700; }
.account-label { color: #607678; font-size: 10px; font-weight: 600; }
.logout-button { color: #667a7c; font-size: 15px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: #637678; background: #fff; font-size: 16px; }
.menu-button, .sidebar-close, .mobile-scrim { display: none; }
.page-content { width: 100%; max-width: 1450px; margin: 0 auto; padding: 28px 34px 34px; flex: 1; }
.app-footer { display: flex; justify-content: space-between; gap: 14px; padding: 14px 34px; border-top: 1px solid #e7eeec; color: #9aa7a8; background: #fafcfb; font-size: 9px; }
.app-footer span:first-child { direction: ltr; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 21px; }
.page-heading h1 { margin: 0; color: #493727; font-size: 22px; line-height: 1.35; font-weight: 700; letter-spacing: -.5px; }
.page-heading p { margin: 6px 0 0; color: #819092; font-size: 11px; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.btn { min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border: 1px solid transparent; border-radius: 8px; font-size: 11px; font-weight: 600; white-space: nowrap; transition: .16s ease; }
.btn-primary { color: #fff; background: var(--teal); box-shadow: 0 5px 12px rgba(8,126,117,.14); }
.btn-primary:hover { background: var(--teal-dark); transform: translateY(-1px); }
.btn-secondary { border-color: #e2d5c4; color: #66513b; background: #fffdf9; }
.btn-secondary:hover { border-color: #c7aa85; color: var(--teal-dark); }
.btn-danger { border-color: #f2d4d1; color: var(--red); background: #fff; }
.btn-small { min-height: 30px; padding: 0 9px; font-size: 10px; }
.btn-icon { font-size: 16px; font-weight: 400; }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 18px; padding: 10px 13px; border: 1px solid #f4e2bc; border-radius: 9px; color: #91601a; background: #fff9eb; font-size: 10px; }
.demo-banner > span { display: flex; align-items: center; gap: 8px; }
.demo-banner strong { color: #805211; }
.demo-banner button { border: 0; color: #926217; background: transparent; text-decoration: underline; font-size: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 17px; }
.stat-card { position: relative; min-height: 112px; overflow: hidden; padding: 15px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
.stat-card::after { content: ''; position: absolute; inset: auto auto -24px -13px; width: 83px; height: 83px; border-radius: 50%; background: var(--icon-soft,#edf7f4); opacity: .8; }
.stat-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; color: #76878a; font-size: 10px; }
.stat-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--icon-color,var(--teal)); background: var(--icon-soft,var(--teal-soft)); font-size: 15px; }
.stat-value { position: relative; z-index: 1; margin-top: 9px; color: #20383c; font-size: 25px; font-weight: 700; line-height: 1; letter-spacing: -.5px; }
.stat-foot { position: relative; z-index: 1; margin-top: 8px; color: #9aa7a8; font-size: 9px; }
.stat-teal { --icon-color:#087e75; --icon-soft:#e9f5f2; }
.stat-green { --icon-color:#168459; --icon-soft:#e9f5ed; }
.stat-amber { --icon-color:#b17618; --icon-soft:#fff4e0; }
.stat-red { --icon-color:#bc5c55; --icon-soft:#fff0ef; }
.content-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(260px,.9fr); gap: 15px; margin-bottom: 16px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow); }
.panel-head { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid #edf1ef; }
.panel-title { display: flex; align-items: center; gap: 8px; color: #49392a; font-size: 12px; font-weight: 700; }
.panel-title small { color: #98a6a7; font-size: 9px; font-weight: 400; }
.panel-link { border: 0; color: var(--teal); background: transparent; font-size: 10px; font-weight: 600; }
.panel-body { padding: 14px 16px 16px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: right; white-space: nowrap; }
th { padding: 10px 9px; color: #91a0a1; background: #fafcfb; font-size: 9px; font-weight: 500; }
td { padding: 10px 9px; border-bottom: 1px solid #f0f3f2; color: #42585a; font-size: 10px; }
tbody tr:last-child td { border-bottom: 0; }
.person-cell { display: flex; align-items: center; gap: 8px; }
.person-avatar { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: #775638; background: #f1e6d8; font-size: 10px; font-weight: 700; }
.person-meta { display: flex; flex-direction: column; gap: 2px; }
.person-meta strong { color: #32494c; font-size: 10px; font-weight: 600; }
.person-meta small { color: #9aa6a7; font-size: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 20px; font-size: 9px; font-weight: 600; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-present, .badge-active { color: #19845c; background: #eaf6ef; }
.badge-late { color: #a76e13; background: #fff4e0; }
.badge-checked { color: #4b76a6; background: #edf4fb; }
.badge-absent { color: #b94f4d; background: #fff0ef; }
.badge-pending { color: #6c7880; background: #f0f3f4; }
.empty-row { padding: 30px 12px; color: #9aa7a8; text-align: center; font-size: 11px; }
.site-list { display: grid; gap: 10px; }
.site-row { display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid #eef2f0; border-radius: 9px; }
.site-symbol { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #795b3b; background: #f2e8dc; font-size: 19px; }
.site-info { min-width: 0; flex: 1; }
.site-info strong { display: block; color: #344b4e; font-size: 10px; }
.site-info small { display: block; margin-top: 3px; color: #96a3a4; font-size: 9px; }
.site-presence { color: #438273; font-size: 9px; font-weight: 600; }
.site-presence strong { color: #14775f; font-size: 13px; }
.quick-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 11px; }
.quick-action { display: flex; align-items: center; gap: 10px; min-height: 65px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: #32494c; background: #fff; text-align: right; box-shadow: var(--shadow); transition: .16s; }
.quick-action:hover { border-color: #b4d8cd; transform: translateY(-1px); }
.quick-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: #795b3b; background: #f2e8dc; font-size: 16px; }
.quick-action span:last-child { display: flex; flex-direction: column; gap: 3px; }
.quick-action strong { font-size: 10px; }
.quick-action small { color: #93a1a2; font-size: 8px; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.search-box { min-width: 190px; max-width: 285px; flex: 1; position: relative; }
.search-box input { width: 100%; height: 36px; padding: 0 34px 0 10px; border: 1px solid #e3eae8; border-radius: 8px; outline: none; color: #3b5154; background: #fff; font-size: 10px; }
.search-box::before { content: '⌕'; position: absolute; top: 4px; right: 11px; color: #9ba8a8; font-size: 19px; }
.filter-select, .date-input { height: 36px; padding: 0 10px; border: 1px solid #e3eae8; border-radius: 8px; outline: none; color: #617477; background: #fff; font-size: 10px; }
.table-panel .panel-body { padding: 0; }
.table-panel th:first-child, .table-panel td:first-child { padding-right: 17px; }
.table-panel th:last-child, .table-panel td:last-child { padding-left: 17px; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.icon-action { width: 28px; height: 27px; display: grid; place-items: center; border: 1px solid #e6edeb; border-radius: 7px; color: #708385; background: #fff; font-size: 12px; }
.icon-action:hover { color: var(--teal); border-color: #a9d5c8; }
.empty-state { padding: 40px 20px; text-align: center; color: #91a0a1; }
.empty-state-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 11px; border-radius: 14px; color: #795b3b; background: #f2e8dc; font-size: 19px; }
.empty-state strong { display: block; color: #496063; font-size: 12px; }
.empty-state p { margin: 5px 0 13px; font-size: 10px; }
.site-cards, .driver-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.site-card, .driver-card { padding: 15px; }
.site-card-top, .driver-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.site-card .site-symbol { width: 40px; height: 40px; }
.site-card h3, .driver-card h3 { margin: 11px 0 4px; color: #2b4447; font-size: 13px; }
.site-card p, .driver-card p { margin: 0; color: #91a0a1; font-size: 9px; }
.site-metrics { display: flex; gap: 18px; margin: 14px 0; padding: 10px 0; border-top: 1px solid #eff3f1; border-bottom: 1px solid #eff3f1; }
.site-metrics div { display: flex; flex-direction: column; gap: 3px; }
.site-metrics strong { color: #624c35; font-size: 12px; }
.site-metrics small { color: #95a2a2; font-size: 8px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #8d9b9c; font-size: 9px; }
.card-footer .row-actions { margin-right: auto; }
.site-coords { direction: ltr; color: #718385; font-size: 9px; }
.site-coordinate-range { margin-top: 5px; color: var(--muted); font-size: 8px; direction: ltr; text-align: right; }
.coordinate-summary { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--teal-soft); font-size: 9px; line-height: 1.8; }
.coordinate-summary strong { color: var(--ink); }
.map-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; color: var(--teal-dark); font-size: 9px; font-weight: 600; text-decoration: none; }
.map-link:hover { text-decoration: underline; }
.map-pin { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--teal); font-size: 14px; }
.employee-count { display: flex; align-items: center; gap: 6px; color: #687e80; font-size: 9px; }
.driver-card { position: relative; }
.driver-head { display: flex; align-items: center; gap: 10px; }
.driver-avatar { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; color: #3d73a0; background: #edf4fb; font-size: 16px; }
.vehicle-box { margin-top: 14px; padding: 10px; border-radius: 8px; background: #f6f9f8; }
.vehicle-box strong { display: block; color: #3b5255; font-size: 10px; }
.vehicle-box small { display: block; margin-top: 4px; color: #8fa0a1; font-size: 9px; }
.mileage-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 15px; }
.mileage-card { padding: 13px; }
.mileage-card small { color: #91a0a1; font-size: 9px; }
.mileage-card strong { display: block; margin-top: 7px; color: #344e51; font-size: 18px; }
.mileage-card p { margin: 4px 0 0; color: #a1adad; font-size: 8px; }
.report-chart { display: grid; gap: 12px; padding: 8px 0; }
.chart-row { display: grid; grid-template-columns: 65px 1fr 42px; align-items: center; gap: 10px; color: #718385; font-size: 9px; }
.chart-track { height: 8px; overflow: hidden; border-radius: 8px; background: #eef3f1; }
.chart-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg,#45bca5,#087e75); }
.chart-number { color: #52696b; text-align: left; font-size: 9px; font-weight: 600; }
.report-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 15px 0; }
.summary-box { padding: 12px 14px; border: 1px solid #edf1ef; border-radius: 9px; background: #fbfcfc; }
.summary-box span { display: block; color: #91a0a1; font-size: 9px; }
.summary-box strong { display: block; margin-top: 6px; color: #31494c; font-size: 18px; }
.settings-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(260px,.8fr); gap: 14px; }
.settings-section { padding: 17px; }
.settings-section h2 { margin: 0 0 5px; color: #2d4548; font-size: 13px; }
.settings-section > p { margin: 0 0 15px; color: #91a0a1; font-size: 9px; line-height: 1.8; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #eef2f0; }
.setting-row strong { display: block; color: #41585a; font-size: 10px; }
.setting-row small { display: block; margin-top: 4px; color: #94a1a2; font-size: 8px; }
.setting-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notice-card { padding: 13px; border: 1px solid #e8f0ed; border-radius: 9px; color: #6a8180; background: #f7fbf9; font-size: 9px; line-height: 1.8; }
.notice-card strong { display: block; margin-bottom: 4px; color: #28786a; font-size: 10px; }
.status-line { display: flex; align-items: center; gap: 7px; color: #788b8d; font-size: 9px; }
.status-line .status-bullet { width: 7px; height: 7px; border-radius: 50%; background: #dfa940; }
.modal-backdrop { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(12,29,32,.46); backdrop-filter: blur(3px); animation: fade-in .16s ease; }
.modal { width: min(100%, 510px); max-height: min(90vh, 780px); overflow: auto; border: 1px solid rgba(255,255,255,.75); border-radius: 14px; background: #fff; box-shadow: 0 24px 70px rgba(8,29,32,.23); animation: rise-in .2s ease; }
.modal.wide { width: min(100%, 670px); }
.modal-head { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 19px 14px; border-bottom: 1px solid #edf1ef; background: rgba(255,255,255,.97); }
.modal-head h2 { margin: 0; color: #233c40; font-size: 15px; }
.modal-head p { margin: 4px 0 0; color: #95a2a3; font-size: 9px; }
.modal-close { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #ebefed; border-radius: 8px; color: #76898a; background: #fff; font-size: 17px; }
.modal-body { padding: 17px 19px 19px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1/-1; }
.field label { color: #627779; font-size: 9px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 37px; padding: 8px 10px; border: 1px solid #e3eae8; border-radius: 8px; outline: none; color: #3e5557; background: #fff; font-size: 10px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #83c4b3; box-shadow: 0 0 0 3px #eaf6f2; }
.field input[dir="ltr"] { text-align: left; }
.field textarea { min-height: 62px; resize: vertical; }
.field-hint { color: #9aa7a8; font-size: 8px; line-height: 1.6; }
.check-row { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid #e7efeb; border-radius: 8px; color: #68807f; background: #f7fbf9; font-size: 9px; line-height: 1.65; }
.check-row input { margin: 1px 0 0; accent-color: var(--teal); }
.geo-result { min-height: 37px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e8eeec; border-radius: 8px; color: #829293; background: #fafcfb; font-size: 9px; }
.geo-result.ok { border-color: #cce8dc; color: #168159; background: #eff8f3; }
.geo-result.outside { border-color: #f2d9d5; color: #b55650; background: #fff5f3; }
.camera-box { overflow: hidden; border: 1px solid #e7eeeb; border-radius: 9px; background: #f8fbfa; }
.camera-box video, .camera-box > img { width: 100%; max-height: 260px; display: block; object-fit: cover; background: #172c31; }
.camera-box [hidden] { display: none; }
.camera-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px; }
.camera-controls span { color: #8b9a9b; font-size: 8px; }
.camera-controls #camera-status { flex-basis: 100%; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.camera-controls #camera-status.camera-error { color: #a23f35; }
.camera-controls .btn { min-height: 38px; font-size: 11px; white-space: normal; text-align: center; }
.camera-settings-link { text-decoration: none; }
.connection-sync-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 14px 28px 0; padding: 10px 13px; border: 1px solid #e5d7c6; border-radius: 10px; background: #fbf7f1; }
.connection-sync-bar[hidden] { display: none; }
.connection-sync-details { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 15px; min-width: 0; color: #725940; font-size: 11px; line-height: 1.8; }
.connection-sync-details strong { color: #537448; font-size: 12px; }
.connection-sync-details strong.sync-warning { color: #9a6030; }
.connection-sync-details b { display: inline-block; font-size: 11px; font-weight: 500; overflow-wrap: anywhere; }
.connection-sync-details small { font-size: 10px; }
.employee-site-selection-warning { margin-top: 8px; padding: 10px 12px; border: 1px solid #e7c99d; border-radius: 8px; background: #fff7e9; color: #8a5d24; font-size: 11px; line-height: 1.8; }
.employee-site-selection-warning[hidden] { display: none; }
.employee-site-selection-warning p { margin: 0 0 8px; }
.camera-permission-note { padding: 10px 12px; border-top: 1px solid #e7dacb; color: #725940; background: #fbf7f1; font-size: 11px; line-height: 1.9; }
.camera-help-link { padding: 2px 4px; border: 0; color: #78522e; background: transparent; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.camera-help-link:focus-visible { outline: 2px solid #9a744e; outline-offset: 2px; }
.camera-permission-backdrop { z-index: 110; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.camera-permission-dialog { max-height: 90vh; max-height: 90dvh; }
.camera-permission-dialog .modal-head h2 { font-size: 17px; }
.camera-permission-dialog .modal-head p { font-size: 12px; line-height: 1.8; }
.camera-permission-steps { margin: 0; padding-inline-start: 23px; color: #594735; font-size: 13px; line-height: 1.9; }
.camera-permission-steps li + li { margin-top: 12px; }
.camera-permission-browser-note { margin: 16px 0 0; padding: 10px 12px; border-radius: 8px; color: #725940; background: #f7f0e6; font-size: 11px; line-height: 1.9; }
.camera-permission-dialog .modal-actions { flex-wrap: wrap; }
@media (max-width: 480px) {
  .connection-sync-bar { margin: 10px 12px 0; }
  .connection-sync-details { flex-basis: 100%; gap: 3px 12px; }
  .connection-sync-details > span { flex-basis: 100%; }
  .connection-sync-bar > .btn { width: 100%; min-height: 40px; }
  .camera-controls > .btn { flex: 1 1 140px; min-height: 42px; }
  .camera-permission-dialog .modal-body { padding: 16px; }
  .camera-permission-dialog .modal-actions > .btn { flex: 1 1 130px; min-height: 42px; }
}
@media print { #camera-permission-help-root, .connection-sync-bar { display: none !important; } }
.attendance-photo { display: block; max-width: 100%; max-height: 330px; margin: 13px auto 0; border: 1px solid #e8eeec; border-radius: 9px; object-fit: contain; }
.modal-actions { display: flex; justify-content: flex-start; gap: 8px; margin-top: 16px; padding-top: 13px; border-top: 1px solid #edf1ef; }
.modal-note { margin-top: 11px; padding: 9px 10px; border-right: 3px solid #e6bd68; border-radius: 5px; color: #896a2d; background: #fff9ec; font-size: 8px; line-height: 1.75; }
.toast-root { position: fixed; z-index: 90; bottom: 22px; left: 22px; display: grid; gap: 8px; }
.toast { max-width: min(360px,calc(100vw - 32px)); display: flex; align-items: center; gap: 9px; padding: 11px 14px; border: 1px solid #dceae4; border-radius: 9px; color: #355557; background: #fff; box-shadow: 0 12px 30px rgba(17,48,48,.14); font-size: 10px; animation: rise-in .2s ease; }
.toast::before { content: '✓'; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #19845c; background: #e7f5ed; font-size: 11px; font-weight: 700; }
.toast.error { border-color: #f1d8d4; }
.toast.error::before { content: '!'; color: #b94f4d; background: #fff0ef; }
.auth-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(10,27,30,.68); backdrop-filter: blur(6px); }
.auth-card { width: min(100%,430px); padding: 25px; border: 1px solid rgba(255,255,255,.8); border-radius: 16px; background: #fff; box-shadow: 0 28px 90px rgba(7,25,27,.28); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-brand .brand-mark { flex: 0 0 auto; }
.auth-brand strong { display: block; color: #493727; font-size: 14px; }
.auth-brand small { display: block; margin-top: 3px; color: #85745f; font-size: 9px; }
.auth-brand .brand-byline { color: #765738; font-size: 8px; font-weight: 700; letter-spacing: 1.4px; direction: ltr; text-align: right; }
.auth-card h2 { margin: 0; color: #1e383c; font-size: 18px; }
.auth-card > p { margin: 7px 0 17px; color: #859496; font-size: 10px; line-height: 1.8; }
.auth-tabs { display: flex; gap: 5px; margin-bottom: 15px; padding: 4px; border-radius: 9px; background: #f1f5f3; }
.auth-tab { flex: 1; min-height: 33px; border: 0; border-radius: 7px; color: #7d8b8d; background: transparent; font-size: 10px; }
.auth-tab.active { color: #11776d; background: #fff; box-shadow: 0 1px 5px rgba(20,52,51,.1); font-weight: 700; }
.auth-error { min-height: 0; margin: 0 0 9px; color: #b94f4d; font-size: 9px; }
.auth-actions { display: grid; gap: 8px; margin-top: 14px; }
.auth-footnote { margin-top: 15px; padding: 10px; border-radius: 8px; color: #738688; background: #f6f9f8; font-size: 8px; line-height: 1.8; }
.employee-home { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(250px,.8fr); gap: 15px; }
.employee-welcome { padding: 20px; }
.employee-welcome h2 { margin: 0; color: #203a3e; font-size: 18px; }
.employee-welcome p { margin: 6px 0 16px; color: #8b999a; font-size: 10px; }
.employee-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 16px; padding: 13px; border: 1px solid #eaf0ee; border-radius: 9px; background: #fbfcfc; }
.employee-status small { display: block; color: #96a4a5; font-size: 9px; }
.employee-status strong { display: block; margin-top: 4px; color: #334d50; font-size: 13px; }
.employee-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.biometric-prompt { margin-bottom: 15px; padding: 13px; border: 1px solid #f0dfbb; border-radius: 9px; color: #87601c; background: #fff9ec; font-size: 9px; line-height: 1.8; }
.biometric-prompt strong { display: block; margin-bottom: 4px; }
.print-only { display: none; }
.mobile-scrim.show { display: block; position: fixed; z-index: 25; inset: 0; background: rgba(9,25,28,.42); }
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise-in { from { opacity: 0; transform: translateY(7px) } to { opacity: 1; transform: translateY(0) } }

@media (max-width: 1100px) {
  .sidebar { width: 225px; }
  .main-area { margin-right: 225px; }
  .topbar, .page-content { padding-right: 24px; padding-left: 24px; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 13px; }
  .quick-grid { grid-template-columns: repeat(2,1fr); }
  .site-cards, .driver-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .sidebar { width: 254px; transform: translateX(105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: grid; margin-right: auto; border-color: rgba(255,255,255,.13); color: #c0d0d1; background: transparent; }
  .main-area { margin-right: 0; }
  .menu-button { display: grid; }
  .topbar { min-height: 62px; padding: 0 17px; }
  .page-content { padding: 22px 17px 26px; }
  .app-footer { padding: 12px 17px; }
  .content-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; }
  .topbar-start, .topbar-end { gap: 8px; }
  .crumb span, .crumb b { display: none; }
  .crumb { font-size: 10px; }
  .today-chip { display: none; }
  .role-switch { padding: 4px; }
  .role-switch > span { display: none; }
  .account-label { display:none; }
  .avatar { width: 29px; height: 29px; }
  .page-content { padding: 18px 12px 22px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .page-heading h1 { font-size: 19px; }
  .heading-actions { width: 100%; min-width: 0; flex-wrap: wrap; }
  .heading-actions .btn { flex: 1 1 auto; min-width: 0; }
  .demo-banner { align-items: flex-start; flex-direction: column; gap: 7px; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 100px; padding: 11px; }
  .stat-value { font-size: 23px; }
  .content-grid { gap: 11px; }
  .panel-head { padding: 0 12px; }
  .panel-body { padding: 12px; }
  .table-panel .panel-body { padding: 0; }
  .quick-grid { gap: 7px; }
  .quick-action { min-height: 61px; gap: 7px; padding: 8px; }
  .quick-action small { display: none; }
  .quick-icon { width: 28px; height: 28px; }
  .toolbar { flex-wrap: wrap; }
  .search-box { min-width: 100%; max-width: none; }
  .filter-select, .date-input { flex: 1; min-width: 0; }
  .site-cards, .driver-cards { grid-template-columns: 1fr; }
  .mileage-summary, .report-summary { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .app-footer { align-items: flex-start; flex-direction: column; gap: 4px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: 94vh; }
}

@media print {
  @page { size: landscape; margin: 12mm; }
  body { background: #fff !important; color: #111 !important; }
  .sidebar, .topbar, .app-footer, .heading-actions, .toolbar, .row-actions, .quick-grid, .demo-banner button, .panel-link, .btn, .icon-action, .sidebar-spacer, .toast-root, #modal-root { display: none !important; }
  .main-area { margin: 0 !important; }
  .page-content { max-width: none; padding: 0 !important; }
  .page-heading { margin-bottom: 14px; }
  .page-heading h1 { font-size: 20px; }
  .panel, .stat-card, .summary-box { box-shadow: none !important; break-inside: avoid; border-color: #cfd8d6 !important; }
  .table-wrap { overflow: visible !important; }
  table { white-space: normal !important; }
  th, td { color: #222 !important; font-size: 9pt !important; border-color: #d8dfdd !important; }
  .app-shell { min-height: 0; }
  .content-grid { grid-template-columns: 1.5fr 1fr; }
  .demo-banner { color: #555; background: #fff; }
  .print-only { display: block; }
}

/* Keep secondary surfaces within the same light-brown brand palette. */
.topbar, .app-footer, .panel-head, th, .search-box input, .filter-select, .date-input,
.field input, .field select, .field textarea, .icon-button, .icon-action,
.site-row, .vehicle-box, .summary-box, .employee-status, .camera-box, .modal-close,
.attendance-photo { border-color: var(--line); }
.topbar, .panel, .search-box input, .filter-select, .date-input, .field input,
.field select, .field textarea, .icon-button, .icon-action, .modal, .auth-card { background-color: var(--surface); }
.crumb, .today-chip, .account-label, .logout-button, .page-heading p, .panel-title small,
.person-meta small, .site-info small, .card-footer, .site-presence, .employee-count,
.vehicle-box small, .chart-row, .setting-row small, .settings-section > p,
.field label, .field-hint, .empty-row, .status-line, .modal-head p, .camera-controls span,
.employee-welcome p, .employee-status small { color: var(--muted); }
.page-heading h1, .panel-title, .stat-value, .person-meta strong, .site-info strong,
.site-card h3, .driver-card h3, .vehicle-box strong, .mileage-card strong,
.summary-box strong, .settings-section h2, .setting-row strong, .modal-head h2,
.auth-card h2, .employee-welcome h2, .employee-status strong { color: var(--ink); }
.quick-action, .site-presence strong, .chart-number, .employee-count { color: var(--teal-dark); }
.quick-action:hover, .icon-action:hover { border-color: var(--aqua); }
.search-box input:focus, .filter-select:focus, .date-input:focus,
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px var(--teal-soft);
}
.stat-teal { --icon-color: var(--teal-dark); --icon-soft: var(--teal-soft); }
.badge-checked { color: var(--teal-dark); background: var(--teal-soft); }
.driver-avatar { color: var(--teal-dark); background: var(--teal-soft); }
.vehicle-box, .summary-box, .employee-status { background: #fbf7f1; }
.chart-track { background: var(--line); }
.chart-fill { background: linear-gradient(90deg, var(--aqua), var(--teal-dark)); }
.notice-card { border-color: #e8ded1; color: #66513b; background: #f7f1e8; }
.notice-card strong { color: var(--teal-dark); }
.check-row { border-color: var(--line); color: #66513b; background: #fbf7f1; }
.geo-result { border-color: var(--line); color: var(--muted); background: #fbf7f1; }
.geo-result.ok { border-color: #d5e8dc; color: #24745b; background: #f0f7f1; }
.camera-box { background: #f7f3ed; }
.camera-box video, .camera-box > img { background: #544435; }
.toast { border-color: var(--line); color: var(--ink); box-shadow: 0 12px 30px rgba(73,55,39,.12); }
.auth-tabs, .auth-footnote { color: var(--muted); background: #f7f3ed; }
.auth-tab.active { color: var(--teal-dark); }

/* HR pages use the same BENYAH light brown surfaces and RTL spacing. */
.hr-module { color: var(--ink); }
.hr-module .page-heading p { line-height: 1.8; max-width: 650px; }
.hr-module .heading-actions, .hr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.hr-module .heading-actions { justify-content: flex-end; }
.hr-module .btn { text-decoration: none; }
.hr-module .panel { background: var(--surface); }
.hr-module .panel-head { min-height: 58px; background: #fcf8f2; }
.hr-module .panel-title { flex-wrap: wrap; }
.hr-module .panel-title small { margin-inline-start: 5px; }
.hr-panel { margin-top: 16px; overflow: hidden; }
.hr-module th { color: #836f57; background: #faf5ed; font-weight: 600; }
.hr-module td { color: #5b4835; border-color: #eee4d7; line-height: 1.65; vertical-align: middle; }
.hr-module td strong { font-weight: 650; color: #493727; }
.hr-module tbody tr:hover { background: #fcf8f2; }
.hr-module .hr-wrap-text { display: inline-block; min-width: 130px; max-width: 340px; white-space: normal; overflow-wrap: anywhere; }
.hr-cell-sub { display: block; color: var(--muted); margin-top: 3px; font-size: 9px; }
.hr-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.hr-summary-item { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(150deg,#fffdf9,#f8f0e5); }
.hr-summary-item > span { display: block; color: var(--muted); font-size: 10px; }
.hr-summary-item > strong { display: block; margin-top: 9px; color: var(--ink); font-size: 21px; line-height: 1.4; overflow-wrap: anywhere; }
.hr-summary-item > small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.hr-toolbar { align-items: center; flex-wrap: wrap; margin: 18px 0; }
.hr-filter-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.hr-module input[type="month"] { direction: ltr; min-width: 145px; }
.hr-notice { margin: 13px 0; padding: 12px 14px; border: 1px solid #e4d2b8; border-radius: 9px; color: #775a38; background: #f8f0e3; font-size: 10px; line-height: 1.9; }
.hr-empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.hr-empty > span { display: grid; width: 42px; height: 42px; margin: 0 auto 12px; place-items: center; border-radius: 12px; color: var(--teal); background: var(--teal-soft); font-size: 22px; }
.hr-empty > strong { font-size: 12px; font-weight: 500; }
.hr-connection { padding: 40px 22px; text-align: center; }
.hr-connection-icon { display: inline-grid; width: 55px; height: 55px; place-items: center; border-radius: 15px; color: var(--teal-dark); background: var(--teal-soft); font-size: 30px; }
.hr-connection h2 { margin: 18px 0 9px; font-size: 18px; }
.hr-connection p { margin: 0 0 20px; color: var(--muted); font-size: 11px; line-height: 1.9; }
.hr-file-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.hr-file-card { padding: 17px; min-width: 0; }
.hr-file-top, .hr-profile-heading { display: flex; gap: 12px; align-items: center; }
.hr-file-top > div, .hr-profile-heading > div { min-width: 0; flex: 1; }
.hr-person-icon { display: grid; flex: 0 0 auto; width: 43px; height: 43px; place-items: center; border: 1px solid #e8d7bf; border-radius: 13px; color: #795637; background: #f0e1cc; font-size: 20px; font-weight: 600; }
.hr-file-card h2 { margin: 0 0 5px; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.hr-file-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.8; }
.hr-file-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 13px 0; margin-top: 10px; color: var(--muted); font-size: 10px; }
.hr-file-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.hr-file-foot b { color: #a36d28; font-weight: 500; }
.hr-tag, .hr-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px; font-size: 9px; font-weight: 600; white-space: nowrap; }
.hr-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.hr-tag-neutral, .hr-status-draft, .hr-status-cancelled, .hr-status-withdrawn { color: #7b6b58; background: #eee8df; }
.hr-tag-warning, .hr-status-pending { color: #a26818; background: #fff1d5; }
.hr-tag-danger, .hr-status-rejected { color: #b84f46; background: #ffefeb; }
.hr-tag-success, .hr-status-approved, .hr-status-completed, .hr-status-paid { color: #257858; background: #eaf5ed; }
.hr-status-acknowledged { color: #7b5938; background: #f0e4d4; }
.hr-readonly { color: var(--muted); font-size: 9px; }
.modal.hr-detail-modal { width: min(100%, 1060px); }
.hr-detail h3 { margin: 24px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: #694d31; font-size: 13px; }
.hr-profile-heading { padding: 4px 0 15px; }
.hr-profile-heading .hr-person-icon { width: 56px; height: 56px; border-radius: 16px; font-size: 27px; }
.hr-profile-heading h2 { margin: 0 0 6px; font-size: 20px; }
.hr-profile-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.hr-profile-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.hr-profile-grid > div { padding: 12px 14px; border-bottom: 1px solid #eee4d7; background: #fcf8f2; }
.hr-profile-grid dt { color: var(--muted); font-size: 9px; }
.hr-profile-grid dd { margin: 5px 0 0; color: var(--ink); font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.hr-section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hr-detail .hr-section-heading h3 { margin: 0; padding: 0; border: 0; }
.hr-detail .hr-summary-item { padding: 12px; }
.hr-detail .hr-summary-item > strong { font-size: 19px; }
.hr-payroll-preview .hr-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
.hr-payroll-preview .hr-summary-item > strong { font-size: 17px; }
.hr-weekdays { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.hr-weekdays .check-row { margin: 0; padding: 8px; font-size: 9px; }
.hr-print-area { display: none; }
@media (max-width: 1050px) {
  .hr-file-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hr-module .page-heading { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .hr-file-grid { grid-template-columns: 1fr; }
  .hr-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .hr-summary-item { padding: 12px; }
  .hr-summary-item > strong { font-size: 18px; }
  .hr-profile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hr-module .heading-actions { justify-content: flex-start; }
  .hr-toolbar .search-box { max-width: none; min-width: 100%; }
  .hr-toolbar .hr-filter-label { flex-wrap: wrap; }
  .hr-weekdays { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hr-detail .hr-profile-grid > div { padding: 10px; }
  .hr-payroll-preview .hr-summary { grid-template-columns: 1fr; }
}
@media print {
  body.hr-printing .app-shell, body.hr-printing #modal-root { display: none !important; }
  body.hr-printing > .hr-print-area { display: block !important; color: #111; background: #fff; }
  .hr-print-heading { margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid #9a744e; }
  .hr-print-heading strong { color: #785837; letter-spacing: 3px; font-size: 18px; }
  .hr-print-heading h1 { margin: 8px 0; font-size: 17px; }
  .hr-print-heading p { margin: 0; font-size: 10px; }
  .hr-print-area table { table-layout: auto; white-space: normal; }
  .hr-print-area th, .hr-print-area td { overflow-wrap: anywhere; font-size: 8pt !important; padding: 7px 5px; }
  .hr-print-area thead { display: table-header-group; }
  .hr-print-area tr { break-inside: avoid; }
  .hr-module .hr-toolbar, .hr-module .hr-actions { display: none !important; }
}

.hr-company-letterhead, .hr-company-letterfooter { display:block; width:100%; height:auto; }
.hr-company-letterhead { margin-bottom:12px; }
.hr-company-letterfooter { margin-top:20px; }
