
/* ===== 1. Pengaturan dasar ===== */
:root {
  --primary: #635bff;
  --primary-hover: #5148e5;
  --background: #f6f7fb;
  --surface: #ffffff;
  --text: #202235;
  --muted: #777b91;
  --border: #e8e9f1;
  --success: #16865c;
  --shadow: 0 8px 28px rgba(31, 35, 75, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

/* ===== 2. Header ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px max(24px, calc((100% - 1100px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 20px;
  font-weight: 750;
  text-decoration: none;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: white;
  background: var(--primary);
  border-radius: 11px;
}

.topbar-label {
  color: var(--muted);
  font-size: 13px;
}

/* ===== 3. Layout utama ===== */
.container {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
}

.welcome {
  padding: 48px 0 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.8px;
}

.welcome h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.2;
  letter-spacing: -1.5px;
}

.welcome h1 span {
  color: var(--primary);
}

.welcome-description {
  max-width: 550px;
  margin-top: 14px;
  color: var(--muted);
}

/* ===== 4. Kartu statistik ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.stat-card strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 32px;
  line-height: 1.3;
}

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

/* ===== 5. Panel tugas ===== */
.task-panel {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.section-heading h2,
.task-toolbar h3 {
  margin: 0;
}

.section-heading p {
  margin: 5px 0 22px;
  color: var(--muted);
  font-size: 14px;
}

/* ===== 6. Formulir ===== */
.task-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  align-items: end;
  gap: 12px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.form-group label {
  font-size: 13px;
  font-weight: 650;
}

.form-group input,
.filter-label select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  color: var(--text);
  background: white;
  border: 1px solid #dfe1eb;
  border-radius: 9px;
  outline: none;
}

.form-group input:focus,
.filter-label select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.12);
}

.primary-button {
  padding: 12px 15px;
  color: white;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--primary);
  border: 0;
  border-radius: 9px;
  transition: background 0.2s, transform 0.2s;
}

.primary-button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* ===== 7. Toolbar dan daftar tugas ===== */
.task-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 16px;
}

.task-toolbar h3 {
  font-size: 16px;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.filter-label select {
  width: auto;
  max-width: 180px;
  padding: 8px;
}

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

.empty-state {
  padding: 38px 15px;
  text-align: center;
  border: 1px dashed #dfe1eb;
  border-radius: 12px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  color: var(--primary);
  font-size: 23px;
  background: #f0efff;
  border-radius: 50%;
}

.empty-state h3 {
  margin: 0;
  font-size: 16px;
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ===== 8. Footer ===== */
.footer {
  padding: 24px 0 32px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* ===== 9. Tampilan HP dan tablet ===== */
@media (max-width: 850px) {
  .task-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-form .primary-button {
    min-height: 44px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 14px 20px;
  }

  .container {
    width: calc(100% - 28px);
  }

  .welcome {
    padding-top: 32px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 16px 18px;
  }

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

  .task-panel {
    padding: 18px 14px;
  }

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

  .task-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-label {
    width: 100%;
    justify-content: space-between;
  }
}

/* ===== 10. Kartu tugas yang dibuat JavaScript ===== */
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s;
}

.task-item:hover {
  border-color: #c9c6ff;
}

.task-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.task-main input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--primary);
  cursor: pointer;
}

.task-details {
  min-width: 0;
}

.task-title {
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.task-subject,
.task-deadline {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.task-item.is-completed .task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.delete-button {
  padding: 7px 10px;
  color: #c43f52;
  background: #fff1f2;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
  flex-shrink: 0;
}

.delete-button:hover {
  background: #ffe0e4;
}

@media (max-width: 400px) {
  .task-item {
    align-items: flex-start;
    gap: 8px;
    padding: 12px 9px;
  }

  .delete-button {
    padding: 6px;
  }
}
