/* =========================================================
   AVAX VEHICLES VISUAL V2
   PHASE 1: DESKTOP FOUNDATION
   Visual only — no functional selectors changed
   ========================================================= */

.vehicles-v2{
  --v2-surface: rgba(15, 23, 42, .82);
  --v2-surface-strong: rgba(15, 23, 42, .96);
  --v2-surface-soft: rgba(255, 255, 255, .045);
  --v2-border: rgba(148, 163, 184, .17);
  --v2-border-strong: rgba(148, 163, 184, .27);
  --v2-shadow: 0 22px 60px rgba(0, 0, 0, .26);
  --v2-shadow-soft: 0 10px 32px rgba(0, 0, 0, .16);
  --v2-radius-xl: 22px;
  --v2-radius-lg: 16px;
  --v2-radius-md: 12px;
}

/* Tema deschisă */
[data-theme="light"] .vehicles-v2{
  --v2-surface: rgba(255, 255, 255, .92);
  --v2-surface-strong: rgba(248, 250, 252, .98);
  --v2-surface-soft: rgba(15, 23, 42, .035);
  --v2-border: rgba(15, 23, 42, .12);
  --v2-border-strong: rgba(15, 23, 42, .20);
  --v2-shadow: 0 22px 55px rgba(15, 23, 42, .10);
  --v2-shadow-soft: 0 8px 26px rgba(15, 23, 42, .08);
}

/* =========================================================
   DESKTOP ONLY
   Nu modificăm comportamentul mobil existent în această fază
   ========================================================= */

