:root {
  --nav: #07111f;
  --nav-soft: #14243a;
  --blue: #3264e6;
  --blue-soft: #eaf2ff;
  --green: #44a35b;
  --green-soft: #effbf3;
  --red: #cf3d38;
  --red-soft: #fff4f4;
  --orange: #c87626;
  --orange-soft: #fff9ea;
  --ink: #101828;
  --muted: #66758d;
  --line: #dfe7f2;
  --bg: #f4f7fb;
  --card: #ffffff;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.theme-dark {
  --nav: #020617;
  --nav-soft: #111827;
  --blue: #6d92ff;
  --blue-soft: #111c34;
  --green: #62d17e;
  --green-soft: #102415;
  --red: #ff6b64;
  --red-soft: #2b1212;
  --orange: #f3ad58;
  --orange-soft: #2c1f10;
  --ink: #edf2f7;
  --muted: #a7b3c5;
  --line: #263244;
  --bg: #0b1120;
  --card: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  font-weight: 650;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

button:hover,
button:focus-visible {
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.16);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f4f7fb;
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 18px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 20px 45px rgba(16, 24, 40, 0.12);
}

.login-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.16);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-card p {
  margin: 0;
  color: var(--muted);
}

.login-card input {
  width: 100%;
}

.login-error {
  min-height: 20px;
  color: var(--red) !important;
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.app-shell.locked {
  display: none;
}

.sidebar {
  width: 86px;
  height: 100vh;
  background: var(--nav);
  color: #d7e1ef;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  overflow: hidden;
  transition: width 0.2s ease;
  z-index: 10;
}

.sidebar.expanded {
  width: 236px;
}

.brand {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand img {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  object-position: 22% 50%;
  background: #111827;
}

.sidebar.expanded .brand {
  justify-content: center;
  gap: 0;
  padding: 0;
}

.sidebar.expanded .brand img,
.sidebar.expanded .brand strong,
.sidebar.expanded .brand span {
  display: none;
}

.sidebar.expanded .menu-toggle {
  margin-left: auto;
}

.brand strong {
  display: none;
  color: white;
  font-size: 25px;
}

.brand span {
  display: none;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #94a3b8;
}

.icon-button,
.mobile-menu,
.round-btn {
  border: 1px solid #d8e3f4;
  background: #eef5ff;
  color: var(--blue);
  border-radius: 8px;
  min-width: 40px;
  height: 40px;
}

.menu-toggle {
  margin-left: 0;
  background: #152840;
  color: #cbd5e1;
  border-color: #2c405d;
}

.profile {
  width: 50px;
  height: 58px;
  margin: 32px auto;
  padding: 0;
  background: var(--nav-soft);
  border-radius: var(--radius);
  position: relative;
}

.mini-label {
  display: none;
  color: #8491a5;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.profile strong {
  display: none;
  color: white;
  font-size: 21px;
}

.profile em {
  display: none;
}

.profile::before {
  content: "♙";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #6ade91;
  font-size: 28px;
}

.sidebar.expanded .profile {
  width: auto;
  height: auto;
  margin: 22px 14px;
  padding: 16px;
}

.sidebar.expanded .profile::before {
  display: none;
}

.sidebar.expanded .mini-label,
.sidebar.expanded .profile strong,
.sidebar.expanded .profile em {
  display: block;
}

.sidebar.expanded .profile em {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: 4px;
  background: #4fb7a6;
  color: white;
  text-transform: uppercase;
  font-style: normal;
  font-size: 13px;
}

.profile-settings {
  display: none;
  width: 40px;
  height: 40px;
  min-height: 40px;
  position: absolute;
  right: 14px;
  bottom: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #22324a;
  color: #dbeafe;
  place-items: center;
}

.profile-settings span {
  font-size: 20px;
  line-height: 1;
}

.sidebar.expanded .profile-settings {
  display: grid;
}

.profile-settings:hover,
.profile-settings.active {
  background: var(--blue);
  color: white;
}

.nav-list {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 28px 10px;
  display: grid;
  gap: 16px;
}

.nav-item,
.logout {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  text-align: center;
  font-size: 0;
}

.nav-item.active {
  background: var(--blue);
  color: white;
}

.nav-item span {
  font-size: 24px;
}

.logout span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font-size: 24px;
  line-height: 1;
}

.logout strong {
  display: none;
  font-size: 16px;
  font-weight: 800;
}

.sidebar.expanded .nav-list {
  padding: 18px 14px;
}

.sidebar.expanded .nav-item,
.sidebar.expanded .logout {
  justify-content: flex-start;
  gap: 16px;
  padding: 0 18px;
  font-size: 16px;
}

.sidebar.expanded .logout strong {
  display: inline;
}

.logout {
  margin-top: auto;
  width: calc(100% - 20px);
  margin-left: 10px;
  margin-right: 10px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  min-height: 52px;
  background: rgba(255, 255, 255, 0.05);
  color: #dbeafe;
}

.logout:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.22);
}

