/* CSS RESET & VARIABLES */
:root {
  --bg-dark: #070B19;
  --bg-card: rgba(18, 25, 50, 0.65);
  --bg-card-hover: rgba(26, 35, 70, 0.85);
  --primary: #3F51B5;
  --primary-glow: rgba(63, 81, 181, 0.4);
  --accent: #00E5FF;
  --accent-glow: rgba(0, 229, 255, 0.35);
  --text-primary: #FFFFFF;
  --text-secondary: #B0BEC5;
  --text-muted: #78909C;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 229, 255, 0.5);
  
  --success: #00E676;
  --success-glow: rgba(0, 230, 118, 0.3);
  --error: #FF1744;
  --error-glow: rgba(255, 23, 68, 0.3);
  --warning: #FFD600;
  --warning-glow: rgba(255, 214, 0, 0.3);
  
  --sidebar-width: 260px;
  --topbar-height: 70px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font-main: 'Outfit', sans-serif;
  --transition-speed: 0.3s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* SCROLLBAR STYLING */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* DYNAMIC PAGE TRANSITIONS */
.page-container {
  display: none;
  width: 100%;
  min-height: 100vh;
  opacity: 0;
  transition: opacity var(--transition-speed) ease-in-out;
}
.page-container.active-page {
  display: flex;
  opacity: 1;
}

/* LOGIN SCREEN */
#login-page {
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, rgba(63, 81, 181, 0.15), transparent),
              radial-gradient(circle at bottom left, rgba(0, 229, 255, 0.08), transparent),
              var(--bg-dark);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: var(--bg-card);
  border: 1px border-color var(--border-color);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--primary-glow);
  border: 1px solid var(--border-color);
}

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

.logo-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 65px;
  height: 65px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 18px;
  font-size: 28px;
  color: white;
  margin-bottom: 15px;
  box-shadow: 0 0 20px var(--accent-glow);
}

.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 18px;
}

.login-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* FORMS & INPUTS */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.input-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  transition: color var(--transition-speed);
}

.input-wrapper input,
select,
textarea {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
  transition: all var(--transition-speed);
}

select {
  padding-left: 16px;
}

.input-wrapper input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px var(--accent-glow);
}

.error-text {
  color: var(--error);
  font-size: 13px;
  margin-bottom: 15px;
  min-height: 18px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition-speed);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #00C853, var(--success));
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--success-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 4px 15px var(--error-glow);
}

/* PORTAL LAYOUT */
#portal-page {
  flex-direction: row;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: rgba(10, 15, 36, 0.95);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
  color: white;
}

.sidebar-logo img {
  height: 32px;
  width: 32px;
  object-fit: contain;
  border-radius: 6px;
}

.sidebar-menu {
  flex: 1;
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition-speed);
}

.menu-item i {
  font-size: 18px;
  width: 20px;
}

.menu-item:hover, .menu-item.active {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
  background: linear-gradient(90deg, rgba(63, 81, 181, 0.3) 0%, rgba(0, 229, 255, 0.1) 100%);
  border-left: 3px solid var(--accent);
  color: var(--accent);
}

.menu-item .badge {
  margin-left: auto;
  background: var(--error);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  box-shadow: 0 0 8px var(--error-glow);
}

.sidebar-footer {
  padding: 20px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  box-shadow: 0 0 10px var(--primary-glow);
}

.user-details h4 {
  font-size: 14px;
  font-weight: 600;
}

