:root {
  --brand: #0d6efd;
  --brand-dark: #0a58ca;
  --surface: #f4f6f9;
}

body {
  background-color: var(--surface);
}

.navbar-brand {
  font-weight: 700;
}

.hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  padding: 64px 0;
}

.card {
  border: none;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  border-radius: 10px;
}

.status-badge {
  font-size: .8rem;
  padding: .4em .7em;
}

.step-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.step-progress .step {
  flex: 1 1 auto;
  text-align: center;
  padding: 10px 6px;
  border-radius: 6px;
  background: #e9ecef;
  color: #6c757d;
  font-size: .8rem;
  font-weight: 600;
}
.step-progress .step.active {
  background: var(--brand);
  color: #fff;
}
.step-progress .step.done {
  background: #198754;
  color: #fff;
}
.step-progress .step.rejected {
  background: #dc3545;
  color: #fff;
}

/* Admin layout */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: #101828;
  color: #cbd5e1;
  flex-shrink: 0;
}
.admin-sidebar a {
  color: #cbd5e1;
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(255,255,255,.06);
  color: #fff;
  border-left-color: var(--brand);
}
.admin-content { flex: 1; padding: 24px; }
.stat-card {
  border-radius: 12px;
  padding: 20px;
  color: #fff;
}
.dropzone {
  border: 2px dashed #ced4da;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background: #fff;
}
.dropzone.dragover { border-color: var(--brand); background: #eef4ff; }

@media (max-width: 768px) {
  .admin-sidebar { position: fixed; z-index: 1050; height: 100%; transform: translateX(-100%); transition: transform .2s; }
  .admin-sidebar.show { transform: translateX(0); }
}

/* ===================================================================
   Native-app-like PWA styling: bottom tab bar, safe areas, touch feel
   =================================================================== */

html {
  -webkit-tap-highlight-color: transparent;
}

body.pwa-standalone {
  overscroll-behavior-y: contain;
}

.bottom-tab-bar {
  display: none;
}

@media (max-width: 768px) {
  /* Give the bottom tab bar room; safe-area-inset covers the iPhone home indicator. */
  .admin-content, main {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .bottom-tab-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .bottom-tab-bar a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 2px 6px;
    color: #6c757d;
    text-decoration: none;
    font-size: .68rem;
    font-weight: 600;
    position: relative;
  }

  .bottom-tab-bar a i {
    font-size: 1.25rem;
    line-height: 1;
  }

  .bottom-tab-bar a.active {
    color: var(--brand);
  }

  .bottom-tab-bar a .tab-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 20px);
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    font-size: .6rem;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
  }

  /* Sidebar becomes a full off-canvas drawer reached via the tab bar's "More" tab. */
  .admin-sidebar { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* Buttons/cards feel more tactile on touch devices, like a native app. */
.btn {
  -webkit-tap-highlight-color: transparent;
  transition: transform .05s ease;
}
.btn:active {
  transform: scale(.97);
}

/* "Install app" floating action button */
.install-app-fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 1060;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--brand);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(13,110,253,.4);
  font-weight: 600;
  font-size: .85rem;
  align-items: center;
  gap: 8px;
}
.install-app-fab.show {
  display: flex;
}
@media (max-width: 768px) {
  .install-app-fab {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
}
