/* Κέλυφος: πλαϊνό μενού (desktop), κάτω μπάρα (κινητό) */
.app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding:
    calc(20px + var(--safe-top))
    calc(16px + var(--safe-right))
    calc(var(--bottomnav-h) + 28px + var(--safe-bottom))
    calc(16px + var(--safe-left));
}

/* ---- Πλαϊνό μενού ---- */
.sidebar { display: none; }

@media (min-width: 1024px) {
  .app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .main { padding: 36px 44px 72px; }
  .bottomnav { display: none !important; }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 16px 18px;
    background: var(--frame);
    color: var(--frame-ink);
    overflow-y: auto;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 18px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--frame-ink);
  color: var(--frame);
}
.brand-text { display: grid; gap: 1px; min-width: 0; }
.brand-name {
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--frame-muted);
  letter-spacing: 0.01em;
}

.btn.btn-sidebar {
  justify-content: flex-start;
  margin: 0 0 14px;
  background: var(--frame-active);
  color: var(--frame-ink);
  border-color: transparent;
}
.btn.btn-sidebar:hover { background: #39414B; }

.snav { display: flex; flex-direction: column; gap: 2px; }
.snav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--frame-muted);
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.snav-item:hover { background: var(--frame-hover); color: var(--frame-ink); }
.snav-item.is-active { background: var(--frame-active); color: var(--frame-ink); }
.snav-item.is-active .icon { color: #9CC0EE; }

.svehicles {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--frame-active);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.svehicles-title {
  padding: 0 12px 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--frame-muted);
}
.svehicle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--frame-ink);
  font-weight: 500;
  font-size: 0.9375rem;
}
.svehicle .icon { color: var(--frame-muted); flex: none; }
.svehicle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svehicle:hover { background: var(--frame-hover); }
.svehicle.is-active { background: var(--frame-active); }
.snav-settings { margin-top: auto; }

/* ---- Κάτω μπάρα ---- */
.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: calc(var(--bottomnav-h) + var(--safe-bottom));
  padding: 0 calc(6px + var(--safe-right)) var(--safe-bottom) calc(6px + var(--safe-left));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.bn-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
}
.bn-item.is-active { color: var(--ink); }
.bn-item.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--ink);
}
.bn-add {
  display: grid;
  place-items: center;
  height: 100%;
}
.bn-add > span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow-lift);
}
.bn-add:active > span { transform: scale(0.95); }

/* ---- Κεφαλίδα σελίδας ---- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.page-title {
  font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.page-sub { margin-top: 6px; color: var(--muted); }
.page-actions { display: flex; gap: 10px; flex: none; }

@media (max-width: 640px) {
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
}
@media (max-width: 1023px) {
  .page-head .page-actions [data-action="quick-add"] { display: none; }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 10px -4px;
  padding: 4px 6px 4px 2px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.875rem;
}
.back-link:hover { color: var(--ink); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 2px 12px;
}
.section-title { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; }

.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---- Αρχική ---- */
.dash { display: flex; flex-direction: column; gap: 28px; }
.dash-cols { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .dash-cols { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
}

/* ---- Επισκόπηση οχήματος ---- */
.ov { display: flex; flex-direction: column; gap: 16px; }
.ov-col { display: contents; }
/* Σειρά στο κινητό */
.ov-upcoming { order: 1; }
.ov-actions { order: 2; }
.ov-history { order: 3; }
.ov-issues { order: 4; }
.ov-expenses { order: 5; }
.ov-specs { order: 6; }
.ov-identity { order: 7; }
.ov-docs { order: 8; }

@media (min-width: 900px) {
  .ov { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
  .ov-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
}

.settings { display: flex; flex-direction: column; gap: 16px; max-width: 820px; }
.mgroups { display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
