:root {
  --navy: #12263a;
  --blue: #1f6feb;
  --light: #f4f7fb;
  --card: #ffffff;
  --text: #17202a;
  --muted: #6b7280;
  --border: #dbe3ec;
  --green: #16803c;
  --amber: #a86400;
  --red: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Segoe UI, Arial, sans-serif; background: var(--light); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #0d2236, #1d4e72); }
.login-card { width: min(470px, 100%); background: #fff; border-radius: 18px; padding: 32px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.login-logo { width: 150px; height: auto; display: block; margin: 0 auto 14px; }
.login-card h1 { text-align: center; margin: 0; font-size: 24px; }
label { display: block; font-weight: 700; font-size: 13px; margin: 14px 0 6px; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 10px 11px; background: #fff; }
textarea { min-height: 78px; resize: vertical; }
.btn { border: 0; border-radius: 9px; padding: 10px 14px; font-weight: 700; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--blue); color: #fff; }
.secondary { background: #eaf1fb; color: #174b82; }
.success { background: #dcfae6; color: var(--green); }
.warning { background: #fff3d6; color: var(--amber); }
.danger { background: #fee4e2; color: var(--red); }
.wide { width: 100%; margin-top: 18px; }
.small { padding: 7px 10px; font-size: 12px; }
.demo-box { margin-top: 18px; padding: 12px; background: #f7f9fc; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; line-height: 1.6; }
.error-text { color: var(--red); margin-top: 10px; font-size: 13px; }
.app { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 245px; background: var(--navy); color: #fff; padding: 20px 14px; z-index: 10; overflow-y: auto; }
.side-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px; padding-bottom: 16px; }
.side-brand img { width: 105px; height: auto; display: block; }
.side-brand strong { display: block; }
.side-brand small { display: block; color: #b9c6d3; margin-top: 2px; }
.nav-btn { width: 100%; text-align: left; border: 0; background: transparent; color: #d8e1ea; padding: 11px 12px; border-radius: 8px; margin: 3px 0; }
.nav-btn:hover, .nav-btn.active { background: #1d3a55; color: #fff; }
.side-bottom { position: absolute; left: 14px; right: 14px; bottom: 18px; }
.user-box { padding: 12px; background: #1a344d; border-radius: 10px; margin-bottom: 9px; font-size: 13px; }
.main { margin-left: 245px; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 18px; }
.topbar h2 { margin: 0; font-size: 25px; }
.topbar p { margin: 4px 0 0; }
.top-summary { display: flex; align-items: center; gap: 12px; text-align: right; }
.week-cost { background: var(--navy); color: #fff; border-radius: 12px; padding: 10px 14px; min-width: 190px; box-shadow: 0 5px 18px rgba(18,38,58,.18); }
.week-cost small { display: block; color: #c8d6e3; font-size: 10px; }
.week-cost strong { display: block; font-size: 22px; }
.week-cost span { display: block; color: #c8d6e3; font-size: 10px; }
.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: 0 3px 14px rgba(16,24,40,.04); }
.metric-label { color: var(--muted); font-size: 13px; }
.metric { font-size: 29px; font-weight: 800; margin-top: 6px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-title h3 { margin: 0; }
.toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.field { min-width: 170px; }
.field label { margin-top: 0; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 11px 12px; border-bottom: 1px solid #edf1f5; text-align: left; vertical-align: top; font-size: 13px; }
th { background: #f8fafc; color: #475467; font-size: 11px; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #f8fbff; }
.project-link { border: 0; background: transparent; color: var(--blue); font-weight: 800; padding: 0; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-draft { background: #eaf1fb; color: #174b82; }
.badge-submitted, .badge-approved { background: #dcfae6; color: #15703b; }
.badge-pending { background: #fff3d6; color: #9a6200; }
.badge-rejected { background: #fee4e2; color: #b42318; }
.notice { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.notice-info { background: #eaf1fb; color: #174b82; }
.notice-warn { background: #fff4db; color: #8b5b00; }
.notice-success { background: #e7f7ec; color: #166534; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.full { grid-column: 1/-1; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(9,20,32,.55); display: grid; place-items: center; padding: 20px; z-index: 30; }
.modal { background: #fff; width: min(760px,100%); max-height: 92vh; overflow: auto; border-radius: 16px; padding: 22px; }
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.empty { text-align: center; padding: 30px; color: var(--muted); }
.status-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.status-value { font-size: 24px; font-weight: 800; margin-top: 5px; }
.total-row td { background: #f8fafc; font-weight: 800; }
.checkbox-list { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; max-height: 180px; overflow: auto; }
.checkbox-list label { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 500; }
.checkbox-list input { width: auto; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 8px; }
.toast { background: #12263a; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.22); }
.mobile-menu { display: none; }
@media (max-width: 1050px) { .cards { grid-template-columns: repeat(2,minmax(0,1fr)); } .status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .form-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 16px; }
  .mobile-menu { display: inline-block; margin-bottom: 7px; }
  .topbar { align-items: flex-start; }
  .top-summary { flex-direction: column; align-items: flex-end; }
  .form-grid { grid-template-columns: 1fr; }
  .field { width: 100%; }
  .side-bottom { position: static; margin-top: 20px; }
}
@media (max-width: 500px) { .cards, .status-grid { grid-template-columns: 1fr; } }

/* MyQSApps Attendance V2 */
.brand-mark { width: 68px; height: 68px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, #1f6feb, #0f3d68); color: #fff; font-size: 26px; font-weight: 900; letter-spacing: -1px; box-shadow: 0 12px 28px rgba(31,111,235,.25); }
.side-mark { width: 54px; height: 54px; margin: 0; border-radius: 14px; font-size: 20px; box-shadow: none; }
.worker-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.worker-hero h3 { margin: 4px 0; font-size: 25px; }
.eyebrow { display: block; color: #64748b; font-size: 11px; font-weight: 900; letter-spacing: .09em; }
.live-pill { border-radius: 999px; padding: 9px 14px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.live-pill.live { background: #dcfae6; color: #15703b; }
.live-pill.off { background: #eef2f6; color: #64748b; }
.clock-card { max-width: 760px; margin: 0 auto; }
.clock-card > h2, .selected-job h2 { margin: 6px 0; font-size: 28px; }
.clock-time { display: flex; justify-content: space-between; gap: 12px; background: #f7f9fc; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 18px 0; }
.worker-main-btn { width: 100%; padding: 15px 18px; font-size: 16px; margin-top: 16px; }
.small-copy { font-size: 12px; text-align: center; }
.selected-job { margin-top: 18px; }
.job-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.radius-badge { background: #eaf1fb; color: #174b82; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 800; }
.induction-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 12px; padding: 14px; margin-top: 16px; }
.induction-status div { display: grid; gap: 3px; }
.induction-status span { font-size: 12px; }
.induction-status.signed { background: #e7f7ec; color: #166534; }
.induction-status.required { background: #fff4db; color: #8b5b00; }
.pdf-frame { width: 100%; height: 52vh; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.signature-canvas { width: 100%; height: 190px; border: 2px dashed #94a3b8; border-radius: 10px; background: #fff; touch-action: none; }
.declaration-check { display: flex; align-items: flex-start; gap: 10px; padding: 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; font-weight: 600; }
.declaration-check input { width: auto; margin-top: 3px; }
.induction-modal { min-width: 0; }
@media (max-width: 760px) {
  .worker-hero, .induction-status, .clock-time, .job-heading { align-items: stretch; flex-direction: column; }
  .clock-card > h2, .selected-job h2 { font-size: 23px; }
  .pdf-frame { height: 45vh; }
}
