@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700;900&family=Raleway:wght@700&display=swap');

:root {
  --green: #A6CE39;
  --green-dark: #92B92C;
  --green-deep: #6E8C1F;
  --brand-gray: #808285;
  --cream: #F4F7E4;
  --cream-soft: #FAFBF2;
  --page: #F6F8FA;
  --ink: #16181D;
  --ink-soft: #5B6472;
  --line: #E4E8EE;
  --card: #FFFFFF;
  --danger: #D64545;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(22, 24, 29, 0.06), 0 8px 24px rgba(22, 24, 29, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--page);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Headings: Montserrat Bold; Black (900) reserved for the main page title */
.serif { font-family: 'Montserrat', sans-serif; font-weight: 700; letter-spacing: -0.3px; }
.page-title { font-weight: 900; letter-spacing: -0.5px; }

/* ---------- Brand mark ---------- */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 46px; width: auto; display: block; }
.brand-text { line-height: 1.05; }
.brand-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 19px;
  color: var(--green);
  letter-spacing: -0.3px;
}
.brand-sub {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 9.5px;
  color: var(--brand-gray);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar .who { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--cream);
  color: var(--green-deep);
  display: grid; place-items: center;
  font-weight: 700; font-size: 17px;
}
.who .name { font-weight: 700; font-size: 16px; }
.who .role { color: var(--ink-soft); font-size: 13px; }
.topbar nav { display: flex; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--cream-soft); border-color: #d5dae2; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--cream-soft); color: var(--ink); }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; padding: 14px; font-size: 16px; }

/* ---------- Layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 28px 64px; }
.wrap-narrow { max-width: 760px; }

.page-title { text-align: center; margin: 34px 0 6px; font-size: 44px; letter-spacing: -.5px; }
.page-sub { text-align: center; color: var(--ink-soft); font-size: 18px; margin: 0 0 34px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  background: var(--cream);
  padding: 26px 30px;
}
.card-head h2 { margin: 0 0 6px; font-size: 24px; }
.card-head p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.card-body { padding: 30px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
label .req { color: var(--danger); }
label .opt { color: var(--ink-soft); font-weight: 400; font-size: 13px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(163, 201, 58, .22);
}
input[readonly] { background: var(--cream-soft); color: var(--ink-soft); }

.suffix-wrap { position: relative; }
.suffix-wrap .suffix {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-soft); font-size: 14px; pointer-events: none;
}
.suffix-wrap input { padding-right: 60px; }

/* Billable toggle */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px;
}
.toggle-row .toggle-label { font-weight: 700; font-size: 15px; }
.toggle-row .toggle-hint { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: #D7DCE3; transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .15s;
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(20px); }

.msg { border-radius: 10px; padding: 12px 16px; font-size: 14px; margin-bottom: 18px; display: none; }
.msg.show { display: block; }
.msg-ok { background: var(--cream); color: var(--green-deep); }
.msg-err { background: #FBEAEA; color: var(--danger); }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 24px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  overflow: hidden;
}
.stat .stat-label { color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.stat .stat-value { font-size: 34px; font-weight: 800; margin-top: 10px; letter-spacing: -.5px; }
.stat .bubble {
  position: absolute; top: -26px; right: -26px;
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px;
  padding-top: 18px; padding-right: 18px;
}
.bubble-blue { background: #E8EEFB; }
.bubble-purple { background: #F3E9FA; }
.bubble-green { background: #E7F3DC; }
.bubble-orange { background: #FCEEE0; }

/* ---------- Filters ---------- */
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.filters-head h3 { margin: 0; font-size: 22px; }
.filter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 820px) { .filter-grid { grid-template-columns: 1fr; } }

/* ---------- Table ---------- */
.table-card { margin-top: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
thead th {
  text-align: left; font-weight: 700; color: var(--ink-soft);
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 14px 18px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--cream-soft); }
.empty { text-align: center; color: var(--ink-soft); padding: 44px 0; }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
}
.pill-yes { background: var(--cream); color: var(--green-deep); }
.pill-no { background: #EEF1F5; color: var(--ink-soft); }
.table-scroll { overflow-x: auto; }

/* ---------- Auth page ---------- */
.auth-page {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 44px 40px;
  text-align: center;
}
.auth-lockup { width: 300px; max-width: 100%; display: block; margin: 6px auto 18px; }
.auth-card h1 { margin: 0 0 6px; font-size: 28px; }
.auth-card .sub { color: var(--ink-soft); margin: 0 0 28px; }
.auth-card form { text-align: left; }
.auth-links {
  display: flex; justify-content: space-between;
  margin-top: 18px; font-size: 14px; color: var(--ink-soft);
}
.auth-links a { color: var(--ink); font-weight: 700; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

.mine-title { margin: 36px 0 14px; font-size: 22px; }

/* ---------- Microsoft sign-in ---------- */
.ms-btn {
  border: 1px solid #8C8C8C;
  background: #fff;
  color: #5E5E5E;
  font-weight: 600;
}
.ms-btn:hover { background: #F3F3F3; border-color: #8C8C8C; }
.auth-note { color: var(--ink-soft); font-size: 13.5px; margin: 20px 0 0; }

/* ---------- Current week strip ---------- */
.current-week { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cw-label { color: var(--ink-soft); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.cw-range { font-size: 24px; margin-top: 4px; font-weight: 500; }
.cw-status { text-align: right; }
.cw-hours { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.week-note { color: var(--green-deep); font-size: 13.5px; margin-top: 8px; min-height: 1em; }

/* File input */
input[type="file"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: var(--cream-soft);
  color: var(--ink-soft);
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
input[type="file"]:hover { border-color: var(--green); }
td a { color: var(--green-deep); font-weight: 600; }
