/* Forest: a quiet, shared visual system for every attendance screen. */
:root {
  color-scheme:light;
  --forest:#07583f;
  --forest-dark:#06432f;
  --mint:#e5f1ea;
  --paper:#f6f7f3;
  --white:#fff;
  --ink:#18251f;
  --muted:#5e6b62;
  --line:#dfe5df;
  --danger:#a33232;
  --focus:#926c14;
  font-family:Inter,"Segoe UI",system-ui,-apple-system,sans-serif;
  line-height:1.55;
  color:var(--ink);
  background:var(--paper);
  font-synthesis:none;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

button,input,select,textarea {
  font:inherit;
}

a {
  color:var(--forest);
  text-underline-offset:4px;
}

a:hover {
  color:var(--forest-dark);
}

svg.icon {
  width:21px;
  height:21px;
  flex-shrink:0;
  vertical-align:middle;
}

h1,h2,h3,p {
  margin-top:0;
}

h1 {
  font-size:clamp(1.8rem,3vw,2.6rem);
  font-weight:600;
  line-height:1.18;
  letter-spacing:-.045em;
  overflow-wrap:anywhere;
  margin-bottom:1.5rem;
}

h2 {
  font-size:1.25rem;
  font-weight:600;
  letter-spacing:-.025em;
  margin-top:2.25rem;
  margin-bottom:1rem;
}

h3 {
  font-size:1.05rem;
}

p {
  margin-bottom:1rem;
}

small,.helptext {
  color:var(--muted);
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,.table-scroll:focus-visible {
  outline:3px solid var(--focus);
  outline-offset:4px;
}

.skip-link {
  position:fixed;
  top:-100px;
  left:20px;
  z-index:100;
  padding:12px 20px;
  background:var(--ink);
  color:white;
  border-radius:10px;
}

.skip-link:focus {
  top:12px;
}

.workspace {
  min-width:0;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.shell {
  width:min(1240px,100% - 80px);
  margin-inline:auto;
}

main.shell {
  padding-block:42px;
  flex:1;
  min-width:0;
}

.site-header {
  min-height:88px;
  border-bottom:1px solid var(--line);
  background:var(--white);
}

.header-content {
  min-height:88px;
  display:flex;
  align-items:center;
  gap:24px;
  padding:16px 40px;
}

.header-date {
  font-size:.82rem;
  color:var(--muted);
}

.brand {
  display:flex;
  align-items:center;
  gap:11px;
  color:var(--ink);
  font-size:1.24rem;
  letter-spacing:-.045em;
  font-weight:700;
  text-decoration:none;
  white-space:nowrap;
}

.brand-mark {
  width:37px;
  height:37px;
  display:grid;
  place-items:center;
  background:var(--forest);
  color:white;
  border-radius:12px;
}

.brand-dot {
  color:var(--forest);
  margin-left:-10px;
}

.language-form {
  display:flex;
  align-items:center;
  gap:4px;
  margin-left:auto;
  flex-shrink:0;
}

.language-form select {
  min-height:40px;
  background:transparent;
  border-color:transparent;
  font-size:.8rem;
  width:auto;
  max-width:140px;
}

.language-form button {
  min-height:40px;
  padding:6px 10px;
  font-size:.8rem;
}

.account-chip {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:.8rem;
  min-width:0;
}

.account-name {
  max-width:160px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.avatar {
  width:36px;
  height:36px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:var(--mint);
  color:var(--forest);
  font-weight:650;
}

.site-footer {
  display:flex;
  justify-content:space-between;
  gap:20px;
  border-top:1px solid var(--line);
  padding-block:22px;
  color:var(--muted);
  font-size:.75rem;
}

.site-footer a {
  color:var(--muted);
}

.sidebar {
  position:fixed;
  inset:0 auto 0 0;
  width:246px;
  background:var(--white);
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  padding:28px 19px;
  z-index:20;
}

.sidebar>.brand {
  margin:0 9px 38px;
}

.sidebar nav {
  display:flex;
  flex-direction:column;
  gap:5px;
  overflow-y:auto;
  flex:1;
}

.nav-link {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:46px;
  padding:10px 13px;
  border-radius:10px;
  text-decoration:none;
  color:var(--muted);
  font-size:.82rem;
  font-weight:500;
  line-height:1.35;
}

.nav-link:hover {
  background:var(--paper);
  color:var(--forest);
}

.nav-link[aria-current=page] {
  background:var(--forest);
  color:var(--white);
}

.sidebar-bottom {
  border-top:1px solid var(--line);
  padding:22px 12px 0;
  margin-top:24px;
  font-size:.78rem;
}

.sidebar-bottom a {
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--muted);
}

.app-layout .workspace {
  margin-left:246px;
}

.mobile-nav-toggle {
  display:none;
}

button,.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:46px;
  padding:11px 20px;
  border:1px solid var(--forest);
  border-radius:9px;
  background:var(--forest);
  color:var(--white);
  font-weight:600;
  font-size:.875rem;
  cursor:pointer;
  text-decoration:none;
  line-height:1.35;
  transition:background .15s,color .15s;
}

button:hover,.button:hover {
  background:var(--forest-dark);
  color:var(--white);
}

button:disabled {
  opacity:.55;
  cursor:not-allowed;
}

.button-quiet {
  background:transparent;
  color:var(--muted);
  border-color:transparent;
  padding:9px 11px;
}

.button-quiet:hover {
  background:var(--mint);
  color:var(--forest);
}

.button-wide {
  width:100%;
  justify-content:space-between;
}

input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select,textarea {
  width:100%;
  min-height:46px;
  border:1px solid #7c9182;
  border-radius:9px;
  padding:10px 13px;
  background:var(--white);
  color:var(--ink);
  max-width:100%;
  font-size:.9rem;
}

textarea {
  min-height:100px;
  resize:vertical;
}

input[type=checkbox],input[type=radio] {
  accent-color:var(--forest);
  width:18px;
  height:18px;
  vertical-align:middle;
}

input:disabled,select:disabled {
  background:var(--paper);
  color:var(--muted);
}

label {
  display:block;
  font-weight:550;
  font-size:.82rem;
  margin-bottom:8px;
}

.helptext {
  display:block;
  font-size:.77rem;
  margin-top:7px;
  line-height:1.5;
}

.errorlist {
  color:var(--danger);
  font-size:.84rem;
  background:#fff1ee;
  border:1px solid #edccc5;
  border-radius:9px;
  padding:12px 16px 12px 32px;
}

.notice,[role=status]:not(:empty) {
  padding:16px 20px;
  background:var(--mint);
  border:1px solid #c2dacb;
  border-radius:10px;
  color:var(--forest-dark);
}

main>form:not(.inline-form) {
  background:var(--white);
  padding:28px;
  border:1px solid var(--line);
  border-radius:16px;
  max-width:850px;
  margin-block:20px 32px;
}

main>form>p {
  margin-bottom:21px;
}

main>form[method=get] {
  max-width:none;
  display:flex;
  align-items:flex-end;
  flex-wrap:wrap;
  gap:18px;
}

main>form[method=get]>p {
  flex:1 1 165px;
  margin:0;
}

main>form[method=get] ul.errorlist {
  flex-basis:100%;
}

main>article {
  max-width:840px;
  background:white;
  padding:36px;
  border:1px solid var(--line);
  border-radius:18px;
}

main>article p {
  color:var(--muted);
  line-height:1.8;
}

main>section:not(.hero):not(.error-panel) {
  padding:24px;
  border:1px solid var(--line);
  border-radius:14px;
  background:white;
  margin-block:20px;
}

main>ul {
  background:white;
  border:1px solid var(--line);
  border-radius:14px;
  padding:20px 20px 20px 40px;
}

main>ul li {
  padding:8px;
}

.inline-form {
  display:inline-block;
  margin:4px;
}

.inline-form button {
  font-size:.8rem;
  min-height:40px;
}

.table-scroll {
  max-width:100%;
  overflow-x:auto;
  margin-block:24px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--white);
}

table {
  width:100%;
  border-collapse:collapse;
  font-size:.85rem;
}

th,td {
  padding:17px 20px;
  text-align:left;
  vertical-align:middle;
  border-bottom:1px solid #edf0eb;
}

th {
  background:#f0f4ef;
  color:var(--muted);
  font-size:.73rem;
  font-weight:600;
  white-space:nowrap;
}

tbody tr:last-child td {
  border-bottom:0;
}

tbody tr:hover {
  background:#fbfcf9;
}

td[colspan] {
  padding:50px 24px;
  text-align:center;
  color:var(--muted);
}

td form {
  display:inline-block;
  margin:4px 0 4px 10px;
}

td button {
  min-height:36px;
  padding:7px 12px;
  font-size:.75rem;
}

td a {
  font-size:.8rem;
}

.hero,.error-panel {
  padding:32px;
  background:white;
  border:1px solid var(--line);
  border-radius:18px;
  max-width:800px;
  margin:28px 0;
}

.eyebrow {
  font-size:.76rem;
  font-weight:600;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:12px;
}

.page-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  margin-bottom:30px;
}

