/* ==========================================================================
   AuraHR Design System - Premium Glassmorphism & High-Contrast Dark Theme
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-primary: #0a0e1a;
  --bg-secondary: #121829;
  --glass-bg: rgba(18, 24, 41, 0.6);
  --glass-bg-inner: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-light: rgba(255, 255, 255, 0.15);
  
  --color-primary: #3b82f6;      /* Electric Blue */
  --color-primary-hover: #2563eb;
  --color-success: #10b981;      /* Turquoise / Green */
  --color-warning: #f59e0b;      /* Amber */
  --color-danger: #ef4444;       /* Crimson */
  --color-purple: #8b5cf6;       /* Violet */
  --color-cyan: #06b6d4;         /* Teal Accent */

  /* Text Colors */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-darker: #4b5563;
  --text-white: #ffffff;
  
  /* Fonts & Shadows */
  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(59, 130, 246, 0.1);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Core Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Glowing Decorative Background Orbs */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
}
.orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 80%);
  top: 10%;
  left: 10%;
  animation: floatOrb 12s infinite alternate;
}
.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-purple) 0%, transparent 80%);
  bottom: 15%;
  right: 5%;
  animation: floatOrb 16s infinite alternate-reverse;
}
.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--color-cyan) 0%, transparent 80%);
  top: 60%;
  left: 50%;
}

@keyframes floatOrb {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-30px) scale(1.1); }
}

/* Master Header Layout */
.master-header {
  height: 70px;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-cyan));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  font-size: 1.25rem;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}
.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-white);
}
.brand-text h1 span {
  color: var(--color-cyan);
}
.badge-tag {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--color-primary);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.badge-tag.danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-danger);
}

.demo-controller {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 0.8rem;
  color: var(--color-success);
}
.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success);
  animation: pulse-ring 1.5s infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.5; }
}

/* Master Screen Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
  align-items: start;
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}
.btn-sm {
  padding: 0.33rem 0.75rem;
  font-size: 0.75rem;
}
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--glass-border);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--glass-border-light);
}
.btn-danger {
  background: var(--color-danger);
  color: var(--text-white);
}
.btn-danger:hover {
  background: #dc2626;
}
.btn-block {
  display: flex;
  width: 100%;
}
.btn-pulse {
  animation: button-breath 2s infinite;
}
@keyframes button-breath {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* Glassmorphism Styling Utilities */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}
.glass-inner-card {
  background: var(--glass-bg-inner);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  transition: var(--transition-smooth);
}
.glass-inner-card:hover {
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
}

/* Interactive Sales Demo Guide Panel */
.demo-guide-panel {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 1.25rem;
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.demo-guide-panel.hidden {
  display: none;
}
.demo-guide-panel h3 {
  color: var(--color-cyan);
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.guide-list {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  padding-left: 0;
  list-style: none;
}
.guide-list li {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-md);
  border-left: 3px solid var(--color-cyan);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.guide-list li strong {
  color: var(--text-main);
}
.alert-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(245, 158, 11, 0.1);
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--color-warning);
  font-size: 0.75rem;
}

/* ==========================================================================
   LEFT COMPONENT: Web Admin Portal
   ========================================================================== */

.admin-panel {
  display: flex;
  min-height: 750px;
}

/* Sidebar Navigation */
.admin-sidebar {
  width: 240px;
  border-right: 1px solid var(--glass-border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  flex-shrink: 0;
}
.admin-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px;
  border-radius: 50px;
}
.admin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary);
}
.profile-info h4 {
  font-size: 0.85rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-white);
}
.profile-info span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.nav-menu li {
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-smooth);
}
.nav-menu li i {
  width: 18px;
  text-align: center;
}
.nav-menu li:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-white);
}
.nav-menu li.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-primary);
  border-left: 3px solid var(--color-primary);
}
.badge-count {
  margin-left: auto;
  background-color: var(--color-danger);
  color: var(--text-white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  display: inline-block;
}

/* Admin Main Content Container */
.admin-content {
  flex-grow: 1;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.content-view {
  display: none;
  animation: viewFadeIn 0.4s ease-out forwards;
}
.content-view.active {
  display: block;
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-header {
  margin-bottom: 1.5rem;
}
.view-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-white);
  font-weight: 700;
}
.view-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.flex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Analytics Cards Layout */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.card-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--color-primary); }
.card-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.card-icon.orange { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.card-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--color-purple); }

.card-data {
  display: flex;
  flex-direction: column;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-white);
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Charts Elements */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.chart-card h3 {
  font-size: 1rem;
  color: var(--text-white);
  font-family: var(--font-display);
  margin-bottom: 0.75rem;
}
.chart-container {
  position: relative;
  height: 200px;
}

