/* Fence Labor Time Clock — app.css
   Dark industrial slate + safety orange. Mobile first, big touch targets. */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #0e1116;
  --bg-2: #12161d;
  --panel: #171c25;
  --panel-2: #1d2430;
  --line: #262f3d;
  --line-soft: #1f2733;
  --ink: #e8edf4;
  --ink-2: #a7b2c2;
  --ink-3: #6f7d90;
  --orange: #f2760c;
  --orange-2: #ff8f2e;
  --orange-dim: rgba(242, 118, 12, .14);
  --green: #2ea36a;
  --green-dim: rgba(46, 163, 106, .16);
  --red: #e04b4b;
  --red-dim: rgba(224, 75, 75, .15);
  --amber: #e8a317;
  --amber-dim: rgba(232, 163, 23, .15);
  --blue: #4b8ee0;
  --blue-dim: rgba(75, 142, 224, .15);
  --r: 10px;
  --r-lg: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --topbar-h: 58px;
  --sidenav-w: 232px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 { margin: 0 0 .35em; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .98rem; }
p { margin: 0 0 .75em; }
a { color: var(--orange-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

.muted { color: var(--ink-2); }
.small { font-size: .82rem; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.is-negative { color: var(--red); }
.inline { display: inline-block; }
.empty {
  color: var(--ink-3);
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 1.5rem;
  text-align: center;
  margin: .5rem 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--orange); color: #101319; padding: .6rem 1rem; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: .6rem;
  padding: 0 .85rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}

.topbar__menu {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
  width: 40px; height: 40px; padding: 0 9px;
  background: transparent; border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer;
}
.topbar__menu span { display: block; height: 2px; background: var(--ink-2); border-radius: 2px; }
.topbar__menu[aria-expanded="true"] span { background: var(--orange); }

.brand { display: flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand__mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--orange-dim); color: var(--orange);
  flex: none;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__text strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__text small { color: var(--ink-3); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.langswap { margin: 0; }
.langswap__btn {
  background: transparent; border: 1px solid var(--line); color: var(--ink-2);
  border-radius: 8px; padding: .35rem .55rem; font-size: .75rem; font-weight: 700;
  letter-spacing: .06em; cursor: pointer;
}
.langswap__btn:hover { color: var(--orange); border-color: var(--orange); }

.usermenu { display: flex; align-items: center; gap: .45rem; }
.usermenu__name { color: var(--ink-2); font-size: .85rem; }
.usermenu form { margin: 0; }
.usermenu__out {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 9px;
  background: transparent; border: 1px solid var(--line); color: var(--ink-2); cursor: pointer;
}
.usermenu__out:hover { color: var(--red); border-color: var(--red); }

.avatar {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--orange); color: #101319;
  font-size: .78rem; font-weight: 800; letter-spacing: .02em;
  flex: none;
}
.avatar--sm { width: 26px; height: 26px; font-size: .65rem; }

/* ------------------------------------------------------------------- shell */
.shell { display: flex; align-items: flex-start; }

.sidenav {
  position: fixed; z-index: 45;
  top: 0; left: 0; bottom: 0;
  width: 264px; max-width: 84vw;
  padding: 1rem .7rem;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .22s ease;
}
.sidenav.is-open { transform: none; }

.sidenav__link {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .75rem;
  border-radius: 9px;
  color: var(--ink-2); font-size: .92rem; font-weight: 500;
  text-decoration: none;
}
.sidenav__link:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.sidenav__link.is-active { background: var(--orange-dim); color: var(--orange-2); font-weight: 700; }
.sidenav__link .ico { flex: none; }
.sidenav__sep { height: 1px; background: var(--line); margin: .7rem .4rem; }

.navscrim {
  position: fixed; inset: 0; z-index: 44;
  background: rgba(4, 6, 10, .6);
  backdrop-filter: blur(2px);
}

.main { flex: 1; min-width: 0; padding: 1rem .85rem 4rem; }

.ico { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; }

/* ------------------------------------------------------------------ flashes */
.flashes { display: grid; gap: .5rem; margin-bottom: 1rem; }
.flashes--float {
  position: fixed; z-index: 60; top: .8rem; left: 50%; transform: translateX(-50%);
  width: min(520px, calc(100vw - 1.6rem));
}
.flash {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem .85rem;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: .9rem;
  box-shadow: var(--shadow);
}
.flash span { flex: 1; }
.flash--success { border-color: rgba(46,163,106,.5); background: var(--green-dim); }
.flash--error   { border-color: rgba(224,75,75,.5);  background: var(--red-dim); }
.flash--warning { border-color: rgba(232,163,23,.5); background: var(--amber-dim); }
.flash--info    { border-color: rgba(75,142,224,.5); background: var(--blue-dim); }
.flash__x {
  background: none; border: 0; color: inherit; opacity: .6;
  font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 .2rem;
}
.flash__x:hover { opacity: 1; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1rem; min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--ink);
  font: inherit; font-weight: 600; font-size: .9rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--line); text-decoration: none; color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--orange); border-color: var(--orange); color: #14181f; }