.main {
  flex: 1;
  min-width: 0;
}

body.theme-dark .main {
  background: var(--bg);
}

.topbar {
  min-height: 82px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 28px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 27px;
  line-height: 1.1;
}

#pageSubtitle {
  display: none;
}

.date-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #eef4ff;
  border: 1px solid #d8e5fb;
  padding: 8px 14px;
  border-radius: var(--radius);
  color: #4a5870;
  white-space: nowrap;
}

.mobile-menu {
  display: none;
}

.view {
  display: none;
  padding: 30px 34px;
}

.view.active {
  display: block;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

body.theme-dark .login-screen,
body.theme-dark .topbar,
body.theme-dark .toolbar,
body.theme-dark .panel,
body.theme-dark .table-wrap,
body.theme-dark .modal,
body.theme-dark .login-card,
body.theme-dark .task-card,
body.theme-dark .head-card,
body.theme-dark .person-total-card,
body.theme-dark .work-modal,
body.theme-dark .settings-card {
  background: var(--card);
  color: var(--ink);
}

body.theme-dark input,
body.theme-dark select {
  background: #0f172a;
  border-color: var(--line);
  color: var(--ink);
}

body.theme-dark th {
  background: #172033;
}

body.theme-dark td,
body.theme-dark th,
body.theme-dark .head-card p,
body.theme-dark .required-task p {
  color: #cbd5e1;
}

body.theme-dark .date-chip,
body.theme-dark .dashboard-filter,
body.theme-dark .person-pill,
body.theme-dark .done-pill {
  background: #111c34;
  border-color: var(--line);
  color: #dbeafe;
}

body.theme-dark button:hover,
body.theme-dark button:focus-visible,
body.theme-dark .icon-action:hover,
body.theme-dark .icon-edit-task:hover,
body.theme-dark .icon-delete-task:hover {
  background-color: #1f2937;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.36);
}

.activity-intro {
  display: block;
  margin-bottom: 26px;
}

.activity-intro h2 {
  color: #6b7890;
  font-size: 23px;
  margin-bottom: 14px;
}

.activity-intro p {
  font-size: 16px;
}

.activity-toolbar {
  width: 100%;
  margin: 18px 0 0;
  padding: 8px 10px;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 6px;
}

.activity-toolbar label {
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 6px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

.activity-toolbar input,
.activity-toolbar select {
  width: 122px;
  min-width: 122px;
  height: 36px;
  padding: 0 4px;
  border: 0;
  background: transparent;
}

.activity-toolbar select {
  width: 78px;
  min-width: 78px;
  background: linear-gradient(#f7f7f8, #e9e9ea);
}

.activity-toolbar span {
  min-width: 92px;
  color: #56647a;
  white-space: nowrap;
}

.activity-toolbar .soft {
  min-height: 36px;
  padding: 0 7px;
  font-size: 14px;
}

#reportView table {
  min-width: 0;
}

#reportView th,
#reportView td {
  padding: 12px 14px;
}

@media (max-width: 1100px) {
  #activityToday {
    display: none;
  }
}

.dashboard-heading,
.work-page-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.dashboard-heading h2,
.work-page-head h2 {
  color: #6b7890;
  font-size: 23px;
  margin-bottom: 12px;
}

.dashboard-heading p,
.work-page-head p {
  color: var(--ink);
  font-size: 16px;
}

.dashboard-filter {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.03);
  overflow: hidden;
  flex-shrink: 0;
}

