:root {
  color-scheme: light;
  --navy: #14253d; --navy-2: #1d3553; --teal: #16b3a3; --green: #16a75c;
  --amber: #f4aa1c; --red: #df4b4b; --ink: #17263a; --muted: #65758a;
  --line: #dce5ea; --canvas: #f2f6f8; --surface: #fff; --radius: 14px;
  font-family: "Trebuchet MS", ui-rounded, "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.splash { min-height: 100vh; display: grid; place-items: center; color: var(--navy); font-size: 1.1rem; }
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 520px) 1fr; background: var(--surface); }
.auth-panel { padding: clamp(30px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; }
.registration-panel { padding-top: 34px; padding-bottom: 34px; }
.auth-art { background: linear-gradient(145deg, var(--navy), #0d6870); color: white; display: grid; place-items: center; padding: 60px; }
.auth-art-content { max-width: 620px; }
.auth-art h2 { font-size: clamp(2rem, 4vw, 4rem); margin: 0 0 18px; line-height: 1.05; }
.auth-art p { color: #d8f4f0; font-size: 1.2rem; line-height: 1.7; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; font-size: 1.3rem; color: inherit; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--teal); color: white; font-weight: 800; }
.auth-panel h1 { margin: 42px 0 8px; font-size: 2rem; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: grid; gap: 7px; }
.field span { font-size: .86rem; font-weight: 650; color: #3f5064; }
input, select, textarea { width: 100%; border: 1px solid #cad6dd; border-radius: 10px; padding: 11px 12px; background: white; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px #16b3a31c; }
textarea { min-height: 84px; resize: vertical; }
.button { border: 0; border-radius: 10px; padding: 11px 17px; font-weight: 700; background: var(--teal); color: white; box-shadow: 0 4px 12px #16b3a326; }
.button:hover { filter: brightness(.96); transform: translateY(-1px); }
.button.secondary { background: white; color: var(--navy); border: 1px solid var(--line); box-shadow: none; }
.button.danger { background: var(--red); }
.button.small { padding: 7px 11px; font-size: .83rem; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.error { color: #b42d2d; background: #fff0f0; border: 1px solid #ffd0d0; border-radius: 9px; padding: 10px 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 225px 1fr; }
.sidebar { background: var(--navy); color: white; padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 0 10px; }
.nav { display: grid; gap: 5px; }
.nav button { border: 0; border-radius: 9px; background: transparent; color: #d6e0eb; padding: 11px 13px; text-align: left; display: flex; gap: 11px; align-items: center; }
.nav button:hover, .nav button.active { background: #16b3a32c; color: white; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #ffffff1a; padding: 16px 10px 0; font-size: .86rem; color: #b9c6d3; }
.app-version { margin-top: 12px; font-size: .7rem; color: #8094a8; }
.version-corner { position: fixed; left: 12px; bottom: 9px; z-index: 12; font-size: .68rem; color: #8795a5; opacity: .9; }
.clock-page .version-corner { color: #c1cbd6; }
.mobile-version { display: none; }
.main { min-width: 0; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 28px; background: white; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { margin: 0; font-size: 1.35rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.location-select { min-width: 190px; }
.content { padding: 26px 28px 48px; max-width: 1500px; margin: 0 auto; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-head h2 { margin: 0 0 5px; font-size: 1.7rem; }
.page-head p { margin: 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.card { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; box-shadow: 0 3px 13px #17334d0b; }
.metric-label { color: var(--muted); font-size: .87rem; font-weight: 650; }
.metric-value { font-size: 2rem; font-weight: 760; margin-top: 8px; }
.metric-caption { margin-top: 2px; color: var(--muted); font-size: .8rem; }
.metric-accent { width: 34px; height: 5px; border-radius: 5px; background: var(--teal); margin-top: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 18px; }
.card h3 { margin: 0 0 16px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; font-size: .89rem; vertical-align: middle; }
th { color: #526377; background: #f8fafb; font-size: .77rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #91a2b3; }
.dot.online { background: var(--green); box-shadow: 0 0 0 3px #16a75c1c; }
.toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .field { min-width: 180px; }
.empty { color: var(--muted); padding: 28px; text-align: center; }
.clock-page { min-height: 100vh; background: linear-gradient(180deg, var(--navy) 0 160px, var(--canvas) 160px); padding: 22px; }
.clock-shell { max-width: 560px; margin: auto; }
.clock-header { color: white; display: flex; justify-content: space-between; align-items: center; padding: 0 0 25px; }
.clock-card { background: white; border-radius: 24px; padding: clamp(24px, 7vw, 44px); box-shadow: 0 20px 45px #0c1a2c25; text-align: center; }
.clock-time { font-size: clamp(2.5rem, 10vw, 4.5rem); font-weight: 780; color: var(--navy); letter-spacing: -.04em; }
.clock-date { color: var(--muted); margin: 5px 0 25px; }
.clock-button { width: 190px; height: 190px; border: 10px solid #d0f2df; border-radius: 50%; background: linear-gradient(145deg, #1fbe68, #0d914d); color: white; font-weight: 800; font-size: 1.25rem; box-shadow: 0 10px 26px #13995348; margin: 10px auto 24px; }
.clock-button:active { transform: scale(.97); }
.clock-continue { min-width: 220px; margin: 4px auto 10px; padding: 16px 28px; font-size: 1.08rem; }
.employee-clock-card { position: relative; max-width: 680px; margin: 0 auto; }
.employee-cancel { width: 52px; height: 52px; border: 1px solid #ffffff78; border-radius: 50%; background: #ffffff18; color: white; font-size: 2rem; line-height: 1; }
.employee-cancel:hover, .employee-cancel:focus-visible { background: #ffffff30; outline: 3px solid #ffffff4a; }
.employee-identity { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 17px; align-items: center; margin: 18px 0 8px; padding: 17px; border-radius: 16px; background: #edf3f6; text-align: left; }
.employee-avatar { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #20bbb0, #09988f); color: white; font-size: 2.25rem; }
.employee-identity strong { display: block; margin-bottom: 5px; font-size: 1.35rem; color: var(--navy); }
.employee-identity span:not(.employee-avatar) { display: block; margin-top: 3px; color: var(--muted); }
.employee-identity .employee-shift-note { margin-top: 8px; color: #995700; font-weight: 750; }
.employee-status { min-height: 48px; display: grid; place-items: center; margin: 2px 0 15px; color: var(--muted); }
.employee-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.employee-links .button { min-height: 58px; font-size: 1rem; }
.employee-detail-list { display: grid; gap: 10px; max-height: 430px; margin: 18px 0; overflow-y: auto; text-align: left; }
.employee-detail-list > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafb; line-height: 1.5; }
.clock-result { margin: 18px 0 0; padding: 14px; border-radius: 11px; background: #eafaf1; color: #116d3d; font-weight: 650; }
.employee-confirmation { position: fixed; z-index: 50; top: 24px; left: 50%; width: min(680px, calc(100% - 30px)); transform: translateX(-50%); padding: 27px 34px; border: 3px solid #42d59a; border-radius: 20px; background: var(--navy); color: white; box-shadow: 0 20px 50px #06101f66; text-align: center; }
.employee-confirmation strong, .employee-confirmation span { display: block; }
.employee-confirmation strong { font-size: clamp(2rem, 6vw, 3.1rem); }
.employee-confirmation span { margin-top: 7px; color: #d6f8ea; font-size: clamp(1.05rem, 3vw, 1.55rem); font-weight: 650; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 12px; }
.section-title h3 { margin: 0; }
.section-title.compact { margin: 0 0 12px; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #edf4f7; color: #496073; font-size: .76rem; font-weight: 700; }
.badge.warn { background: #fff4d9; color: #895b00; }
.toast { position: fixed; right: 22px; bottom: 22px; background: var(--navy); color: white; border-radius: 10px; padding: 12px 16px; box-shadow: 0 8px 24px #0003; transform: translateY(120px); opacity: 0; transition: .25s; z-index: 20; }
.toast.show { transform: translateY(0); opacity: 1; }
.mobile-bar { display: none; }
.chart-card { margin-bottom: 20px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .9fr); gap: 18px; margin-bottom: 20px; }
.schedule-days { display: grid; grid-template-columns: repeat(7, 1fr); margin: 16px 0 6px; padding-left: 150px; color: var(--muted); font-size: .72rem; text-align: center; }
.visual-schedule { display: grid; gap: 9px; }
.schedule-row { display: grid; grid-template-columns: 140px 1fr; gap: 10px; align-items: center; }
.schedule-row > div:first-child { min-width: 0; display: grid; }
.schedule-row small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-track { position: relative; height: 25px; border-radius: 7px; overflow: hidden; background: repeating-linear-gradient(90deg,#eef3f6 0,#eef3f6 calc(14.285% - 1px),#d7e2e8 calc(14.285% - 1px),#d7e2e8 14.285%); }
.schedule-track span { position: absolute; top: 4px; bottom: 4px; min-width: 4px; border-radius: 5px; background: linear-gradient(90deg,#20b9ae,#398ee8); }
.schedule-toolbar { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.schedule-view-toggle { display: flex; gap: 7px; margin: -8px 0 14px; }
.schedule-view-toggle .button { padding: 7px 12px; }
.schedule-view-toggle .button.active { background: var(--teal); border-color: var(--teal); color: white; }
.schedule-toolbar .field { min-width: 190px; }
.schedule-tip { margin-left: auto; align-self: center; color: var(--muted); font-size: .88rem; }
.schedule-builder { padding: 0; overflow: hidden; }
.schedule-scroll { overflow-x: auto; }
.schedule-grid { min-width: 1300px; display: grid; grid-template-columns: 190px repeat(15, 64px) 130px; align-items: stretch; }
.schedule-grid > * { min-height: 55px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.schedule-grid-head { position: sticky; top: 0; z-index: 3; display: grid; place-items: center; padding: 10px 4px; background: #f7fafc; color: #40566d; font-size: .78rem; font-weight: 750; }
.schedule-grid-head.employee-column { left: 0; z-index: 5; place-items: center start; padding-left: 16px; }
.schedule-employee { position: sticky; left: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; padding: 8px 15px; background: white; cursor: pointer; }
.schedule-employee small { color: var(--muted); }
.schedule-employee.active { background: #e9f8f6; box-shadow: inset 4px 0 var(--teal); }
.schedule-cell { min-width: 0; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: white; touch-action: none; }
.schedule-cell:hover { background: #edf8f7; }
.schedule-cell.selected { margin: 5px 2px; min-height: 45px; border: 0; border-radius: 7px; background: linear-gradient(145deg,#20b9ae,#0d9d92); box-shadow: 0 3px 8px #10a89e35; }
.schedule-row-actions { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px; background: white; }
.save-schedule-row.saved { background: #e7f8ee; border-color: #b9e8cd; color: #147343; }
.schedule-note-card { margin-top: 18px; }
.schedule-note-card h3 { margin-bottom: 5px; }
.schedule-note-card textarea { min-height: 95px; margin-top: 12px; }
.schedule-summary { position: sticky; z-index: 6; bottom: 0; display: grid; grid-template-columns: repeat(3,auto) minmax(180px,1fr); align-items: center; gap: 28px; margin-top: 16px; padding: 17px 22px; border: 1px solid var(--line); border-radius: 14px; background: #f9fcfded; box-shadow: 0 -6px 24px #16344d12; backdrop-filter: blur(8px); }
.schedule-summary > div { display: flex; align-items: baseline; gap: 6px; color: var(--muted); }
.schedule-summary strong { color: var(--navy); font-size: 1.45rem; }
.schedule-summary .button { justify-self: end; min-width: 220px; }
.dot.late { background: var(--amber); box-shadow: 0 0 0 3px #f4aa1c24; }
.hours-chart { height: 210px; display: grid; grid-template-columns: repeat(7,1fr); gap: clamp(8px,2vw,28px); align-items: end; padding: 16px 12px 0; border-bottom: 1px solid var(--line); }
.hours-column { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; color: var(--muted); font-size: .75rem; }
.hours-column span { width: min(54px,80%); min-height: 3px; border-radius: 7px 7px 0 0; background: linear-gradient(180deg,#12b7ad,#2c94df); }
.hours-column strong { color: var(--ink); }
.labor-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.labor-panel { min-width: 0; }
.labor-panel + .labor-panel { border-left: 1px solid var(--line); padding-left: 20px; }
.labor-panel h3 { min-height: 2.4em; font-size: 1rem; }
.labor-panel .bar-row { grid-template-columns: minmax(82px, 120px) minmax(70px, 1fr); gap: 8px; }
.labor-panel .bar-row > strong { grid-column: 2; text-align: right; font-size: .86rem; }
.labor-panel .bar-row small { font-size: .72rem; }
.bar-chart { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(130px, 190px) minmax(120px, 1fr) 100px; align-items: center; gap: 14px; }
.bar-row div:first-child { display: grid; gap: 2px; }
.bar-row small { color: var(--muted); }
.bar-track { height: 18px; border-radius: 99px; background: #e9f0f3; overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #28c880); }
.note-list { display: grid; gap: 10px; }
.note-list.full { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.note-item { border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 10px; padding: 12px 14px; background: #fffdf8; }
.note-item p { margin: 7px 0; color: #405267; line-height: 1.45; }
.note-item small { color: var(--muted); }
.note-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.payroll-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 16px; }
.report-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check-row { display: flex; gap: 10px; align-items: center; }
.check-row input { width: auto; }
.currency-input { display: grid; grid-template-columns: auto 1fr; align-items: center; border: 1px solid #cad6dd; border-radius: 10px; background: white; overflow: hidden; }
.currency-input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px #16b3a31c; }
.currency-input > span { padding-left: 12px; color: var(--muted); font-size: 1rem; }
.currency-input input { border: 0; box-shadow: none; padding-left: 7px; }
.currency-input input:focus { box-shadow: none; }
.roles-card { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-top: 18px; }
.role-list { display: flex; flex-wrap: wrap; gap: 7px; }
.role-form { display: flex; align-items: end; gap: 10px; min-width: min(420px, 100%); }
.role-form .field { flex: 1; }
.payroll-policy-card { margin-top: 18px; }
.payroll-policy-card form { max-width: 850px; }
.policy-option { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fafcfd; cursor: pointer; }
.policy-option input { width: 42px; height: 23px; accent-color: var(--teal); }
.policy-option span { display: grid; gap: 3px; }
.policy-option small { color: var(--muted); }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.timecard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.timecard { padding: 0; overflow: hidden; }
.timecard-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 20px; background: linear-gradient(135deg,#f4f9fb,#edf7f6); border-bottom: 1px solid var(--line); }
.timecard-head h3 { margin: 0 0 3px; }
.timecard-total { display: grid; min-width: 72px; text-align: right; }
.timecard-total strong { color: var(--teal); font-size: 1.7rem; }
.timecard-total span { color: var(--muted); font-size: .75rem; }
.timecard-days { min-height: 145px; padding: 8px 20px; }
.timecard-days > div { display: grid; grid-template-columns: 125px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.timecard-days > div:last-child { border-bottom: 0; }
.timecard-footer { display: flex; justify-content: space-between; padding: 13px 20px; background: #fafcfd; border-top: 1px solid var(--line); }
fieldset { border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 9px; padding: 12px; }
fieldset legend { color: var(--muted); font-size: .83rem; font-weight: 700; padding: 0 5px; }
fieldset.disabled { opacity: .5; }
.pin-field { max-width: 260px; margin: 0 auto; text-align: left; }
.pin-field input { text-align: center; font-size: 1.7rem; letter-spacing: .3em; }
.link-button { border: 0; background: transparent; color: var(--muted); text-decoration: underline; }
.narrow { max-width: 700px; }
@media (max-width: 1100px) { .labor-panels { grid-template-columns: 1fr; } .labor-panel + .labor-panel { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; } .labor-panel h3 { min-height: auto; } }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, 1fr); } .grid-2, .overview-grid, .timecard-grid { grid-template-columns: 1fr; } .roles-card { align-items: stretch; flex-direction: column; } }
@media (max-width: 760px) {
  .auth-page { grid-template-columns: 1fr; } .auth-art { display: none; }
  .app-shell { display: block; padding-bottom: 66px; } .sidebar { display: none; }
  .topbar { padding: 10px 16px; min-height: 64px; } .topbar h1 { display: none; }
  .location-select { min-width: 145px; } .content { padding: 20px 14px 32px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; } .card { padding: 15px; }
  .metric-value { font-size: 1.55rem; } .form-grid { grid-template-columns: 1fr; }
  .mobile-bar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; background: white; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-bar button { border: 0; background: white; padding: 11px 2px; color: var(--muted); font-size: .68rem; }
  .mobile-bar button.active { color: var(--teal); font-weight: 750; }
  .mobile-version { display: block; position: fixed; left: 7px; bottom: calc(52px + env(safe-area-inset-bottom)); z-index: 11; padding: 2px 5px; border-radius: 4px; background: #ffffffd9; color: #8290a0; font-size: .58rem; }
  .page-head { align-items: start; flex-direction: column; } .clock-page { padding: 15px; }
  .overview-grid, .timecard-grid { grid-template-columns: 1fr; } .schedule-days { padding-left: 100px; } .schedule-row { grid-template-columns: 90px 1fr; }
  .schedule-tip { width: 100%; margin-left: 0; } .schedule-summary { grid-template-columns: 1fr 1fr; gap: 12px; } .schedule-summary .button { min-width: 0; width: 100%; }
  .employee-clock-card { padding: 21px 16px; } .employee-identity { grid-template-columns: 58px minmax(0, 1fr); padding: 13px; } .employee-avatar { width: 58px; height: 58px; font-size: 1.75rem; } .employee-links { gap: 8px; } .employee-links .button { padding: 11px 7px; font-size: .9rem; }
  .bar-row { grid-template-columns: 110px 1fr; } .bar-row > strong { grid-column: 2; }
  .note-list.full, .payroll-grid { grid-template-columns: 1fr; }
  .role-form { min-width: 0; flex-direction: column; align-items: stretch; }
}
@media print {
  body { background: white; }
  .sidebar, .topbar, .mobile-bar, .no-print, .toast { display: none !important; }
  .app-shell { display: block; } .content { padding: 0; max-width: none; }
  .card, .table-wrap { box-shadow: none; break-inside: avoid; }
  .payroll-grid { grid-template-columns: 1fr; }
}
