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

:root {

  --bg:
    linear-gradient(
      135deg,
      #f8fbff 0%,
      #eef4ff 45%,
      #f8fafc 100%
    );

  --card:
    rgba(255,255,255,0.82);

  --card-solid:
    #ffffff;

  --border:
    rgba(15,23,42,0.06);

  --text:
    #0f172a;

  --muted:
    #64748b;

  --blue:
    #2563eb;

  --cyan:
    #06b6d4;

  --green:
    #10b981;

  --danger:
    #ef4444;

  --shadow:
    0 20px 50px rgba(15,23,42,0.08);

}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font-family: 'Inter', sans-serif;
}

/* SCROLLBAR */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {

  background:
    linear-gradient(
      135deg,
      #cbd5e1,
      #94a3b8
    );

  border-radius: 999px;
}

body {

  min-height: 100vh;

  font-family: 'Inter', sans-serif;

  background:
    radial-gradient(
      circle at top left,
      rgba(37,99,235,0.08),
      transparent 28%
    ),

    radial-gradient(
      circle at bottom right,
      rgba(6,182,212,0.08),
      transparent 25%
    ),

    var(--bg);

  color: var(--text);

  padding: 36px;
}

/* CONTAINER */

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* HERO */

.hero {

  position: relative;

  overflow: hidden;

  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 24px;

  padding: 42px;

  margin-bottom: 34px;

  border-radius: 36px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.92),
      rgba(248,250,252,0.9)
    );

  border: 1px solid rgba(255,255,255,0.7);

  backdrop-filter: blur(18px);

  box-shadow: var(--shadow);
}

.hero::before {

  content: '';

  position: absolute;

  width: 500px;
  height: 500px;

  background:
    radial-gradient(
      circle,
      rgba(37,99,235,0.08),
      transparent 70%
    );

  top: -250px;
  right: -150px;
}

.hero h1 {

  font-size: 4rem;

  line-height: 0.95;

  font-weight: 800;

  letter-spacing: -3px;

  margin-bottom: 14px;
}

.hero p {

  color: var(--muted);

  font-size: 1.08rem;

  max-width: 620px;

  line-height: 1.7;
}

.phase-badge {

  background:
    linear-gradient(
      135deg,
      var(--blue),
      var(--cyan)
    );

  color: white;

  padding: 16px 24px;

  border-radius: 999px;

  font-weight: 700;

  font-size: 0.95rem;

  box-shadow:
    0 12px 30px rgba(37,99,235,0.18);

  white-space: nowrap;
}

/* CARDS */

.card {

  background: var(--card);

  border: 1px solid rgba(255,255,255,0.7);

  border-radius: 32px;

  padding: 30px;

  margin-bottom: 28px;

  backdrop-filter: blur(18px);

  box-shadow: var(--shadow);

  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease;
}

.card:hover {

  transform: translateY(-3px);

  box-shadow:
    0 24px 50px rgba(15,23,42,0.1);
}

/* HEADERS */

.section-header {

  display: flex;

  justify-content: space-between;

  align-items: flex-end;

  margin-bottom: 26px;

  gap: 24px;
}

.section-header h2 {

  font-size: 1.7rem;

  font-weight: 700;

  margin-bottom: 6px;
}

.section-header p {

  color: var(--muted);

  line-height: 1.6;
}

/* GRID */

.goals-grid,
.metric-grid,
.stats-grid {

  display: grid;

  grid-template-columns: repeat(4, 1fr);

  gap: 22px;
}

/* LABEL */

label {

  display: block;

  margin-bottom: 10px;

  color: var(--muted);

  font-size: 0.92rem;

  font-weight: 600;
}

/* INPUTS */

input {

  width: 100%;

  border: 1px solid #dbe4f0;

  background:
    rgba(255,255,255,0.92);

  color: var(--text);

  border-radius: 20px;

  padding: 18px;

  font-size: 1rem;

  transition: 0.25s ease;
}

input:focus {

  outline: none;

  border-color: rgba(37,99,235,0.45);

  box-shadow:
    0 0 0 4px rgba(37,99,235,0.1);
}

/* METRIC CARDS */

.metric-card {

  position: relative;

  overflow: hidden;

  border-radius: 28px;

  padding: 28px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.96),
      rgba(248,250,252,0.94)
    );

  border: 1px solid rgba(226,232,240,0.8);

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.metric-card::before {

  content: '';

  position: absolute;

  inset: 0;

  background:
    linear-gradient(
      135deg,
      rgba(37,99,235,0.04),
      transparent
    );

  pointer-events: none;
}