.dashboard-filter select {
  min-width: 150px;
  height: 46px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: linear-gradient(#f7f7f8, #e9e9ea);
  color: #5b6678;
}

.dashboard-filter span {
  min-width: 210px;
  padding: 0 24px;
  color: #4d5a6d;
  white-space: nowrap;
}

.dashboard-filter input[type="date"] {
  position: absolute;
  right: 0;
  width: 210px;
  opacity: 0;
}

label {
  display: grid;
  gap: 8px;
  color: #4a5870;
  font-size: 13px;
  text-transform: uppercase;
}

input,
select {
  height: 42px;
  border: 1px solid #cbd6e6;
  border-radius: var(--radius);
  padding: 0 14px;
  background: white;
  color: var(--ink);
  min-width: 180px;
  font-size: 15px;
}

.primary,
.secondary,
.danger,
.soft {
  border: 0;
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 18px;
  font-size: 15px;
}

.primary {
  background: var(--blue);
  color: white;
}

.secondary,
.soft.blue {
  background: #dbe9ff;
  color: #2453d4;
}

.danger,
.soft.red {
  background: #ffe0e0;
  color: #b92020;
}

.purple-action {
  border: 0;
  width: 50px;
  height: 50px;
  min-height: 50px;
  border-radius: 16px;
  padding: 0;
  background: #f0e8ff;
  color: #5c3d96;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.soft.green {
  background: #dcf8e5;
  color: #287747;
}

.soft.yellow {
  background: #fff3cb;
  color: #9b5a16;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.stats-grid.compact {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  min-height: 104px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: white;
  padding: 20px;
  display: grid;
  align-content: space-between;
}

.stat-card span {
  color: #3e4b60;
  font-size: 18px;
}

.stat-card strong {
  font-size: 34px;
  line-height: 1;
}

.stat-card.green {
  color: var(--green);
  background: var(--green-soft);
  border-color: #bff3ce;
}

.stat-card.blue {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #bed8ff;
}

.stat-card.red {
  color: var(--red);
  background: var(--red-soft);
  border-color: #ffc5c0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head h2,
.hourly-intro h2 {
  color: #67758b;
  font-size: 25px;
}

.section-head p,
.hourly-intro p {
  color: var(--ink);
  margin-top: 8px;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 18px;
}

.task-card,
.head-card,
.person-total-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.04);
}

.task-card {
  position: relative;
  min-height: 164px;
  display: grid;
  gap: 10px;
  border: 2px solid #ef4d4d;
  background: #fff8f8;
  color: #84302c;
  overflow: hidden;
  cursor: pointer;
}

.task-card.due {
  border-color: #ef4d4d;
  background: #fff4f4;
  color: #87322f;
}

.task-card.schedule {
  border-color: #f9e4a6;
  background: #fffdf5;
  color: #8a691f;
}

.task-card.schedule .due-ribbon {
  background: #f9e4a6;
  color: #6b5015;
}

.task-card.schedule .task-divider {
  background: #fbf1cd;
}

.task-card.schedule .task-card-top p,
.task-card.schedule .card-actions {
  color: #9a7a2b;
}

.task-card.schedule .done-pill {
  background: #fff7d9;
  color: #7f641c;
}

.task-card.schedule .time-pill {
  background: #fff4c2;
  color: #7a5d12;
}

.task-card.progress {
  border-color: #d8c5ff;
  background: #fbf7ff;
  color: #6241a3;
}

.task-card.progress .due-ribbon {
  background: #dbcafe;
  color: #58339a;
}

.task-card.progress .task-divider {
  background: #eadfff;
}

.task-card.progress .task-card-top p,
.task-card.progress .card-actions {
  color: #7456aa;
}

.task-card.progress .time-pill,
.task-card.progress .person-pill,
.task-card.progress .done-pill {
  background: #f0e8ff;
  color: #5c3d96;
}

.task-card.complete {
  border-color: #52b56c;
  background: #f6fff8;
  color: #2e7042;
}

.task-card.complete .due-ribbon {
  background: #44a35b;
}

.task-card.complete .done-pill {
  background: #dcf8e5;
  color: #287747;
}

.task-card h3,
.head-card h3 {
  margin: 0;
  font-size: 20px;
}

.task-card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 26px;
}

.task-card-top p {
  margin-top: 10px;
  color: #a2615f;
  text-transform: uppercase;
}

