/* ============================================================
   MegaCash Portal — portal-specific styles
   Extends styles.css (loaded first on all portal pages)
   ============================================================ */

/* Prevent horizontal page scroll on all portal pages */
html, body { overflow-x: hidden; max-width: 100%; }

/* --- Skip to main content link (IA42) --------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 99999;
  padding: 0.75rem 1.25rem;
  background: #15803d;
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 0;
}

/* --- Auth pages (login, signup, reset) -------------------- */

/* Card entrance animation */
@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Frosted nav bar sitting on top of the green background */
.auth-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(5, 40, 20, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  z-index: 10;
}

.auth-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.2px;
}

.auth-nav-logo img {
  width: 30px;
  height: 30px;
  filter: brightness(0) invert(1);
}

.auth-nav-back {
  color: rgba(255,255,255,0.72);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}

.auth-nav-back:hover { color: #fff; }

/* Keep lang-btn visible in auth-nav on mobile (overrides styles.css hide) */
.auth-nav .lang-btn { display: flex !important; }

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 8% 5%,  rgba(255,255,255,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 92% 95%, rgba(255,255,255,0.05) 0%, transparent 55%),
    linear-gradient(150deg, #083d1e 0%, #0f5c2e 55%, #145229 100%);
  padding: 5rem 1rem 2rem; /* top padding clears the fixed nav */
}

.auth-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  padding: 2.75rem 2.25rem;
  width: 100%;
  max-width: 420px;
  animation: authFadeUp 0.35s ease both;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f5c2e;
  text-decoration: none;
  margin-bottom: 2rem;
}

.auth-logo img {
  width: 34px;
  height: 34px;
}

.auth-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.35rem;
  letter-spacing: -0.3px;
}

.auth-card .auth-sub {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

.auth-card .form-group {
  margin-bottom: 1.1rem;
}

.auth-card label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-card input {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #0f172a;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-card input:focus {
  outline: none;
  border-color: #0f5c2e;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15,92,46,0.12);
}

.auth-card .btn-primary {
  width: 100%;
  padding: 0.8rem;
  background: #0f5c2e;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.01em;
}

.auth-card .btn-primary:hover {
  background: #0d4f27;
}

.auth-card .btn-primary:active {
  transform: scale(0.99);
}

.auth-card .btn-primary:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.auth-card input:focus-visible {
  outline: none; /* custom ring already applied via border + box-shadow */
}

.auth-card a:focus-visible {
  outline: 2px solid #0f5c2e;
  outline-offset: 2px;
  border-radius: 3px;
}

.auth-card .auth-links {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: #64748b;
}

.auth-card .auth-links a {
  color: #0f5c2e;
  text-decoration: none;
  font-weight: 600;
}

.auth-card .auth-links a:hover {
  text-decoration: underline;
}

.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}

.auth-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}

/* Auth wrap — stacks card + trust strip vertically */
.auth-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 420px;
}

/* Phone field — country code + number */
.phone-field {
  display: flex;
  gap: 0.5rem;
}

.phone-field #phoneCode {
  width: 72px;
  flex-shrink: 0;
  text-align: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.phone-field #phoneNumber {
  flex: 1;
}

/* Password field with show/hide toggle */
.pwd-field {
  position: relative;
}

.pwd-field input {
  padding-left: 2.75rem;
  padding-right: 2.75rem;
}

.pwd-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 0;
  display: flex;
  align-items: center;
  line-height: 1;
}

