/* ==========================================================================
   SKIP NOT AD STUDIOS - STAFF & ADMIN PORTAL STYLING
   Precision Enterprise UI for Attendance, Face Capture, Geolocation Tracking,
   Task Rollover Engine, and Administrative Governance.
   ========================================================================== */

/* Portal Host / Modal or Dedicated Screen */
.portal-root {
  min-height: 100vh;
  background-color: #08090d;
  color: #f1f5f9;
  font-family: var(--font-sans);
}

.portal-header-bar {
  height: 68px;
  background: #0e1118;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 500;
}

.portal-brand-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.portal-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(229, 9, 20, 0.15);
  color: var(--brand-red);
  border: 1px solid rgba(229, 9, 20, 0.3);
}

.portal-user-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.live-clock-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   AUTHENTICATION VIEW
   ========================================================================== */
.portal-auth-container {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: radial-gradient(circle at 50% 20%, rgba(229, 9, 20, 0.06) 0%, transparent 60%),
              #08090d;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: #11141c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 0.75rem;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.auth-tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: #090b10;
  padding: 0.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-tab-btn {
  padding: 0.65rem 0;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.auth-tab-btn.active {
  background: #1c2230;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Quick Fill Demo Badges */
.auth-quickfill-box {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.quickfill-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.65rem;
}

.quickfill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-pill {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.quick-pill:hover {
  background: rgba(229, 9, 20, 0.15);
  border-color: var(--brand-red);
  color: #ffffff;
}

/* ==========================================================================
   PORTAL MAIN DASHBOARD LAYOUT
   ========================================================================== */
.portal-content-area {
  max-width: 1360px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem 1.5rem;
}

/* Top Notification Banners */
.portal-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  border: 1px solid transparent;
}

.portal-alert-banner.success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.portal-alert-banner.warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

/* Staff KPI Strip */
.staff-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.kpi-card {
  background: #11141c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
}

.kpi-note {
  font-size: 0.75rem;
  color: #64748b;
}

/* ==========================================================================
   ATTENDANCE MODULE: LIVE WEBCAM & GPS VERIFICATION
   ========================================================================== */
.attendance-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.camera-verify-card {
  background: #11141c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.camera-preview-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  background: #06070a;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror selfie */
}

.camera-placeholder-overlay {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: #64748b;
  text-align: center;
  padding: 1rem;
}

.captured-snapshot-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.gps-location-bar {
  background: #090c12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gps-info-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gps-coords-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38bdf8;
}

.gps-address-tag {
  font-size: 0.85rem;
  color: #e2e8f0;
  font-weight: 500;
}

.attendance-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Today's Punch Status Box */
.punch-status-card {
  background: #11141c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.punch-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.punch-event {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
}

.punch-icon-bullet {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1c2230;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex-shrink: 0;
}
.punch-event.active .punch-icon-bullet {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
}

/* ==========================================================================
   DAILY TASK WORKFLOW & AUTOMATIC ROLLOVER SYSTEM
   ========================================================================== */
.tasks-container-card {
  background: #11141c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 3rem;
}

.tasks-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-item-card {
  background: #090c12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  transition: all var(--transition-fast);
}
.task-item-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: #0e121a;
}

/* Rollover Warning Badge */
.task-rollover-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid #ef4444;
  color: #f87171;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.task-priority-pill {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}
.task-priority-pill.high {
  background: rgba(229, 9, 20, 0.15);
  color: var(--brand-red);
}
.task-priority-pill.medium {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.task-status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
}
.task-status-pill.assigned {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}
.task-status-pill.submitted {
  background: rgba(2, 132, 199, 0.18);
  color: #38bdf8;
}
.task-status-pill.approved {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

/* ==========================================================================
   ADVANCE LEAVE APPLICATION MODULE
   ========================================================================== */
.leave-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.leave-form-card {
  background: #11141c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.leave-history-card {
  background: #11141c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.leave-status-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}
.leave-status-tag.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.leave-status-tag.approved {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}
.leave-status-tag.rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* ==========================================================================
   DATA TABLES (ATTENDANCE & AUDIT)
   ========================================================================== */
.portal-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.portal-table th {
  background: #090c12;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.portal-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.selfie-thumb-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--trans-fast);
  text-decoration: none;
}

.btn-danger:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

/* ==========================================================================
   ADMIN CONTROL TABS & PANELS
   ========================================================================== */
.admin-tabs-nav {
  display: flex;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.admin-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.admin-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}
.admin-tab-btn.active {
  background: #161b26;
  border-color: rgba(229, 9, 20, 0.4);
  color: #ffffff;
}

/* Modals */
.portal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.portal-modal-backdrop.open {
  display: flex;
}

.portal-modal-window {
  background: #11141c;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.25rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8);
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
}
.modal-close-btn:hover {
  color: #ffffff;
}

/* Responsive Portal */
@media (max-width: 900px) {
  .staff-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .attendance-grid,
  .leave-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .staff-kpi-grid {
    grid-template-columns: 1fr;
  }
  .attendance-actions-row {
    grid-template-columns: 1fr;
  }
  .portal-header-bar {
    padding: 0 1rem;
  }
}