.task-badges {
  display: flex;
  align-items: start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.time-pill,
.person-pill,
.done-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 0 12px;
  background: #eef1f7;
  color: #7e302d;
  white-space: nowrap;
}

.time-pill {
  background: #fef3c7;
  color: #854d0e;
  font-weight: 800;
}

.done-pill {
  background: #ffe8e8;
}

.due-ribbon {
  position: absolute;
  right: 0;
  top: 0;
  min-width: 142px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #df4c49;
  color: white;
  text-transform: uppercase;
  font-size: 13px;
  border-bottom-left-radius: 8px;
}

.task-divider {
  height: 1px;
  background: #efdada;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  color: #56647a;
  font-size: 14px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef3fa;
  color: #48566d;
  font-size: 13px;
}

.badge.red {
  background: #ffe5e5;
  color: var(--red);
}

.badge.green {
  background: #e4f8ea;
  color: var(--green);
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #a2615f;
  font-size: 15px;
}

.check-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: white;
  color: #9a4b49;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.12);
}

.check-button:hover {
  background: #fff0f0;
}

.hidden {
  display: none !important;
}

.panel {
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.head-list {
  display: grid;
  gap: 12px;
}

.work-head-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 18px;
}

.head-card {
  min-height: 168px;
  cursor: pointer;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
}

.head-card:hover {
  border-color: #c6d4ea;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
}

.head-card-top {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  column-gap: 14px;
  margin-bottom: 20px;
}

.head-icon {
  width: 24px;
  height: 18px;
  border: 3px solid #98a8bd;
  border-top-width: 7px;
  border-radius: 3px;
  color: #9ba8bc;
  font-size: 0;
  display: inline-block;
}

.icon-action {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.icon-action:hover {
  background-color: white;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.16);
  transform: translateY(-1px);
}

.delete-head {
  color: #f15050;
  background: transparent;
  width: 32px;
  height: 32px;
  position: relative;
  font-size: 0;
  display: inline-block;
  border-radius: 8px;
  padding: 0;
  background-image: url("assets/delete-icon.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
}

.delete-head::before {
  content: none;
}

.delete-head::after {
  content: none;
}

.head-card p {
  color: #69768b;
  font-size: 15px;
  margin: 0 0 10px;
}

.head-card .green-line {
  color: var(--green);
}

.head-card .red-line {
  color: #ef4d4d;
}

.work-detail {
  display: none;
}

.add-head-main {
  min-width: 112px;
  min-height: 52px;
  font-size: 17px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0 0 10px;
  font-size: 17px;
}

.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #eef2f7;
  color: #445166;
}

th {
  background: #eef4ff;
  text-transform: uppercase;
  font-size: 13px;
}

td {
  font-size: 14px;
  font-weight: 700;
}

.person-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0 28px;
}

.person-total-card {
  background: var(--green-soft);
  border-color: #c5f4d1;
}

.person-total-card span {
  display: block;
  color: #7b8493;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.person-total-card strong {
  font-size: 24px;
}

.settings-page {
  display: grid;
  gap: 22px;
  max-width: 760px;
}

.settings-page h2 {
  color: #66758d;
  font-size: 22px;
}

.settings-page p {
  margin-top: 8px;
  color: var(--muted);
}

.settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.04);
}

.settings-card h3 {
  margin: 0;
  font-size: 18px;
}

.theme-toggle {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef4ff;
}

.theme-option {
  min-width: 96px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4a5870;
}

.theme-option.active {
  background: var(--blue);
  color: white;
}

.backup-card {
  align-items: flex-start;
}

.backup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.import-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0 18px;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.import-button:hover,
.import-button:focus-visible {
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.16);
  transform: translateY(-1px);
}

body.theme-dark .settings-page h2 {
  color: #cbd5e1;
}

body.theme-dark .theme-toggle {
  background: #0f172a;
}

body.theme-dark .theme-option {
  color: #cbd5e1;
}