.btn--primary:hover { background: var(--orange-2); border-color: var(--orange-2); color: #14181f; }
.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--panel); color: var(--ink); }
.btn--danger { background: transparent; border-color: rgba(224,75,75,.55); color: #ff8181; }
.btn--danger:hover { background: var(--red-dim); color: #ff9c9c; }
.btn--sm { padding: .38rem .7rem; min-height: 34px; font-size: .82rem; }
.btn--lg { padding: .85rem 1.4rem; min-height: 52px; font-size: 1rem; }
.btn--block { width: 100%; }

.linkbtn {
  background: none; border: 0; padding: 0;
  color: var(--ink-3); font: inherit; font-size: .82rem;
  cursor: pointer; text-decoration: underline;
}
.linkbtn:hover { color: var(--ink); }
.linkbtn--danger:hover { color: var(--red); }

.backlink { display: inline-block; margin-top: .8rem; color: var(--ink-3); font-size: .85rem; }

/* -------------------------------------------------------------------- page */
.page { max-width: 1280px; margin: 0 auto; }
.page--narrow { max-width: 860px; }
.page__head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: .75rem; margin-bottom: 1.1rem;
}
.page__head p { margin: 0; font-size: .88rem; }
.page__actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.subhead { color: var(--ink-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; margin: 1.4rem 0 .5rem; }

/* ------------------------------------------------------------------- panel */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1rem;
  margin-bottom: 1rem;
}
.panel--muted { background: var(--bg-2); }
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin: -.15rem 0 .85rem;
}
.panel__head h2 { margin: 0; }
.panel > .tablewrap { margin: 0 -1rem -1rem; width: calc(100% + 2rem); }
.panel > .tablewrap:first-child { margin-top: -1rem; }

/* ------------------------------------------------------------------ layout */
.stack { display: grid; gap: 1rem; }
.cols { display: grid; gap: 1rem; }
.split { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.grid2, .grid3, .grid4 { display: grid; gap: .8rem; grid-template-columns: 1fr; }

/* ------------------------------------------------------------------- forms */
.form { display: grid; gap: .85rem; }
.form--tight { gap: .55rem; }
.fieldset {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: .9rem; margin: 0 0 .3rem;
  display: grid; gap: .8rem;
}
.fieldset > legend {
  padding: 0 .4rem; color: var(--ink-3);
  font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
}

.field { display: grid; gap: .3rem; min-width: 0; }
.field__label { color: var(--ink-2); font-size: .78rem; font-weight: 600; letter-spacing: .02em; }
.field__input {
  width: 100%;
  padding: .6rem .7rem; min-height: 44px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: .92rem;
  appearance: none;
}
.field__input:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 0 3px var(--orange-dim); }
.field__input::placeholder { color: var(--ink-3); }
.field__input--lg { min-height: 54px; font-size: 1.05rem; }
.field__input--sm { min-height: 36px; padding: .3rem .5rem; font-size: .85rem; }
.field__input--multi { min-height: 84px; resize: vertical; line-height: 1.5; }
.field__input--color { padding: .2rem; height: 44px; }
select.field__input {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}
select.field__input--multi { background-image: none; padding-right: .7rem; }
.field__wrap { position: relative; display: flex; }
.field__wrap .field__input { padding-right: 3rem; }
.field__eye {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--ink-3);
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .5rem; cursor: pointer;
}
.field__eye:hover { color: var(--orange); }
.field__hint { color: var(--ink-3); font-size: .76rem; }
.field--inline { gap: .2rem; }
.field--compact { max-width: 170px; }
.field--grow { flex: 1 1 180px; }
.field--indent { margin-left: 1.75rem; max-width: 220px; }

