/* ==========================================
   CSS GLOBAL STYLES & DESIGN SYSTEM VARIABLES
   ========================================== */
:root {
  /* Colors */
  --bg-primary: #f3f4f6;
  --bg-secondary: #ffffff;
  --sidebar-bg: #0a122c;
  --sidebar-hover: #15224f;
  --sidebar-active: #E21E26;
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #f8fafc;
  
  --accent-primary: #E21E26;
  --accent-primary-hover: #b9161c;
  --accent-success: #10b981;
  --accent-success-hover: #059669;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-danger-hover: #dc2626;

  /* Glassmorphism & Shadow Properties */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(226, 232, 240, 0.8);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Profile Box overrides for dark background */
.sidebar-profile {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
  box-shadow: none;
}

.sidebar-profile .profile-guest {
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.sidebar-profile .guest-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
}

.sidebar-profile .profile-logged {
  width: 100%;
  justify-content: space-between;
}

.sidebar-profile .profile-name {
  color: #ffffff;
}

.sidebar-profile .profile-role {
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-profile .profile-avatar {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

.sidebar-profile .btn-logout {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition-fast);
  font-size: 1.1rem;
}

.sidebar-profile .btn-logout:hover {
  color: var(--accent-primary);
}

/* Management sub-tabs and sub-panes */
.management-sub-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
}

.sub-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sub-tab:hover {
  background-color: rgba(0, 0, 0, 0.02);
  color: var(--text-primary);
}

.sub-tab.active {
  background-color: var(--accent-primary);
  color: var(--text-light);
  box-shadow: 0 4px 12px rgba(226, 30, 38, 0.25);
}

.pane-content {
  display: none;
}

.pane-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

/* Trainees checklist styling */
.trainees-checklist-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 180px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.trainees-checklist-box label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  color: var(--text-primary);
  line-height: 1.2;
}

.trainees-checklist-box input[type="checkbox"] {
  width: auto;
  cursor: pointer;
  margin: 0;
}

/* Base resets & typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

/* ==========================================
   LAYOUT STRUCTURE
   ========================================== */
.app-container {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100vh;
  width: 100vw;
}

