:root {
  --portal-accent: #075ca8;
  --portal-focus: rgba(7, 92, 168, .28);
}

html { scroll-behavior: smooth; }
body { -webkit-tap-highlight-color: transparent; }

body.portal-ready main,
body.portal-ready .container:not(nav .container),
body.portal-ready .login-shell,
body.portal-ready .auth-wrap {
  animation: portal-enter .42s ease both;
}

@keyframes portal-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card,
.dashboard-card,
.quick-action,
.list-group-item,
.admin-sidebar,
.portal-interactive {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}

.card.portal-hover:hover,
.dashboard-card:hover,
.quick-action:hover,
.portal-interactive:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(14, 42, 70, .13) !important;
}

a, button, .btn, [role="button"] { touch-action: manipulation; }
.btn, button { position: relative; overflow: hidden; }
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--portal-focus) !important;
  outline-offset: 2px;
}

.portal-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.48);
  pointer-events: none;
  transform: translate(-50%,-50%) scale(0);
  animation: portal-ripple .55s ease-out;
}
@keyframes portal-ripple { to { transform: translate(-50%,-50%) scale(5); opacity: 0; } }

.portal-loading { pointer-events: none; opacity: .78; }
.portal-loading::after {
  content: '';
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: portal-spin .65s linear infinite;
}
@keyframes portal-spin { to { transform: rotate(360deg); } }

.portal-alert-close {
  float: right;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0 0 12px;
}

.table-responsive { border-radius: 12px; }
table tbody tr { transition: background-color .16s ease, transform .16s ease; }
table tbody tr:hover { background-color: rgba(7, 92, 168, .055); }

.portal-scroll-progress {
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #efb52a, #2bbf83);
  box-shadow: 0 0 10px rgba(239,181,42,.5);
  pointer-events: none;
}

.portal-mobile-menu {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 1090;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--portal-accent);
  box-shadow: 0 8px 22px rgba(0,0,0,.24);
}

.portal-dashboard-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 13px;
  border: 1px solid rgba(7,92,168,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 8px 22px rgba(22,52,78,.07);
}
.portal-dashboard-greeting { margin-right: auto; min-width: 180px; }
.portal-dashboard-greeting strong { display: block; color: #173c61; }
.portal-dashboard-greeting small { color: #687b8c; }
.portal-dashboard-search { position: relative; flex: 1 1 220px; max-width: 340px; }
.portal-dashboard-search input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c8d7e4;
  border-radius: 999px;
  padding: 8px 38px 8px 14px;
  background: #fff;
}
.portal-dashboard-search span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #64798b; }
.portal-refresh {
  min-height: 40px;
  border: 1px solid #b8ccdc;
  border-radius: 999px;
  padding: 8px 13px;
  color: #17476f;
  background: #f7fbff;
  font-weight: 700;
}
.portal-refresh.is-refreshing span { display: inline-block; animation: portal-spin .65s linear infinite; }
.portal-dashboard-card { animation: portal-card-in .38s ease both; animation-delay: calc(var(--portal-card-index, 0) * 45ms); }
@keyframes portal-card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.portal-card-link { cursor: pointer; }
.portal-card-link:focus-visible { outline: 3px solid var(--portal-focus); outline-offset: 3px; }
.portal-filtered-out { display: none !important; }
.portal-no-results { width: 100%; padding: 22px; text-align: center; color: #687b8c; border: 1px dashed #b9cad8; border-radius: 12px; }
.portal-updated { font-variant-numeric: tabular-nums; }

@media (min-width: 992px) { .portal-mobile-menu { display: none; } }
@media (max-width: 767px) {
  .btn { min-height: 42px; }
  .card.portal-hover:hover, .dashboard-card:hover { transform: none; }
  table { font-size: .84rem; }
  .portal-dashboard-tools { align-items: stretch; }
  .portal-dashboard-greeting, .portal-dashboard-search { flex-basis: 100%; max-width: none; }
  .portal-refresh { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.faculty-pwa-install {
  position: fixed;
  z-index: 1200;
  right: 14px;
  bottom: 74px;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px;
  background: #082f52;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(0,25,50,.28);
}
.faculty-pwa-install[hidden], .pwa-standalone .faculty-pwa-install { display: none !important; }