.check { display: flex; align-items: flex-start; gap: .55rem; cursor: pointer; font-size: .9rem; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--orange); flex: none; }
.check span { color: var(--ink-2); }
.check--sm { font-size: .82rem; }
.check--pad { align-self: end; padding-bottom: .7rem; }

.formactions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .3rem; }
.formactions--sticky {
  position: sticky; bottom: 0;
  background: linear-gradient(180deg, rgba(14,17,22,0), var(--bg) 35%);
  padding: 1rem 0 .5rem;
}
.inlineactions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.rowform { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: 0; }
.rowform .field__input { min-width: 120px; }

/* --------------------------------------------------------------- filterbar */
.filterbar {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: .8rem;
  margin-bottom: 1rem;
}
.filterbar__row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.filterbar__row .field { flex: 1 1 150px; }
.filterbar__row .btn { min-height: 44px; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.chip {
  display: inline-block;
  padding: .35rem .75rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--ink-2);
  font-size: .8rem; font-weight: 600; text-decoration: none;
  cursor: pointer;
}
.chip:hover { color: var(--ink); border-color: var(--ink-3); text-decoration: none; }
.chip.is-active { background: var(--orange); border-color: var(--orange); color: #14181f; }

/* ------------------------------------------------------------------ tables */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: .65rem .7rem; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table thead th {
  color: var(--ink-3); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody tr:hover { background: rgba(255, 255, 255, .022); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td {
  border-top: 2px solid var(--line); border-bottom: 0;
  font-weight: 800; color: var(--ink);
  background: var(--bg-2);
}
.table--compact th, .table--compact td { padding: .45rem .6rem; font-size: .84rem; }
.table--report td { white-space: nowrap; }
.table--sticky thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); }
.table__note { color: var(--ink-3); font-size: .78rem; }
.table .check-col { width: 40px; }
.table tr.is-open { background: var(--green-dim); }
.table tr.is-dim { opacity: .55; }
.table--grid td { min-width: 130px; }
.table--grid .sticky-col { position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 150px; font-weight: 600; }
.table--grid .is-today { background: var(--orange-dim); }
.rowlink { color: var(--ink); font-weight: 600; }
.rowlink:hover { color: var(--orange-2); }
.maplink { color: var(--ink-3); font-size: .78rem; }
.maplink:hover { color: var(--orange-2); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: 0; }

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1rem 0; font-size: .85rem; }

