/* =========================================================
   Velo Global Express - DESKTOP layout (PC, or "Desktop site" in a phone browser)
   Only applies at 900px and wider (Chrome "Desktop site" on a phone is about 980px). Phones keep the existing mobile layout.
   Colours = the site's existing palette: deep teal + signal red.
   ========================================================= */

/* Desktop-only pieces are hidden everywhere else */
.dk-side, .dk-top, .vx-hero, .vx-side { display: none; }

@media (min-width: 900px) {
  :root {
    --dk-side: 250px;
    --dk-bg: #071d24;
    --dk-card: #0c2c35;
    --dk-line: #18424d;
    --dk-text: #f4f9fb;
    --dk-muted: #9fb8c0;
    --dk-red: #ee1c25;
    --dk-top-h: 76px;
  }

  /* ---------- hide the phone chrome ---------- */
  .bottom-nav, .menu-sheet, .topbar, .vx-head { display: none !important; }
  body, body.vx-home { padding-bottom: 0 !important; }

  /* ---------- sidebar ---------- */
  .dk-side {
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--dk-side); z-index: 60;
    background: linear-gradient(180deg, #0a2a33 0%, #071d24 100%);
    border-right: 1px solid var(--dk-line);
    padding: 18px 14px 14px; overflow-y: auto; color: var(--dk-text);
  }
  .dk-brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 18px; text-decoration: none; color: #fff; }
  .dk-brand img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.14); background: #050505; flex: none; }
  .dk-brand strong { display: block; font-family: var(--font-display); font-size: 17px; line-height: 1.15; }
  .dk-brand strong em { font-style: normal; color: var(--dk-red); }
  .dk-brand small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--dk-muted); }
  .dk-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
  .dk-nav a {
    display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 14px;
    color: var(--dk-muted); font-weight: 600; font-size: 15.5px; text-decoration: none; position: relative;
    transition: background .15s, color .15s;
  }
  .dk-nav a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
  .dk-nav a svg.fill { fill: currentColor; stroke: none; }
  .dk-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
  .dk-nav a.on { background: rgba(238,28,37,.16); color: #fff; box-shadow: inset 3px 0 0 var(--dk-red); }
  .dk-nav a.on svg { color: var(--dk-red); }
  .dk-badge { margin-left: auto; background: var(--dk-red); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
  .dk-promo {
    margin-top: auto; border: 1px solid var(--dk-line); border-radius: 18px; padding: 18px 16px;
    background: linear-gradient(105deg, #0c2c35 0%, #0c2c35 55%, #8d1118 55.5%, #b3141c 100%);
  }
  .dk-promo h4 { font-family: var(--font-display); font-size: 19px; line-height: 1.15; margin: 0; color: #fff; }
  .dk-promo h4 em { display: block; font-style: normal; color: #ff2b33; }
  .dk-promo p { margin: 6px 0 12px; font-size: 13px; color: #cfdde2; }
  .dk-promo a { display: inline-block; background: #ff1e26; color: #fff; font-weight: 700; font-size: 14px; padding: 9px 18px; border-radius: 999px; text-decoration: none; }
  .dk-copy { padding: 14px 6px 0; font-size: 11.5px; color: #6f8c95; }

  /* ---------- top bar ---------- */
  .dk-top {
    display: flex; align-items: center; gap: 16px;
    position: fixed; top: 0; left: var(--dk-side); right: 0; height: var(--dk-top-h); z-index: 55;
    padding: 0 32px; background: rgba(7,29,36,.92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--dk-line);
  }
  .dk-search {
    flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px;
    background: var(--dk-card); border: 1px solid var(--dk-line); border-radius: 999px; margin: 0;
  }
  .dk-search svg { width: 19px; height: 19px; stroke: var(--dk-muted); fill: none; stroke-width: 2; stroke-linecap: round; flex: none; }
  .dk-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #fff; font-size: 14.5px; font-family: inherit; padding: 0; box-shadow: none; }
  .dk-search input::placeholder { color: var(--dk-muted); }
  .dk-search:focus-within { border-color: var(--dk-red); }
  .dk-bell {
    margin-left: auto; position: relative; width: 46px; height: 46px; border-radius: 50%;
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; justify-content: center; color: #fff;
  }
  .dk-bell svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .dk-bell i { position: absolute; top: 10px; right: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--dk-red); border: 2px solid #0b2a33; }
  .dk-user { position: relative; }
  .dk-user summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; color: #fff; font-weight: 700; }
  .dk-user summary::-webkit-details-marker { display: none; }
  .dk-av { width: 44px; height: 44px; border-radius: 50%; background: var(--dk-red); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
  .dk-caret { color: var(--dk-muted); font-size: 12px; }
  .dk-drop {
    position: absolute; right: 0; top: 56px; min-width: 190px; background: var(--dk-card);
    border: 1px solid var(--dk-line); border-radius: 14px; padding: 8px; box-shadow: 0 16px 36px rgba(0,0,0,.45);
  }
  .dk-drop a, .dk-drop button { display: block; width: 100%; text-align: left; padding: 11px 14px; border-radius: 10px; color: #fff; font-size: 14.5px; font-weight: 600; background: none; border: 0; cursor: pointer; text-decoration: none; font-family: inherit; }
  .dk-drop a:hover, .dk-drop button:hover { background: rgba(255,255,255,.07); }
  .dk-drop button { color: #ff6b70; }
  .dk-drop form { margin: 0; }

  /* ---------- content area (all signed-in pages) ---------- */
  .dk-side ~ .flash-stack { position: fixed; top: calc(var(--dk-top-h) + 10px); left: calc(var(--dk-side) + 32px); right: 32px; z-index: 70; padding: 0; max-width: none; }
  .dk-side ~ main { margin-left: var(--dk-side); padding-top: var(--dk-top-h); min-height: 100vh; }

  /* inner pages: wider, centred content instead of the 480px phone column */
  .dk-side ~ main .container { max-width: 1000px; padding: 0 32px; }
  .dk-side ~ main .page-head { max-width: 1000px; margin: 0 auto; padding: 30px 32px 8px; }
  .dk-side ~ main .page-head h1 { font-size: 28px; }
  .dk-side ~ main .search-bar, .dk-side ~ main .filter-chips { max-width: 1000px; margin-left: auto; margin-right: auto; padding-left: 32px; padding-right: 32px; }

  /* create-tracking form: two columns so it fits a PC screen */
  .dk-side ~ main #create-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; align-items: start; padding-bottom: 40px; }
  .dk-side ~ main #create-form > fieldset {
    background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 8px 22px 6px; margin: 0 0 22px; box-shadow: var(--shadow);
  }
  .dk-side ~ main #create-form > fieldset legend { font-family: var(--font-display); font-weight: 700; padding: 0 8px; }
  .dk-side ~ main #create-form > :not(fieldset) { grid-column: 1 / -1; }
  .dk-side ~ main #create-form > button.btn { max-width: 420px; margin: 0 auto; }

  /* ---------- HOME / dashboard on desktop ---------- */
  body.vx-home { background: radial-gradient(120% 60% at 60% 0%, #0d3540 0%, #071d24 55%, #05151a 100%) fixed; }
  body.vx-home .dk-side ~ main, body.vx-home main { max-width: none; margin: 0 0 0 var(--dk-side); padding: var(--dk-top-h) 32px 40px; }
  body.vx-home .flash-stack { max-width: none; }
  .vx-hero {
    display: block; position: relative; margin: 28px 0 8px; border-radius: 22px; overflow: hidden;
    border: 1px solid var(--dk-line); min-height: 250px; background-size: cover; background-position: center right;
  }
  .vx-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,29,36,.96) 0%, rgba(7,29,36,.82) 42%, rgba(7,29,36,.15) 100%); }
  .vx-hero-in { position: relative; padding: 38px 44px; max-width: 560px; }
  .vx-hero-in small { display: block; font-size: 15px; font-weight: 600; color: var(--dk-muted); margin-bottom: 6px; }
  .vx-hero-in h2 { font-family: var(--font-display); font-size: 42px; line-height: 1.1; margin: 0 0 12px; color: #fff; }
  .vx-hero-in h2 em { font-style: normal; color: var(--dk-red); }
  .vx-hero-in p { color: #cfdde2; font-size: 16px; line-height: 1.5; margin: 0 0 20px; }
  .vx-hero-btn { display: inline-block; background: var(--dk-red); color: #fff; font-weight: 700; padding: 13px 24px; border-radius: 999px; text-decoration: none; box-shadow: 0 8px 20px rgba(238,0,0,.3); }
  .vx-hero-btn:hover { background: #d40000; }

  .vx-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
  .vx-main { min-width: 0; }
  /* the phone-only greeting and banner are replaced by the hero + sidebar promo */
  .vx-main .vx-greet, .vx-main .vx-banner { display: none; }
  .vx-main .vx-sec { padding: 22px 0 14px; }
  .vx-main .vx-actions { grid-template-columns: repeat(4, 1fr); padding: 0; gap: 16px; }
  .vx-main .vx-act { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; position: relative; transition: transform .15s, border-color .15s; }
  .vx-main .vx-act:hover { transform: translateY(-3px); border-color: var(--dk-red); }
  .vx-main .vx-act .chev { position: absolute; top: 18px; right: 16px; }
  .vx-main .vx-list { padding: 0; }
  .vx-main .vx-empty { margin: 0; }
  .vx-main .vx-row { transition: border-color .15s; }
  .vx-main .vx-row:hover { border-color: var(--dk-red); }

  .vx-side { display: flex; flex-direction: column; gap: 20px; margin-top: 22px; }
  .vx-box { background: var(--dk-card); border: 1px solid var(--dk-line); border-radius: 18px; padding: 18px; color: #fff; }
  .vx-box-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .vx-box-h h3 { font-family: var(--font-display); font-size: 18px; margin: 0; color: #fff; }
  .vx-box-h a { color: var(--dk-muted); font-size: 13.5px; text-decoration: none; }
  .vx-updates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
  .vx-updates li { display: flex; gap: 12px; align-items: flex-start; }
  .vx-updates .d { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--dk-red); margin-top: 6px; }
  .vx-updates .d.transit { background: #19b3c0; }
  .vx-updates .d.delivered { background: #2fbf63; }
  .vx-updates a { color: #fff; font-size: 14.5px; font-weight: 600; text-decoration: none; line-height: 1.35; display: block; }
  .vx-updates small { display: block; color: var(--dk-muted); font-size: 12.5px; margin-top: 2px; }
  .vx-none { color: var(--dk-muted); font-size: 14px; margin: 0; }
  .vx-links { display: flex; flex-direction: column; gap: 10px; }
  .vx-links a { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--dk-line); color: #fff; font-size: 14.5px; font-weight: 600; text-decoration: none; }
  .vx-links a:hover { border-color: var(--dk-red); }
  .vx-links svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
  .vx-links a span { margin-left: auto; color: #cfdde2; font-size: 22px; line-height: 1; }
  .vx-help { background: linear-gradient(135deg, #0c2c35 0%, #12414d 100%); }
  .vx-help h3 { font-family: var(--font-display); font-size: 18px; margin: 0 0 4px; color: #fff; }
  .vx-help p { color: var(--dk-muted); font-size: 14px; margin: 0 0 14px; }
  .vx-help a { display: inline-block; border: 1px solid rgba(255,255,255,.3); color: #fff; font-weight: 700; font-size: 14px; padding: 9px 18px; border-radius: 999px; text-decoration: none; }
  .vx-help a:hover { background: var(--dk-red); border-color: var(--dk-red); }
}

/* medium desktops: tuck the right column under the main one */
@media (min-width: 900px) and (max-width: 1279px) {
  .vx-grid { grid-template-columns: minmax(0, 1fr); }
  .vx-side { display: grid; grid-template-columns: 1fr 1fr; }
  .vx-side .vx-help { grid-column: 1 / -1; }
  .vx-main .vx-actions { grid-template-columns: repeat(2, 1fr); }
}

/* wide screens get a roomier sidebar */
@media (min-width: 1280px) { :root { --dk-side: 270px; } }

/* desktop: the welcome / status message floats over the page and fades away on its own */
@media (min-width: 900px) {
  .dk-side ~ .flash-stack .flash { box-shadow: 0 10px 26px rgba(0,0,0,.4); animation: dkFlash 6s ease forwards; }
  @keyframes dkFlash { 0%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); visibility: hidden; } }
}

@media (min-width: 900px) {
  /* tracking cards line up with the page title and search bar */
  .dk-side ~ main .tracking-card { width: min(936px, calc(100% - 64px)); margin-left: auto; margin-right: auto; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .dk-side ~ main #create-form .field-row { flex-direction: column; gap: 0; }
}
