/* Pishonserv AI CRM — Staff Portal Styles */

/* ══ App Shell Grid ══════════════════════════════════════════════════════════ */
#staff-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 100vh;
  height: 100vh;
  overflow: hidden;
}

/* ══ Sidebar ═════════════════════════════════════════════════════════════════ */
#staff-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--ps-sidebar-bg, #1a237e);
  color: var(--ps-sidebar-text, rgba(255,255,255,.82));
  overflow: hidden;
  transition: transform .25s ease;
  z-index: 200;
}

.staff-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.staff-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-weight: 900;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.2);
}

/* Nav */
.staff-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
}
.staff-nav::-webkit-scrollbar { width: 4px; }
.staff-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.staff-nav-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ps-sidebar-muted, rgba(255,255,255,.4));
  padding: 12px 8px 5px;
}
.staff-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: var(--ps-radius, 8px);
  background: none;
  color: var(--ps-sidebar-text, rgba(255,255,255,.75));
  font-size: .86rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-family: var(--ps-font, 'Inter', sans-serif);
  transition: background .14s, color .14s;
  margin-bottom: 2px;
}
.staff-nav-item:hover {
  background: var(--ps-sidebar-hover, rgba(255,255,255,.07));
  color: #fff;
}
.staff-nav-item.active {
  background: var(--ps-sidebar-active, rgba(255,255,255,.13));
  color: #fff;
  font-weight: 600;
}
.staff-nav-item .nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: .8;
}
.staff-nav-item.active .nav-icon,
.staff-nav-item:hover .nav-icon { opacity: 1; }

/* Sidebar footer */
.staff-sidebar-footer {
  padding: 14px 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.staff-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.staff-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .92rem;
  flex-shrink: 0;
}

/* ══ Main Area ═══════════════════════════════════════════════════════════════ */
#staff-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ps-bg);
  min-height: 0;
}

/* Topbar */
#staff-topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--ps-surface);
  border-bottom: 1px solid var(--ps-border);
  flex-shrink: 0;
  box-shadow: var(--ps-shadow-xs);
}

/* Content */
#staff-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-height: 0;
}

/* ══ Sections ════════════════════════════════════════════════════════════════ */
.staff-section { display: none; }
.staff-section.active { display: block; }

/* ══ Mobile hamburger ════════════════════════════════════════════════════════ */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
}
.hamburger-btn span {
  display: block;
  height: 2px;
  background: var(--ps-text-muted);
  border-radius: 2px;
  transition: .2s;
}
.hamburger-btn:hover span { background: var(--ps-text); }

/* ══ Mobile sidebar overlay ══════════════════════════════════════════════════ */
#staff-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 199;
}
#staff-sidebar-overlay.active { display: block; }

/* ══ Staff KPI Cards ═════════════════════════════════════════════════════════ */
.staff-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.staff-kpi-card {
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-lg);
  padding: 18px 20px;
  box-shadow: var(--ps-shadow-xs);
  transition: box-shadow .15s;
}
.staff-kpi-card:hover { box-shadow: var(--ps-shadow-sm); }
.staff-kpi-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ps-text);
  line-height: 1.1;
}
.staff-kpi-lbl {
  font-size: .73rem;
  color: var(--ps-text-muted);
  margin-top: 5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.staff-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.staff-quick-btn {
  border: 1px solid var(--ps-border);
  background: var(--ps-surface-2);
  color: var(--ps-text);
  border-radius: var(--ps-radius);
  padding: 12px 14px;
  font-weight: 700;
  font-size: .84rem;
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s, transform .15s;
}
.staff-quick-btn:hover {
  background: var(--ps-primary-light);
  border-color: var(--ps-primary);
  transform: translateY(-1px);
}

.staff-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.staff-template-card {
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-lg);
  box-shadow: var(--ps-shadow-xs);
  padding: 16px;
}
.staff-template-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.staff-template-card h3 {
  font-size: .98rem;
  margin: 0 0 8px;
  color: var(--ps-text);
}
.staff-template-subject {
  font-weight: 600;
  font-size: .84rem;
  color: var(--ps-text);
  margin: 0 0 8px;
}
.staff-template-preview {
  color: var(--ps-text-muted);
  font-size: .8rem;
  line-height: 1.45;
  margin: 0 0 14px;
}
.staff-template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* ══ Check-in card ═══════════════════════════════════════════════════════════ */
.staff-checkin-card {
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  box-shadow: var(--ps-shadow-xs);
}
.staff-checkin-info { flex: 1; min-width: 0; }
.staff-checkin-status {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ps-text);
  margin-bottom: 4px;
}
.staff-checkin-time { font-size: .82rem; color: var(--ps-text-muted); }

/* ══ Notifications ═══════════════════════════════════════════════════════════ */
.sp-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ps-border);
  cursor: pointer;
  transition: background .12s;
}
.sp-notif-item:hover { background: var(--ps-surface-2); }
.sp-notif-item:last-child { border-bottom: none; }
.sp-notif-unread { background: rgba(57,73,171,.06); }
[data-theme="dark"] .sp-notif-unread { background: rgba(57,73,171,.18); }
.sp-notif-body { flex: 1; min-width: 0; }
.sp-notif-title { font-weight: 600; font-size: .875rem; color: var(--ps-text); }
.sp-notif-text { font-size: .78rem; color: var(--ps-text-muted); margin-top: 2px; }
.sp-notif-time { font-size: .7rem; color: var(--ps-text-light); margin-top: 4px; }
.sp-notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ps-primary); flex-shrink: 0; align-self: center; margin-top: 2px;
}

/* ══ Staff Modal ═════════════════════════════════════════════════════════════ */
.staff-modal-box {
  background: var(--ps-surface);
  border-radius: var(--ps-radius-xl);
  box-shadow: var(--ps-shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
}
.staff-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--ps-border);
}
.staff-modal-title { font-weight: 700; font-size: .95rem; }
.staff-modal-close {
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: var(--ps-text-muted); line-height: 1;
}
.staff-modal-body { padding: 22px; }

/* ══ Login-error (reuse admin class) ═════════════════════════════════════════ */
.login-error {
  background: var(--ps-danger-bg);
  color: var(--ps-danger);
  border-radius: var(--ps-radius);
  padding: 10px 14px;
  font-size: .82rem;
  font-weight: 500;
  margin-bottom: 14px;
  display: none;
}
.login-error.visible { display: block; }

/* ══ Auth subheading (missing from some admin.css builds) ════════════════════ */
.auth-subheading {
  font-size: .86rem;
  color: var(--ps-text-muted);
  margin-top: 5px;
  line-height: 1.45;
}

/* ══ Responsive ══════════════════════════════════════════════════════════════ */
@media (max-width: 680px) {
  #staff-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 100vh;
  }
  #staff-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 250px;
    transform: translateX(-100%);
    box-shadow: 4px 0 28px rgba(0,0,0,.22);
    z-index: 300;
  }
  #staff-sidebar.staff-sidebar-open {
    transform: translateX(0);
  }
  .hamburger-btn { display: flex; }
  #staff-content { padding: 14px; }
  #staff-topbar { padding: 0 14px; }
}
