/* ==========================================================================
   PNS MANAGER - UI COMPONENTS & ATOMIC ELEMENTS (Vanilla CSS)
   ========================================================================== */

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-md);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-icon-bg {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.bg-emerald { background: var(--status-emerald-bg); color: var(--status-emerald); }
.bg-blue { background: var(--status-blue-bg); color: var(--status-blue); }
.bg-amber { background: var(--status-amber-bg); color: var(--status-amber); }
.bg-purple { background: var(--status-purple-bg); color: var(--status-purple); }

.kpi-value {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin: 12px 0 6px;
}

.kpi-footer {
  font-size: 11px;
}

/* Panel Cards */
.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.panel-body {
  padding: 20px;
}

/* Grids & Helpers */
.grid-2-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 20px; }
.text-right { text-align: right; }
.text-emerald { color: var(--status-emerald); }
.text-amber { color: var(--status-amber); }
.text-purple { color: var(--status-purple); }
.text-danger { color: var(--status-danger); }
.text-accent { color: var(--accent-primary); }
.text-secondary { color: var(--text-secondary); }
.font-bold { font-weight: 700; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.35);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-panel);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
}

.btn-danger {
  background: var(--status-danger);
  color: #fff;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: var(--status-danger-hover);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.55);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

/* Badges & Status Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-emerald {
  background: var(--status-emerald-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--status-emerald);
}

.badge-amber {
  background: var(--status-amber-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--status-amber);
}

.badge-danger {
  background: var(--status-danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--status-danger);
}

.badge-purple {
  background: var(--status-purple-bg);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: var(--status-purple);
}

.badge-gray {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.badge-pulse {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: var(--accent-primary);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(249, 115, 22, 0); }
  100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

/* Data Tables - Strict Zero Horizontal Scroll */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  box-sizing: border-box;
}

.data-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
  box-sizing: border-box;
}

.data-table th {
  padding: 10px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.015);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  vertical-align: middle;
  overflow: hidden;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: var(--bg-hover);
}

.code-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  color: var(--accent-primary-light);
  border: 1px solid var(--border-subtle);
  display: inline-block;
  white-space: nowrap;
  flex-shrink: 0;
}

.text-nowrap {
  white-space: nowrap !important;
}

.cell-notes-truncate {
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.provider-cell-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
}

.provider-cell-inline .font-bold {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Interactive Project Chip on Employee Row */
.btn-employee-projects-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-md);
  color: #60a5fa;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-employee-projects-chip:hover {
  background: rgba(59, 130, 246, 0.25);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
  transform: translateX(2px);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.search-filter-bar {
  display: flex;
  gap: 12px;
  width: 100%;
}

.search-filter-bar .form-input {
  max-width: 320px;
}

.search-filter-bar .form-select {
  max-width: 200px;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-container.modal-lg {
  max-width: 780px;
}

@keyframes modalPop {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

/* Alert Boxes */
.info-alert-box {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #93c5fd;
  margin-top: 12px;
}

.danger-alert-box {
  background: var(--status-danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #fca5a5;
  margin-top: 12px;
}

/* Live Stream Task Cards */
.live-task-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.live-task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.live-task-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
}

.live-task-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f97316, #fb923c);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.live-task-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

/* Employee Projects Grid in Modal */
.emp-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.emp-project-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.emp-project-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
}

.emp-project-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: var(--text-main);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success { border-left: 4px solid var(--status-emerald); }
.toast-error { border-left: 4px solid var(--status-danger); }
.toast-info { border-left: 4px solid var(--accent-primary); }

@keyframes toastIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   ADMIN LOGIN PORTAL STYLES
   ========================================================================== */

.login-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 15%, #18233c 0%, #080c14 65%);
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.login-bg-glow {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(40px);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(14, 20, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 2;
  animation: loginCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(249, 115, 22, 0.05) 100%);
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.25);
}

.login-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0 0 6px 0;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.login-edge-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: #34d399;
}

.login-error-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #fca5a5;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.login-form .form-group {
  margin-bottom: 20px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon .form-input {
  padding-left: 42px;
  padding-right: 42px;
  height: 44px;
  font-size: 14px;
}

.btn-toggle-pass {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 15px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  padding: 4px;
}

.btn-toggle-pass:hover {
  opacity: 1;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  height: 46px;
  font-size: 15px;
  font-weight: 600;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.login-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.login-hint code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-primary-light);
  font-family: var(--font-mono);
}

