/* Staff Portal (scoped) */
:root {
  --sp-bg: #f8fafc;
  --sp-card: #ffffff;
  --sp-text: #111827;
  --sp-muted: #6b7280;
  --sp-border: rgba(15, 23, 42, 0.08);
  --sp-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --sp-primary: #2ecc71;
  --sp-primary-ink: #0b1220;
}

body.staff-portal {
  background-color: #fafbfc;
  color: var(--sp-text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Light theme glowing orb */
body.staff-portal::before {
  content: '';
  position: absolute;
  top: -150px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 400px;
  background: radial-gradient(ellipse at center, rgba(46, 204, 113, 0.1) 0%, rgba(250, 251, 252, 0) 70%);
  pointer-events: none; z-index: -1;
}

/* Logged-out: show ONLY a simple centered login window */
body.staff-portal.is-logged-out .portal-main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 140px);
  padding-top: 40px;
}

body.staff-portal.is-logged-out .login-card {
  max-width: 440px;
  width: 100%;
}

body.staff-portal.is-logged-out {
  background-color: #fafbfc;
}

body.staff-portal.is-logged-out .portal-shell {
  padding: 28px 0;
}

body.staff-portal.is-logged-out .portal-topbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

body.staff-portal.is-logged-out .login-card {
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.04);
  border: 1px solid #e5e7eb;
}

body.staff-portal.is-logged-out .login-card .card-head {
  padding: 28px 28px 0;
  text-align: center;
}

body.staff-portal.is-logged-out .login-card .card-body {
  padding: 28px;
}

body.staff-portal.is-logged-out .login-card .card-title {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

body.staff-portal.is-logged-out .login-card .card-subtitle {
  font-size: 0.95rem;
  margin-top: 6px;
}

body.staff-portal.is-logged-out .login-card input,
body.staff-portal.is-logged-out .login-card select {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
}

body.staff-portal.is-logged-out .login-card .split-actions {
  margin-top: 20px;
}

.staff-portal .portal-shell {
  width: min(1200px, 94%);
  margin: 0 auto;
  padding: 24px 0;
}

.staff-portal .portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border: 1px solid var(--sp-border);
  border-radius: 16px;
  background: var(--sp-card);
  box-shadow: var(--sp-shadow);
  margin-bottom: 20px;
}

.staff-portal .topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Main content area - full width for dashboard */
.staff-portal .portal-main {
  width: 100%;
}

.staff-portal .dashboard-main {
  background: var(--sp-card);
  border: 1px solid var(--sp-border);
  border-radius: 20px;
  box-shadow: var(--sp-shadow);
  overflow: hidden;
}

.staff-portal .dash-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--sp-border);
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.06) 0%, rgba(59, 130, 246, 0.04) 100%);
}

.staff-portal .dash-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.staff-portal .dash-subtitle {
  color: var(--sp-muted);
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 4px;
}

.staff-portal .dash-content {
  padding: 28px;
}

.staff-portal .portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--sp-border);
  background: #f9fafb;
  font-weight: 800;
  font-size: 0.92rem;
}

.staff-portal .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #374151;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
}

.staff-portal .back-link:hover {
  color: #111827;
}

.staff-portal .portal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 920px) {
  .staff-portal .portal-grid {
    grid-template-columns: 380px 1fr;
  }
}

.staff-portal .portal-card {
  border: 1px solid var(--sp-border);
  border-radius: 16px;
  background: var(--sp-card);
  box-shadow: var(--sp-shadow);
  overflow: hidden;
}

.staff-portal .card-head {
  padding: 18px 18px 0;
}

.staff-portal .card-title {
  font-size: 1.18rem;
  font-weight: 900;
  color: #0f172a;
}

.staff-portal .card-subtitle {
  margin-top: 6px;
  color: var(--sp-muted);
  font-size: 0.95rem;
}

.staff-portal .card-body {
  padding: 18px;
}

.staff-portal .field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 520px) {
  .staff-portal .field-row.cols-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.staff-portal label {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  color: #111827;
  margin-bottom: 6px;
}

.staff-portal input[type="text"],
.staff-portal input[type="email"],
.staff-portal input[type="password"],
.staff-portal select,
.staff-portal textarea {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 12px;
  outline: none;
  background: #ffffff;
  color: #111827;
}

.staff-portal textarea {
  min-height: 110px;
  resize: vertical;
}

.staff-portal input:focus,
.staff-portal select:focus,
.staff-portal textarea:focus {
  border-color: rgba(46, 204, 113, 0.7);
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.15);
}

.staff-portal .help {
  margin-top: 6px;
  color: var(--sp-muted);
  font-size: 0.86rem;
}

