/* Mobile kecil */
@media (max-width: 380px) {
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-row {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    transform: rotate(90deg);
  }
}

/* Tablet */
@media (min-width: 600px) and (max-width: 899px) {
  .app {
    max-width: 760px;
  }

  .bottom-nav {
    max-width: 760px;
  }

  .header,
  .content,
  .search-wrap {
    padding-right: 28px;
    padding-left: 28px;
  }

  .hero {
    padding: 28px;
  }

  .hero-title {
    max-width: 620px;
    font-size: 26px;
  }

  .hero-desc {
    max-width: 620px;
    font-size: 14px;
  }

  .quick-grid {
    gap: 14px;
  }

  .quick-card {
    padding: 18px 12px;
  }

  .quick-label {
    font-size: 12px;
  }
}

/* Desktop dan laptop */
@media (min-width: 900px) {
  body {
    background: var(--bg);
  }

  .app {
    width: calc(100% - var(--desktop-sidebar-width));
    max-width: none;
    min-height: 100dvh;
    margin: 0 0 0 var(--desktop-sidebar-width);
    padding-bottom: 48px;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 420px);
  }

  .header,
  .search-wrap,
  .content {
    width: min(calc(100% - 48px), var(--content-max-width));
    max-width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 0;
    padding-left: 0;
  }

  .header {
    padding-top: 32px;
    padding-bottom: 18px;
  }

  .topbar {
    margin-bottom: 24px;
  }

  .brand-icon {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .brand-title {
    font-size: 20px;
  }

  .brand-subtitle {
    font-size: 13px;
  }

  .hero {
    min-height: 220px;
    padding: 40px;
    display: flex;
    justify-content: center;
    flex-direction: column;
  }

  .hero::after {
    top: -100px;
    right: -80px;
    width: 320px;
    height: 320px;
  }

  .hero-title {
    max-width: 760px;
    font-size: clamp(30px, 3vw, 42px);
  }

  .hero-desc {
    max-width: 720px;
    font-size: 15px;
  }

  .search-wrap {
    margin-top: -24px;
  }

  .search-box {
    max-width: 820px;
    margin: 0 auto;
    padding: 17px 20px;
  }

  .search-box input {
    font-size: 15px;
  }

  .content {
    padding-top: 34px;
  }

  .section {
    margin-bottom: 34px;
  }

  .section-title {
    font-size: 18px;
  }

  .quick-grid {
    gap: 16px;
  }

  .quick-card {
    padding: 22px 16px;
  }

  .quick-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 11px;
    font-size: 20px;
  }

  .quick-label {
    font-size: 13px;
  }

  .feature-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .feature-card {
    min-height: 148px;
    align-items: flex-start;
    padding: 20px;
  }

  .feature-desc {
    font-size: 13px;
  }

  .native-click:hover {
    transform: translateY(-2px);
  }

  .quick-card:hover,
  .feature-card:hover,
  .chip:hover,
  .icon-btn:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
  }
}

/* Layar sangat lebar */
@media (min-width: 1440px) {
  :root {
    --desktop-sidebar-width: 260px;
    --content-max-width: 1240px;
  }
}

/* Menghormati preferensi aksesibilitas pengguna */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   SIDEBAR DESKTOP — GAYA ASKEP
   Satu-satunya aturan sidebar untuk tampilan desktop.
   Menu diberi jarak dari area identitas aplikasi.
   Layout mobile, tablet, hero, kartu, dan konten tidak berubah.
========================================================= */

@media (min-width: 900px) {
  /* Konten utama tetap bergeser mengikuti lebar sidebar */
  .app {
    width: calc(100% - var(--desktop-sidebar-width));
    max-width: none;
    min-height: 100dvh;
    margin: 0 0 0 var(--desktop-sidebar-width);
  }

  /* Bottom navigation berubah menjadi sidebar stabil */
  .bottom-nav {
    position: fixed;
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;

    display: flex;
    align-items: stretch;
    flex-direction: column;

    width: var(--desktop-sidebar-width);
    max-width: none;
    height: 100vh;
    height: 100dvh;

    box-sizing: border-box;
    gap: 8px;
    padding: 116px 18px 24px;
    overflow-x: hidden;
    overflow-y: auto;

    transform: none;
    border-top: 0;
    border-right: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 50;
  }

  /* Kotak ikon brand tanpa perlu mengubah HTML */
 .bottom-nav::before {
  position: absolute;
  top: 28px;
  left: 22px;

  display: block;

  width: 42px;
  height: 42px;
  margin: 0;

  border-radius: 15px;
  background-image: url("../icons/icon-512.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;

  box-shadow: 0 9px 20px rgba(37, 99, 235, 0.20);

  content: "";
}
  /* Nama dan keterangan brand */
  .bottom-nav::after {
    position: absolute;
    top: 31px;
    left: 75px;
    right: 16px;

    overflow: hidden;
    color: var(--text);
    content: "ASKEP\A Asuhan Keperawatan";
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    white-space: pre-line;
  }

  .bottom-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 52px;
    flex-direction: row;

    width: 100%;
    height: 52px;
    min-height: 52px;
    gap: 12px;
    padding: 0 14px;
    overflow: hidden;

    border-radius: 15px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
  }

  .bottom-item i {
    width: 22px;
    flex: 0 0 22px;
    font-size: 17px;
    text-align: center;
  }

  .bottom-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bottom-item.active {
    background: var(--primary-light);
    box-shadow: inset 3px 0 0 var(--primary);
    color: var(--primary);
  }

  .bottom-item:hover {
    transform: none;
    background: var(--primary-light);
    color: var(--primary);
  }
}
