/* ========================================================
 * BRI Mobile Attendance Application - Admin & Supervisor Dashboard
 * ======================================================== */

.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-main);
}

.admin-sidebar {
  width: 250px;
  background: var(--bri-navy);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.admin-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-sidebar-menu {
  list-style: none;
  padding: 16px 0;
  flex: 1;
}

.admin-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.admin-menu-link:hover, .admin-menu-link.active {
  color: white;
  background: var(--bri-blue);
  border-left: 4px solid var(--bri-orange);
}

.admin-main {
  margin-left: 250px;
  flex: 1;
  padding: 24px;
  width: calc(100% - 250px);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-custom {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-width: 600px;
}

.table-custom th {
  background: #F8FAFC;
  color: var(--text-dark);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.table-custom td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-dark);
}

.table-custom tr:hover {
  background: #F1F5F9;
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: white;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 20px;
  background: var(--bri-navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

/* ========================================================
 * RESPONSIVE MOBILE VIEWPORT OVERRIDES (Mobile & Tablet)
 * ======================================================== */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column !important;
    min-height: auto;
  }

  .admin-sidebar {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    box-shadow: none;
    border-bottom: 3px solid var(--bri-orange);
  }

  .admin-sidebar-header {
    padding: 12px 16px;
    justify-content: space-between;
  }

  .admin-sidebar-menu {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    padding: 8px 12px !important;
    gap: 8px !important;
    white-space: nowrap !important;
    background: rgba(0, 0, 0, 0.2);
  }

  .admin-menu-link {
    padding: 8px 14px !important;
    font-size: 12px !important;
    border-radius: 20px !important;
    border-left: none !important;
    background: rgba(255, 255, 255, 0.1);
  }

  .admin-menu-link.active {
    background: var(--bri-orange) !important;
    color: white !important;
    border-left: none !important;
  }

  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 14px !important;
  }

  /* Grid metrics cards on mobile */
  .admin-main div[style*="grid-template-columns: repeat(3, 1fr)"],
  .admin-main div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}