.hourly-intro {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.toolbar.mini {
  margin: 0;
  padding: 8px;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.toolbar.mini label {
  gap: 5px;
  width: 116px;
  font-size: 11px;
}

.toolbar.mini input {
  width: 116px;
  min-width: 116px;
  height: 34px;
  padding: 0 8px;
  font-size: 13px;
}

.toolbar.mini .soft,
.toolbar.mini .primary {
  min-height: 34px;
  padding: 0 9px;
  font-size: 13px;
}

.square {
  width: 34px;
  padding: 0;
}

.hourly-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.hourly-cards .stat-card {
  min-height: 82px;
  padding: 16px;
}

.hourly-cards .stat-card span {
  font-size: 15px;
}

.hourly-cards .stat-card strong {
  font-size: 24px;
}

#hourlyView {
  padding-top: 24px;
}

#hourlyView > h2 {
  font-size: 22px;
  margin: 8px 0 12px;
}

#hourlyView .person-totals {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

#hourlyView .person-total-card {
  padding: 16px;
}

#hourlyView .category-tone-0 {
  background: #eef5ff;
  border-color: #bed8ff;
  color: #2f63d9;
}

#hourlyView .category-tone-1 {
  background: #effaf2;
  border-color: #c4efcf;
  color: #338754;
}

#hourlyView .category-tone-2 {
  background: #fff4f4;
  border-color: #ffc8c8;
  color: #c63d3d;
}

#hourlyView .category-tone-3 {
  background: #fff8e9;
  border-color: #f8dfac;
  color: #bd7321;
}

#hourlyView .category-tone-4 {
  background: #f5f1ff;
  border-color: #dccfff;
  color: #6f49c7;
}

#hourlyView .category-tone-5 {
  background: #eefbfb;
  border-color: #bfecec;
  color: #168080;
}

#hourlyView .person-total-card span {
  font-size: 13px;
  margin-bottom: 8px;
}

#hourlyView .person-total-card strong {
  font-size: 20px;
}

#hourlyView table {
  min-width: 720px;
}

#hourlyView th,
#hourlyView td {
  padding: 11px 14px;
}

#hourlyView th {
  font-size: 12px;
}

#hourlyView td {
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

.modal-backdrop.open {
  display: flex;
}

#taskModal {
  z-index: 80;
}

#progressModal {
  z-index: 90;
}

#calendarPopover {
  z-index: 100;
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: white;
  border-radius: 14px;
  padding: 24px;
  display: grid;
  gap: 14px;
}

#taskModal .modal {
  width: min(760px, 100%);
}

#taskModal .modal-head h2 {
  font-size: 26px;
}

#taskModal label {
  font-size: 14px;
  text-transform: none;
  color: #344054;
  gap: 7px;
}

#taskModal input,
#taskModal select {
  min-height: 44px;
  font-size: 16px;
  border-radius: 8px;
}

.time-picker {
  display: grid;
  grid-template-columns: minmax(58px, 1fr) auto minmax(58px, 1fr) minmax(116px, 1.2fr);
  gap: 8px;
  align-items: center;
}

.time-picker span {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.time-picker input,
.time-picker select {
  min-width: 0;
}

.ampm-toggle {
  min-height: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid #cbd6e6;
  border-radius: 8px;
  background: #eef4ff;
}

.ampm-option {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4a5870;
  font-size: 14px;
  font-weight: 800;
}

.ampm-option.active {
  background: var(--blue);
  color: white;
  box-shadow: 0 6px 14px rgba(50, 100, 230, 0.22);
}

body.theme-dark .ampm-toggle {
  border-color: #334155;
  background: #0f172a;
}

body.theme-dark .ampm-option {
  color: #cbd5e1;
}

.repeat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: end;
}

.check-label {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 44px;
}

.check-label input {
  min-width: 18px;
  width: 18px;
  min-height: 18px !important;
  height: 18px;
}

.muted-field {
  color: #9ba3af !important;
}

.work-modal {
  width: min(980px, calc(100vw - 60px));
  max-height: calc(100vh - 60px);
  overflow: auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.35);
}

.work-modal-hero {
  min-height: 132px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: 30px 36px;
  background: #4168e8;
  color: white;
}

.work-modal-hero span {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 15px;
  color: #dce7ff;
}

.work-modal-hero h2 {
  margin-top: 10px;
  font-size: 32px;
}

.work-close {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 12px;
  background: #3158d6;
  color: white;
  font-size: 48px;
  line-height: 1;
}

.work-modal-body {
  padding: 32px 36px;
}

.work-modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.work-modal-top h2 {
  font-size: 24px;
  color: #344054;
}

