﻿@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #f4f6fb;
  --bg-soft: #eef1f7;
  --panel: rgba(255, 255, 255, 0.85);
  --panel-strong: rgba(255, 255, 255, 0.95);
  --text: #1c2433;
  --muted: #5f6b7c;
  --accent: #14b88b;
  --accent-strong: #0e8f6d;
  --warning: #f2a94b;
  --danger: #ee5e5e;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #ffffff 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.22;
  z-index: 0;
}

.orb-1 {
  background: radial-gradient(circle, #d7f6ee 0%, rgba(215, 246, 238, 0) 70%);
  top: -160px;
  left: -80px;
}

.orb-2 {
  background: radial-gradient(circle, #ffe6c2 0%, rgba(255, 230, 194, 0) 70%);
  right: -140px;
  bottom: -160px;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.15;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.hero-copy {
  max-width: 420px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 11px;
  color: var(--accent);
  margin: 0 0 6px;
}

h1 {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  margin: 0 0 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(20, 184, 139, 0.12);
  color: var(--accent);
}

.brand-icon svg {
  width: 18px;
  height: 18px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 460px;
  font-size: 0.95rem;
}

.top-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.count-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 0;
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.count-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.control-separator {
  width: 1px;
  height: 28px;
  background: rgba(15, 23, 42, 0.12);
  border-radius: 999px;
}

.settings-btn {
  width: 34px;
  height: 34px;
}

.hero-label {
  color: var(--muted);
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 184, 139, 0.16);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.75rem;
}

.pill.ghost {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.pill.pro {
  background: rgba(20, 184, 139, 0.16);
  color: var(--accent-strong);
  display: none;
}

.create-inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow);
}

input,
textarea {
  font-family: inherit;
}

#create-name,
#create-desc,
#notify-phone,
#notify-interval,
#free-hours-limit,
#modal-input,
#modal-input-secondary,
#modal-input-tertiary,
#report-month {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 220px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#create-desc {
  min-width: 220px;
}

#create-desc {
  min-height: 44px;
  resize: vertical;
}

#modal-input-secondary {
  min-height: 96px;
  resize: vertical;
}

#create-name:focus,
#create-desc:focus,
#notify-phone:focus,
#notify-interval:focus,
#free-hours-limit:focus,
#modal-input:focus,
#modal-input-secondary:focus,
#modal-input-tertiary:focus,
#report-month:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 208, 162, 0.2);
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn:disabled:hover {
  transform: none;
}

.btn.icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.icon svg {
  width: 18px;
  height: 18px;
}

.btn.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn.with-icon svg {
  width: 16px;
  height: 16px;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(20, 184, 139, 0.22);
}

