/* Zenorix Timesheet: styles for this app, on top of the shared Zenorix theme (base.css, portal.css). */
main { max-width: 1240px; }

/* Week header */
.week-nav { display: inline-flex; align-items: center; gap: 6px; }
.week-nav .icon-btn { width: 38px; height: 38px; }
.week-label { font-weight: 700; font-size: 14px; min-width: 170px; text-align: center; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.stat small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.stat b { font-family: var(--font-display); font-size: 26px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat b.under { color: var(--warn); }
.stat b.over { color: var(--warn); }
.stat b.good { color: var(--good); }
.status.draft { background: var(--panel-3); color: var(--text-2); }
.status.submitted { background: rgba(246, 185, 59, 0.14); color: var(--warn); }
.banner { margin: 0 0 16px; }
.banner.ok { background: rgba(47, 210, 122, 0.08); border-color: rgba(47, 210, 122, 0.3); color: #b7f0d0; }
.banner.plain { background: var(--panel-2); border-color: var(--line); color: var(--text-2); }

/* The weekly grid */
.grid-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.ts-grid { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 860px; }
.ts-grid th, .ts-grid td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; font-size: 13px; }
.ts-grid thead th { font-weight: 700; color: var(--text-2); vertical-align: top; background: var(--panel-2); padding-top: 12px; padding-bottom: 12px; }
.ts-grid thead th small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.ts-grid thead th .tag { display: block; margin-top: 3px; font-size: 10px; font-weight: 800; line-height: 1.2; white-space: normal; }
.ts-grid .col-work { text-align: left; padding-left: 16px; min-width: 240px; position: sticky; left: 0; background: var(--panel); z-index: 2; }
.ts-grid thead .col-work { background: var(--panel-2); }
.ts-grid .col-total { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 62px; }
.ts-grid .col-x { width: 38px; padding: 0 6px 0 0; }
.ts-grid tfoot td { background: var(--panel-2); font-weight: 700; font-variant-numeric: tabular-nums; border-bottom: 0; }
.ts-grid tfoot .col-work { background: var(--panel-2); }
.ts-grid tfoot small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.ts-grid tr:last-child td { border-bottom: 0; }
.row-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.row-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.bill-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--good); }
.bill-dot.off { background: var(--muted); }
.day-off { background: rgba(255, 255, 255, 0.018); }
.day-holiday .tag { color: var(--warn); }
.day-leave .tag, .day-half .tag { color: var(--blue-3); }
.day-today { box-shadow: inset 0 2px 0 var(--blue-2); }