.pwd-toggle:hover { color: #475569; }

/* Password strength bar (signup only) */
.pwd-strength {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.pwd-strength-bar {
  flex: 1;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
}

.pwd-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.pwd-strength-label {
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 48px;
  text-align: right;
}

/* Input icon wrapper (email field) */
.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .input-icon,
.pwd-field .input-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.input-icon-wrap input {
  padding-left: 2.75rem;
}

/* Remember me checkbox */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: -0.15rem;
  margin-bottom: 0.75rem;
}

.form-check input[type="checkbox"] {
  width: auto;
  padding: 0;
  accent-color: #0f5c2e;
  cursor: pointer;
}

.form-check label {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
  cursor: pointer;
}

/* Terms / privacy notice (signup) */
.auth-terms {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 0.85rem;
  line-height: 1.55;
}

.auth-terms a {
  color: #0f5c2e;
  text-decoration: underline;
}

/* Trust strip below the card */
.auth-trust {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  color: rgba(255,255,255,0.45);
  font-size: 0.72rem;
  font-weight: 500;
  flex-wrap: wrap;
  justify-content: center;
}

.auth-trust-dot { opacity: 0.35; }

/* --- Dashboard layout ------------------------------------- */

.portal-layout {
  display: flex;
  min-height: 100vh;
  background: #f0f4f1;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: #052814;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.5rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1rem;
}

.sidebar-logo img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

/* Fix: override global nav{} from styles.css bleeding into sidebar-nav */
.sidebar nav {
  position: static;
  background: transparent;
  height: auto;
  padding: 0 0.75rem;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  gap: 0;
  z-index: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 0.2rem;
  height: auto;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar-nav a:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: -2px;
  border-radius: 8px;
}

.sidebar-nav a svg {
  flex-shrink: 0;
  opacity: 0.65;
}

.sidebar-nav a:hover svg,
.sidebar-nav a.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 1rem 1.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Lang + bell row inside sidebar footer */
.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

/* Lang button styled for the dark sidebar */
.sidebar-lang-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.sidebar-lang-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.sidebar-user {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.75rem;
  word-break: break-all;
}

.btn-signout {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 7px;
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-signout:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

/* Main content area */
.portal-main {
  margin-left: 240px;
  flex: 1;
  padding: 2rem 2.5rem;
  min-width: 0;
}

.portal-header {
  margin-bottom: 2rem;
}

.portal-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.portal-header p {
  color: #64748b;
  font-size: 0.9rem;
}

/* Cards */
.portal-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.portal-card h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-review   { background: #dbeafe; color: #1e40af; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-active   { background: #dcfce7; color: #166534; }
.badge-verified { background: #dcfce7; color: #166534; }
.badge-open     { background: #dbeafe; color: #1e40af; }
.badge-resolved { background: #f1f5f9; color: #64748b; }

/* Summary stat boxes */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  padding: 1.25rem 1.5rem;
}

.stat-box .stat-label {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.stat-box .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
}

/* Table wrapper — horizontal scroll on small screens */
.portal-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tables */
.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 480px;
}

.portal-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  color: #64748b;
  font-weight: 600;
  border-bottom: 1.5px solid #e2e8f0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.portal-table td {
  padding: 0.75rem;
  color: #374151;
  border-bottom: 1px solid #f1f5f9;
}

.portal-table tr:last-child td {
  border-bottom: none;
}

/* Upload area */
.upload-area {
  border: 2px dashed #e2e8f0;
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  color: #94a3b8;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1.25rem;
}

.upload-area:hover {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #64748b;
}

.upload-area svg {
  margin-bottom: 0.5rem;
}

.upload-area p {
  font-size: 0.875rem;
  margin: 0;
}

/* Ticket cards */
.ticket-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.ticket-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.ticket-card .ticket-subject {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.ticket-card .ticket-meta {
  font-size: 0.8rem;
  color: #94a3b8;
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Portal button variants */
.btn-portal {
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.btn-portal-primary {
  background: #f59e0b;
  color: #fff;
}

.btn-portal-primary:hover {
  background: #d97706;
}

.btn-portal-secondary {
  background: #f1f5f9;
  color: #374151;
}

.btn-portal-secondary:hover {
  background: #e2e8f0;
}

.btn-portal-danger {
  background: #fee2e2;
  color: #dc2626;
}

.btn-portal-danger:hover {
  background: #fecaca;
}

.btn-portal-warning {
  background: #fef3c7;
  color: #b45309;
}

.btn-portal-warning:hover {
  background: #fde68a;
}

.btn-portal:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.btn-signout:focus-visible {
  outline: 3px solid rgba(255,255,255,0.6);
  outline-offset: 2px;
}

/* Global portal input/select/textarea focus ring */
.portal-main input:focus-visible,
.portal-main select:focus-visible,
.portal-main textarea:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 0;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.18);
}

/* Action cards keyboard focus */
.action-card:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
  border-radius: 12px;
}

/* Quick action cards grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: #1e293b;
  transition: box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.action-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: #cbd5e1;
}

.action-card-primary {
  border-color: #f59e0b;
  background: #fffbeb;
}

.action-card-primary:hover {
  border-color: #d97706;
  box-shadow: 0 4px 16px rgba(245,158,11,0.15);
}

.action-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
}

.action-card-primary .action-card-icon {
  background: #fef3c7;
  color: #d97706;
}

.action-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.15rem;
}

.action-card-sub {
  font-size: 0.78rem;
  color: #94a3b8;
}

@media (max-width: 768px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
}

/* Portal top bar — name + actions */
.portal-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.portal-topbar h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.portal-topbar p {
  color: #64748b;
  font-size: 0.9rem;
}

.portal-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  padding-top: 0.2rem;
}

/* Lang button override for light portal background */
.portal-topbar-actions .lang-btn {
  border-color: #e2e8f0;
  color: #374151;
  background: #fff;
}

.portal-topbar-actions .lang-btn:hover {
  background: #f1f5f9;
}

/* Notification bell button */
.notif-bell-btn {
  position: relative;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.notif-bell-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #f8fafc;
}

/* Sidebar nav count badge (pending items indicator) */
.sidebar-nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
}

/* MFA / verification warning banner */
.notif-banner {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 0.8rem 1.1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: #92400e;
}

.notif-banner-msg {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notif-banner a {
  color: #0f5c2e;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.85rem;
}

.notif-banner a:hover { text-decoration: underline; }

/* Notification dropdown panel */
.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  border: 1px solid #e2e8f0;
  z-index: 500;
  overflow: hidden;
}

.notif-panel-header {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
}

.notif-mark-all {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: #f59e0b;
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}

.notif-mark-all:hover { text-decoration: underline; }

.notif-panel-list { max-height: 320px; overflow-y: auto; }

.notif-panel-empty {
  padding: 1.5rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
  margin: 0;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  text-decoration: none;
  color: #374151;
  font-size: 0.875rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
}

.notif-item:hover { background: #f8fafc; }

.notif-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.notif-dot-red    { background: #ef4444; }
.notif-dot-blue   { background: #3b82f6; }
.notif-dot-purple { background: #8b5cf6; }
.notif-dot-green  { background: #22c55e; }

.notif-item-body { flex: 1; min-width: 0; }

.notif-item-title {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.2rem;
}

.notif-item-msg {
  color: #64748b;
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

.notif-item-time {
  font-size: 0.72rem;
  color: #94a3b8;
}

/* Mobile top bar — hidden on desktop */
.mobile-topbar {
  display: none;
}

/* Sidebar overlay — hidden by default */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
}

/* ── Mobile ── */
/* ── Loading spinner ── */
@keyframes portalSpin {
  to { transform: rotate(360deg); }
}

.portal-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2.5px solid #e2e8f0;
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: portalSpin 0.7s linear infinite;
  vertical-align: middle;
}

@media (max-width: 768px) {

  /* Fixed top bar replaces the sidebar header */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    height: 56px;
    background: #052814;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  }

  .mobile-topbar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
  }

  .mobile-topbar-logo img {
    width: 26px;
    height: 26px;
    filter: brightness(0) invert(1);
  }

  /* Lang button in mobile topbar */
  .mobile-topbar .sidebar-lang-btn {
    font-size: 0.72rem;
    padding: 0.28rem 0.55rem;
  }

  .hamburger-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: background 0.15s;
  }

  .hamburger-btn:hover {
    background: rgba(255,255,255,0.1);
  }

  /* Sidebar: slide off-screen by default */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 300;
    width: 260px;
    padding-top: 1.5rem;
  }

  /* Slide sidebar in when open */
  .portal-layout.sidebar-open .sidebar {
    transform: translateX(0);
  }

  /* Show overlay when sidebar open */
  .portal-layout.sidebar-open .sidebar-overlay {
    display: block;
  }

  /* Main: full width, push down past the mobile topbar */
  .portal-main {
    margin-left: 0;
    padding: 1.25rem 1rem;
    padding-top: calc(56px + 1.25rem);
    /* Prevent any child from causing horizontal page scroll */
    overflow-x: hidden;
  }

  /* Stack two-column grids on staff pages */
  .portal-two-col {
    display: block !important;
  }

  .portal-two-col > * + * {
    margin-top: 1rem;
  }

  /* Staff applications detail panel — single column below 768px */
  #detailGrid {
    grid-template-columns: 1fr !important;
  }

  /* Staff applications action buttons — stack vertically */
  #detailPanel .btn-portal {
    width: 100%;
    justify-content: center;
  }

  /* Filter bars: inputs grow to fill available width */
  .portal-card input[type="text"],
  .portal-card input[type="search"],
  .portal-card input[type="date"],
  .portal-card select {
    min-width: 0 !important;
    width: 100%;
    box-sizing: border-box;
  }

  /* Filter bar flex rows: wrap and fill width */
  .portal-card > div[style*="display:flex"],
  .portal-card > div[style*="display: flex"] {
    flex-wrap: wrap !important;
  }

  /* Applications filter bar — stack on mobile */
  #appFilterBar {
    flex-direction: column;
    align-items: stretch !important;
  }

  #appFilterBar input,
  #appFilterBar select,
  #appFilterBar button,
  #appFilterBar label {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  /* Reports date range row */
  #reportControls {
    flex-direction: column;
    align-items: stretch !important;
  }

  #reportControls input,
  #reportControls select,
  #reportControls button {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  /* Stat grid: 2 columns on mobile instead of 4 */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Admin add-staff row */
  .admin-add-row {
    flex-direction: column !important;
  }

  .admin-add-row > * {
    min-width: 0 !important;
    width: 100% !important;
  }
}