.metric-card:hover {

  transform: translateY(-5px);

  box-shadow:
    0 18px 40px rgba(15,23,42,0.08);
}

.metric-top {

  display: flex;

  justify-content: space-between;

  align-items: flex-start;

  margin-bottom: 22px;

  gap: 14px;
}

.metric-top span {

  font-size: 1rem;

  font-weight: 700;
}

.metric-top small {

  color: var(--muted);

  text-align: right;

  line-height: 1.5;
}

.metric-card input {

  border: none;

  padding: 20px;

  background: transparent;

  font-size: 2rem;

  font-weight: 800;

  letter-spacing: -2px;
}

.metric-card input:focus {
  box-shadow: none;
}

.metric-unit {

  margin-top: 12px;

  color: var(--muted);

  font-size: 0.92rem;
}

/* BUTTONS */

button {

  position: relative;

  overflow: hidden;

  border: none;

  background: #ce36ff;

  color: white;

  padding: 18px 24px;

  border-radius: 18px;

  font-size: 1rem;

  font-weight: 700;

  cursor: pointer;

  transition: 0.25s ease;

  box-shadow:
    0 12px 28px rgba(37,99,235,0.16);
}

button::before {

  content: '';

  position: absolute;

  inset: 0;

  background:
    linear-gradient(
      135deg,
      rgba(255,255,255,0.18),
      transparent
    );

  opacity: 0;

  transition: 0.25s ease;
}

button:hover {

  transform: translateY(-2px);

  opacity: 0.96;
}

button:hover::before {

  opacity: 1;
}

.save-btn {

  width: 100%;

  margin-top: 28px;
}

/* STATS */

.stat-card {

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.96),
      rgba(248,250,252,0.94)
    );

  border: 1px solid rgba(226,232,240,0.8);

  border-radius: 28px;

  padding: 28px;

  box-shadow: var(--shadow);

  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease;
}

.stat-card:hover {

  transform: translateY(-4px);

  box-shadow:
    0 20px 40px rgba(15,23,42,0.08);
}

.stat-card h3 {

  color: var(--muted);

  margin-bottom: 14px;

  font-size: 0.92rem;

  text-transform: uppercase;

  letter-spacing: 0.08em;
}

.stat-value {

  font-size: 3rem;

  font-weight: 800;

  letter-spacing: -3px;
}

/* WEEKLY */

.week-grid {

  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 22px;

  align-items: stretch;
}

.week-card {

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.96),
      rgba(248,250,252,0.94)
    );

  border: 1px solid rgba(226,232,240,0.8);

  border-radius: 26px;

  padding: 24px;

  height: 100%;

  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease;
}

.history-accordion {
  display: grid;
  gap: 14px;
}

.history-empty {
  color: var(--muted);
  line-height: 1.6;
}

.history-month {
  overflow: hidden;
  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.96),
      rgba(248,250,252,0.94)
    );
  border: 1px solid rgba(226,232,240,0.8);
  border-radius: 18px;
}

.history-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  color: #0f172a;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.history-month-header::-webkit-details-marker {
  display: none;
}

.history-month-header::before {
  content: '▸';
  color: var(--muted);
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.history-month[open] .history-month-header::before {
  transform: rotate(90deg);
}

.history-month-header span {
  flex: 1;
}

.history-month-header small {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.history-month-table {
  border-top: 1px solid #e2e8f0;
}

.history-month-table .entries-table {
  min-width: 760px;
}

.week-card:hover {

  transform: translateY(-3px);

  box-shadow:
    0 18px 40px rgba(15,23,42,0.08);
}

.week-card h3 {

  margin-bottom: 16px;
}

.week-card p {

  color: #334155;

  line-height: 1.8;
}

/* TABLE */

.table-wrap {
  overflow-x: auto;
}

.entries-table {

  width: 100%;

  border-collapse: collapse;

  min-width: 760px;
}

.entries-table thead {

  background:
    rgba(248,250,252,0.9);
}

.entries-table th {

  color: var(--muted);

  text-transform: uppercase;

  font-size: 0.82rem;

  letter-spacing: 0.08em;

  font-weight: 700;
}

.entries-table th,
.entries-table td {

  padding: 20px;

  border-bottom:
    1px solid #e2e8f0;

  text-align: left;
}

.entries-table tbody tr {

  transition: 0.25s ease;
}

.entries-table tbody tr:hover {

  background:
    rgba(37,99,235,0.04);
}

.entries-table td {

  vertical-align: middle;

  font-weight: 500;
}

/* TABLE BUTTONS */

.entries-table button {

  padding: 10px 14px;

  border-radius: 12px;

  font-size: 0.85rem;

  box-shadow: none;
}

.delete-btn {

  background:
    linear-gradient(
      135deg,
      #ef4444,
      #dc2626
    );
}

/* CHART */

.chart-container {

  position: relative;

  width: 100%;

  height: 460px;

  overflow: hidden;

  border-radius: 24px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.55),
      rgba(248,250,252,0.75)
    );

  padding: 18px;
}