.page-heading h1 {
  margin:0;
}

.date-pill {
  white-space:nowrap;
  font-size:.78rem;
  padding:10px 16px;
  border:1px solid var(--line);
  border-radius:30px;
  background:var(--white);
  color:var(--muted);
}

.dashboard-grid {
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(250px,1fr);
  gap:24px;
  align-items:stretch;
}

.attendance-card {
  padding:32px;
  border-radius:20px;
  background:var(--forest);
  color:white;
  position:relative;
  overflow:hidden;
  min-height:360px;
}

.card-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  color:#d1e8dc;
  font-size:.86rem;
}

.card-top p {
  margin:0;
}

.card-symbol {
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  border-radius:50%;
  border:1px solid #64977f;
  color:#e5f1ea;
}

.attendance-status {
  display:flex;
  align-items:center;
  gap:14px;
  margin:26px 0 36px;
}

.attendance-status strong {
  font-size:clamp(2rem,3.5vw,3.2rem);
  font-weight:500;
  letter-spacing:-.045em;
  line-height:1.12;
}

.status-dot {
  width:11px;
  height:11px;
  border-radius:50%;
  background:#c7e7b5;
  box-shadow:0 0 0 7px #ffffff0d;
  flex-shrink:0;
}

.attendance-card>p {
  color:#e3eee7;
  max-width:32rem;
  font-size:.92rem;
  line-height:1.8;
}

