* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: Poppins, "Segoe UI", sans-serif;
  color: #1c2b33;
  background: #f3f6f4;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #00af7a;
  outline-offset: 2px;
}

a { color: #0d6b48; }

.page-header,
.summary,
.controls,
.hour-panel,
#grids,
.status {
  width: min(1440px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.page-header {
  width: 100%;
  padding: 18px 16px 16px;
  background: #fff;
  border-top: 4px solid #00af7a;
  border-bottom: 1px solid #e2e8e6;
}

.page-header > * {
  width: min(1440px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.eyebrow {
  margin: 0;
  color: #0d6b48;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.2;
}

.demo-banner {
  margin: 10px auto 0;
  padding: 8px 12px;
  background: #fff6e8;
  border: 1px solid #f0d7a8;
  border-radius: 8px;
}

.toolbar, .pager, .tag-add, .hour-figures, .summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.toolbar { margin-top: 14px; }

label { font-size: 14px; }

select, input[type="text"], input[type="number"] {
  margin-left: 6px;
  padding: 6px 8px;
  border: 1px solid #c9d5d0;
  border-radius: 8px;
  background: #fff;
  color: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 7px 12px;
  background: #00af7a;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  background: #c5d4ce;
  cursor: default;
}

.pager button { background: #1c2b33; }

.summary {
  margin-top: 16px;
  margin-bottom: 8px;
}

.summary article {
  flex: 1 1 140px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e2e8e6;
  border-radius: 12px;
}

.summary h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #5d6f68;
}

.summary p {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
}

.controls {
  margin-top: 8px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e2e8e6;
  border-radius: 12px;
}

fieldset {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  font-weight: 700;
}

.toggle-list, .tag-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.toggle-list label, .tag-rows li {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  background: #f3f6f4;
  border-radius: 999px;
}

.tag-rows button {
  padding: 2px 8px;
  background: transparent;
  color: #0d6b48;
}

.legend, .status, .hour-panel p {
  color: #3e5149;
  font-size: 14px;
  line-height: 1.45;
}

.hour-panel {
  margin-top: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid #d7ebe3;
  border-radius: 12px;
}

.hour-panel h2 { margin: 0 0 8px; font-size: 18px; }

#hour-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
}

#hour-note { min-width: min(100%, 240px); }

.day-block { margin-top: 18px; }

.day-block h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.table-scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #d5e2dc;
  border-radius: 12px;
}

.grid {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  font-size: 13px;
}

.grid th, .grid td {
  padding: 6px 8px;
  border-bottom: 1px solid #e6efeb;
  border-right: 1px solid #eef3f1;
  white-space: nowrap;
  text-align: right;
  background: #fff;
}

.grid th:first-child,
.grid td:first-child,
.grid thead th {
  text-align: left;
}

.grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0d6b48;
  color: #fff;
  font-weight: 600;
}

.grid tbody th:first-child,
.grid thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 148px;
  text-align: left;
}

.grid thead th:first-child { z-index: 3; }

.grid tbody tr.is-alt th,
.grid tbody tr.is-alt td { background: #f7faf8; }

.grid tbody td.is-selected,
.grid tbody th.is-selected,
.grid thead th.is-selected {
  background: #d9f3e8;
  color: #12382c;
}

.grid tbody td.is-hover,
.grid tbody th.is-hover { background: #f3fbf7; }

.grid tbody tr.is-running td,
.grid tbody tr.is-running th {
  color: #0d6b48;
  font-weight: 700;
}

.grid tbody tr.is-hour-total td,
.grid tbody tr.is-hour-total th { font-weight: 700; }

.grid .day-total {
  background: #eef6f2;
  font-weight: 700;
}

.grid thead th.day-total { background: #084e34; }

.grid .is-now { box-shadow: inset 0 -3px 0 #00af7a; }

.empty-note {
  padding: 16px;
  background: #fff;
  border: 1px solid #e2e8e6;
  border-radius: 12px;
}

.status { margin: 16px auto 28px; }

@media (max-width: 720px) {
  h1 { font-size: 22px; }
  .summary p { font-size: 18px; }
  .page-header > *,
  .summary,
  .controls,
  .hour-panel,
  #grids,
  .status {
    width: min(1440px, calc(100% - 20px));
  }
}
