:root {
  /* ---------- COLOR ---------- */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;

  --ink: #182230;
  --ink-soft: #344054;
  --muted: #667085;
  --muted-light: #98a2b3;

  --line: #e4e7ec;
  --line-hover: #d0d5dd;

  --blue: #1677ff;
  --blue-hover: #0f6ce5;
  --blue-soft: #eaf3ff;

  --purple-soft: #f1edff;
  --yellow-soft: #fff3cc;
  --green-soft: #e4f8ed;
  --pink-soft: #ffeaf1;

  /* ---------- RADIUS ---------- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* ---------- SHADOW ---------- */
  --shadow-card:
    0 1px 2px rgba(16, 24, 40, 0.02);

  --shadow-hover:
    0 8px 24px rgba(16, 24, 40, 0.07);

  /* ---------- TYPE ---------- */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-lg: 15px;
  --text-section: 18px;
  --text-hero: 26px;

  /* ---------- LAYOUT ---------- */
  --page-width: 1440px;
}

/* =========================================================
   RESET
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;

  font-family:
    "Plus Jakarta Sans",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  font-size: var(--text-md);
  line-height: 1.5;

  color: var(--ink);
  background: var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  display: block;
}

/* =========================================================
   HEADER
   ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;

  height: 64px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding-inline:
    max(30px, calc((100vw - var(--page-width)) / 2));

  background: rgba(255, 255, 255, 0.94);

  border-bottom: 1px solid #eef0f3;

  backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0;
    margin: 0;

    border: 0;
    background: transparent;
    appearance: none;

    color: var(--ink);

    font-family: inherit;
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.02em;

    cursor: pointer;
}

.logo {
  width: 36px;
  height: 36px;

  display: grid;
  place-items: center;

  border-radius: 9px;

  background: #2580ed;
  color: #ffffff;

  font-size: 18px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn,
.avatar,
.menu-btn {
  border: 0;
  background: transparent;

  display: grid;
  place-items: center;

  cursor: pointer;
}

.icon-btn {
  width: 36px;
  height: 36px;

  border-radius: 8px;

  color: var(--ink-soft);

  transition:
    background 150ms ease,
    color 150ms ease;
}

.icon-btn:hover {
  background: #f5f7fa;
  color: var(--ink);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.avatar {
  width: 36px;
  height: 36px;

  border-radius: 999px;

  background: #eef5ff;
  color: #3478cf;

  font-size: 12px;
  font-weight: 700;
}

/* =========================================================
   PAGE
   ========================================================= */

.main {
  width: min(var(--page-width), 100%);
  margin: 0 auto;

  padding: 28px 30px 40px;
}

/* =========================================================
   WELCOME
   ========================================================= */

.welcome {
  position: relative;
  overflow: hidden;

  min-height: 108px;

  padding: 24px 36px;

  display: flex;
  align-items: center;
  gap: 22px;

  border-radius: var(--radius-lg);

  background:
    linear-gradient(
      100deg,
      #f6f9fd 0%,
      #f4f8fd 67%,
      #edf5ff 100%
    );
}

.welcome-icon {
  position: relative;
  z-index: 1;

  flex: 0 0 auto;

  width: 52px;
  height: 52px;

  display: grid;
  place-items: center;

  color: #172033;
}

.welcome-icon svg {
  width: 42px;
  height: 42px;

  stroke-width: 1.8;
}

.welcome > div:not(.arc) {
  position: relative;
  z-index: 1;
}

.welcome h1 {
  margin: 0 0 4px;

  font-size: var(--text-hero);
  line-height: 1.25;

  font-weight: 700;
  letter-spacing: -0.035em;
}

.welcome p {
  margin: 0;

  color: var(--muted);

  font-size: var(--text-md);
  line-height: 1.55;
}

.arc {
  position: absolute;

  width: 236px;
  height: 236px;

  right: -32px;
  top: -148px;

  border: 34px solid rgba(73, 137, 245, 0.12);
  border-radius: 999px;

  pointer-events: none;
}

/* =========================================================
   SECTIONS
   ========================================================= */

.section {
  margin-top: 30px;
}