/* Sidebar navigation */
.sidebar {
  background: linear-gradient(180deg, #0a122c 0%, #15224f 75%, #801317 100%);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 32px;
  background-color: #ffffff;
  padding: 16px 12px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo-img {
  max-width: 90%;
  max-height: 48px;
  object-fit: contain;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #0f172a;
}

.brand-text span {
  font-size: 0.65rem;
  color: var(--accent-primary);
  font-weight: 600;
  display: block;
  margin-top: 2px;
  white-space: nowrap;
}

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

.menu-item {
  background: transparent;
  border: none;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
  width: 100%;
  white-space: nowrap;
}

.menu-item i {
  font-size: 1.15rem;
  width: 20px;
  text-align: center;
}

.menu-item:hover {
  background-color: var(--sidebar-hover);
  color: var(--text-light);
}

.menu-item.active {
  background-color: var(--sidebar-active);
  color: var(--text-light);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* User Profile in Header */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-profile {
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  min-height: 44px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.profile-guest {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.profile-guest .guest-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.profile-logged {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.profile-avatar {
  background-color: rgba(226, 232, 240, 0.8);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--accent-primary);
  border: 1px solid rgba(226, 232, 240, 1);
}

.profile-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 180px;
}

.profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.profile-role {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  margin-top: -1px;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  margin-left: 8px;
  padding: 4px;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
}

.btn-logout:hover {
  color: var(--accent-danger);
  transform: scale(1.1);
}

/* Main Content Wrapper */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  position: relative;
}

.top-header {
  align-items: center;
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  padding: 20px 32px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-title h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
}

.header-title p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.system-time {
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Page Section Switching */
.page-section {
  display: none;
  padding: 32px;
  flex-grow: 1;
}

.page-section.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

/* ==========================================
   BUTTONS AND COMMON COMPONENTS
   ========================================== */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 20px;
  transition: var(--transition-fast);
}

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

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: var(--text-light);
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-success {
  background-color: var(--accent-success);
  color: var(--text-light);
}

.btn-success:hover {
  background-color: var(--accent-success-hover);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-danger {
  background-color: var(--accent-danger);
  color: var(--text-light);
}

.btn-danger:hover {
  background-color: var(--accent-danger-hover);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: rgba(0, 0, 0, 0.02);
  border-color: var(--text-secondary);
}

.btn-outline-danger {
  background-color: transparent;
  border: 1px solid var(--accent-danger);
  color: var(--accent-danger);
}

.btn-outline-danger:hover {
  background-color: rgba(239, 68, 68, 0.05);
}

/* Common Card Base */
.card {
  background-color: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header h3 i {
  color: var(--accent-primary);
}

.card-body {
  padding: 24px;
}

/* Badges */
.badge {
  border-radius: 50px;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  text-align: center;
  white-space: nowrap;
}

.badge-primary {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--accent-primary);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--accent-success);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--accent-warning);
}

.badge-info {
  background-color: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-warning-30 {
  background-color: rgba(249, 115, 22, 0.12);
  color: #ea580c;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.badge-warning-60 {
  background-color: rgba(234, 179, 8, 0.12);
  color: #b45309;
  border: 1px solid rgba(234, 179, 8, 0.2);
}

/* ==========================================
   PAGE 1: DASHBOARD LAYOUT & COMPONENTS
   ========================================== */

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

.kpi-card {
  align-items: center;
  border-radius: var(--radius-lg);
  color: var(--text-light);
  display: flex;
  gap: 20px;
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.bg-gradient-blue {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
}
.bg-gradient-purple {
  background: linear-gradient(135deg, #0b1a44, #1b367c);
}
.bg-gradient-emerald {
  background: linear-gradient(135deg, #047857, #10b981);
}
.bg-gradient-amber {
  background: linear-gradient(135deg, #b45309, #f59e0b);
}

.kpi-icon {
  background-color: rgba(255, 255, 255, 0.15);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-value {
  font-family: inherit;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* Main Grid: Left List, Right Charts */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: 2.7fr 1fr;
  gap: 24px;
  align-items: start;
}

.card-table-section {
  min-height: 500px;
}

/* Search and Filters panel */
.filters-panel {
  background-color: rgba(0, 0, 0, 0.01);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 24px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
  flex-grow: 1;
}

.filter-search {
  flex-grow: 2;
  min-width: 250px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  padding: 10px 12px;
  transition: var(--transition-fast);
  width: 100%;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper i {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.filter-group .search-input-wrapper input {
  padding-left: 40px;
}

/* Responsive Custom Data Table */
.table-responsive {
  overflow-x: auto;
  max-height: 520px;
  overflow-y: auto;
}

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

.data-table th {
  background-color: rgba(248, 250, 252, 0.85);
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 10px 8px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table td {
  border-bottom: 1px solid var(--glass-border);
  padding: 10px 8px;
  vertical-align: middle;
  color: var(--text-primary);
  line-height: 1.4;
}

.data-table tbody tr {
  transition: var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.02);
}

/* Department Bar Chart CSS */
.department-chart-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chart-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.chart-dept-name {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75%;
}

.chart-hours-val {
  font-family: inherit;
  font-weight: 600;
  color: var(--accent-primary);
}

.chart-bar-track {
  background-color: rgba(0, 0, 0, 0.05);
  height: 10px;
  border-radius: 50px;
  overflow: hidden;
  width: 100%;
}

.chart-bar-fill {
  background: linear-gradient(90deg, var(--accent-primary), #60a5fa);
  height: 100%;
  border-radius: 50px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0; /* Animated in JS */
}

/* Category breakdown */
.category-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-breakdown-item {
  align-items: flex-start;
  background-color: rgba(0, 0, 0, 0.01);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
}

.cat-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  flex: 1;
  padding-right: 12px;
}

.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-top: 5px;
  flex-shrink: 0;
}

.cat-count {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  background-color: var(--bg-primary);
  border: 1px solid var(--glass-border);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-primary);
}

/* Border separator helper */
.border-top {
  border-top: 1px solid var(--glass-border);
}

/* ==========================================
   PAGE 2: MY TRAINING & AUTHENTICATION
   ========================================== */

/* Centered Authentication State UI */
.auth-box-wrapper {
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  margin: 40px auto;
  max-width: 480px;
  overflow: hidden;
  width: 100%;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--glass-border);
}

.auth-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 16px;
  text-align: center;
  transition: var(--transition-fast);
}

.auth-tab.active {
  background-color: var(--bg-secondary);
  color: var(--accent-primary);
  border-bottom: 2px solid var(--accent-primary);
}

.auth-card {
  padding: 32px;
}

.auth-icon {
  background-color: rgba(37, 99, 235, 0.05);
  color: var(--accent-primary);
  width: 65px;
  height: 65px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 20px;
}

.auth-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.auth-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 24px;
}

/* Forms layout */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group label .required {
  color: var(--accent-danger);
}

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

.input-icon-wrapper i {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  padding: 11px 14px;
  transition: var(--transition-fast);
  width: 100%;
}

.form-group .input-icon-wrapper input {
  padding-left: 40px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row-profile {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background-color: rgba(37, 99, 235, 0.03);
  border: 1px dashed rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 12px;
}

.profile-field-item {
  font-size: 0.88rem;
}

.p-label {
  color: var(--text-secondary);
  font-weight: 500;
  margin-right: 4px;
}

.p-value {
  color: var(--text-primary);
  font-weight: 600;
}

.form-divider {
  border: 0;
  border-top: 1px solid var(--glass-border);
  margin: 16px 0;
}

.col-6 { flex: 1 1 calc(50% - 8px); }
.col-4 { flex: 1 1 calc(33.33% - 11px); }

.auth-actions {
  margin-top: 24px;
}

.alert {
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 12px 16px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-danger);
}

/* Management grid (When Logged-in) */
.management-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: stretch;
}

.card-form {
  min-height: 500px;
}

/* Custom file upload component */
.file-upload-wrapper {
  position: relative;
  width: 100%;
}

.file-upload-trigger {
  align-items: center;
  background-color: var(--bg-primary);
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  padding: 24px;
  text-align: center;
  transition: var(--transition-fast);
}

.file-upload-trigger:hover {
  background-color: rgba(37, 99, 235, 0.02);
  border-color: var(--accent-primary);
}

.file-upload-trigger i {
  color: var(--accent-primary);
  font-size: 2rem;
}

.file-upload-trigger span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.file-upload-limits {
  color: var(--text-secondary) !important;
  font-size: 0.75rem !important;
}

.file-upload-wrapper input[type="file"] {
  height: 100%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  width: 100%;
  cursor: pointer;
}

/* Upload Preview */
.upload-preview-container {
  margin-top: 14px;
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  max-height: 250px;
}

.upload-preview-container img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 248px;
}

.btn-remove-preview {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(239, 68, 68, 0.9);
  color: var(--text-light);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-remove-preview:hover {
  background-color: var(--accent-danger-hover);
}

/* My Training List on the Right */
.card-mylist {
  max-height: 750px;
  display: flex;
  flex-direction: column;
}

.card-mylist .card-body {
  max-height: 650px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-right: 8px;
}

.mylist-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mylist-item {
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  transition: var(--transition-fast);
}

.mylist-item:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transform: translateY(-2px);
}

.mylist-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.mylist-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.mylist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.mylist-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mylist-meta-item i {
  color: var(--accent-primary);
}

.mylist-actions {
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 12px;
}

/* Action icons inside tables/lists */
.action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 6px;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.action-view {
  color: var(--accent-primary);
}
.action-view:hover {
  background-color: rgba(37, 99, 235, 0.06);
}

.action-edit {
  color: var(--accent-success);
}
.action-edit:hover {
  background-color: rgba(16, 185, 129, 0.06);
}

.action-delete {
  color: var(--accent-danger);
}
.action-delete:hover {
  background-color: rgba(239, 68, 68, 0.06);
}

.actions-cell {
  display: flex;
  gap: 4px;
}

/* ==========================================
   MODAL VIEW DIALOG STYLE
   ========================================== */
.modal {
  align-items: center;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  height: 100vh;
  justify-content: center;
  left: 0;
  position: fixed;
  top: 0;
  width: 100vw;
  z-index: 100;
  animation: fadeIn 0.25s ease-out;
}

.modal.open {
  display: flex;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 900px;
  position: relative;
  width: 90%;
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.btn-close-modal {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.1rem;
  height: 36px;
  position: absolute;
  right: 16px;
  top: 16px;
  width: 36px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-close-modal:hover {
  background-color: var(--accent-danger);
  color: var(--text-light);
  transform: rotate(90deg);
}

.modal-body-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  height: 520px;
}

.modal-cert-viewer {
  background-color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.modal-cert-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.no-cert-state {
  color: #475569;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.no-cert-state i {
  font-size: 3rem;
}

.modal-info-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 32px;
}

.modal-info-panel h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 12px;
  padding-right: 12px;
}

.modal-meta-row {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}

.detail-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.detail-val {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-note-box {
  background-color: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: auto;
}

.detail-note-box p {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin-top: 6px;
}

/* ==========================================
   RESPONSIVE MEDIA QUERIES (Mobile/Tablet)
   ========================================== */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
  }
  
  .sidebar {
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
  }
  
  .sidebar-brand {
    margin-bottom: 0;
  }
  
  .sidebar-menu {
    flex-direction: row;
    gap: 8px;
    flex-grow: 0;
  }
  
  .sidebar-profile {
    margin-top: 0;
    padding: 8px 12px;
  }
  
  .profile-guest p {
    display: none;
  }
  
  .profile-logged {
    gap: 8px;
  }
  
  .profile-info {
    display: none; /* Hide name/role text on tablet/mobile sidebar */
  }

  .main-content {
    height: calc(100vh - 78px);
  }
  
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }
  
  .management-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  
  .sidebar-menu {
    width: 100%;
    justify-content: space-around;
  }
  
  .main-content {
    height: auto;
  }
  
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }
  
  .page-section {
    padding: 16px;
  }
  
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .filters-panel {
    padding: 16px;
  }
  
  .form-row, .form-row-profile {
    flex-direction: column;
    gap: 0;
  }
  
  .col-6, .col-4 {
    flex: 1 1 100%;
  }
  
  .modal-body-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 250px 1fr;
    height: 90vh;
  }
  
  .modal-info-panel {
    padding: 20px;
  }
}

/* ==========================================
   NEW FEATURES: LICENSE MANAGEMENT & USER ADMIN & EXPIRY
   ========================================== */

.card-expiry-alerts {
  border-left: 5px solid var(--accent-primary);
  box-shadow: 0 10px 25px -5px rgba(226, 30, 38, 0.08);
}

.bg-expiry-header {
  background-color: rgba(226, 30, 38, 0.03) !important;
  border-bottom: 1px solid rgba(226, 30, 38, 0.08) !important;
}

.bg-expiry-header h3 {
  color: var(--accent-primary) !important;
}

#dashboard-expiry-alerts-list tr:hover {
  background-color: rgba(226, 30, 38, 0.015);
}

.bg-navy {
  background-color: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.bg-slate {
  background-color: rgba(71, 85, 105, 0.08);
  color: #475569;
  border: 1px solid rgba(71, 85, 105, 0.12);
}

/* User Form row overrides */
#section-admin-users .form-row,
#section-license-expiries .form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

#section-admin-users .form-row .form-group,
#section-license-expiries .form-row .form-group {
  margin-bottom: 0;
}