.attendance-card label {
  color:#d1e8dc;
}

.attendance-card select {
  border-color:#6b9c83;
  max-width:360px;
}

.attendance-actions {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin:22px 0 0;
}

.attendance-actions button {
  background:white;
  color:var(--forest);
  border-color:white;
  min-width:130px;
}

.attendance-actions button:hover {
  background:var(--mint);
}

.attendance-actions button[data-action=CLOCK_OUT] {
  background:transparent;
  color:white;
  border-color:#8bb8a0;
}

.attendance-card [role=status]:not(:empty) {
  margin-top:24px;
  background:#e5f1ea;
  color:var(--forest-dark);
}

.quick-links {
  display:grid;
  gap:16px;
}

.quick-card {
  display:flex;
  align-items:center;
  gap:16px;
  padding:24px;
  border:1px solid var(--line);
  border-radius:16px;
  background:white;
  text-decoration:none;
  color:var(--ink);
}

.quick-card:hover {
  border-color:#88b59c;
  background:#f0f6ef;
}

.quick-icon {
  width:43px;
  height:43px;
  background:var(--paper);
  border-radius:12px;
  display:grid;
  place-items:center;
  color:var(--forest);
}

.quick-card>span:nth-child(2) {
  flex:1;
  min-width:0;
}

.quick-card small {
  display:block;
  font-size:.74rem;
  margin-bottom:5px;
}

.quick-card strong {
  font-size:1.1rem;
  font-weight:600;
  letter-spacing:-.025em;
}

.quick-card>.icon {
  width:18px;
  color:var(--forest);
}

.mint-card {
  background:var(--mint);
  border-color:#d3e5d9;
}

.mint-card .quick-icon {
  background:#ffffff9c;
}