.staff-portal .muted-inline {
  color: var(--sp-muted);
  font-size: 0.92rem;
}

.staff-portal .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 900;
}

.staff-portal .btn-primary {
  background: var(--sp-primary);
  color: var(--sp-primary-ink);
}

.staff-portal .btn-primary:hover {
  filter: brightness(0.97);
}

.staff-portal .btn-ghost {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  color: #111827;
}

.staff-portal .btn-ghost:hover {
  background: #f9fafb;
}

.staff-portal .split-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.staff-portal .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.staff-portal .tab {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  font-weight: 900;
  color: #111827;
  cursor: pointer;
  font-size: 0.92rem;
}

.staff-portal .tab.active {
  background: rgba(46, 204, 113, 0.16);
  border-color: rgba(46, 204, 113, 0.45);
}

.staff-portal .tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-left: 8px;
  border-radius: 999px;
  background: #dc2626;
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
}

.staff-portal .panel {
  padding: 16px;
}

.staff-portal .panel[hidden] {
  display: none;
}

.staff-portal .list {
  display: grid;
  gap: 10px;
}

.staff-portal .msg-item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: #ffffff;
  cursor: pointer;
}

.staff-portal .msg-item:hover {
  background: #f9fafb;
}

.staff-portal .msg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.staff-portal .msg-from {
  font-weight: 900;
  color: #0f172a;
  font-size: 0.95rem;
}

.staff-portal .msg-date {
  color: var(--sp-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.staff-portal .msg-subject {
  margin-top: 6px;
  font-weight: 900;
  color: #111827;
}

.staff-portal .msg-preview {
  margin-top: 2px;
  color: var(--sp-muted);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-portal .pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.staff-portal .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid rgba(15, 23, 42, 0.10);
  font-weight: 900;
  font-size: 0.82rem;
  color: #111827;
}

.staff-portal .pill input {
  transform: translateY(1px);
}

.staff-portal .hr {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 16px 0;
}

.staff-portal .kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 520px) {
  .staff-portal .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.staff-portal .kpi {
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
}

.staff-portal .kpi-label {
  color: var(--sp-muted);
  font-weight: 900;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.staff-portal .kpi-value {
  margin-top: 6px;
  font-weight: 1000;
  font-size: 1.1rem;
  color: #0f172a;
}

.staff-portal .kpi-sub {
  margin-top: 2px;
  color: var(--sp-muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.staff-portal .section-title {
  font-weight: 1000;
  font-size: 1rem;
  color: #0f172a;
  margin: 6px 0 10px;
}

.staff-portal .table-wrap {
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
}

.staff-portal .simple-table {
  width: 100%;
  border-collapse: collapse;
}

.staff-portal .simple-table th,
.staff-portal .simple-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: left;
  font-size: 0.92rem;
}

.staff-portal .simple-table th {
  background: #f9fafb;
  font-weight: 1000;
  color: #111827;
}

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

.staff-portal .simple-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 8px;
}

.staff-portal .simple-list li {
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  background: #ffffff;
  font-weight: 800;
  color: #111827;
}

.staff-portal .toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.94);
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.92rem;
  display: none;
  z-index: 9999;
}

/* ===== ROLE DASHBOARD STYLES ===== */

.staff-portal .welcome-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
  border-radius: 16px;
  margin-bottom: 20px;
}

.staff-portal .welcome-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.staff-portal .welcome-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
}

.staff-portal .welcome-meta {
  color: var(--sp-muted);
  font-size: 0.92rem;
  font-weight: 700;
  margin-top: 2px;
}

.staff-portal .dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.staff-portal .dash-card {
  padding: 16px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.staff-portal .dash-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.staff-portal .dash-card.accent-blue::before { background: #3b82f6; }
.staff-portal .dash-card.accent-green::before { background: #2ecc71; }
.staff-portal .dash-card.accent-purple::before { background: #8b5cf6; }
.staff-portal .dash-card.accent-orange::before { background: #f59e0b; }
.staff-portal .dash-card.accent-red::before { background: #ef4444; }

.staff-portal .dash-card-icon {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--sp-muted);
}

.staff-portal .dash-card-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--sp-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.staff-portal .dash-card-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: #0f172a;
  margin-top: 4px;
}

.staff-portal .dash-section {
  margin-bottom: 20px;
}

.staff-portal .dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.staff-portal .dash-section-title {
  font-size: 1rem;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.staff-portal .dash-section-title i {
  color: var(--sp-muted);
}

.staff-portal .dash-section-actions {
  display: flex;
  gap: 6px;
}

.staff-portal .btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sp-muted);
  transition: all 0.15s;
}

.staff-portal .btn-icon:hover {
  background: #f9fafb;
  color: #0f172a;
}

.staff-portal .empty-row {
  text-align: center;
  color: var(--sp-muted);
  font-style: italic;
}

.staff-portal .score-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.15);
  color: #16a34a;
  font-weight: 900;
  font-size: 0.85rem;
}

.staff-portal .status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.8rem;
}