.section-head {
  min-height: 30px;
  margin-bottom: 14px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-head h2 {
  margin: 0;

  color: var(--ink);

  font-size: var(--text-section);
  line-height: 1.35;

  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-head p {
  margin: 3px 0 0;

  color: var(--muted);

  font-size: var(--text-xs);
  line-height: 1.5;
}

.text-btn {
  min-height: 32px;
  padding: 4px 5px;

  display: inline-flex;
  align-items: center;
  gap: 6px;

  border: 0;
  background: transparent;

  color: var(--blue);

  font-size: var(--text-xs);
  font-weight: 600;

  cursor: pointer;

  transition: color 150ms ease;
}

.text-btn:hover {
  color: var(--blue-hover);
}

.text-btn svg {
  width: 15px;
  height: 15px;
}

/* =========================================================
   TOOL GRID
   ========================================================= */

.tools {
  display: grid;

  grid-template-columns:
    repeat(5, minmax(0, 1fr));

  gap: 14px;
}

.tool {
  position: relative;

  min-width: 0;
  min-height: 198px;

  padding: 20px;

  display: flex;
  flex-direction: column;
  align-items: flex-start;

  text-align: left;

  border: 1px solid var(--line);
  border-radius: 14px;

  background: var(--surface);

  box-shadow: var(--shadow-card);

  cursor: pointer;

  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.tool:hover {
  transform: translateY(-2px);

  border-color: var(--line-hover);

  box-shadow: var(--shadow-hover);
}

.tool:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.18);
  outline-offset: 2px;
}

.tool-icon {
  width: 48px;
  height: 48px;

  margin-bottom: 16px;

  display: grid;
  place-items: center;

  border-radius: 12px;
}

.tool-icon svg {
  width: 24px;
  height: 24px;

  stroke-width: 1.9;
}

.tool-icon.blue {
  background: var(--blue-soft);
  color: #2678df;
}

.tool-icon.purple {
  background: var(--purple-soft);
  color: #6851c7;
}

.tool-icon.yellow {
  background: var(--yellow-soft);
  color: #a87813;
}

.tool-icon.green {
  background: var(--green-soft);
  color: #198754;
}

.tool-icon.pink {
  background: var(--pink-soft);
  color: #bd4a75;
}

.tool strong {
  margin-bottom: 5px;

  color: var(--ink);

  font-size: var(--text-lg);
  line-height: 1.4;

  font-weight: 700;
  letter-spacing: -0.015em;
}

.tool small {
  max-width: 210px;

  color: var(--muted);

  font-size: var(--text-sm);
  line-height: 1.55;
}

/* arrow dibuat menjadi affordance,
   bukan tombol visual kedua */

.round-arrow {
  width: 30px;
  height: 30px;

  margin-top: auto;
  margin-left: -3px;

  display: grid;
  place-items: center;

  border-radius: 999px;

  background: #f6f7f9;

  color: #344054;

  transition:
    background 150ms ease,
    transform 150ms ease;
}

.round-arrow svg {
  width: 16px;
  height: 16px;
}

.tool:hover .round-arrow {
  background: #eef2f6;
  transform: translateX(2px);
}

/* =========================================================
   CLASSES
   ========================================================= */

.classes-section {
  margin-top: 28px;
}

.classes {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 14px;
}

.class-card {
  min-height: 76px;

  padding: 13px 15px;

  display: flex;
  align-items: center;
  gap: 12px;

  border: 1px solid var(--line);
  border-radius: 12px;

  background: #ffffff;

  text-align: left;

  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.class-card:not(.new-card):hover {
  border-color: var(--line-hover);

  box-shadow:
    0 4px 14px rgba(16, 24, 40, 0.045);
}

.class-icon {
  flex: 0 0 auto;

  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border-radius: 10px;

  background: var(--blue-soft);
  color: #2678df;
}

.class-icon svg {
  width: 21px;
  height: 21px;

  stroke-width: 1.9;
}

.class-info {
  min-width: 0;
  flex: 1;

  display: flex;
  flex-direction: column;

  gap: 2px;
}

.class-info b,
.new-card b {
  color: var(--ink);

  font-size: var(--text-sm);
  line-height: 1.45;

  font-weight: 700;
}

.class-info small,
.new-card small {
  color: var(--muted);

  font-size: var(--text-xs);
  line-height: 1.45;
}

.menu-btn {
  width: 32px;
  height: 32px;

  border-radius: 7px;

  color: var(--muted);
}

.menu-btn:hover {
  background: #f5f7fa;
  color: var(--ink);
}

/* =========================================================
   EMPTY STATE / NEW CLASS
   ========================================================= */

.new-card {
  min-height: 76px;

  justify-content: flex-start;

  border-style: dashed;
  border-color: #d9dfe8;

  cursor: pointer;

  transition:
    border-color 150ms ease,
    background 150ms ease;
}

.new-card:hover {
  border-color: #aab6c5;
  background: #fafbfc;
}

.new-card > span:last-child {
  display: flex;
  flex-direction: column;

  gap: 2px;
}

.plus-circle {
  flex: 0 0 auto;

  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border: 1px solid #ccd4df;
  border-radius: 999px;

  color: #667085;

  background: #ffffff;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
  min-height: 38px;

  padding: 0 13px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 6px;

  border: 1px solid var(--line);
  border-radius: 9px;

  background: #ffffff;
  color: var(--ink);

  font-size: var(--text-sm);
  font-weight: 600;

  cursor: pointer;

  transition:
    background 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.btn:hover {
  background: #f8fafc;
  border-color: var(--line-hover);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn.primary {
  border-color: var(--blue);

  background: var(--blue);
  color: #ffffff;
}

.btn.primary:hover {
  border-color: var(--blue-hover);

  background: var(--blue-hover);
}

/* =========================================================
   TIP
   ========================================================= */

.tip {
  min-height: 62px;

  margin-top: 16px;
  padding: 10px 14px;

  display: flex;
  align-items: center;

  gap: 12px;

  border: 1px solid #e6e9ee;
  border-radius: 12px;

  background: #fafcff;
}

.tip-icon {
  flex: 0 0 auto;

  width: 36px;
  height: 36px;

  display: grid;
  place-items: center;

  border-radius: 9px;

  background: #fff4c7;
  color: #9b6c00;
}

.tip-icon svg {
  width: 18px;
  height: 18px;

  stroke-width: 1.9;
}

.tip > div {
  min-width: 0;
  flex: 1;

  display: flex;
  flex-direction: column;

  gap: 1px;
}

.tip > div b {
  font-size: var(--text-xs);
  font-weight: 700;
}

.tip > div span {
  color: var(--muted);

  font-size: var(--text-xs);
  line-height: 1.45;
}

/* =========================================================
   MODAL
   ========================================================= */

.modal-bg {
  position: fixed;
  inset: 0;

  z-index: 50;

  padding: 20px;

  display: grid;
  place-items: center;

  background: rgba(16, 24, 40, 0.38);

  backdrop-filter: blur(3px);
}

.modal {
  width: min(560px, 100%);

  padding: 24px;

  border-radius: 16px;

  background: #ffffff;

  box-shadow:
    0 24px 60px rgba(16, 24, 40, 0.18);
}

.modal-title {
  margin-bottom: 20px;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal h3 {
  margin: 0 0 4px;

  font-size: 20px;
  line-height: 1.35;

  font-weight: 700;
  letter-spacing: -0.025em;
}

.modal p {
  margin: 0;

  color: var(--muted);

  font-size: var(--text-sm);
  line-height: 1.55;
}

.modal label {
  display: block;

  margin: 15px 0 7px;

  font-size: var(--text-xs);
  font-weight: 700;
}

.modal label span {
  color: var(--muted);

  font-weight: 500;
}

.input,
textarea {
  width: 100%;

  padding: 10px 12px;

  border: 1px solid #d8dee8;
  border-radius: 9px;

  background: #ffffff;
  color: var(--ink);

  font-size: var(--text-sm);

  outline: none;

  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.input:focus,
textarea:focus {
  border-color: #75aaf2;

  box-shadow:
    0 0 0 3px rgba(22, 119, 255, 0.12);
}

textarea {
  min-height: 170px;

  resize: vertical;
}

.modal-actions {
  margin-top: 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-actions > div {
  display: flex;
  gap: 8px;
}

/* =========================================================
   TOAST
   ========================================================= */

.toast {
  position: fixed;

  left: 50%;
  bottom: 24px;

  z-index: 70;

  transform: translateX(-50%);

  padding: 10px 14px;

  display: flex;
  align-items: center;

  gap: 7px;

  border-radius: 9px;

  background: #182230;
  color: #ffffff;

  font-size: var(--text-sm);

  box-shadow:
    0 12px 36px rgba(16, 24, 40, 0.18);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
  .tools {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

  .classes {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    height: 60px;

    padding-inline: 18px;
  }

  .main {
    padding:
      18px
      18px
      34px;
  }

  .welcome {
    min-height: 100px;

    padding: 20px;

    gap: 15px;
  }

  .welcome-icon {
    width: 42px;
    height: 42px;
  }

  .welcome-icon svg {
    width: 34px;
    height: 34px;
  }

  .welcome h1 {
    font-size: 22px;
  }

  .welcome p {
    font-size: 13px;
  }

  .arc {
    opacity: 0.7;
  }

  .tools {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .tool {
    min-height: 185px;
  }
}

@media (max-width: 520px) {
  .brand {
    font-size: 15px;
  }

  .logo {
    width: 34px;
    height: 34px;
  }

  .welcome {
    padding: 18px;
  }

  .welcome-icon {
    display: none;
  }

  .section {
    margin-top: 26px;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head h2 {
    font-size: 17px;
  }

  .tools,
  .classes {
    grid-template-columns: 1fr;
  }

  .tool {
    min-height: 176px;
  }

  .tool small {
    max-width: none;
  }

  .tip .btn {
    display: none;
  }
}