.cell { position: relative; display: inline-block; width: 72px; }
.cell input { width: 100%; height: 38px; text-align: center; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--text); font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; transition: border-color 0.15s, background 0.15s; }
.cell input::placeholder { color: var(--muted); opacity: 0.45; font-weight: 500; }
.cell input:hover { border-color: var(--line-2); }
.cell input:focus { outline: none; border-color: var(--blue-2); background: rgba(77, 109, 255, 0.1); }
.cell input.bad { border-color: var(--bad); background: rgba(242, 84, 106, 0.1); }
.cell input[readonly] { background: transparent; border-color: transparent; cursor: default; }
.note-btn { position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; border-radius: 50%; display: none; place-items: center; background: var(--panel-3); border: 1px solid var(--line-2); color: var(--muted); z-index: 1; }
.note-btn svg { width: 11px; height: 11px; }
.cell:hover .note-btn, .cell:focus-within .note-btn, .note-btn.has { display: grid; }
.note-btn.has { background: var(--blue); border-color: var(--blue); color: #fff; }

.grid-empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.grid-empty svg { display: block; margin: 0 auto 8px; color: var(--blue-3); }
.grid-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.grid-actions .grow { flex: 1; }
.save-state { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state.err { color: var(--bad); }
.day-tabs { display: none; }
.grid-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* Add a row */
.recent-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.recent-row .chip { font-size: 12px; padding: 6px 12px; }
.modal.wide { width: min(620px, 100%); }
.modal.scroll { max-height: 86vh; overflow-y: auto; }
.check-list { display: grid; gap: 2px; max-height: 340px; overflow-y: auto; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.check-row:hover { background: rgba(255, 255, 255, 0.04); }
.check-row small { color: var(--muted); margin-left: auto; }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 14px; cursor: pointer; }
.switch-row small { display: block; color: var(--muted); font-size: 12px; }

/* Approvals */
.review-card { padding: 18px 20px; margin-bottom: 14px; }
.review-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.review-head h3 { font-size: 16px; }
.review-head p { font-size: 13px; color: var(--muted); }
.review-head .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.flag { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(246, 185, 59, 0.14); color: var(--warn); white-space: nowrap; }
.flag.ok { background: rgba(47, 210, 122, 0.14); color: var(--good); }
.day-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.day-strip div { padding: 8px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); text-align: center; font-size: 11px; color: var(--muted); }
.day-strip b { display: block; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.day-strip .off { opacity: 0.55; }
.mini-rows { display: grid; gap: 4px; font-size: 13px; }
.mini-rows div { display: flex; gap: 10px; justify-content: space-between; color: var(--text-2); }
.mini-rows b { font-variant-numeric: tabular-nums; }

/* Reports and tables */
.tbl-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.data-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.data-tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-tbl tr:last-child td { border-bottom: 0; }
.data-tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-tbl small { display: block; color: var(--muted); font-size: 12px; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.filter-bar .field { margin: 0; }
.filter-bar label { font-size: 12px; }
.filter-bar .input { padding-top: 9px; padding-bottom: 9px; }
.bar { height: 8px; border-radius: 999px; background: var(--panel-3); overflow: hidden; min-width: 90px; display: flex; }
.bar i { display: block; height: 100%; background: var(--blue-2); }
.bar i.non { background: var(--muted); }
.bar i.over { background: var(--bad); }
.section-gap { margin-top: 22px; }
.ts-section-h { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

/* Admin: clients and projects */
.client-block { margin-bottom: 18px; }
.client-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.client-h h3 { font-size: 16px; }
.project-card { padding: 14px 16px; margin-bottom: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.project-card.off { opacity: 0.6; }
.project-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.project-top h4 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.project-top p { font-size: 12px; color: var(--muted); }
.project-top .right { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.task-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.task-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-3); color: var(--text-2); }
.task-chip.off { opacity: 0.5; text-decoration: line-through; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.audit-row { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.audit-row:last-child { border-bottom: 0; }
.audit-row small { color: var(--muted); display: block; }

/* Autofill, usual week, monthly view */
.row-tools { display: flex; gap: 2px; justify-content: flex-end; }
.ts-grid .col-x { width: 74px; }
.note-req { color: var(--warn); font-weight: 700; }
.usual-line { font-size: 12px; color: var(--muted); margin-top: 6px; }
.usual-line .link { font-size: 12px; }
.review-card.off { opacity: 0.6; }
.month-tbl td, .month-tbl th { white-space: nowrap; }
.month-cell { display: block; min-width: 78px; padding: 6px 8px; border-radius: 10px; background: var(--panel-3); text-align: center; color: var(--text-2); }
.month-cell b { display: block; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.month-cell span { font-size: 10px; font-weight: 700; }
.month-cell.approved { background: rgba(47, 210, 122, 0.12); color: var(--good); }
.month-cell.submitted { background: rgba(246, 185, 59, 0.12); color: var(--warn); }
.month-cell.rejected, .month-cell.late { background: rgba(242, 84, 106, 0.12); color: var(--bad); }
.month-cell.off { opacity: 0.45; }

/* Sign-in art: a small week of hours */
.hero-week { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 420px; margin-top: 34px; align-items: end; height: 120px; }
.hero-week i { display: block; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--blue-2), var(--blue)); animation: rise 0.6s var(--ease) both; }

/* Phones: one day at a time, chosen from the tabs above the grid */
@media (max-width: 760px) {
  .day-tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 10px; }
  .day-tabs button { padding: 7px 0; border-radius: 10px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); line-height: 1.25; }
  .day-tabs button b { display: block; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
  .day-tabs button.on { border-color: var(--blue-2); background: rgba(77, 109, 255, 0.16); }
  .ts-grid { min-width: 0; }
  .ts-grid .col-work { position: static; min-width: 0; padding-left: 12px; }
  .ts-grid .col-day { display: none; }
  .ts-grid .col-day.shown { display: table-cell; }
  .ts-grid .col-total { min-width: 46px; }
  .cell { width: 66px; }
  .cell input { font-size: 16px; }
  .note-btn { display: grid; }
  .week-label { min-width: 0; }
  .review-head .right { margin-left: 0; width: 100%; }
  .day-strip { gap: 3px; }
  .day-strip div { padding: 6px 2px; font-size: 10px; }
  .day-strip b { font-size: 13px; }
  .grid-hint { display: none; }
}