.staff-portal .status-active {
  background: rgba(46, 204, 113, 0.15);
  color: #16a34a;
}

.staff-portal .status-done {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.staff-portal .status-plan {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.staff-portal .activity-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}

.staff-portal .activity-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f9fafb;
  font-weight: 700;
  color: #111827;
  font-size: 0.92rem;
}

.staff-portal .activity-list li i {
  font-size: 0.8rem;
}

.staff-portal .text-green { color: #16a34a; }
.staff-portal .text-blue { color: #2563eb; }
.staff-portal .text-orange { color: #d97706; }
.staff-portal .text-purple { color: #8b5cf6; }
.staff-portal .text-red { color: #ef4444; }

.staff-portal .quick-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.staff-portal .action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: #111827;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.staff-portal .action-btn:hover {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.08), rgba(59, 130, 246, 0.06));
  border-color: rgba(46, 204, 113, 0.3);
}

.staff-portal .action-btn i {
  color: var(--sp-muted);
}

/* ===================== */
/* Floating Message FAB  */
/* ===================== */
.msg-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  border: none;
  box-shadow: 0 6px 24px rgba(39, 174, 96, 0.35), 0 2px 8px rgba(0,0,0,0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.2s, box-shadow 0.2s;
}

.msg-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(39, 174, 96, 0.45), 0 4px 12px rgba(0,0,0,0.15);
}

.msg-fab i {
  font-size: 1.5rem;
  color: #fff;
}

.msg-fab-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  background: #e74c3c;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
  animation: pulse-dot 1.5s infinite;
}

.msg-fab-dot.has-unread {
  display: block;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ===================== */
/* Message Modal Overlay */
/* ===================== */
.msg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.msg-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.msg-modal {
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(40px) scale(0.95);
  transition: transform 0.3s ease;
}

.msg-modal-overlay.open .msg-modal {
  transform: translateY(0) scale(1);
}

.msg-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--sp-border);
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.08) 0%, rgba(39, 174, 96, 0.04) 100%);
}

.msg-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.msg-modal-title i {
  color: var(--sp-accent);
}

.msg-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.msg-modal-close:hover {
  background: #e2e8f0;
  transform: rotate(90deg);
}

.msg-modal-close i {
  font-size: 1rem;
  color: #64748b;
}

.msg-modal .tabs {
  padding: 0 24px;
  border-bottom: 1px solid var(--sp-border);
}

.msg-modal .panel {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  max-height: 50vh;
}

/* Responsive adjustments for FAB and Modal */
@media (max-width: 600px) {
  .msg-fab {
    bottom: 20px;
    right: 20px;
    width: 54px;
    height: 54px;
  }
  
  .msg-modal {
    width: 95%;
    max-height: 90vh;
    border-radius: 16px;
  }
  
  .msg-modal-header {
    padding: 14px 18px;
  }
  
  .msg-modal .panel {
    padding: 16px 18px;
  }
}

/* ===== COMPREHENSIVE MOBILE RESPONSIVE STYLES ===== */

/* Tablet and below */
@media (max-width: 920px) {
  .staff-portal .portal-shell {
    width: 96%;
    padding: 16px 0;
  }

  .staff-portal .portal-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .staff-portal .topbar-left {
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
  }

  .staff-portal .portal-grid {
    grid-template-columns: 1fr;
  }

  .staff-portal .dash-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .staff-portal .dash-header {
    padding: 18px 20px;
  }

  .staff-portal .dash-content {
    padding: 18px 20px;
  }

  .staff-portal .dash-title {
    font-size: 1.3rem;
  }

  .staff-portal .welcome-banner {
    flex-direction: column;
    text-align: center;
    padding: 16px;
  }

  .staff-portal .welcome-icon {
    margin-bottom: 8px;
  }

  .staff-portal .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .staff-portal .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .staff-portal .simple-table {
    min-width: 500px;
  }

  .staff-portal .quick-actions-row {
    justify-content: center;
  }
}