/* -------------------------------------------------------------------- tags */
.tag {
  display: inline-block;
  padding: .16rem .5rem;
  border-radius: 999px;
  background: var(--panel-2); color: var(--ink-2);
  border: 1px solid var(--line);
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  text-transform: capitalize; white-space: nowrap;
}
.tag--pw       { background: var(--amber-dim); color: #f2c66b; border-color: rgba(232,163,23,.45); }
.tag--live,
.tag--open     { background: var(--green-dim); color: #6fdca4; border-color: rgba(46,163,106,.45); }
.tag--approved { background: var(--blue-dim);  color: #8cbcf2; border-color: rgba(75,142,224,.45); }
.tag--pending,
.tag--warn     { background: var(--amber-dim); color: #f2c66b; border-color: rgba(232,163,23,.45); }
.tag--denied,
.tag--rejected { background: var(--red-dim);   color: #ff9c9c; border-color: rgba(224,75,75,.45); }
.tag--closed   { background: var(--panel-2);   color: var(--ink-2); }
.tag--muted    { background: transparent; color: var(--ink-3); }

.badge {
  display: inline-block; min-width: 20px; padding: .05rem .4rem;
  border-radius: 999px; background: var(--panel-2); color: var(--ink-2);
  font-size: .7rem; font-weight: 800; text-align: center;
}
.badge--warn { background: var(--amber); color: #14181f; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(46,163,106,.6); animation: dot 2s infinite; }
@keyframes dot { 70% { box-shadow: 0 0 0 8px rgba(46,163,106,0); } 100% { box-shadow: 0 0 0 0 rgba(46,163,106,0); } }

.notice {
  padding: .7rem .85rem; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--panel);
  font-size: .85rem; color: var(--ink-2);
}
.notice--warn { border-color: rgba(232,163,23,.45); background: var(--amber-dim); color: #f2d49b; }

/* --------------------------------------------------------------- kpi/stats */
.kpis, .statgrid { display: grid; gap: .7rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1rem; }
.kpi, .stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: .85rem;
}
.kpi__label, .stat__label {
  color: var(--ink-3); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em;
  display: block; margin-bottom: .3rem;
}
.kpi__value, .stat__value { display: block; font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat__value--sm { font-size: 1.2rem; }
.kpi__sub, .stat__sub { display: block; color: var(--ink-3); font-size: .78rem; margin-top: .2rem; }
.kpi--live { border-color: rgba(46,163,106,.45); }
.kpi--live .kpi__value { color: #6fdca4; }
.kpi--pw { border-color: rgba(232,163,23,.4); }
.kpi--pw .kpi__value { color: #f2c66b; }
.stat--accent .stat__value { color: var(--orange-2); }
.stat--wide { grid-column: 1 / -1; }

/* -------------------------------------------------------------- trend/bars */
.trend { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-top: .5rem; }
.trend__col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .3rem; height: 100%; }
.trend__bar { width: 100%; min-height: 3px; background: var(--orange); border-radius: 4px 4px 0 0; opacity: .85; }
.trend__col:hover .trend__bar { opacity: 1; }
.trend__label { color: var(--ink-3); font-size: .62rem; white-space: nowrap; }

.barlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.barlist li { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; align-items: center; }
.barlist__name { font-size: .87rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist__value { font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.barlist__track { grid-column: 1 / -1; height: 6px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.barlist__fill { display: block; height: 100%; background: var(--orange); border-radius: 4px; }
.barlist__fill--alt { background: var(--amber); }

.alertlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.alertlist li {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .6rem .7rem; border-radius: var(--r);
  background: var(--amber-dim); border: 1px solid rgba(232,163,23,.3);
  font-size: .86rem;
}

.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); display: grid; gap: .8rem; }
.timeline li { position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -1.32rem; top: .45rem;
  width: 8px; height: 8px; border-radius: 50%; background: var(--orange);
}
.timeline__when { display: block; color: var(--ink-3); font-size: .74rem; }
.timeline__summary { font-size: .87rem; }

.deflist { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: 0; font-size: .87rem; }
.deflist dt { color: var(--ink-3); }
.deflist dd { margin: 0; }

.plainlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.plainlist li { display: grid; gap: .1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line-soft); }
.plainlist li:last-child { border-bottom: 0; padding-bottom: 0; }

/* ---------------------------------------------------------------- announce */
.announcelist { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.announce {
  display: flex; gap: .75rem; justify-content: space-between; align-items: flex-start;
  padding: .75rem .85rem;
  background: var(--panel-2); border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  border-radius: var(--r);
  font-size: .88rem;
}
.announce p { margin: .25rem 0 0; }
.announce.is-dim { opacity: .55; border-left-color: var(--ink-3); }
.announce form { margin: 0; }

/* --------------------------------------------------------- punch (crew UI) */
.punchpage { max-width: 560px; margin: 0 auto; }
.hello { text-align: center; margin-bottom: 1rem; }
.hello h1 { font-size: 1.4rem; margin-bottom: .1rem; }

.punchcard {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.5rem 1.1rem 1.2rem;
  text-align: center;
  overflow: hidden;
  margin-bottom: 1rem;
}
.punchcard.is-in { border-color: rgba(46,163,106,.55); }
.punchcard.is-out { border-color: var(--line); }
.pulse {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, var(--green-dim), transparent 68%);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.punchcard.is-in .pulse { opacity: 1; animation: breathe 3.4s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.12); } }

.punchcard__status {
  position: relative;
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--ink-2); font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
}
.punchcard.is-in .punchcard__status { color: #6fdca4; }
.punchcard__timer { position: relative; margin: .5rem 0 .1rem; }
.bigtime { display: block; font-size: 3.1rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.bigtime__label { display: block; color: var(--ink-3); font-size: .78rem; margin-top: .35rem; min-height: 1.1em; }
.punchcard__job { position: relative; margin: .7rem 0 0; }
.jobchip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .8rem; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: .84rem; color: var(--ink-2);
}
.punchcard__hint { position: relative; color: var(--ink-3); font-size: .8rem; margin: .9rem 0 0; }
.punchcard__msg { position: relative; margin: .6rem 0 0; font-size: .87rem; min-height: 1.2em; }
.punchcard__msg.is-error { color: #ff9c9c; }
.punchcard__msg.is-ok { color: #6fdca4; }
.punchcard__break { position: relative; margin-top: .9rem; }

/* slide to punch */
.slider {
  position: relative;
  height: 68px; margin: 1.2rem auto 0; max-width: 420px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.slider__fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--orange-2));
  transition: width .18s ease;
}
.punchcard.is-in .slider__fill { background: linear-gradient(90deg, #b03636, var(--red)); }
.slider.is-dragging .slider__fill { transition: none; }
.slider__label {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding-left: 3.5rem;
  color: var(--ink-2); font-size: .88rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  pointer-events: none;
}
.slider__knob {
  position: absolute; top: 5px; left: 5px;
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--orange); color: #14181f;
  border: 0; cursor: grab;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
  transition: left .18s ease, background .2s;
  touch-action: none;
}
.punchcard.is-in .slider__knob { background: var(--red); color: #fff; }
.slider.is-dragging .slider__knob { transition: background .2s; cursor: grabbing; }
.slider.is-busy { opacity: .6; pointer-events: none; }
.slider__knob svg { width: 24px; height: 24px; }

.punchlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.punchlist__item {
  display: grid; grid-template-columns: 58px 1fr auto; gap: .1rem .7rem; align-items: center;
  padding: .6rem .7rem;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r);
  font-size: .86rem;
}
.punchlist__date { color: var(--ink-3); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.punchlist__body { min-width: 0; }
.punchlist__job { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.punchlist__times { display: block; color: var(--ink-3); font-size: .78rem; }
.punchlist__total { font-weight: 800; font-variant-numeric: tabular-nums; }

.dayblock { margin-bottom: .9rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.dayblock__head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .65rem .85rem; background: var(--panel-2); border-bottom: 1px solid var(--line);
  font-size: .88rem; font-weight: 700;
}
.dayblock__total { font-variant-numeric: tabular-nums; color: var(--orange-2); }

.shiftlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.shiftrow {
  display: grid; grid-template-columns: 62px 1fr auto; gap: .1rem .7rem; align-items: center;
  padding: .65rem .75rem;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--orange);
  border-radius: var(--r);
  font-size: .87rem;
}
.shiftrow.is-past { opacity: .5; border-left-color: var(--ink-3); }
.shiftrow__date { color: var(--ink-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; text-align: center; line-height: 1.25; }
.shiftrow__body { min-width: 0; }
.shiftrow__job { display: block; font-weight: 600; }
.shiftrow__note { display: block; color: var(--ink-3); font-size: .78rem; }
.shiftrow__time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.shiftchip {
  position: relative;
  display: grid; gap: 1px;
  padding: .4rem 1.3rem .4rem .5rem;
  margin-bottom: .35rem;
  border-radius: 7px;
  background: var(--panel-2);
  border-left: 3px solid var(--chip, var(--orange));
  font-size: .76rem; line-height: 1.3;
}
.shiftchip span { color: var(--ink-3); }
.shiftchip em { color: var(--amber); font-style: normal; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.shiftchip form { position: absolute; top: 2px; right: 2px; margin: 0; }
.shiftchip__x { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px 4px; }
.shiftchip__x:hover { color: var(--red); }

/* ----------------------------------------------------------------- reports */
.reporttabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .9rem; border-bottom: 1px solid var(--line); padding-bottom: .6rem; }
.reporttab {
  padding: .4rem .8rem; border-radius: 8px;
  color: var(--ink-2); font-size: .84rem; font-weight: 600; text-decoration: none;
}
.reporttab:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.reporttab.is-active { background: var(--orange-dim); color: var(--orange-2); }

.bulkbar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  padding: .7rem .85rem; margin-top: .5rem;
  background: var(--panel-2); border: 1px solid var(--orange); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

/* ------------------------------------------------------------- auth screen */
.authpage { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.authpage__art { display: none; }
.authpage__panel {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 2rem 1.1rem;
}
.authpage__panel--wide { padding: 2.5rem 1.1rem; }
.authcard { width: min(400px, 100%); }
.authpage__panel--wide .authcard { width: min(560px, 100%); }
.authcard__brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.5rem; justify-content: center; }
.authcard__brand strong { font-size: 1.15rem; }
.authcard__title { text-align: center; margin-bottom: 1.4rem; }
.authcard__title h1 { font-size: 1.5rem; }
.authcard__title p { color: var(--ink-2); font-size: .88rem; margin: 0; }
.authcard__foot { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1rem; margin-top: 1.4rem; font-size: .84rem; }
.authcard__foot a, .authcard__foot button { color: var(--ink-3); }
.authpage__legal { color: var(--ink-3); font-size: .75rem; margin-top: 2rem; text-align: center; }

.fence { display: flex; align-items: flex-end; gap: 10px; height: 100%; width: 100%; padding: 3rem; }
.fence span {
  flex: 1; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, rgba(242,118,12,.5), rgba(242,118,12,.05));
  height: 55%;
}
.fence span:nth-child(odd) { height: 72%; }
.fence span:nth-child(3n) { height: 64%; }

.errorcard { text-align: center; max-width: 460px; margin: 4rem auto; padding: 0 1rem; }
.errorcard__code { font-size: 4rem; font-weight: 800; color: var(--orange); line-height: 1; }
.errorcard__detail { font-family: var(--mono); font-size: .78rem; color: var(--ink-3); text-align: left; background: var(--panel); padding: .8rem; border-radius: var(--r); overflow-x: auto; }
.errorcard__actions { display: flex; gap: .6rem; justify-content: center; margin-top: 1.2rem; }

/* ------------------------------------------------------------------ kiosk */
.kioskbody { background: var(--bg); }
.kiosk { min-height: 100vh; display: flex; flex-direction: column; }
.kiosk__top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.kiosk__brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.kiosk__clock { text-align: right; line-height: 1.15; }
.kiosk__clock strong { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.kiosk__clock span { color: var(--ink-3); font-size: .78rem; }
.kiosk__main { flex: 1; display: grid; grid-template-columns: 1fr; gap: 1rem; padding: 1.1rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.kiosk__pad { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem; }
.kiosk__step { text-align: center; color: var(--ink-2); font-size: .95rem; font-weight: 600; margin-bottom: .6rem; }
.kiosk__display {
  min-height: 76px; display: grid; place-content: center; gap: .2rem; text-align: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: .9rem;
}
.kiosk__value { font-size: 2.1rem; font-weight: 800; letter-spacing: .18em; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.kiosk__who { color: var(--orange-2); font-size: .9rem; font-weight: 600; }
.kiosk__job { margin-bottom: .9rem; }
.kiosk__actions { display: grid; gap: .5rem; margin-top: .9rem; }
.kiosk__msg { text-align: center; margin: .7rem 0 0; font-size: .95rem; min-height: 1.4em; }
.kiosk__msg.is-error { color: #ff9c9c; }
.kiosk__msg.is-ok { color: #6fdca4; }
.kiosk__side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem; }
.kiosk__side h2 { display: flex; align-items: center; gap: .5rem; font-size: .95rem; margin-bottom: .8rem; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.keypad__key {
  min-height: 62px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); font: inherit; font-size: 1.5rem; font-weight: 700;
  cursor: pointer;
}
.keypad__key:active { background: var(--orange); color: #14181f; }
.keypad__key--alt { font-size: .9rem; color: var(--ink-2); }

/* ------------------------------------------------------------ breakpoints */
@media (min-width: 560px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .kpis, .statgrid { grid-template-columns: repeat(3, 1fr); }
  .authpage__panel { padding: 3rem 2rem; }
}

@media (min-width: 780px) {
  .grid3 { grid-template-columns: repeat(3, 1fr); }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .kpis, .statgrid { grid-template-columns: repeat(4, 1fr); }
  .cols--1-1 { grid-template-columns: 1fr 1fr; }
  .cols--2-1 { grid-template-columns: 2fr 1fr; }
  .cols--1-2 { grid-template-columns: 1fr 1.4fr; }
  .kiosk__main { grid-template-columns: 1.3fr 1fr; }
}

@media (min-width: 1024px) {
  body { font-size: 15px; }
  .main { padding: 1.4rem 1.6rem 4rem; }
  .grid4 { grid-template-columns: repeat(4, 1fr); }
  .hide-sm { display: inline-flex; }
  .topbar__menu { display: none; }
  .sidenav {
    position: sticky; top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    width: var(--sidenav-w); max-width: none;
    transform: none;
  }
  .navscrim { display: none !important; }
  .authpage { grid-template-columns: 1.1fr 1fr; }
  .authpage--plain { grid-template-columns: 1fr; }
  .authpage__art {
    display: block;
    background: radial-gradient(120% 90% at 20% 10%, #1a2130, var(--bg));
    border-right: 1px solid var(--line);
  }
}

@media (max-width: 1023px) {
  .hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media print {
  .topbar, .sidenav, .navscrim, .filterbar, .page__actions, .reporttabs, .bulkbar, .flashes { display: none !important; }
  body { background: #fff; color: #000; }
  .panel, .table, .table th, .table td { border-color: #bbb; background: #fff; color: #000; }
}