.big-add {
  min-height: 52px;
  min-width: 150px;
  font-size: 18px;
  border-radius: 10px;
}

.required-task {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  border: 1px solid #f9e4a6;
  border-radius: 12px;
  background: #fffdf5;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
}

.required-task.schedule {
  border-color: #f9e4a6;
  background: #fffdf5;
}

.required-task.due {
  border-color: #ffd0d0;
  background: #fff4f4;
}

.required-task.complete {
  border-color: #bdecc8;
  background: #f6fff8;
}

.required-task.progress {
  border-color: #d8c5ff;
  background: #fbf7ff;
}

.required-task + .required-task {
  margin-top: 14px;
}

.required-task h3 {
  margin: 0 0 12px;
  color: #8a691f;
  font-size: 22px;
}

.required-task.due h3 {
  color: #a71919;
}

.required-task.complete h3 {
  color: #16834a;
}

.required-task.progress h3 {
  color: #6241a3;
}

.required-task h3 span {
  display: inline-flex;
  margin-left: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff4c2;
  color: #7a5d12;
  font-size: 15px;
}

.required-task.due h3 span {
  background: #ffe0e0;
  color: #bd1717;
}

.required-task.complete h3 span {
  background: #dcf8e5;
  color: #287747;
}

.required-task.progress h3 span {
  background: #f0e8ff;
  color: #5c3d96;
}

.required-task p {
  color: #697284;
  font-size: 16px;
}

.task-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-edit-task,
.icon-delete-task,
.task-log-icon,
.task-progress-return {
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 16px;
  background: #f8fafc;
  color: #8da0ba;
  font-size: 26px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.icon-edit-task:hover,
.icon-delete-task:hover,
.task-log-icon:hover,
.task-progress-return:hover,
.purple-action:hover {
  background-color: white;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.16);
  transform: translateY(-1px);
}

.task-log-icon {
  color: #2454c6;
  font-size: 14px;
  font-weight: 800;
}

.task-progress-return {
  background: #f0e8ff;
  color: #5c3d96;
  font-size: 26px;
  font-weight: 900;
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-delete-task {
  background-image: url("assets/delete-icon.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 26px 26px;
}

.delete-head:hover,
.delete-head:focus,
.icon-delete-task:hover,
.icon-delete-task:focus {
  background-image: url("assets/delete-icon.png");
  background-repeat: no-repeat;
  background-position: center;
}

.delete-head:hover,
.delete-head:focus {
  background-size: 22px 22px;
}

.icon-delete-task:hover,
.icon-delete-task:focus {
  background-size: 26px 26px;
}

.icon-delete {
  border: 0;
  background: transparent;
  color: #f15050;
  font-size: 22px;
}

.progress-task-name {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-weight: 800;
}

.modal textarea {
  min-height: 100px;
  resize: vertical;
  border: 1px solid #cbd6e6;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: white;
}

.progress-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.progress-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.progress-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.progress-item p {
  color: var(--ink);
  white-space: pre-wrap;
}

.small-action {
  min-height: 36px;
  padding: 0 12px;
  align-self: start;
}

.compact-empty {
  padding: 18px;
}

.calendar-popover {
  position: fixed;
  width: 340px;
  z-index: 60;
  display: none;
  padding: 18px;
  border: 1px solid #1f2937;
  background: white;
  box-shadow: 0 20px 46px rgba(16, 24, 40, 0.18);
}

.calendar-popover.open {
  display: block;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.calendar-head button {
  border: 0;
  background: transparent;
  color: #111;
  font-size: 20px;
}

#calendarMonthLabel {
  font-size: 25px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 8px;
}

.calendar-weekdays {
  margin-bottom: 8px;
  color: #111;
  font-size: 20px;
}

.calendar-grid button {
  height: 36px;
  border: 0;
  background: white;
  color: #111;
  font-size: 20px;
}

.calendar-grid button.muted {
  color: #7a7a7a;
}

.calendar-grid button.selected {
  background: #0b72e7;
  color: white;
  box-shadow: inset 0 0 0 5px #0a5fc3;
}

.calendar-grid button.today {
  border: 2px solid #7a7a7a;
  border-radius: 4px;
}

.calendar-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.calendar-actions button {
  border: 0;
  background: transparent;
  color: #0075e8;
  font-size: 20px;
}

/* Consistent app type scale */
body {
  font-size: 14px;
}

h1 {
  font-size: 26px;
}

.dashboard-heading h2,
.work-page-head h2,
.activity-intro h2,
.section-head h2,
.hourly-intro h2,
#hourlyView > h2 {
  font-size: 22px;
}

.dashboard-heading p,
.work-page-head p,
.activity-intro p,
.section-head p,
.hourly-intro p {
  font-size: 15px;
}

button,
input,
select,
td {
  font-size: 14px;
}

label,
th,
.mini-label {
  font-size: 12px;
}

.task-card h3 {
  font-size: 18px;
}

.head-card h3 {
  font-size: 20px;
}

.stat-card span,
.person-total-card span {
  font-size: 14px;
}

.stat-card strong,
.hourly-cards .stat-card strong {
  font-size: 26px;
}

.person-total-card strong,
#hourlyView .person-total-card strong {
  font-size: 20px;
}