/* Layout for Dashboard Sub Tables */
.double-table-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.table-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.table-card-header h3 {
  font-size: 1rem;
  color: var(--text-white);
  font-family: var(--font-display);
}
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--border-radius-sm);
  background: rgba(0, 0, 0, 0.15);
}

/* Core Data Table Styling */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}
.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.data-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 600;
}
.data-table tbody tr {
  transition: var(--transition-smooth);
}
.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-mute { color: var(--text-muted); }

/* Employee Directory View */
.search-filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}
.search-input-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  gap: 0.5rem;
}
.search-input-wrapper input {
  background: transparent;
  border: none;
  color: var(--text-main);
  outline: none;
  font-size: 0.85rem;
  width: 100%;
}
.search-filter-bar select {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  outline: none;
}
.employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* Premium Card Profiles */
.employee-card {
  text-align: center;
  position: relative;
  overflow: hidden;
}
.employee-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.2));
  z-index: 0;
}
.card-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  margin: 1.5rem auto 0.75rem;
  border: 3px solid var(--bg-secondary);
  position: relative;
  z-index: 1;
}
.employee-card h4 {
  font-size: 0.95rem;
  color: var(--text-white);
  font-family: var(--font-display);
}
.employee-card .role {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.dept-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 1rem;
}
.card-contact-info {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.status-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  z-index: 1;
}
.status-pill.online { background-color: rgba(16, 185, 129, 0.2); color: var(--color-success); border: 1px solid var(--color-success); }
.status-pill.offline { background-color: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid var(--text-darker); }

/* Leaves analytics inside Admin Portal */
.leaves-analytics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-mini-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}
.stat-mini-card .value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-white);
  font-family: var(--font-display);
}
.stat-mini-card .label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Live Payroll Calculator Form */
.payroll-config-box {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.calculator-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.form-group input, .form-group select, .form-group textarea {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  outline: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 5px rgba(59, 130, 246, 0.4);
}
.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.calculator-outputs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.calc-row.highlighted {
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.5rem 0;
  font-size: 1rem;
  color: var(--text-white);
}
.calc-row.compliance-row {
  color: var(--color-cyan);
  font-size: 0.8rem;
  font-weight: 500;
}

.action-row {
  display: flex;
  gap: 1rem;
}

/* Beautiful Statutory Payslip */
.payslip-card {
  border: 1px dashed var(--glass-border-light);
  padding: 2.5rem;
  background: #0f1423;
  color: #d1d5db;
  font-family: 'Courier New', Courier, monospace;
  max-width: 720px;
  margin: 1.5rem auto;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
}
.payslip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.payslip-logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-white);
  font-family: var(--font-display);
}
.payslip-logo i { color: var(--color-cyan); }
.payslip-title h3 {
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: var(--text-white);
}
.payslip-meta {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  font-size: 0.8rem;
  margin: 1.5rem 0;
}
.payslip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
}
.payslip-table th, .payslip-table td {
  padding: 8px;
  border: 1px solid #1f2937;
}
.payslip-table th {
  background-color: rgba(255,255,255,0.02);
  color: var(--text-white);
}
.payslip-table .bold-row td {
  font-weight: bold;
  border-top: 2px double #1f2937;
}
.payslip-table .net-salary-row {
  background-color: rgba(59, 130, 246, 0.05);
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-white);
}
.compliance-footer {
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.1);
  padding: 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-bottom: 1.5rem;
}
.compliance-footer h4 {
  color: var(--color-cyan);
  margin-bottom: 4px;
}
.compliance-contributions {
  display: flex;
  gap: 2rem;
}
.payslip-signature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.75rem;
}
.payslip-signature .line {
  border-bottom: 1px solid #4b5563;
  width: 150px;
  margin: 0 auto 5px;
}

.hidden { display: none !important; }