@media (min-width: 901px){

  .vehicles-v2 .wrap{
    width: min(98%, 1880px);
    max-width: 1880px;
    margin-inline: auto;
    padding: 22px 18px 30px;
    box-sizing: border-box;
  }

  /* Header premium */
  .vehicles-v2 .hero{
    position: relative;
    overflow: hidden;
    padding: 24px 26px;
    margin-bottom: 18px;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-xl);
    background:
      radial-gradient(
        700px 260px at 0% 0%,
        rgba(37, 99, 235, .16),
        transparent 68%
      ),
      linear-gradient(
        135deg,
        rgba(15, 23, 42, .92),
        rgba(10, 16, 28, .78)
      );
    box-shadow: var(--v2-shadow-soft);
  }

  [data-theme="light"] .vehicles-v2 .hero{
    background:
      radial-gradient(
        700px 260px at 0% 0%,
        rgba(37, 99, 235, .10),
        transparent 68%
      ),
      linear-gradient(
        135deg,
        rgba(255, 255, 255, .98),
        rgba(241, 245, 249, .92)
      );
  }

  .vehicles-v2 .hero::after{
    content: "";
    position: absolute;
    inset: auto -90px -120px auto;
    width: 310px;
    height: 310px;
    border-radius: 50%;
    background: rgba(59, 130, 246, .07);
    pointer-events: none;
  }

  .vehicles-v2 .hero h1{
    margin: 0;
    letter-spacing: -.035em;
    font-size: clamp(28px, 2vw, 38px);
    line-height: 1.05;
  }

  .vehicles-v2 .hero p{
    max-width: 900px;
    margin-top: 10px;
    margin-bottom: 0;
    line-height: 1.55;
    opacity: .74;
  }

  .vehicles-v2 .hero .meta{
    position: relative;
    z-index: 1;
    justify-content: flex-end;
  }

  .vehicles-v2 .hero .chip{
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-color: var(--v2-border);
    background: rgba(255, 255, 255, .055);
    backdrop-filter: blur(10px);
  }

  /* Card principal */
  .vehicles-v2 .card{
    overflow: hidden;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-xl);
    background: var(--v2-surface);
    box-shadow: var(--v2-shadow);
    backdrop-filter: blur(16px);
  }

  /* Toolbar */
  .vehicles-v2 .toolbar{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--v2-border);
    background: rgba(255, 255, 255, .018);
  }

  .vehicles-v2 .toolbar .search{
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .vehicles-v2 .toolbar .search input{
    flex: 1 1 auto;
    min-width: 260px;
    height: 44px;
    padding-inline: 15px;
    border-radius: var(--v2-radius-md);
    border-color: var(--v2-border-strong);
    transition:
      border-color .18s ease,
      box-shadow .18s ease,
      background .18s ease;
  }

  .vehicles-v2 .toolbar .search input:focus{
    border-color: rgba(59, 130, 246, .65);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .13);
  }

  .vehicles-v2 .toolbar .btn{
    min-height: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: var(--v2-radius-md);
    border-color: var(--v2-border);
    white-space: nowrap;
    transition:
      transform .16s ease,
      background .16s ease,
      border-color .16s ease;
  }

  .vehicles-v2 .toolbar .btn:hover{
    transform: translateY(-1px);
    border-color: var(--v2-border-strong);
  }

  .vehicles-v2 .toolbar #btnAddVehicle{
    box-shadow: 0 8px 20px rgba(37, 99, 235, .18);
  }

  .vehicles-v2 .toolbar > .meta{
    justify-content: flex-end;
    white-space: nowrap;
  }

  .vehicles-v2 .toolbar select{
    height: 42px;
    border-color: var(--v2-border);
  }

  /* Tabel — păstrăm geometria existentă */
  .vehicles-v2 .tablewrap{
    max-height: calc(100vh - 285px);
    border-top: 0;
    background: transparent;
    scrollbar-gutter: stable;
  }

  .vehicles-v2 #vehiclesTableWrap table{
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .vehicles-v2 #vehiclesTableWrap thead th{
    top: 0;
    z-index: 5;
    padding: 13px 11px;
    border-bottom: 1px solid var(--v2-border-strong);
    background: var(--v2-surface-strong);
    color: rgba(226, 232, 240, .88);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
    backdrop-filter: blur(16px);
  }

  [data-theme="light"] .vehicles-v2 #vehiclesTableWrap thead th{
    color: rgba(15, 23, 42, .70);
  }

  .vehicles-v2 #vehiclesTableWrap tbody td{
    padding: 12px 11px;
    border-bottom: 1px solid var(--v2-border);
    background: transparent;
    line-height: 1.38;
    transition:
      background .15s ease,
      border-color .15s ease;
  }

  .vehicles-v2 #vehiclesTableWrap tbody tr{
    transition:
      background .15s ease,
      box-shadow .15s ease;
  }

  .vehicles-v2 #vehiclesTableWrap tbody tr:hover{
    background: rgba(59, 130, 246, .055);
  }

  .vehicles-v2 #vehiclesTableWrap tbody tr.selected,
  .vehicles-v2 #vehiclesTableWrap tbody tr.is-selected{
    background: rgba(37, 99, 235, .12);
    box-shadow:
      inset 3px 0 0 rgba(59, 130, 246, .95),
      inset 0 1px 0 rgba(59, 130, 246, .18),
      inset 0 -1px 0 rgba(59, 130, 246, .18);
  }

  /* Conducător */
  .vehicles-v2 td[data-col="driver_ui"]{
    min-width: 180px;
    white-space: normal;
  }

  .vehicles-v2 td[data-col="driver_ui"] .dept-line{
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
    opacity: .58;
  }

  /* Telefon */
  .vehicles-v2 td[data-col="phone_ui"]{
    min-width: 125px;
  }

  .vehicles-v2 .tel-lines{
    gap: 5px;
  }

  /* Număr auto */
  .vehicles-v2 td[data-col="licPlate"]{
    font-weight: 800;
    letter-spacing: .025em;
  }

  /* Accesuri */
  .vehicles-v2 td[data-col="parking_access"],
  .vehicles-v2 td[data-col="site_access"]{
    min-width: 128px;
  }

  /* Comentarii */
  .vehicles-v2 td[data-col="accessNotes"]{
    min-width: 180px;
    max-width: 250px;
    white-space: normal;
  }

  .vehicles-v2 .access-note-badge{
    max-width: 220px;
    padding: 6px 10px;
    border-radius: 10px;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
    box-shadow: 0 5px 16px rgba(245, 158, 11, .16);
  }

  /* Footer / paginare */
  .vehicles-v2 .pager{
    min-height: 58px;
    padding: 12px 16px;
    border-top: 1px solid var(--v2-border);
    background: rgba(255, 255, 255, .018);
  }

  .vehicles-v2 .pager .chip{
    background: rgba(255, 255, 255, .035);
  }
}