.user-details p {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-logout {
  width: 100%;
  background: rgba(255, 23, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(255, 23, 68, 0.2);
}

.btn-logout:hover {
  background: var(--error);
  color: white;
  box-shadow: 0 0 15px var(--error-glow);
}

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px;
  background: radial-gradient(circle at 70% 10%, rgba(63, 81, 181, 0.05), transparent), var(--bg-dark);
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.topbar-title h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.clock {
  font-family: monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
  background: rgba(0, 229, 255, 0.05);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(0, 229, 255, 0.15);
}

/* TAB CONTENT SYSTEM */
.tab-content {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease-in-out;
}

.tab-content.active-tab {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* STATS CARDS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all var(--transition-speed);
}

.stat-card:hover {
  transform: translateY(-5px);
  background: var(--bg-card-hover);
}

.stat-icon {
  width: 55px;
  height: 55px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-info h3 {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-info p {
  font-size: 28px;
  font-weight: 800;
}

/* STAT CARD COLOR FLAVORS */
.stat-card.blue .stat-icon { background: rgba(63, 81, 181, 0.15); color: #5C6BC0; }
.stat-card.blue { border-left: 4px solid #5C6BC0; }
.stat-card.green .stat-icon { background: rgba(0, 230, 118, 0.15); color: var(--success); }
.stat-card.green { border-left: 4px solid var(--success); }
.stat-card.yellow .stat-icon { background: rgba(255, 214, 0, 0.1); color: var(--warning); }
.stat-card.yellow { border-left: 4px solid var(--warning); }
.stat-card.purple .stat-icon { background: rgba(124, 77, 255, 0.15); color: #7C4DFF; }
.stat-card.purple { border-left: 4px solid #7C4DFF; }

/* PANELS LAYOUT */
.dashboard-panels {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.dashboard-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.panel-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.panel-body {
  padding: 24px;
  flex: 1;
}

.chart-container {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ACTIONS BAR */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.action-bar.flex-end {
  justify-content: flex-end;
}

.search-filters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  width: 280px;
}

/* DATA TABLE STYLING */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.data-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

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

.emp-row-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--border-color);
}

/* BADGES */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge.present { background: rgba(0, 230, 118, 0.1); color: var(--success); }
.status-badge.pending { background: rgba(255, 214, 0, 0.1); color: var(--warning); }
.status-badge.rejected { background: rgba(255, 23, 68, 0.1); color: var(--error); }
.status-badge.approved { background: rgba(0, 229, 255, 0.1); color: var(--accent); }

/* ALERTS & NOTIFICATIONS list */
.alert-info-banner {
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.15);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-info-banner i {
  color: var(--accent);
}

.notif-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item i {
  margin-top: 3px;
  font-size: 14px;
}

.notif-item.warning i { color: var(--warning); }
.notif-item.info i { color: var(--accent); }

/* MODALS */
.modal {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 7, 18, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-speed);
}

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

.modal-content {
  width: 100%;
  max-width: 500px;
  background: #0D132D;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  animation: slideUp var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-large { max-width: 900px; }
.modal-medium { max-width: 700px; }

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.close-btn {
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-speed);
}

.close-btn:hover {
  color: white;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* PROFILE HEADER (DETAIL MODAL) */
.profile-summary-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  color: white;
  border: 3px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 15px var(--primary-glow);
}

.profile-title-info h2 {
  font-size: 20px;
  font-weight: 800;
}

.profile-title-info p {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* DETAILS TABS NAVIGATION */
.detail-tab-headers {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.detail-tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.detail-tab-btn:hover, .detail-tab-btn.active {
  color: white;
}

.detail-tab-btn.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.detail-tab-contents .detail-tab-content {
  display: none;
}

.detail-tab-contents .detail-tab-content.active-tab {
  display: block;
}

/* INFO ROW STYLINGS */
.info-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.info-section h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-group-inline {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  font-size: 13px;
}

.info-group-inline:last-child {
  border-bottom: none;
}

.info-label {
  width: 160px;
  color: var(--text-secondary);
  font-weight: 500;
}

.info-value {
  color: white;
  flex: 1;
}

.info-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

/* FORM GRIDS */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.col-span-2 {
  grid-column: span 2;
}

/* INLINE DOCUMENT UPLOADER & GRID */
.inline-upload-form {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  border-radius: var(--radius-md);
}

.inline-upload-form select, .inline-upload-form input {
  flex: 1;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.doc-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.doc-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.doc-card-icon {
  width: 38px;
  height: 38px;
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.doc-card-text {
  min-width: 0;
}

.doc-card-text h5 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-card-text p {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-card-actions {
  display: flex;
  gap: 6px;
}

.action-btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-speed);
}

.action-btn-icon.view { color: var(--accent); }
.action-btn-icon.view:hover { background: rgba(0, 229, 255, 0.1); }
.action-btn-icon.delete { color: var(--error); }
.action-btn-icon.delete:hover { background: rgba(255, 23, 68, 0.1); }

/* UTILS */
.margin-top-20 { margin-top: 20px; }
.loading-spinner {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}
.loading-spinner i {
  margin-right: 8px;
}
