/* Solia Garage — mobile admin shell (inspired by student-gui-v2 mobile hub) */

body.solia-mobile-shell {
  --solia-accent: #1a5276;
  --mobile-top-bar-height: calc(48px + env(safe-area-inset-top, 0px));
  --mobile-bottom-nav-height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-top: var(--mobile-top-bar-height);
  padding-bottom: var(--mobile-bottom-nav-height);
}

body.solia-mobile-shell .navbar-desktop {
  display: none !important;
}

body.solia-mobile-shell .container-fluid.px-4 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

body.solia-mobile-shell footer {
  display: none;
}

@media (min-width: 992px) {
  body.solia-mobile-shell {
    padding-top: 0;
    padding-bottom: 0;
  }
  body.solia-mobile-shell .navbar-desktop {
    display: flex !important;
  }
  .solia-mobile-top-bar,
  .solia-mobile-bottom-nav,
  .solia-notif-backdrop {
    display: none !important;
  }
}

/* ── Top bar ─────────────────────────────────────────────── */
.solia-mobile-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: env(safe-area-inset-top, 0px) 10px 0 12px;
  background: linear-gradient(135deg, #1a5276 0%, #2e86c1 100%);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.solia-mobile-top-bar__brand {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  text-decoration: none;
}

.solia-mobile-top-bar__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.solia-mobile-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}

.solia-mobile-icon-btn:active,
.solia-mobile-icon-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.15);
}

.solia-mobile-notif-wrap {
  position: relative;
}

.solia-mobile-notif-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #dc3545;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ── Notification panel ─────────────────────────────────── */
.solia-notif-panel {
  position: fixed;
  top: var(--mobile-top-bar-height, 48px);
  left: 0;
  right: 0;
  max-height: min(70vh, calc(100dvh - var(--mobile-top-bar-height, 48px) - var(--mobile-bottom-nav-height, 64px)));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1041;
}

.solia-notif-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
  position: sticky;
  top: 0;
  z-index: 1;
}

.solia-notif-panel__header strong {
  font-size: 0.95rem;
}

.solia-notif-link {
  font-size: 0.78rem;
  white-space: nowrap;
  color: var(--solia-accent);
}

.solia-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  color: #212529;
  text-decoration: none;
}

.solia-notif-item:active {
  background: #f1f5f9;
}

.solia-notif-item__icon {
  flex: 0 0 auto;
  font-size: 1.1rem;
  line-height: 1;
  margin-top: 2px;
}

.solia-notif-item__body {
  flex: 1 1 auto;
  min-width: 0;
}

.solia-notif-item__title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.solia-notif-empty {
  padding: 24px 14px;
  text-align: center;
  color: #6c757d;
  font-size: 0.88rem;
}

.solia-notif-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1039;
  background: rgba(0, 0, 0, 0.35);
}

body.solia-notif-panel-open {
  overflow: hidden;
}

/* ── Bottom nav ──────────────────────────────────────────── */
.solia-mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  background: #fff;
  border-top: 1px solid #dee2e6;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.solia-mobile-bottom-nav .nav-row {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
}

.solia-mobile-bottom-nav a {
  flex: 1 1 0;
  text-align: center;
  padding: 8px 4px 6px;
  color: #495057;
  text-decoration: none;
  font-size: 0.72rem;
  line-height: 1.1;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
}

.solia-mobile-bottom-nav a .nav-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.solia-mobile-bottom-nav a.active {
  color: var(--solia-accent);
  font-weight: 600;
  background: #eef4ff;
}

.solia-mobile-bottom-nav a:active {
  background: #e2e6ea;
}

.solia-mobile-bottom-nav .badge-count {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  background: #dc3545;
  color: #fff;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  min-width: 16px;
  line-height: 1.3;
}

/* ── Hub grid ────────────────────────────────────────────── */
.mobile-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .mobile-hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.mobile-hub-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 108px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #dee2e6;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #212529;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: transform 0.12s ease;
}

.mobile-hub-tile:active {
  transform: scale(0.98);
}

.mobile-hub-tile.primary {
  border-color: #b6d4fe;
  background: linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
}

.mobile-hub-tile.alert-tile {
  border-color: #f5c2c7;
  background: linear-gradient(180deg, #fff5f5 0%, #fff 100%);
}

.mobile-hub-tile .tile-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 8px;
}

.mobile-hub-tile .tile-label {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.15;
}

.mobile-hub-tile .tile-meta {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 4px;
}

.mobile-hub-tile .tile-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.mobile-hub-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: auto;
}

.mobile-page-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.mobile-page-header h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.mobile-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid #dee2e6;
  background: #fff;
  color: #212529;
  text-decoration: none;
  font-size: 1.2rem;
}

.mobile-tap-target {
  min-height: 44px;
}

.mobile-list-card {
  border-radius: 12px;
  border: 1px solid #dee2e6;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  margin-bottom: 10px;
  overflow: hidden;
}

.mobile-list-card .card-body-inner {
  padding: 12px 14px;
}

.mobile-list-card a.card-link {
  display: block;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
}

.mobile-list-card a.card-link:active {
  background: #f1f5f9;
}