/* Status Badges */
.badge-status {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-status.pending { background-color: rgba(245, 158, 11, 0.15); color: var(--color-warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-status.approved { background-color: rgba(16, 185, 129, 0.15); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-status.rejected { background-color: rgba(239, 68, 68, 0.15); color: var(--color-danger); border: 1px solid rgba(239, 68, 68, 0.3); }

/* ==========================================================================
   RIGHT COMPONENT: Employee Mobile App Simulator
   ========================================================================== */

.mobile-phone-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.simulator-instructions {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  padding: 8px 12px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  width: 100%;
}
.simulator-instructions span {
  color: var(--text-muted);
  white-space: nowrap;
}
.simulator-instructions select {
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-weight: bold;
  outline: none;
  cursor: pointer;
  width: 100%;
}

/* Smartphone Wrapper Chassis */
.smartphone-frame {
  width: 370px;
  height: 730px;
  background-color: #000;
  border-radius: 48px;
  border: 12px solid #1f293d;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 25px rgba(59, 130, 246, 0.15), inset 0 0 8px rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Speaker & Camera Notch Details */
.phone-speaker {
  width: 60px;
  height: 4px;
  background-color: #2e3033;
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 105;
}
.phone-camera {
  width: 8px;
  height: 8px;
  background-color: #111;
  border-radius: 50%;
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 105;
  box-shadow: inset 0 0 2px rgba(255,255,255,0.3);
}

/* Active Inside Smartphone Viewport */
.phone-screen {
  background-color: #0b0d17;
  flex-grow: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 28px; /* Room for the top notch area */
  padding-bottom: 24px; /* Room for bottom home indicator */
}

/* iPhone Bottom Home Sweep bar */
.phone-home-button {
  width: 110px;
  height: 5px;
  background-color: #4b5563;
  border-radius: 3px;
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 106;
  cursor: pointer;
  transition: background-color 0.2s;
}
.phone-home-button:hover {
  background-color: #9ca3af;
}

/* Mobile Screens Inner Content Views */
.mobile-screen-view {
  display: none;
  flex-direction: column;
  flex-grow: 1;
  height: 100%;
  overflow: hidden;
  animation: mobileFade 0.3s ease-out;
}
.mobile-screen-view.active {
  display: flex;
}
@keyframes mobileFade {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.mobile-scroll-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.mobile-scroll-content::-webkit-scrollbar {
  display: none; /* Hide scrollbars for native feel */
}

/* Splash biometric login */
#mobile-splash {
  justify-content: space-between;
  align-items: center;
  padding: 3rem 1.5rem;
}
.mobile-splash-logo {
  text-align: center;
  margin-top: 4rem;
}
.mobile-splash-logo i {
  font-size: 4rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.mobile-splash-logo h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-top: 1rem;
  color: var(--text-white);
}
.mobile-splash-logo span {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.fingerprint-scan {
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.fingerprint-scan:hover {
  transform: scale(1.05);
}
.fingerprint-scan i {
  font-size: 3.5rem;
  color: var(--color-primary);
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}
.fingerprint-scan p {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  color: var(--text-muted);
}
.login-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.05);
  width: 100%;
  text-align: center;
  padding-top: 1rem;
}

/* Mobile Screen: Main Header */
.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.user-greeting {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mobile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--color-primary);
  object-fit: cover;
}
.user-greeting h4 {
  font-size: 0.8rem;
  font-family: var(--font-display);
  color: var(--text-white);
}
.user-greeting span {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.notification-icon {
  position: relative;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
}
.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 6px;
  height: 6px;
  background-color: var(--color-danger);
  border-radius: 50%;
}

/* Mobile Widgets */
.mobile-widget-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-md);
  padding: 1rem;
}
.clock-widget {
  text-align: center;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, rgba(0,0,0,0) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.clock-widget .widget-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.clock-widget .badge {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
  padding: 2px 8px;
  border-radius: 10px;
}
.clock-time {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-white);
  margin: 0.5rem 0;
  letter-spacing: 0.5px;
}

/* Simulated Phone Grid Buttons */
.mobile-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.mini-widget {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.mini-widget:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}
.mini-widget i {
  font-size: 1.1rem;
}
.mini-widget strong {
  font-size: 0.75rem;
  color: var(--text-white);
}
.mini-widget span {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.text-blue { color: var(--color-primary); }
.text-green { color: var(--color-success); }
.text-purple { color: var(--color-purple); }
.text-orange { color: var(--color-warning); }

/* Activity / Logs Listing inside mobile */
.mobile-activity-section h5 {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  color: var(--text-white);
  font-family: var(--font-display);
}
.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.7rem;
}
.activity-item .icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
}
.activity-item.checkin .icon { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.activity-item.checkout .icon { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.activity-item .details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.activity-item .time {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Simulated GPS/Leaflet Map View Screen */
.mobile-view-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mobile-view-title-bar h3 {
  font-size: 0.9rem;
  font-family: var(--font-display);
  color: var(--text-white);
}
.back-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
}
.mobile-map-container {
  height: 280px;
  position: relative;
}
#mobile-leaflet-map {
  width: 100%;
  height: 100%;
  background-color: #121829;
}
.map-overlay-info {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  z-index: 1000;
}
.map-overlay-info i {
  color: var(--color-danger);
  font-size: 1.1rem;
}
.map-overlay-info div {
  display: flex;
  flex-direction: column;
}
.map-overlay-info strong {
  color: var(--text-white);
}

.mobile-action-panel {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.clock-display-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.7rem;
}
.clock-display-mini .label { color: var(--text-muted); }
.clock-display-mini .time-label { color: var(--text-white); font-weight: bold; }

/* Apply Leave screen inside simulator */
.leave-balance-container {
  display: flex;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.75rem;
  border-radius: 8px;
}
.bal-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
}
.bal-circle strong {
  font-size: 1.1rem;
  font-family: var(--font-display);
  color: var(--text-white);
}
.bal-circle span { color: var(--text-muted); }

/* Forms inside Phone App */
.mobile-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.mobile-form .form-group label {
  font-size: 0.7rem;
}
.mobile-form .form-group input, .mobile-form .form-group select, .mobile-form .form-group textarea {
  padding: 6px 10px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
}

.receipt-upload-box {
  border: 1px dashed var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  padding: 1.25rem 1rem;
  border-radius: var(--border-radius-md);
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}
.receipt-upload-box:hover {
  border-color: var(--color-primary);
  background-color: rgba(59, 130, 246, 0.05);
}
.receipt-upload-box i {
  font-size: 1.5rem;
  color: var(--color-primary);
}

.my-leaves-history, .my-claims-history {
  margin-top: 1rem;
}
.my-leaves-history h5, .my-claims-history h5 {
  font-size: 0.75rem;
  color: var(--text-white);
  margin-bottom: 0.5rem;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.history-item-mini {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
}
.history-item-mini .details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.history-item-mini .title {
  font-weight: bold;
  color: var(--text-white);
}
.history-item-mini .meta {
  color: var(--text-muted);
}
.history-item-mini .status {
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.55rem;
}
.history-item-mini .status.Pending { background-color: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.history-item-mini .status.Approved { background-color: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.history-item-mini .status.Rejected { background-color: rgba(239, 68, 68, 0.15); color: var(--color-danger); }

/* Payslips List on Mobile app */
.payslip-teaser-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}
.payslip-teaser-card i {
  font-size: 1.5rem;
  color: var(--color-cyan);
}
.payslip-teaser-card h4 {
  font-size: 0.75rem;
  color: var(--text-white);
}
.payslip-teaser-card span {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.mobile-payslip-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.m-payslip-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.m-payslip-card .info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.m-payslip-card .month {
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--text-white);
}
.m-payslip-card .net {
  font-size: 0.65rem;
  color: var(--color-success);
}
.m-payslip-card i {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Performance screen inside Mobile App */
.score-card-gauge {
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(0,0,0,0) 80%);
  border: 1px dashed rgba(139, 92, 246, 0.3);
  border-radius: var(--border-radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
}
.rating-circle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.rating-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-white);
  font-family: var(--font-display);
}
.score-card-gauge h4 {
  font-size: 0.85rem;
  color: var(--color-purple);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.my-kpis-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.my-kpis-list h5 {
  font-size: 0.75rem;
  color: var(--text-white);
}
.kpi-row-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.kpi-row-card .header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: bold;
  color: var(--text-white);
}
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background-color: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-cyan));
  border-radius: 3px;
  width: 0;
  transition: width 0.6s ease-out;
}
.kpi-row-card .feedback {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid rgba(255,255,255,0.03);
  padding-top: 4px;
}

