* { box-sizing: border-box; }

.manage-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.manage-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.manage-list li:last-child {
  border-bottom: none;
}

.manage-list .person-name {
  flex-shrink: 0;
  min-width: 70px;
}

.manage-list .person-email-input {
  flex: 1;
  min-width: 0;
  max-width: 220px;
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
}

.manage-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.manage-actions button {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

@font-face {
  font-family: "TASA Explorer";
  src: url("../fonts/TASAExplorer-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TASA Explorer";
  src: url("../fonts/TASAExplorer-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: "TASA Explorer", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f6f7f9;
  color: #1c1e21;
}

header {
  background: #1c1e21;
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

header h1 {
  font-size: 1.1rem;
  margin: 0;
}

nav#nav {
  display: flex;
  gap: 1rem;
}

nav#nav a {
  color: #cfd3d8;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}

nav#nav a:hover {
  color: #fff;
}

nav#nav a.active {
  color: #fff;
  border-bottom-color: #4f8cff;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

form.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: #555;
  gap: 0.25rem;
}

input, select, textarea {
  padding: 0.5rem 0.6rem;
  border: 1px solid #d5d8dc;
  border-radius: 6px;
  font-size: 0.95rem;
  min-width: 0;
}

button {
  background: #4f8cff;
  color: #fff;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

button:hover {
  background: #3d78e8;
}

button.secondary {
  background: #eceff3;
  color: #1c1e21;
}

button.secondary:hover {
  background: #dfe3e8;
}

button.danger {
  background: #fdeceb;
  color: #c0392b;
}

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

th, td {
  text-align: left;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid #eee;
}

th {
  color: #666;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.muted {
  color: #777;
  font-size: 0.85rem;
}

.owed-positive { color: #1b8a3f; font-weight: 600; }
.owed-zero { color: #777; }

.stat {
  text-align: center;
}

.stat .value {
  font-size: 1.6rem;
  font-weight: 700;
}

.stat .label {
  color: #777;
  font-size: 0.85rem;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.bar-row .bar-label {
  width: 140px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  background: #eef0f3;
  border-radius: 4px;
  height: 14px;
  overflow: hidden;
}

.bar-fill {
  background: #4f8cff;
  height: 100%;
}

.bar-value {
  width: 90px;
  text-align: right;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.error-banner {
  background: #fdeceb;
  color: #c0392b;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: #1c1e21;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.hours-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid #eee;
  border-radius: 8px;
}

.hours-table {
  border-collapse: separate;
  border-spacing: 0;
}

.hours-table th,
.hours-table td {
  border-bottom: 1px solid #eee;
  border-right: 2px solid #f2f2f2;
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 140px;
  max-width: 140px;
  border-right: 2px solid #eee;
}

thead .sticky-col {
  z-index: 3;
}

.date-th,
.date-col {
  width: 76px;
  min-width: 76px;
  max-width: 76px;
  text-align: center;
  padding: 0.3rem 0.15rem;
}

.date-th {
  font-weight: 400;
}

.date-th-day {
  font-size: 0.65rem;
  color: #999;
  text-transform: uppercase;
}

.date-th-num {
  font-size: 0.8rem;
  color: #555;
  font-weight: 600;
}

.date-th.weekend,
.date-col.weekend {
  background: #f8f9fb;
}

.date-th.today {
  background: #4f8cff;
  border-radius: 8px;
}

.date-th.today .date-th-day,
.date-th.today .date-th-num {
  color: #fff;
}

.date-th.week-start,
.date-col.week-start {
  border-left: 2px solid #dde1e6;
}

.hcell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hcell-btn {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1;
  background: #eef0f3;
  color: #555;
}

.hcell-btn:hover {
  background: #e2e5ea;
  color: #1c1e21;
}

.hcell-input {
  width: 34px;
  text-align: center;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.9rem;
  padding: 0.15rem 0;
}

.hcell-input::-webkit-outer-spin-button,
.hcell-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.hcell-input {
  -moz-appearance: textfield;
}

.hcell-input:focus {
  border-color: #4f8cff;
  background: #fff;
  border-radius: 4px;
}

.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.month-label {
  font-weight: 600;
  font-size: 1.05rem;
}

.payslip-table td:nth-child(2),
.payslip-table td:nth-child(3),
.payslip-table th:nth-child(2),
.payslip-table th:nth-child(3) {
  text-align: right;
}

.payslip-table td:nth-child(3) {
  color: #777;
  width: 70px;
}

.payslip-subtotal td {
  font-weight: 700;
  border-top: 2px solid #ddd;
}

.payslip-split-start td {
  border-top: 2px solid #ddd;
}

.pie-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.pie {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pie-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 180px;
}

.pie-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.9rem;
}

.pie-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.pie-label {
  flex: 1;
}

.pie-pct {
  font-weight: 600;
  color: #555;
}

.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.confirm-box {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.confirm-box p {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: #1c1e21;
  line-height: 1.4;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.auth-gate {
  display: none;
  position: fixed;
  inset: 0;
  background: #f6f7f9;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.auth-box {
  background: #fff;
  border-radius: 10px;
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.auth-box h2 {
  margin-top: 0;
}

.auth-box form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.auth-box button {
  width: 100%;
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #cfd3d8;
}

.account-bar button {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}