.public-layout .header-content {
  max-width:1260px;
  margin:auto;
}

.public-layout main.shell {
  width:min(1120px,100% - 80px);
  padding-block:54px;
}

.login-layout {
  display:grid;
  grid-template-columns:1.1fr 1fr;
  min-height:530px;
  border:1px solid var(--line);
  border-radius:24px;
  overflow:hidden;
  background:white;
}

.login-intro {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  padding:46px;
  background:var(--forest);
  color:white;
  position:relative;
  overflow:hidden;
}

.intro-emblem {
  width:86px;
  height:86px;
  border:1px solid #609780;
  border-radius:26px;
  display:grid;
  place-items:center;
  margin-bottom:68px;
}

.intro-emblem .icon {
  width:48px;
  height:48px;
  stroke-width:1;
}

.login-intro .eyebrow {
  color:#bbd9c9;
}

.login-intro h1 {
  font-size:clamp(3rem,5vw,4.6rem);
  font-weight:500;
  margin-bottom:28px;
}

.login-intro h1 span {
  color:#bbd9c9;
}

.intro-rule {
  height:1px;
  width:100%;
  background:#448068;
  margin-top:auto;
}

.intro-bottom {
  display:flex;
  justify-content:space-between;
  width:100%;
  gap:16px;
  font-size:.78rem;
  color:#d1e8dc;
  padding-top:22px;
}

.login-panel {
  align-self:center;
  padding:48px 56px;
}

.login-panel h2 {
  font-size:2rem;
  letter-spacing:-.04em;
  margin:22px 0 30px;
}

.login-panel form>p {
  margin-bottom:22px;
}

.form-emblem {
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  background:var(--mint);
  border-radius:14px;
  color:var(--forest);
}

.reset-link {
  display:block;
  text-align:center;
  font-size:.82rem;
  margin-top:24px;
}

.public-layout main>h1 {
  max-width:700px;
}

.public-layout main>form {
  max-width:600px;
}

@media(min-width:1100px) {
  .sidebar nav:focus {
    outline:none;
  }
}

@media(max-width:1099px) {
  .app-layout .workspace {
    margin-left:0;
  }
  .sidebar {
    position:static;
    width:auto;
    padding:0;
    border-right:0;
    border-bottom:0;
  }
  .sidebar>.brand,.sidebar-bottom {
    display:none;
  }
  .sidebar nav {
    display:none;
    padding:90px 20px 18px;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;
  }
  .nav-open .sidebar nav {
    display:grid;
  }
  .app-layout .site-header {
    position:absolute;
    top:0;
    left:0;
    right:0;
    z-index:25;
  }
  .app-layout .workspace {
    padding-top:88px;
  }
  .nav-open .workspace {
    padding-top:0;
  }
  .mobile-nav-toggle {
    display:inline-flex;
  }
  .header-content {
    gap:16px;
  }
  .account-name {
    display:none;
  }
  .dashboard-grid {
    grid-template-columns:minmax(0,1.2fr) minmax(240px,1fr);
  }
}