#trendChart {

  width: 100% !important;

  height: 100% !important;

}

/* DATE */

.date-wrap {

  min-width: 240px;
}

/* DATE NAV */

.date-nav {

  display: flex;

  align-items: center;

  gap: 10px;

  flex-wrap: wrap;

  margin: 0 auto;
}

.today-btn{
    width: 100%;
    display: flex;
    justify-content: center;
}
.date-nav input {

  flex: 1;
}

.date-btn {

  width: 48px;

  height: 48px;

  padding: 0;

  border-radius: 14px;

  display: flex;

  align-items: center;

  justify-content: center;

  font-size: 1.2rem;

  flex-shrink: 0;
}

.targets-box{
    margin: 1.5rem 0 2rem;
    padding: 1.25rem;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    border-radius: 18px;
    backdrop-filter: blur(6px);
}

.targets-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:1rem;
    margin-bottom:1rem;
}

.targets-header h3{
    margin:0;
    font-size:1rem;
    font-weight:600;
}

.targets-header p{
    margin:0.2rem 0 0;
    opacity:0.7;
    font-size:0.85rem;
}

.targets-save-btn{
    padding:0.65rem 1rem;
    border-radius:12px;
    font-size:0.85rem;
}

.targets-box .goals-grid{
    gap:1rem;
}

.targets-box input{
    background: rgba(255,255,255,0.04);
}

/* TABLE CELL GOAL STATUS */

.entries-table td.goal-met {
  color: var(--green);
  font-weight: 600;
}

.entries-table td.goal-not-met {
  color: var(--danger);
  font-weight: 600;
}

/* WEEKLY INSIGHTS */

.insights-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.insight-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94));
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 24px;
  padding: 24px;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.insight-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.insight-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.insight-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
}

.insight-card p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.insight-card.positive {
  border-left: 4px solid var(--green);
}

.insight-card.warning {
  border-left: 4px solid #ac34fd;
}

.insight-card.tip {
  border-left: 4px solid #ac34fd;
}

@media (max-width:768px){

    .targets-header{
        flex-direction:column;
        align-items:flex-start;
    }

    .targets-save-btn{
        width:100%;
    }

}

/* TABLET */

@media (max-width: 1150px) {

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

  .metric-grid,
  .stats-grid,
  .goals-grid {

    grid-template-columns: repeat(2, 1fr);
  }

}

/* MOBILE */

@media (max-width: 760px) {

  body {
    padding: 14px;
  }

  .hero,
  .section-header {

    flex-direction: column;

    align-items: flex-start;
  }

  .hero {

    padding: 26px;

    border-radius: 28px;

    margin-bottom: 22px;
  }

  .hero h1 {

    font-size: 2.4rem;

    letter-spacing: -2px;
  }

  .hero p {

    font-size: 0.98rem;

    line-height: 1.6;
  }

  .phase-badge {

    width: 100%;

    text-align: center;
  }

  .metric-grid,
  .stats-grid,
  .goals-grid {

    grid-template-columns: 1fr;
  }

  .week-grid {
    grid-template-columns: 1fr;
  }

  .card {

    padding: 22px;

    border-radius: 24px;
  }

  .metric-card {

    padding: 24px;
  }

  .metric-card input {

    font-size: 1.4rem;
  }

  .stat-card {

    padding: 24px;
  }

  .stat-value {

    font-size: 2rem;
  }

  .entries-table {

    min-width: 640px;
  }

  .entries-table th,
  .entries-table td {

    padding: 16px;
  }

  .chart-container {

    height: 280px;

    padding: 10px;

    border-radius: 20px;
  }

  #trendChart {

    height: 260px !important;
  }

}
