/* DrivePilot V4.0.2 – Dashboard speziell für iPhone/PWA */

/* Desktop */
.dashboard-card-grid{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:16px !important;
}

.dashboard-card-grid .nav-card{
  min-width:0;
}

/* Mobile header: Logo + Abmelden bleiben in EINER Zeile */
@media(max-width:700px){
  .topbar{
    flex-wrap:nowrap !important;
    padding-top:12px !important;
    padding-bottom:12px !important;
  }

  .brand{
    flex:1 1 auto !important;
    min-width:0 !important;
  }

  .top-actions{
    width:auto !important;
    flex:0 0 auto !important;
    margin-left:auto !important;
    justify-content:flex-end !important;
  }

  .user-pill{
    display:none !important;
  }

  .link-btn{
    white-space:nowrap;
  }

  /* obere Navigation sauber als 2 x 2 */
  .dashboard-topnav{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
    margin-top:14px !important;
  }

  .dashboard-topnav a{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-width:0 !important;
    width:100% !important;
    padding:11px 10px !important;
    text-align:center !important;
    white-space:nowrap !important;
  }

  /* Hero kompakter */
  .dashboard-hero{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:14px !important;
    margin-top:18px !important;
  }

  .dashboard-hero .hero-card{
    padding:22px 20px !important;
  }

  .dashboard-hero .hero-card h1{
    font-size:30px !important;
    line-height:1.08 !important;
    margin-bottom:10px !important;
  }

  .dashboard-hero .hero-card p{
    font-size:17px !important;
    line-height:1.35 !important;
  }

  .dashboard-primary-action{
    margin-top:18px !important;
  }

  .dashboard-primary-action .btn{
    width:100% !important;
    text-align:center !important;
  }

  .dashboard-live-card{
    min-height:auto !important;
    padding:20px !important;
  }

  .dashboard-live-card .stat-num{
    font-size:54px !important;
    line-height:1 !important;
  }

  /* WICHTIG: keine 5 schmalen Karten mehr */
  .dashboard-card-grid{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:12px !important;
    margin-top:14px !important;
  }

  .dashboard-card-grid .nav-card{
    width:100% !important;
    min-width:0 !important;
    min-height:170px !important;
    padding:16px !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    justify-content:space-between !important;
    gap:14px !important;
    overflow:hidden !important;
  }

  .dashboard-card-grid .nav-icon{
    width:52px !important;
    height:52px !important;
    min-width:52px !important;
    flex:0 0 52px !important;
  }

  .dashboard-card-grid .nav-icon svg{
    width:27px !important;
    height:27px !important;
  }

  .dashboard-card-grid .nav-title{
    font-size:20px !important;
    line-height:1.08 !important;
    overflow-wrap:anywhere !important;
    word-break:normal !important;
  }

  .dashboard-card-grid .nav-sub{
    margin-top:5px !important;
    font-size:15px !important;
    line-height:1.28 !important;
    overflow-wrap:anywhere !important;
  }

  /* 5. Karte über volle Breite */
  .dashboard-card-grid .new-drive-card{
    grid-column:1 / -1 !important;
    min-height:128px !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-start !important;
  }

  .dashboard-card-grid .new-drive-card > div:last-child{
    min-width:0 !important;
  }

  .dashboard-section-head{
    margin-top:26px !important;
    align-items:center !important;
    flex-wrap:nowrap !important;
  }

  .dashboard-section-head h2{
    font-size:24px !important;
    margin:0 !important;
  }

  .dashboard-section-head .link-btn{
    width:auto !important;
    flex:0 0 auto !important;
  }
}

/* Sehr schmale iPhones */
@media(max-width:390px){
  .brand-logo-wrap{
    width:50px !important;
    height:40px !important;
  }

  .brand-text strong{
    font-size:17px !important;
  }

  .dashboard-hero .hero-card h1{
    font-size:27px !important;
  }

  .dashboard-card-grid{
    gap:10px !important;
  }

  .dashboard-card-grid .nav-card{
    min-height:158px !important;
    padding:14px !important;
  }

  .dashboard-card-grid .nav-title{
    font-size:18px !important;
  }

  .dashboard-card-grid .nav-sub{
    font-size:14px !important;
  }
}
