:root {
  --zyna-sidebar-bg: #0f172a;
  --zyna-sidebar-bg-2: #111827;
}

body.zyna-app { background: #f4f6fb; }

.zyna-sidebar {
  width: 240px;
  min-width: 240px;
  background: linear-gradient(180deg, var(--zyna-sidebar-bg) 0%, var(--zyna-sidebar-bg-2) 100%);
}

.zyna-sidebar .nav-link {
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-weight: 500;
  opacity: 0.85;
}
.zyna-sidebar .nav-link:hover {
  background: rgba(255,255,255,0.06);
  opacity: 1;
}
.zyna-sidebar .nav-link.active {
  background: rgba(99,102,241,0.25);
  opacity: 1;
}
.zyna-sidebar i { width: 1.1em; text-align: center; margin-right: 4px; }

.card { border-radius: 0.75rem; }

/* Driver mobile layout: slim sticky top bar, no sidebar */
.driver-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: linear-gradient(90deg, var(--zyna-sidebar-bg) 0%, var(--zyna-sidebar-bg-2) 100%);
  padding-top: calc(0.5rem + env(safe-area-inset-top));
}

.zyna-login {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  min-height: 100vh;
}
.zyna-login .card { border-radius: 0.85rem; }

#customer_results .list-group-item { cursor: pointer; }
#customer_results .list-group-item:hover { background: #f1f5f9; }

.article-row td { vertical-align: middle; }

/* Mobile bottom tab bar (shown only below md via .d-flex.d-md-none). */
.zyna-bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  background: linear-gradient(90deg, var(--zyna-sidebar-bg) 0%, var(--zyna-sidebar-bg-2) 100%);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.zyna-bottomnav a,
.zyna-bottomnav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.45rem 0;
  font-size: 0.7rem;
  line-height: 1.1;
  color: rgba(255,255,255,0.7);
  background: transparent;
  border: 0;
  text-decoration: none;
}
.zyna-bottomnav i { font-size: 1.2rem; }
.zyna-bottomnav a.active,
.zyna-bottomnav a:hover,
.zyna-bottomnav button:hover { color: #fff; }

@media (max-width: 768px) {
  /* Sidebar is hidden via .d-none; reserve space for the fixed bottom bar. */
  main { padding-bottom: 4.75rem; }

  /* Articles table -> stacked labeled cards (keeps desktop table intact). */
  #articles-table thead { display: none; }
  #articles-table,
  #articles-table tbody,
  #articles-table tfoot,
  #articles-table tr,
  #articles-table td { display: block; width: 100%; }

  #articles-table tr.article-row {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background: #fff;
  }

  #articles-table tr.article-row td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 0;
    padding: 0.3rem 0;
  }
  #articles-table tr.article-row td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #64748b;
    flex: 0 0 auto;
  }
  #articles-table tr.article-row td .form-control { max-width: 60%; }
  #articles-table tr.article-row td.article-total {
    justify-content: space-between;
    font-weight: 600;
  }
  #articles-table tr.article-row td.article-actions { justify-content: flex-end; }
  #articles-table tr.article-row td.article-actions::before { content: ""; }
  #articles-table tr.article-row td.article-actions .remove-article { width: 100%; }

  /* Grand total row */
  #articles-table tfoot tr { display: flex; justify-content: space-between; padding: 0.5rem 0.25rem; }
  #articles-table tfoot td { width: auto; padding: 0; }
  #articles-table tfoot td:empty { display: none; }
}