/* ── Back to top button ─────────────────────────────────────── */
#backToTopBtn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 999;
}
#backToTopBtn.visible {
  opacity: 1;
  pointer-events: auto;
}
#backToTopBtn:hover { background: #d97706; }
@media print { #backToTopBtn { display: none !important; } }

/* ============================================================
   Global print stylesheet (AJ)
   Hides interactive chrome; expands content to full width.
   ============================================================ */
@media print {
  /* Hide navigation, sidebar, topbar, action buttons, modals */
  .portal-sidebar,
  .portal-topbar,
  .portal-topbar-actions,
  .nav-buttons,
  .btn-portal,
  .modal-overlay,
  #cookieConsentBanner,
  .notif-panel,
  #sessionExpiryModal,
  .print-hide {
    display: none !important;
  }

  /* Full-width content area */
  .portal-layout,
  .portal-main,
  .portal-content {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  /* Cards: remove shadows for clean print */
  .portal-card {
    box-shadow: none !important;
    border: 1px solid #e2e8f0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Tables: avoid mid-row page breaks */
  table { break-inside: auto; }
  tr    { break-inside: avoid; page-break-inside: avoid; }
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }

  /* Links: show URL after the text */
  a[href]:not([href^="#"])::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #64748b;
  }

  body { font-size: 11pt; color: #000; background: #fff; }
}