/* Phone App Footer Navigation bar */
.phone-nav-footer {
  height: 48px;
  background-color: rgba(18, 24, 41, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}
.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  width: 20%;
  font-family: var(--font-body);
}
.nav-item i {
  font-size: 0.95rem;
}
.nav-item span {
  font-size: 0.55rem;
}
.nav-item:hover {
  color: var(--text-white);
}
.nav-item.active {
  color: var(--color-primary);
}

/* ==========================================================================
   MODAL POPUPS SYSTEM
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease-out;
}
.modal-overlay.hidden {
  display: none !important;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 90%;
  max-width: 600px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--glass-border-light);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-white);
}
.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.close-btn:hover { color: var(--text-white); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1rem;
}

/* Map control tweaks to dark styles */
.leaflet-container {
  font-family: var(--font-body);
}
.leaflet-bar a {
  background-color: var(--bg-secondary) !important;
  color: var(--text-main) !important;
  border-bottom: 1px solid var(--glass-border) !important;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Media Queries)
   ========================================================================== */

@media screen and (max-width: 1100px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .mobile-phone-section {
    margin-top: 2rem;
  }
  .demo-guide-panel {
    grid-column: span 1;
  }
  .guide-list {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media screen and (max-width: 768px) {
  .admin-panel {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem;
  }
  .nav-menu {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  .nav-menu li {
    white-space: nowrap;
  }
  .charts-row, .double-table-row {
    grid-template-columns: 1fr;
  }
  .calculator-inputs {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