/* Respectăm utilizatorii care preferă animații reduse */
@media (prefers-reduced-motion: reduce){
  .vehicles-v2 *,
  .vehicles-v2 *::before,
  .vehicles-v2 *::after{
    scroll-behavior: auto !important;
    transition: none !important;
  }
}


/* =========================================================
   AVAX V2 DESKTOP FINAL POLISH V1
   Desktop only — visual changes only
   ========================================================= */

@media (min-width: 901px){

  /* Header mai compact */
  .vehicles-v2 .wrap{
    padding-top: 18px;
  }

  .vehicles-v2 .hero{
    padding: 18px 22px;
    margin-bottom: 14px;
    min-height: 0;
  }

  .vehicles-v2 .hero .title > div{
    margin-bottom: 5px !important;
  }

  .vehicles-v2 .hero .title img{
    height: 36px !important;
  }

  .vehicles-v2 .hero h1{
    font-size: clamp(27px, 1.8vw, 34px);
  }

  .vehicles-v2 .hero p{
    margin-top: 7px;
  }

  /* Cardul principal mai aproape de header */
  .vehicles-v2 .card{
    margin-top: 0;
  }

  /* Toolbar puțin mai compact */
  .vehicles-v2 .toolbar{
    padding: 13px 16px;
  }

  .vehicles-v2 .toolbar .search input,
  .vehicles-v2 .toolbar .btn{
    height: 42px;
    min-height: 42px;
  }

  /* Mai multe rânduri vizibile */
  .vehicles-v2 .tablewrap{
    max-height: calc(100vh - 245px);
  }

  /* Conducătorul primește puțin mai mult spațiu */
  .vehicles-v2 th:first-child,
  .vehicles-v2 td[data-col="driver_ui"]{
    min-width: 220px;
  }

  /* Comentarii lizibile, fără să împingă excesiv tabelul */
  .vehicles-v2 th:last-child,
  .vehicles-v2 td[data-col="accessNotes"]{
    min-width: 185px;
    width: 185px;
    max-width: 230px;
  }

  .vehicles-v2 td[data-col="accessNotes"]{
    white-space: normal;
  }

  .vehicles-v2 .access-note-badge{
    display: inline-flex;
    width: auto;
    max-width: 210px;
    padding: 6px 10px;
    border-radius: 10px;
    text-align: left;
  }

  /* Contrast mai bun pentru headerul tabelului în light mode */
  [data-theme="light"] .vehicles-v2 #vehiclesTableWrap thead th{
    background: rgba(226, 232, 240, .98);
    color: rgba(15, 23, 42, .84);
    border-bottom-color: rgba(15, 23, 42, .18);
  }

  /* Stare disabled mai clară */
  .vehicles-v2 #btnEditVehicle.btn-disabled,
  .vehicles-v2 #btnEditVehicle[aria-disabled="true"]{
    opacity: .48;
    filter: saturate(.55);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
  }
}


/* =========================================================
   AVAX V2 HERO INLINE LOGO V1
   ========================================================= */

.vehicles-v2 .hero-title-row{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:6px;
  min-width:0;
}

.vehicles-v2 .hero-logo{
  display:block;
  width:auto;
  height:34px;
  flex:0 0 auto;
}

.vehicles-v2 .hero-title-row h1{
  margin:0;
}

@media (min-width: 901px){
  .vehicles-v2 .hero{
    padding:16px 20px;
  }

  .vehicles-v2 .hero-title-row{
    gap:10px;
    margin-bottom:4px;
  }

  .vehicles-v2 .hero-logo{
    height:30px;
  }

  .vehicles-v2 .hero h1{
    font-size:clamp(25px, 1.7vw, 32px);
    line-height:1.04;
  }

  .vehicles-v2 .hero p{
    margin-top:4px;
  }
}

@media (max-width: 900px){
  .vehicles-v2 .hero-title-row{
    gap:10px;
    margin-bottom:6px;
  }

  .vehicles-v2 .hero-logo{
    height:28px;
  }
}

@media (max-width: 560px){
  .vehicles-v2 .hero-title-row{
    align-items:center;
    gap:8px;
  }

  .vehicles-v2 .hero-logo{
    height:24px;
  }
}