@media(max-width:700px) {
  .shell,.public-layout main.shell {
    width:calc(100% - 32px);
  }
  main.shell,.public-layout main.shell {
    padding-block:28px;
  }
  .header-content {
    padding:12px 16px;
    gap:9px;
    min-height:78px;
  }
  .site-header {
    min-height:78px;
  }
  .app-layout .workspace {
    padding-top:78px;
  }
  .nav-open .workspace {
    padding-top:0;
  }
  .header-date {
    display:none;
  }
  .sidebar nav {
    padding-top:84px;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .nav-link {
    font-size:.79rem;
    min-height:48px;
    padding:10px;
  }
  .language-form {
    gap:0;
  }
  .language-form select {
    max-width:120px;
    padding:7px;
    font-size:.75rem;
  }
  .language-form button {
    font-size:.75rem;
    padding:7px;
  }
  .account-chip {
    display:none;
  }
  .public-layout .brand {
    font-size:1rem;
    gap:7px;
  }
  .brand-mark {
    width:30px;
    height:30px;
    border-radius:9px;
  }
  .brand-dot {
    margin-left:-6px;
  }
  .public-layout .language-form select {
    max-width:105px;
  }
  .page-heading {
    align-items:flex-start;
    margin-bottom:24px;
  }
  .page-heading h1 {
    font-size:1.85rem;
  }
  .date-pill {
    display:none;
  }
  .dashboard-grid {
    grid-template-columns:1fr;
    gap:18px;
  }
  .attendance-card {
    padding:26px;
    min-height:300px;
  }
  .attendance-status {
    margin:22px 0 30px;
  }
  .quick-links {
    gap:12px;
  }
  .quick-card {
    padding:20px;
  }
  .quick-card strong {
    font-size:1rem;
  }
  .login-layout {
    display:block;
    border-radius:18px;
    min-height:0;
  }
  .login-intro {
    padding:28px;
    min-height:200px;
  }
  .intro-emblem {
    display:none;
  }
  .login-intro h1 {
    font-size:3rem;
    margin:0 0 22px;
  }
  .login-intro .eyebrow {
    font-size:.7rem;
  }
  .intro-bottom {
    padding-top:15px;
  }
  .login-panel {
    padding:30px 26px;
  }
  .login-panel h2 {
    font-size:1.7rem;
    margin:16px 0 26px;
  }
  .form-emblem {
    display:none;
  }
  main>form:not(.inline-form),main>article,.hero,.error-panel {
    padding:22px;
    border-radius:14px;
  }
  main>form[method=get] {
    gap:16px;
  }
  main>form[method=get]>p {
    flex-basis:100%;
  }
  main>form[method=get]>button {
    width:100%;
  }
  th,td {
    padding:14px 16px;
  }
  .site-footer {
    font-size:.72rem;
  }
  .attendance-actions button {
    flex:1;
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important;
    scroll-behavior:auto!important;
  }
}

@media print {
  .sidebar,.site-header,.site-footer,.skip-link {
    display:none!important;
  }
  .app-layout .workspace {
    margin:0;
    padding:0;
  }
  main.shell {
    width:100%;
    padding:0;
  }
  .table-scroll {
    overflow:visible;
    border:0;
  }
  body {
    background:white;
  }
  button {
    display:none;
  }
}

.sidebar nav {
  scrollbar-width:thin;
  scrollbar-color:#c4d1c8 transparent;
}

.nav-divider {
  height:1px;
  background:var(--line);
  margin:13px;
  flex-shrink:0;
}

.status-pill {
  display:inline-flex;
  align-items:center;
  padding:5px 10px;
  border-radius:20px;
  background:#f0f2ef;
  color:#5e6b62;
  font-size:.74rem;
  white-space:nowrap;
}

.status-pill.is-active {
  background:var(--mint);
  color:var(--forest);
}

.status-pill.is-active:before {
  content:"";
  width:5px;
  height:5px;
  border-radius:50%;
  background:var(--forest);
  margin-right:6px;
}

.button-secondary {
  background:white;
  color:var(--forest);
  border-color:var(--line);
}

.button-secondary:hover {
  background:var(--mint);
  color:var(--forest);
}

.export-actions {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.export-actions a {
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:9px 14px;
  border:1px solid var(--line);
  border-radius:8px;
  background:white;
  text-decoration:none;
  font-size:.8rem;
}

.export-actions a:hover {
  background:var(--mint);
}

@media(max-width:1099px) {
  .nav-divider {
    grid-column:1/-1;
    margin:6px 12px;
  }
  .nav-open .workspace {
    padding-top:0;
  }
}

@media(max-width:700px) {
  .page-heading {
    flex-wrap:wrap;
  }
}

/* Keep dense tables readable on small screens; scroll only their labelled region. */
.table-scroll table { min-width: 640px; }
.table-scroll td form { margin-left: 0; }

/* Workflow helpers retain the Forest visual language. */
.duration-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.duration-hint { display: block; font-size: .68rem; margin-top: 4px; font-weight: 400; }
.employee-filters a { align-self: center; font-size: .82rem; }
#attendance-controls[aria-busy="true"] .attendance-actions button { cursor: wait; }
