:root {
  color-scheme: light;
  --ink: #1d2733;
  --muted: #78838d;
  --green: #2e7158;
  --green-dark: #245c47;
  --shadow: 0 2px 12px rgba(27, 44, 37, .045);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.brand-logo { display: block; width: 100%; max-height: 65px; object-fit: contain; }

* { box-sizing: border-box; }
body { margin: 0; background: #f7f8f6; color: var(--ink); font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px; flex: 0 0 248px; position: fixed; inset: 0 auto 0 0; z-index: 3;
  display: flex; flex-direction: column; padding: 27px 16px 18px; background: #fff;
  border-right: 1px solid #edf0ed;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px; font-size: 21px; font-weight: 750; letter-spacing: -.8px; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--green); font-size: 21px; font-weight: 800; }
.workspace-label { margin: 46px 12px 12px; color: #a1a9a5; font-size: 10px; font-weight: 750; letter-spacing: 1.1px; }
.primary-nav { display: grid; gap: 5px; }
.nav-link { min-height: 43px; display: flex; align-items: center; gap: 13px; padding: 0 12px; border-radius: 8px; color: #626d70; font-weight: 550; transition: background .16s, color .16s; }
.nav-link:hover { background: #f5f8f5; color: var(--green); }
.nav-link.active { background: #edf5ef; color: var(--green-dark); font-weight: 650; }
.nav-icon { width: 18px; text-align: center; font-size: 18px; line-height: 1; }
.main-content { width: calc(100% - 248px); min-width: 0; margin-left: 248px; padding: 0 42px 44px; }
.topbar { height: 75px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e8ebe8; }
.breadcrumbs { color: #87918c; font-size: 12px; }
.breadcrumbs span { margin: 0 9px; color: #c1c8c3; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.date-chip { color: #77827c; font-size: 12px; }
.icon-button { width: 33px; height: 33px; position: relative; border: 0; border-radius: 50%; background: #fff; color: #64716b; font-size: 17px; }
.icon-button i { width: 6px; height: 6px; position: absolute; top: 6px; right: 6px; border: 1px solid white; border-radius: 50%; background: #e7935c; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 32px 0 23px; }
.eyebrow { margin: 0 0 9px; color: #8c9890; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; color: #202b34; font-size: clamp(25px, 3vw, 31px); font-weight: 660; letter-spacing: -1.15px; }
.wave { color: #db9d63; font-size: 22px; vertical-align: 3px; }
.page-description { margin: 0; color: var(--muted); font-size: 13px; }
.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 650; transition: background .15s, border-color .15s; }
.button-primary { background: var(--green); color: white; box-shadow: 0 2px 4px rgba(46, 113, 88, .14); }
.button-primary:hover { background: var(--green-dark); }
.button-primary span { font-size: 18px; font-weight: 400; }
.button-secondary { border-color: #e2e7e3; background: white; color: #53615a; }
.button-secondary:hover, .button-quiet:hover { background: #f7f9f7; }
.button-small { min-height: 30px; padding: 0 9px; font-size: 10px; }
.button-success { border-color: #dcece1; background: #f0f8f2; color: #347556; }
.button-success:hover { background: #e4f2e8; }
.button-quiet { min-height: 30px; padding: 0 9px; border-color: #e8ece8; background: #fff; color: #727d76; font-size: 10px; }
.full-width { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.metric-card, .panel { border: 1px solid #e9ede9; border-radius: 10px; background: white; box-shadow: var(--shadow); }
.metric-card { min-height: 150px; padding: 18px 19px 15px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-icon { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 9px; font-size: 18px; }
.people-icon { color: #628a70; background: #edf6ef; }
.clock-icon { color: #6684aa; background: #eef3fb; }
.calendar-icon { color: #ad8463; background: #fbf3eb; }
.vacation-icon { color: #b48c50; background: #faf5e8; }
.metric-trend { color: #9aa39d; font-size: 10px; }
.metric-value { margin-top: 11px; font-size: 25px; font-weight: 670; letter-spacing: -.8px; line-height: 1; }
.metric-label { margin-top: 5px; color: #55615b; font-size: 12px; font-weight: 580; }
.metric-footnote { margin-top: 12px; color: #94a099; font-size: 10px; }
.metric-footnote a { color: var(--green); font-weight: 600; }
.dot { width: 7px; height: 7px; display: inline-block; margin-right: 5px; border-radius: 50%; vertical-align: 1px; }
.dot-green { background: #61aa7d; }
.dot-yellow { background: #dfa94c; }
.dot-red { background: #d87972; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .95fr); gap: 16px; margin-top: 17px; }
.panel { overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 20px 16px; }
.panel-heading h2 { margin: 0 0 5px; font-size: 14px; font-weight: 670; letter-spacing: -.18px; }
.panel-heading p { margin: 0; color: #909a94; font-size: 11px; }
.text-link, .row-link { color: var(--green); font-size: 11px; font-weight: 600; white-space: nowrap; }
.text-link:hover, .row-link:hover, .panel-footer-link:hover { color: var(--green-dark); text-decoration: underline; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 15px; border-top: 1px solid #f0f2f0; border-bottom: 1px solid #f0f2f0; background: #fbfcfb; color: #98a19b; font-size: 9px; font-weight: 700; letter-spacing: .55px; white-space: nowrap; }
td { padding: 11px 15px; border-bottom: 1px solid #f1f3f1; color: #69746e; font-size: 11px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.person-cell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.person-cell strong { display: block; color: #303c35; font-size: 11px; font-weight: 620; }
.person-cell small { display: block; margin-top: 3px; color: #98a19b; font-size: 10px; }
.avatar { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 50%; color: #52615a; font-size: 10px; font-weight: 700; }
.top-avatar { width: 30px; height: 30px; flex-basis: 30px; }
.avatar-purple { background: #eee8f5; color: #76658d; }
.avatar-mint { background: #e7f2e9; color: #63846b; }
.avatar-peach { background: #f8ece5; color: #a7775d; }
.avatar-blue { background: #e8eef7; color: #6880a4; }
.avatar-yellow { background: #f7f0dc; color: #a88a4d; }
.avatar-image { object-fit: cover; }
.calendar-heading, .calendar-navigation, .calendar-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.calendar-filter input { min-width: 0; max-width: 100%; }
.team-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekday { padding: 10px; text-align: center; background: #f7f8f6; }
.calendar-day { min-width: 0; min-height: 120px; padding: 8px; border-top: 1px solid #e9ede9; border-right: 1px solid #e9ede9; }
.calendar-day time { display: block; margin-bottom: 8px; font-weight: 650; }
.calendar-outside { background: #f7f8f6; color: var(--muted); }
.calendar-today { box-shadow: inset 0 0 0 2px var(--green); }
.calendar-absence { display: flex; align-items: center; gap: 6px; margin-top: 5px; padding: 5px; background: #edf7f0; border-radius: 5px; overflow-wrap: anywhere; }
.calendar-absence > span { min-width: 0; }
.calendar-absence strong, .calendar-absence small { display: block; font-size: 11px; }
.calendar-empty { font-size: 11px; color: var(--muted); }
.calendar-mobile-weekday { display: none; }
@media (max-width: 1100px) {
  .team-calendar { grid-template-columns: 1fr; }
  .calendar-weekday { display: none; }
  .calendar-day { min-height: 70px; border-right: 0; }
  .calendar-mobile-weekday { display: inline; }
}
.time-cell { color: #47534c; font-variant-numeric: tabular-nums; }
.time-cell span { color: #aab2ad; padding: 0 3px; }
.status-pill { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 20px; font-size: 10px; }
.status-complete, .status-approved { background: #edf7f0; color: #4a8961; }
.status-pending { background: #fcf5e8; color: #a47d37; }
.status-rejected { background: #faeeee; color: #ae6661; }
.count-badge { min-width: 25px; height: 25px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border-radius: 20px; background: #f2f5f2; color: #65736a; font-size: 10px; font-weight: 650; white-space: nowrap; }
.count-badge.large { height: 31px; }
.request-list { padding: 0 19px; }
.request-item { min-height: 59px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #f0f2f0; }
.request-item:last-child { border-bottom: 0; }
.request-copy { min-width: 0; flex: 1; }
.request-copy strong { display: block; overflow: hidden; color: #344039; font-size: 11px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.request-copy span { display: block; margin-top: 4px; color: #929c95; font-size: 10px; white-space: nowrap; }
.request-days { color: #47544c; font-size: 11px; font-weight: 650; white-space: nowrap; }
.request-days small { color: #9aa39d; font-size: 9px; font-weight: 450; }
.panel-footer-link { display: block; margin-top: 6px; padding: 12px 20px 15px; border-top: 1px solid #f1f3f1; color: var(--green); font-size: 10px; font-weight: 650; }
.upcoming-panel { margin-top: 16px; }
.upcoming-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 20px 12px; }
.upcoming-item { min-height: 66px; display: flex; align-items: center; gap: 11px; border-top: 1px solid #f0f2f0; }
.calendar-date { width: 37px; height: 40px; flex: 0 0 37px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #edf0ed; border-radius: 7px; background: #fbfcfb; }
.calendar-date strong { font-size: 14px; line-height: 1.1; }
.calendar-date span { margin-top: 3px; color: #929c95; font-size: 8px; }
.upcoming-item > div:nth-child(2) { min-width: 0; flex: 1; }
.upcoming-item > div:nth-child(2) strong { display: block; color: #344039; font-size: 11px; }
.upcoming-item > div:nth-child(2) span { display: block; overflow: hidden; margin-top: 4px; color: #929c95; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-duration { color: #758078; font-size: 10px; white-space: nowrap; }
.empty-state { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; color: #96a099; text-align: center; }
.empty-state > span { margin-bottom: 9px; color: #9cb1a3; font-size: 24px; }
.empty-state strong { color: #58655d; font-size: 12px; }
.empty-state p { margin: 5px 0 0; font-size: 11px; }
.empty-state.compact { min-height: 123px; }

.filter-tabs { display: flex; gap: 18px; padding: 0 20px; border-bottom: 1px solid #eff2ef; }
.filter-tab { padding: 0 1px 12px; border-bottom: 2px solid transparent; color: #8b9690; font-size: 11px; }
.filter-tab.selected { border-color: var(--green); color: var(--green); font-weight: 650; }
.inline-actions { display: flex; gap: 6px; }
.search-placeholder { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #edf0ed; border-radius: 6px; color: #9aa39d; font-size: 16px; }
.search-placeholder span { font-size: 10px; }
.form-panel { max-width: 760px; padding: 23px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-full { grid-column: 1 / -1; }
.field label { color: #546159; font-size: 11px; font-weight: 620; }
.field input, .field select, .field textarea { width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid #e2e8e3; border-radius: 6px; outline: none; background: white; color: #37443c; font-size: 12px; }
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #84ad94; box-shadow: 0 0 0 3px rgba(75, 135, 101, .1); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 3px; }
.form-errors { grid-column: 1 / -1; padding: 12px 14px; border: 1px solid #f1d5d1; border-radius: 7px; background: #fff8f7; color: #9d5149; font-size: 11px; }
.form-errors ul { margin: 6px 0 0; padding-left: 17px; }
.attendance-layout { display: grid; grid-template-columns: minmax(270px, .72fr) minmax(0, 1.8fr); gap: 16px; align-items: start; }
.stacked-form { display: grid; gap: 14px; padding: 0 20px 20px; }
.stacked-form .form-errors { grid-column: 1; }
.muted { color: #9ba49e; font-size: 10px; }
.flash { margin: 16px 0 -7px; padding: 11px 14px; border-radius: 7px; font-size: 12px; }
.flash-notice { border: 1px solid #d5e9db; background: #eff8f1; color: #397052; }
.flash-alert { border: 1px solid #f0d7d2; background: #fff5f3; color: #9a5149; }
.logout-button { min-height: 44px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: auto; min-height: auto; }
.auth-main { width: min(100% - 32px, 430px); margin: 10vh auto 0; }
.login-panel { padding: 30px; }
.login-brand { padding: 0; }
.login-heading { margin: 37px 0 23px; }
.login-heading h1 { margin-bottom: 7px; }
.login-panel .stacked-form { padding: 0; }
.login-panel .flash { margin: 0 0 15px; }

@media (max-width: 1100px) {
  .main-content { padding-right: 25px; padding-left: 25px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.3fr) minmax(285px, .9fr); }
}
@media (max-width: 850px) {
  .sidebar { width: 70px; flex-basis: 70px; padding-right: 10px; padding-left: 10px; }
  .brand { justify-content: center; padding: 0; }
  .brand > span:last-child, .workspace-label, .nav-link > span:last-child { display: none; }
  .primary-nav { margin-top: 40px; }
  .nav-link { justify-content: center; padding: 0; }
  .nav-icon { font-size: 20px; }
  .main-content { width: calc(100% - 70px); margin-left: 70px; }
  .dashboard-grid, .attendance-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .main-content { padding: 0 15px 28px; }
  .topbar { height: 62px; }
  .date-chip { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; padding: 25px 0 18px; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 136px; padding: 14px; }
  .metric-value { font-size: 23px; }
  .panel-heading { padding-right: 14px; padding-left: 14px; }
  .upcoming-grid { grid-template-columns: 1fr; padding: 0 14px 10px; }
  .filter-tabs { gap: 13px; overflow-x: auto; padding: 0 14px; }
  .filter-tab { white-space: nowrap; }
  .form-panel { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: 1; }
  .inline-actions { flex-direction: column; }
  .login-panel { padding: 22px; }
}

.page-heading > *, .panel-heading > *, .field, .person-cell > div,
.metric-card, .panel, .topbar > *, .upcoming-item, .request-item {
  min-width: 0;
}
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field input, .field select, .field textarea { min-width: 0; max-width: 100%; }
.page-heading, .panel-heading, .form-actions { flex-wrap: wrap; }
.breadcrumbs, .page-heading, .panel-heading, .form-errors, .flash { overflow-wrap: anywhere; }
.button { max-width: 100%; white-space: normal; text-align: center; }
.responsive-table { table-layout: fixed; }
.responsive-table th, .responsive-table td { white-space: normal; overflow-wrap: anywhere; }
.responsive-table .person-cell { min-width: 0; }
.responsive-table .inline-actions { flex-wrap: wrap; }
.responsive-table .inline-actions form { max-width: 100%; }

@media (max-width: 1100px) {
  .responsive-table, .responsive-table tbody { display: block; width: 100%; }
  /* Keep column headers available to assistive technology in the card layout. */
  .responsive-table thead {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .responsive-table tr {
    display: block; margin: 12px; padding: 8px;
    border: 1px solid #e9ede9; border-radius: 8px;
  }
  .responsive-table td {
    display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 12px; align-items: start; padding: 9px 5px;
    white-space: normal; overflow-wrap: anywhere;
  }
  .responsive-table td::before {
    content: attr(data-label); color: #78838d; font-weight: 600;
  }
  .responsive-table td > * { min-width: 0; max-width: 100%; }
  .table-wrap:has(.responsive-table) { overflow: visible; }
  .responsive-table .text-link, .responsive-table .row-link { white-space: normal; }
}

@media (max-width: 850px) {
  .request-copy strong, .request-copy span, .upcoming-item > div:nth-child(2) span {
    white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere;
  }
  .request-item, .upcoming-item { flex-wrap: wrap; padding-block: 10px; }
  .request-days, .upcoming-duration { white-space: normal; }
  .metric-top { flex-wrap: wrap; gap: 6px; }
  .metric-label, .metric-footnote { overflow-wrap: anywhere; }
  .filter-tabs { flex-wrap: wrap; overflow: visible; row-gap: 8px; }
}

@media (max-width: 600px) {
  .app-shell { display: block; }
  .sidebar {
    position: static; width: 100%; padding: 14px 15px;
    border-right: 0; border-bottom: 1px solid #edf0ed;
  }
  .brand { justify-content: flex-start; }
  .brand-logo { width: auto; max-width: 100%; max-height: 48px; }
  .primary-nav { margin-top: 15px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .nav-link { justify-content: flex-start; gap: 8px; padding: 8px; }
  .nav-link > span:last-child { display: inline; overflow-wrap: anywhere; }
  .nav-icon { flex: 0 0 18px; }
  .main-content { width: 100%; margin-left: 0; }
  .topbar { gap: 12px; height: auto; min-height: 62px; padding-block: 10px; }
  .topbar-actions { flex-shrink: 0; gap: 8px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .button { width: 100%; }
  .text-link, .row-link, .filter-tab { white-space: normal; overflow-wrap: anywhere; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .inline-actions { flex-direction: column; align-items: stretch; }
  .inline-actions .button { width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-main { margin-top: 24px; }
}

@media (max-width: 360px) {
  .metric-grid { grid-template-columns: minmax(0, 1fr); }
  .responsive-table td { grid-template-columns: minmax(0, 1fr); gap: 5px; }
}