#taskModal .modal-head h2,
.modal-head h2 {
  font-size: 24px;
}

#taskModal label {
  font-size: 14px;
}

#taskModal input,
#taskModal select {
  font-size: 15px;
}

.modal.small {
  width: min(440px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  color: var(--ink);
  font-size: 26px;
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-log-button {
  min-height: 38px;
  min-width: 72px;
  border-radius: 8px;
  font-size: 15px;
}

.close {
  border: 0;
  background: transparent;
  font-size: 34px;
  color: #66758d;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid input,
.form-grid select,
.modal input,
.modal select,
.modal textarea {
  width: 100%;
}

.inline-manager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
}

.inline-manager input {
  min-width: 0;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.full {
  width: 100%;
  min-height: 56px;
}

.empty {
  padding: 32px;
  border: 1px dashed #cbd6e6;
  border-radius: var(--radius);
  color: #657286;
  background: white;
  text-align: center;
}

@media (max-width: 1300px) {
  .dashboard-heading {
    display: grid;
  }
}

@media (max-width: 900px) {
  .sidebar:not(.expanded) {
    width: 86px;
  }

  .brand div,
  .profile,
  .nav-item:not(.active),
  .nav-item.active,
  .logout {
    font-size: 0;
    justify-content: center;
    padding: 0;
  }

  .nav-item span {
    font-size: 20px;
  }

  .menu-toggle {
    display: inline-block;
  }

  .sidebar.expanded .brand div,
  .sidebar.expanded .profile,
  .sidebar.expanded .nav-item,
  .sidebar.expanded .logout {
    font-size: inherit;
  }

  .stats-grid,
  .hourly-cards,
  .task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-head-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .work-page-head,
  .activity-intro {
    display: grid;
  }

  .activity-intro {
    display: block;
  }
}

@media (max-width: 760px) {
  .sidebar:not(.expanded) {
    position: fixed;
    left: -280px;
    width: 272px;
    z-index: 30;
    transition: left 0.2s ease;
  }

  .sidebar.expanded {
    position: fixed;
    left: 0;
    width: 272px;
    z-index: 30;
  }

  .brand div,
  .profile,
  .nav-item,
  .logout {
    font-size: inherit;
    justify-content: flex-start;
    padding: 0 24px;
  }

  .profile {
    display: block;
  }

  .mobile-menu {
    display: block;
  }

  .topbar {
    padding: 18px;
    align-items: start;
  }

  .date-chip {
    display: none;
  }

  .view {
    padding: 22px 16px;
  }

  .stats-grid,
  .hourly-cards,
  .task-grid,
  .person-totals,
  .work-head-grid,
  .form-grid,
  .two-cols {
    grid-template-columns: 1fr;
  }

  .dashboard-filter {
    display: grid;
    overflow: visible;
  }

  .dashboard-filter select,
  .dashboard-filter span {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .work-modal {
    width: calc(100vw - 24px);
  }

  .work-modal-hero,
  .work-modal-body {
    padding: 28px;
  }

  .required-task,
  .work-modal-top {
    display: grid;
  }

  .repeat-row {
    grid-template-columns: 1fr;
  }

  .hourly-intro {
    display: grid;
  }

  .inline-manager {
    grid-template-columns: 1fr;
  }

  input,
  select {
    min-width: 0;
  }
}
