:root {
  --bg: #f7f1e8;
  --bg-strong: #efe4d4;
  --surface: rgba(255, 252, 247, 0.78);
  --surface-strong: rgba(255, 252, 247, 0.96);
  --surface-border: rgba(37, 32, 27, 0.12);
  --text: #1c1612;
  --muted: #6f6458;
  --accent: #c85d2a;
  --accent-soft: rgba(200, 93, 42, 0.14);
  --accent-2: #1a7f72;
  --accent-3: #f0b24d;
  --danger: #b94934;
  --shadow: 0 28px 80px rgba(58, 40, 18, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(200, 93, 42, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(26, 127, 114, 0.16), transparent 24%),
    linear-gradient(180deg, #fbf6ee 0%, var(--bg) 42%, #f4ecdf 100%);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(28, 22, 18, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 22, 18, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 92%);
}

.page-glow {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.3;
  pointer-events: none;
}

.page-glow-left {
  background: rgba(240, 178, 77, 0.55);
  top: -10rem;
  left: -8rem;
}

.page-glow-right {
  background: rgba(26, 127, 114, 0.4);
  right: -10rem;
  bottom: -10rem;
}

.auth-layout,
.dashboard-shell {
  position: relative;
  z-index: 1;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card,
.panel,
.toolbar,
.notice-card,
.identity-card {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(460px, 100%);
  border-radius: var(--radius-xl);
  padding: 36px;
}

.auth-eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 12px;
}

h1, h2 {
  margin: 0;
}

.auth-card h1,
.hero h1 {
  font-size: clamp(2rem, 3vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.auth-copy,
.hero-copy,
.panel-head span,
.toolbar-title,
.selection-chip span,
.identity-label,
.status-chip,
.field span,
.notice-card span {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid rgba(37, 32, 27, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.88);
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus {
  outline: none;
  border-color: rgba(200, 93, 42, 0.46);
  box-shadow: 0 0 0 4px rgba(200, 93, 42, 0.12);
  transform: translateY(-1px);
}

button {
  font: inherit;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.ghost-button,
.preset-button,
.range-trigger,
.calendar-nav {
  border: 0;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #dd7e38);
  color: #fffaf4;
  padding: 14px 18px;
  font-weight: 800;
  box-shadow: 0 14px 26px rgba(200, 93, 42, 0.28);
}

.secondary-button,
.ghost-button,
.preset-button,
.range-trigger,
.calendar-nav {
  background: rgba(255, 252, 247, 0.88);
  color: var(--text);
  border: 1px solid rgba(37, 32, 27, 0.12);
}

.secondary-button,
.ghost-button {
  padding: 12px 16px;
  font-weight: 700;
}

.preset-button {
  padding: 10px 14px;
  font-weight: 700;
}

.range-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: min(420px, 100%);
  padding: 16px 18px;
  font-weight: 700;
}

.calendar-nav {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.dashboard-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 24px 54px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.hero-copy {
  max-width: 760px;
  font-size: 15px;
  line-height: 1.7;
  margin-top: 16px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.identity-card {
  border-radius: 999px;
  padding: 12px 18px;
  display: grid;
  gap: 2px;
}

.identity-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.identity-logout-button {
  white-space: nowrap;
}

.toolbar {
  position: relative;
  z-index: 20;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.toolbar-main {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  flex: 1;
}

.toolbar-title {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toolbar-copy {
  display: grid;
  gap: 6px;
}

.toolbar-subtitle,
.popover-subtitle,
.calendar-header-copy span,
.range-trigger-copy small,
.range-hint {
  color: var(--muted);
}

.toolbar-subtitle {
  max-width: 420px;
  font-size: 14px;
}

.range-control {
  position: relative;
  z-index: 21;
  isolation: isolate;
}

.range-trigger-copy {
  display: grid;
  gap: 4px;
  text-align: left;
}

.range-trigger-copy strong {
  font-size: 15px;
}

.range-trigger-copy small {
  font-size: 13px;
  font-weight: 600;
}

.range-trigger-icon {
  color: var(--accent);
  font-weight: 800;
  font-size: 18px;
}

.range-popover {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  width: min(860px, calc(100vw - 48px));
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid rgba(37, 32, 27, 0.12);
  box-shadow: var(--shadow);
  padding: 20px;
  z-index: 1000;
}

.hidden {
  display: none !important;
}

.popover-topbar,
.popover-meta,
.popover-actions,
.calendar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.popover-topbar {
  margin-bottom: 18px;
}

.popover-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.popover-subtitle {
  margin-top: 6px;
  font-size: 14px;
}

.preset-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.range-hint {
  min-height: 24px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.range-hint.is-error {
  color: var(--danger);
}

.calendar-frame {
  border-radius: var(--radius-md);
  border: 1px solid rgba(37, 32, 27, 0.08);
  background: rgba(255, 255, 255, 0.48);
  padding: 16px;
}

.calendar-header {
  margin-bottom: 14px;
  align-items: center;
}

.calendar-header-copy {
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
  flex: 1;
}

.calendar-header-copy strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

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

.calendar-panel {
  min-width: 0;
}

.close-popover-button {
  white-space: nowrap;
}

.calendar-title {
  font-weight: 800;
  margin-bottom: 10px;
  text-align: center;
}

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

.calendar-weekdays {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

.calendar-grid {
  margin-bottom: 14px;
}

.calendar-day {
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(37, 32, 27, 0.05);
  background: rgba(255, 255, 255, 0.64);
  font-weight: 700;
}

.calendar-day.is-outside {
  color: rgba(111, 100, 88, 0.42);
}

.calendar-day.is-weekend {
  background: rgba(28, 22, 18, 0.04);
}

.calendar-day.is-today {
  border-color: rgba(26, 127, 114, 0.34);
  box-shadow: inset 0 0 0 1px rgba(26, 127, 114, 0.12);
}

.calendar-day.is-selected,
.calendar-day.is-range-edge {
  background: linear-gradient(135deg, var(--accent), #dd7e38);
  color: white;
  border-color: transparent;
}

.calendar-day.is-in-range {
  background: rgba(200, 93, 42, 0.16);
  border-color: rgba(200, 93, 42, 0.22);
}

.calendar-day.is-disabled {
  color: rgba(111, 100, 88, 0.35);
  background: rgba(28, 22, 18, 0.03);
}

.popover-actions {
  margin-top: 16px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(28, 22, 18, 0.05);
  font-size: 14px;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(26, 127, 114, 0.12);
}

.summary-grid {
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  border-radius: var(--radius-lg);
  padding: 16px;
  background: rgba(255, 252, 247, 0.82);
  border: 1px solid rgba(37, 32, 27, 0.1);
  box-shadow: var(--shadow);
}

.summary-card span {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 800;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
}

.summary-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

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

.panel {
  border-radius: var(--radius-lg);
  padding: 18px;
}

.panel-wide {
  grid-column: span 1;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.chart {
  width: 100%;
  min-height: 340px;
}

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

.task-section {
  display: grid;
  gap: 10px;
}

.task-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.task-section-head h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.task-section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.task-card-grid.task-card-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-card {
  border-radius: 18px;
  border: 1px solid rgba(37, 32, 27, 0.1);
  background: rgba(255, 255, 255, 0.6);
  padding: 12px 14px;
}

.task-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.task-card-head strong {
  font-size: 15px;
  line-height: 1.25;
}

.task-card-head span {
  color: var(--muted);
  font-size: 12px;
}

.task-card-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.task-card-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.task-card-metrics span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(28, 22, 18, 0.05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 108px) minmax(0, 108px) auto minmax(0, 1fr);
  gap: 6px;
  align-items: end;
  margin-bottom: 8px;
}

.task-edit-field {
  display: grid;
  gap: 4px;
}

.task-edit-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.task-edit-input {
  padding: 8px 10px;
}

.task-edit-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-edit-status.is-success {
  color: var(--accent-2);
}

.task-edit-status.is-error {
  color: var(--danger);
}

.task-comment {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.task-time,
.task-clock {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--muted);
}

.task-day-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.task-day-strip.is-empty {
  display: block;
}

.task-day-chip {
  display: grid;
  gap: 3px;
  min-width: 106px;
  padding: 7px 9px;
  border-radius: 12px;
  background: rgba(28, 22, 18, 0.05);
  border: 1px solid rgba(37, 32, 27, 0.08);
}

.task-day-chip strong {
  font-size: 12px;
}

.task-day-chip span {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.task-no-log-note {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(28, 22, 18, 0.05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 32, 27, 0.12);
  background: rgba(255, 252, 247, 0.88);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.task-link-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(58, 40, 18, 0.12);
}

.task-log-list {
  display: grid;
  gap: 8px;
}

.task-log-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.task-log-list-head strong {
  font-size: 13px;
}

.task-log-list-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-log-list-head span {
  color: var(--muted);
  font-size: 12px;
}

.task-log-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-log-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 13px;
  border: 1px solid rgba(37, 32, 27, 0.08);
  background: rgba(28, 22, 18, 0.045);
}

.task-log-chip-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.task-log-chip-copy strong {
  font-size: 12px;
}

.task-log-chip-copy span {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.task-log-chip-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.task-log-icon-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(37, 32, 27, 0.12);
  background: rgba(255, 252, 247, 0.92);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.task-log-icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(58, 40, 18, 0.12);
}

.task-log-icon-button svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-log-popover {
  position: absolute;
  z-index: 80;
}

.task-log-popover-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(37, 32, 27, 0.1);
  background: rgba(255, 250, 244, 0.98);
  box-shadow: 0 22px 38px rgba(29, 21, 14, 0.18);
}

.task-log-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-log-popover-head strong {
  font-size: 14px;
}

.task-log-popover-close {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(37, 32, 27, 0.12);
  background: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.task-log-popover-copy {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.task-log-popover-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.task-log-field {
  display: grid;
  gap: 4px;
}

.task-log-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.task-log-field-comment {
  min-width: 0;
}

.task-log-field-comment-wide {
  grid-column: 1 / -1;
}

.task-log-input {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(37, 32, 27, 0.12);
  background: rgba(255, 252, 247, 0.95);
  color: var(--text);
  font: inherit;
}

.task-log-input:focus {
  outline: none;
  border-color: rgba(26, 127, 114, 0.55);
  box-shadow: 0 0 0 4px rgba(26, 127, 114, 0.12);
}

.task-log-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.task-log-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-log-status.is-success {
  color: var(--accent-2);
}

.task-log-status.is-error {
  color: var(--danger);
}

.alert {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-weight: 700;
}

.alert-error {
  background: rgba(185, 73, 52, 0.1);
  color: var(--danger);
  border: 1px solid rgba(185, 73, 52, 0.18);
}

.notice-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  display: grid;
  gap: 6px;
}

code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92em;
}

@media (max-width: 1120px) {
  .summary-grid,
  .charts-grid {
    grid-template-columns: 1fr 1fr;
  }

  .task-card-grid,
  .task-card-grid.task-card-grid-compact {
    grid-template-columns: 1fr;
  }

  .calendar-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-shell {
    padding: 24px 16px 40px;
  }

  .hero,
  .toolbar,
  .task-card-head,
  .task-section-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-actions,
  .toolbar-main,
  .range-control,
  .range-trigger {
    width: 100%;
  }

  .summary-grid,
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .range-popover {
    left: 0;
    right: 0;
    width: auto;
    padding: 16px;
  }

  .popover-topbar,
  .calendar-header,
  .popover-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-header-copy {
    justify-items: start;
    text-align: left;
  }

  .calendar-nav {
    width: 100%;
    height: auto;
    padding: 12px 16px;
  }

  .task-card-actions {
    justify-items: start;
  }

  .task-edit-grid {
    grid-template-columns: 1fr;
  }

  .task-log-list-head {
    display: grid;
    justify-content: start;
  }

  .task-log-list-tools {
    justify-content: start;
    flex-wrap: wrap;
  }

  .task-log-popover {
    left: 16px !important;
    right: 16px;
    width: auto !important;
  }

  .task-log-popover-grid {
    grid-template-columns: 1fr;
  }
}
