/* ============================================================
   SDVI — Mobile skin (P0 shell)
   Restyles the existing chrome to the demo-mobile ("Bếp Học Đường")
   look at phone widths. Pure presentation — no logic/data change.
   Loaded AFTER app.css so these win at ≤720px. Desktop untouched.
   ============================================================ */

@media (max-width: 720px) {
  :root {
    --m-primary: #1e88e5;
    --m-green: #43a047;
    --m-grad: linear-gradient(135deg, #1e88e5, #43a047);
  }

  /* ---------- Hero header (was thin topbar) ---------- */
  .topbar {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 16px 16px 14px;
    background: var(--m-grad);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
  }
  .topbar .brand {
    width: 100%;
    font-size: 19px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .topbar .brand small {
    display: block;
    margin-left: 0;
    font-size: 11px;
    opacity: .85;
    font-weight: 400;
  }
  .topbar .mode-badge { order: 3; }
  .topbar .spacer { display: none; }
  .topbar select.role-switch {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .35);
    border-radius: 8px;
    padding: 7px 10px;
    max-width: 100%;
  }
  .topbar .tour-btn { border-radius: 999px; }

  /* ---------- Main / headings ---------- */
  .main h1 { font-size: 20px; }
  .main .subtitle { font-size: 13px; margin-bottom: 14px; }

  /* ---------- Cards: rounded + soft (mockup) ---------- */
  .card {
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
    padding: 16px;
  }

  /* ---------- Buttons: mockup blue ---------- */
  .btn {
    background: var(--m-primary);
    border-color: var(--m-primary);
    border-radius: 8px;
  }
  .btn:hover { background: #1565c0; border-color: #1565c0; }
  .btn.btn-secondary { background: #fff; color: var(--m-primary); border-color: var(--m-primary); }

  /* ---------- Bottom nav (polished) ---------- */
  .sidebar {
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .08);
    padding: 0;
  }
  .sidebar .nav-item {
    flex: 0 0 auto;
    min-width: 66px;
    padding: 8px 10px 6px;
    gap: 3px;
    color: #666;
    border-top: 3px solid transparent;
  }
  .sidebar .nav-item span:last-child {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.15;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar .nav-item .icon { font-size: 21px; }
  .sidebar .nav-item:hover { color: var(--m-primary); background: #f8fbff; }
  .sidebar .nav-item.active {
    color: var(--m-primary);
    border-top-color: var(--m-primary);
    background: #f8fbff;
  }
  /* Home tab — distinct gradient chip */
  .sidebar .nav-item.nav-home .icon {
    width: 34px; height: 34px; border-radius: 11px;
    background: var(--m-grad); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; box-shadow: 0 3px 10px rgba(30, 136, 229, .4);
  }
  .sidebar .nav-item.nav-home.active { background: #f8fbff; }

  /* ---------- Home launcher (feature-grid) ---------- */
  .m-home { padding: 2px 0 8px; }
  .m-home-section {
    font-size: 12px; font-weight: 700; letter-spacing: .03em;
    text-transform: uppercase; color: var(--m-primary);
    margin: 18px 2px 10px;
  }
  .m-home-section:first-child { margin-top: 4px; }
  .feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .feature-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 16px 6px 12px;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    transition: transform .18s, box-shadow .18s;
  }
  .feature-card:active { transform: scale(.97); }
  .feature-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0, 0, 0, .10); }
  .feature-card .fc-icon-wrap {
    width: 52px; height: 52px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
  }
  .feature-card .fc-label {
    font-size: 11.5px; font-weight: 600; color: #333; line-height: 1.25;
    min-height: 30px; display: flex; align-items: center;
  }
  /* 10-color icon gradient cycle (from mockup) */
  .fc-icon-wrap.color-blue   { background: linear-gradient(135deg, #42a5f5, #1565c0); }
  .fc-icon-wrap.color-green  { background: linear-gradient(135deg, #66bb6a, #2e7d32); }
  .fc-icon-wrap.color-orange { background: linear-gradient(135deg, #ffa726, #ef6c00); }
  .fc-icon-wrap.color-purple { background: linear-gradient(135deg, #ba68c8, #6a1b9a); }
  .fc-icon-wrap.color-coral  { background: linear-gradient(135deg, #ff7e5f, #e63946); }
  .fc-icon-wrap.color-indigo { background: linear-gradient(135deg, #5c6bc0, #283593); }
  .fc-icon-wrap.color-cyan   { background: linear-gradient(135deg, #4dd0e1, #00838f); }
  .fc-icon-wrap.color-teal   { background: linear-gradient(135deg, #4db6ac, #00695c); }
  .fc-icon-wrap.color-pink   { background: linear-gradient(135deg, #f06292, #ad1457); }
  .fc-icon-wrap.color-amber  { background: linear-gradient(135deg, #ffd54f, #ff8f00); }

  /* smaller phones */
  @media (max-width: 400px) {
    .feature-grid { gap: 8px; }
    .feature-card { padding: 13px 4px 10px; border-radius: 14px; }
    .feature-card .fc-icon-wrap { width: 46px; height: 46px; font-size: 23px; }
    .feature-card .fc-label { font-size: 11px; min-height: 28px; }
  }
}