/* Mobile devices */
@media (max-width: 600px) {
  .staff-portal .portal-shell {
    width: 100%;
    padding: 12px 0;
  }

  .staff-portal .portal-topbar {
    border-radius: 0;
    margin: 0 0 16px 0;
  }

  .staff-portal .topbar-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .staff-portal .back-link {
    font-size: 0.85rem;
  }

  .staff-portal .portal-badge {
    font-size: 0.85rem;
    padding: 6px 10px;
  }

  .staff-portal .dashboard-main {
    border-radius: 16px;
    margin: 0 8px;
  }

  .staff-portal .dash-header {
    padding: 16px;
  }

  .staff-portal .dash-content {
    padding: 16px;
  }

  .staff-portal .dash-title {
    font-size: 1.15rem;
  }

  .staff-portal .dash-subtitle {
    font-size: 0.85rem;
  }

  .staff-portal .dash-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .staff-portal .dash-card {
    padding: 12px;
  }

  .staff-portal .dash-card-icon {
    font-size: 1rem;
    margin-bottom: 6px;
  }

  .staff-portal .dash-card-label {
    font-size: 0.7rem;
  }

  .staff-portal .dash-card-value {
    font-size: 1.3rem;
  }

  .staff-portal .welcome-banner {
    padding: 14px;
    gap: 12px;
  }

  .staff-portal .welcome-icon {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .staff-portal .welcome-name {
    font-size: 1.1rem;
  }

  .staff-portal .welcome-meta {
    font-size: 0.85rem;
  }

  .staff-portal .kpi-grid {
    grid-template-columns: 1fr;
  }

  .staff-portal .kpi {
    padding: 10px;
  }

  .staff-portal .kpi-label {
    font-size: 0.75rem;
  }

  .staff-portal .kpi-value {
    font-size: 1rem;
  }

  .staff-portal .section-title {
    font-size: 0.9rem;
  }

  .staff-portal .dash-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .staff-portal .dash-section-title {
    font-size: 0.9rem;
  }

  .staff-portal .simple-table th,
  .staff-portal .simple-table td {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .staff-portal .activity-list li {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .staff-portal .quick-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .staff-portal .action-btn {
    justify-content: center;
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .staff-portal .btn {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .staff-portal .split-actions {
    flex-direction: column;
  }

  .staff-portal .split-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .staff-portal .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
    gap: 6px;
  }

  .staff-portal .tab {
    padding: 8px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .staff-portal .panel {
    padding: 14px;
  }

  .staff-portal .msg-item {
    padding: 10px;
  }

  .staff-portal .msg-from {
    font-size: 0.9rem;
  }

  .staff-portal .msg-date {
    font-size: 0.75rem;
  }

  .staff-portal .msg-subject {
    font-size: 0.85rem;
  }

  .staff-portal .msg-preview {
    font-size: 0.8rem;
  }

  .staff-portal .pill {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .staff-portal .field-row.cols-2 {
    grid-template-columns: 1fr;
  }

  .staff-portal label {
    font-size: 0.85rem;
  }

  .staff-portal input[type="text"],
  .staff-portal input[type="email"],
  .staff-portal input[type="password"],
  .staff-portal select,
  .staff-portal textarea {
    padding: 10px;
    font-size: 0.9rem;
  }

  .staff-portal .card-head {
    padding: 14px 14px 0;
  }

  .staff-portal .card-body {
    padding: 14px;
  }

  .staff-portal .card-title {
    font-size: 1.05rem;
  }

  .staff-portal .card-subtitle {
    font-size: 0.85rem;
  }

  .staff-portal .portal-card {
    border-radius: 14px;
  }

  /* Login card specific mobile styles */
  body.staff-portal.is-logged-out .login-card {
    max-width: 100%;
    margin: 0 12px;
    border-radius: 16px;
  }

  body.staff-portal.is-logged-out .login-card .card-head {
    padding: 20px 20px 0;
  }

  body.staff-portal.is-logged-out .login-card .card-body {
    padding: 20px;
  }

  body.staff-portal.is-logged-out .login-card .card-title {
    font-size: 1.3rem;
  }

  body.staff-portal.is-logged-out .portal-main {
    padding-top: 20px;
  }
}

/* Very small devices */
@media (max-width: 380px) {
  .staff-portal .dash-grid {
    grid-template-columns: 1fr;
  }

  .staff-portal .dash-card-value {
    font-size: 1.2rem;
  }

  .staff-portal .welcome-name {
    font-size: 1rem;
  }

  .staff-portal .dash-title {
    font-size: 1rem;
  }

  .msg-fab {
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
  }

  .msg-fab i {
    font-size: 1.3rem;
  }

  .msg-modal {
    width: 98%;
    max-height: 92vh;
  }

  .msg-modal-header {
    padding: 12px 14px;
  }

  .msg-modal-title {
    font-size: 1rem;
  }

  .msg-modal .tabs {
    padding: 8px 12px;
  }

  .msg-modal .panel {
    padding: 12px 14px;
  }
}