.btn.ghost {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.btn.warn {
  background: rgba(242, 169, 75, 0.22);
  color: #8a5a12;
}

.btn.danger {
  background: rgba(238, 94, 94, 0.2);
  color: #8b2b2b;
}

.btn.is-loading {
  position: relative;
  padding-right: 38px;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: buttonSpin 0.7s linear infinite;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-help {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.settings-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.settings-form input {
  min-width: 200px;
  width: 100%;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text);
}

.toggle input {
  display: none;
}

.toggle-slider {
  width: 46px;
  height: 26px;
  background: rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.toggle input:checked + .toggle-slider {
  background: rgba(14, 143, 109, 0.95);
  box-shadow: inset 0 0 0 1px rgba(8, 92, 71, 0.8);
}

.toggle input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

.toggle-label {
  color: var(--muted);
}

.section-header h2 {
  margin: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.report-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report-month-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.report-feedback {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  max-width: 0;
  padding: 0;
  border-radius: 999px;
  border: 0 solid rgba(20, 184, 139, 0.18);
  background: rgba(20, 184, 139, 0.08);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-50%) translateX(8px);
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease, max-width 0.2s ease,
    padding 0.2s ease, border-width 0.2s ease;
}

.report-feedback::before {
  content: "OK";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(20, 184, 139, 0.16);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.report-feedback.show {
  min-height: 40px;
  max-width: 320px;
  padding: 0 14px;
  border-width: 1px;
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

#report-month.month-updated {
  border-color: rgba(20, 184, 139, 0.52);
  box-shadow: 0 0 0 4px rgba(20, 184, 139, 0.16);
  background: rgba(232, 252, 245, 0.95);
  animation: monthUpdatedGlow 0.6s ease;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.summary-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}

.summary-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.summary-top h3 {
  margin: 0;
  font-size: 1rem;
}

.summary-status {
  font-size: 0.78rem;
  color: var(--muted);
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  font-size: 0.86rem;
}

.summary-metrics strong {
  color: var(--text);
}

.progress {
  width: 100%;
  height: 24px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.progress-fill.warn {
  background: #f2a94b;
}

.progress-fill.danger {
  background: #ee5e5e;
}

.progress-text {
  position: relative;
  z-index: 1;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
}

.contract-edit {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.contract-edit input {
  min-width: 0;
  flex: 1;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.contract-edit input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 208, 162, 0.2);
}

.muted {
  color: var(--muted);
}

.card-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tracker-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) 160px auto;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: rise 0.5s ease forwards;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease,
    background 0.2s ease;
}

.tracker-card.running {
  border-left: 5px solid var(--accent);
  background: linear-gradient(
      90deg,
      rgba(20, 184, 139, 0.12),
      rgba(255, 255, 255, 0)
    ),
    var(--panel);
  animation: pulseGlow 2.4s ease-in-out infinite;
}

.tracker-card.running:hover {
  border-left-color: var(--accent-strong);
}

.tracker-card.running .time-display {
  color: var(--accent-strong);
}

@keyframes pulseGlow {
  0% {
    box-shadow: var(--shadow);
    background: linear-gradient(
        90deg,
        rgba(20, 184, 139, 0.12),
        rgba(255, 255, 255, 0)
      ),
      var(--panel);
  }
  50% {
    box-shadow: 0 22px 50px rgba(20, 184, 139, 0.2);
    background: linear-gradient(
        90deg,
        rgba(20, 184, 139, 0.2),
        rgba(255, 255, 255, 0)
      ),
      var(--panel-strong);
  }
  100% {
    box-shadow: var(--shadow);
    background: linear-gradient(
        90deg,
        rgba(20, 184, 139, 0.12),
        rgba(255, 255, 255, 0)
      ),
      var(--panel);
  }
}

@keyframes buttonSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.tracker-card:hover {
  border-color: rgba(20, 184, 139, 0.35);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  background: var(--panel-strong);
  transform: translateY(-1px);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes monthUpdatedGlow {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
  100% {
    transform: translateY(0);
  }
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-wrap h3 {
  margin: 0;
  font-size: 1.1rem;
}

.title-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tracker-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.tracker-client {
  margin: 0;
  font-size: 0.82rem;
  color: var(--accent-strong);
}

.status-dot {
  width: 10px;
  height: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.running {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(20, 184, 139, 0.6);
  animation: pulse 1.4s infinite;
}

.status-dot.paused {
  background: #9aa4b2;
}

.status-dot.archived {
  background: #f2a94b;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.4);
  }
  100% {
    transform: scale(1);
  }
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  align-self: flex-start;
}

.status-pill.running {
  background: rgba(20, 184, 139, 0.18);
  color: var(--accent);
}

.status-pill.paused {
  background: rgba(15, 23, 42, 0.05);
  color: var(--muted);
}

.status-pill.archived {
  background: rgba(242, 169, 75, 0.2);
  color: #8a5a12;
}

.time-display {
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  justify-self: start;
}

.time-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-self: start;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-self: end;
}

.empty {
  text-align: center;
  padding: 24px;
  border: 1px dashed rgba(15, 23, 42, 0.2);
  border-radius: 18px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(21, 30, 46, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal.open {
  display: flex;
}

.modal-card {
  width: min(420px, 90vw);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}

.modal-card h3 {
  margin: 0;
}

.modal-card p {
  margin: 0;
}

.modal-preview {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  display: none;
}

.plan-card {
  width: min(480px, 92vw);
}

.plan-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 16px;
}

.plan-price {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-weight: 600;
}

.plan-price strong {
  font-size: 1.1rem;
  color: var(--accent-strong);
}

.plan-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  font-size: 0.9rem;
}

.plan-metrics span {
  display: block;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#modal-secondary {
  display: none;
}

#modal-tertiary {
  display: none;
}

.modal-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 12;
}

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

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .top-controls {
    width: 100%;
    align-items: stretch;
  }

  .count-group {
    width: 100%;
    justify-content: space-between;
  }

  .report-controls {
    width: 100%;
  }

  .report-month-wrap {
    width: 100%;
  }

  #report-month {
    flex: 1;
    width: 100%;
    min-width: 0;
  }

  .report-feedback {
    right: auto;
    left: 0;
    top: calc(100% + 8px);
    transform: translateY(-4px);
  }

  .report-feedback.show {
    max-width: min(100%, 320px);
    min-height: 36px;
    transform: translateY(0);
  }

  .create-inline {
    width: 100%;
  }

  #create-name {
    flex: 1;
    min-width: 0;
  }

  #create-desc {
    flex: 1;
    min-width: 0;
  }

  .settings-form {
    flex-direction: column;
    align-items: stretch;
  }

  .toggle {
    justify-content: space-between;
  }

  .tracker-card {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .time-display {
    justify-self: start;
  }

  .actions {
    justify-self: start;
  }
}
