:root {
  --primary: #012970;
  --secondary: #4154f1;
  --success: #198754;
  --danger: #dc3545;
  --light: #f6f9ff;
  --dark: #012970;
  --sidebar-width: 300px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; background: #f6f9ff; overflow-x: hidden; }

/* ─── Login Page ─── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); }
.login-card { background: white; border-radius: 10px; box-shadow: 0 0 30px rgba(1, 41, 112, 0.1); width: 100%; max-width: 460px; padding: 40px; }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo h1 { font-size: 26px; font-weight: 700; color: var(--primary); }
.login-logo p { color: #899bbd; font-size: 14px; }
.form-control { border-radius: 8px; padding: 12px; }
.form-control:focus { border-color: var(--secondary); box-shadow: 0 0 0 0.2rem rgba(65,84,241,.25); }
.btn-primary { background: var(--secondary); border: none; padding: 12px; border-radius: 8px; font-weight: 500; }
.btn-primary:hover { background: #3445d6; }

/* ─── Header ─── */
.header { position: fixed; top: 0; right: 0; left: var(--sidebar-width); height: 60px; background: white; border-bottom: 1px solid #dee2e6; z-index: 997; display: flex; align-items: center; padding: 0 20px; box-shadow: 0px 0 20px rgba(1, 41, 112, 0.1); }
.toggle-sidebar-btn { font-size: 32px; padding: 0 10px; cursor: pointer; color: var(--primary); }
.toggle-sidebar-btn:hover { color: var(--secondary); }
.header-nav { margin-left: auto; }
.nav-profile img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.nav-profile { display: flex; align-items: center; cursor: pointer; color: #012970; }
.nav-profile:hover { color: var(--secondary); }

/* ─── Sidebar ─── */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width); background: var(--primary); padding: 20px; overflow-y: auto; z-index: 996; transition: all 0.3s; }
.sidebar-logo { display: flex; align-items: center; color: white; text-decoration: none; margin-bottom: 30px; }
.sidebar-logo img { width: 40px; margin-right: 12px; }
.sidebar-logo span { font-size: 22px; font-weight: 700; }
.sidebar-nav { list-style: none; padding: 0; }
.nav-heading { padding: 10px 0 0; font-size: 11px; text-transform: uppercase; color: #899bbd; font-weight: 600; margin: 0 0 10px; }
.nav-item { margin-bottom: 5px; }
.nav-link { display: flex; align-items: center; padding: 10px 15px; color: #899bbd; border-radius: 4px; transition: all 0.3s; text-decoration: none; font-size: 15px; }
.nav-link:hover, .nav-link.active { color: white; background: rgba(255,255,255,0.1); }
.nav-link.active { background: var(--secondary); }
.nav-link i { font-size: 18px; margin-right: 10px; }
.nav-content { list-style: none; padding-left: 20px; margin-top: 5px; }
.nav-content .nav-link { font-size: 14px; padding-left: 40px; }

/* ─── Main Content ─── */
.main { margin-left: var(--sidebar-width); padding: 80px 30px 30px; min-height: 100vh; }
.pagetitle h1 { font-size: 24px; margin-bottom: 5px; font-weight: 600; color: var(--primary); }
.pagetitle nav { font-size: 14px; color: #899bbd; }
.section { padding: 20px 0; }
.card { background: white; border: 1px solid #ebeef4; border-radius: 8px; box-shadow: 0px 0 20px rgba(1, 41, 112, 0.1); margin-bottom: 20px; }
.card-header { padding: 20px; border-bottom: 1px solid #ebeef4; font-weight: 600; color: var(--primary); }
.card-body { padding: 20px; }

/* ─── Stats Cards ─── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 20px; }
.stat-card { background: white; border-radius: 8px; padding: 20px; box-shadow: 0px 0 20px rgba(1, 41, 112, 0.1); border-left: 4px solid var(--secondary); }
.stat-card.teal { border-left-color: #17a2b8; }
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: #ffc107; }
.stat-label { font-size: 14px; color: #899bbd; text-transform: uppercase; font-weight: 600; margin-bottom: 10px; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--primary); }

/* ─── Tables ─── */
.table { font-size: 14px; }
.table { border-collapse: collapse; }
.table thead th { text-align: center; background: #f8f9fa; color: #012970; font-weight: 600; border-left: none; border-right: 1px solid #dee2e6; border-top: none; border-bottom: 2px solid #dee2e6; padding: 12px; }
.table thead th:last-child { border-right: none; }
.table tbody td { padding: 12px; vertical-align: middle;  border-left: none; border-right: 1px solid #dee2e6; border-top: none; border-bottom: 2px solid #dee2e6;}
.table tbody tr:last-child td { border-bottom: none;}
.table tbody td:last-child { border-right: none; }
.table tbody tr:hover { background: #f8f9fa; }

/* ─── Badges ─── */
.badge { padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.badge-primary { background: #cfe2ff; color: #084298; }
.badge-success { background: #d1e7dd; color: #0f5132; }
.badge-warning { background: #fff3cd; color: #856404; }

/* ─── Buttons ─── */
.btn { padding: 8px 20px; border-radius: 4px; font-size: 14px; font-weight: 500; }
.btn-sm { padding: 4px 12px; font-size: 13px; }

/* ─── Upload Zone ─── */
.upload-zone { border: 2px dashed #dee2e6; border-radius: 8px; padding: 40px; text-align: center; cursor: pointer; transition: all 0.3s; }
.upload-zone:hover { border-color: var(--secondary); background: #f8f9ff; }
.upload-icon { width: 60px; height: 60px; background: #f6f9ff; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 15px; }
.upload-icon i { font-size: 28px; color: var(--secondary); }

/* ─── Table Column Widths ─── */
.table th, .table td {
  white-space: nowrap; /* Prevent wrapping by default */
  overflow: hidden;
  text-overflow: ellipsis; /* Show ... for overflow */
}

/* Allow wrapping for specific columns */
.table td.wrap-text {
  white-space: normal !important;
  word-wrap: break-word;
  max-width: 500px; /* Increased from 250px */
  min-width: 300px; /* Increased from 150px */
  line-height: 1.5;
}

/* ─── Mobile ─── */
@media (max-width: 1199px) {
  .sidebar { left: -var(--sidebar-width); }
  .sidebar.show { left: 0; }
  .header { left: 0; }
  .main { margin-left: 0; }
  .toggle-sidebar-btn { display: block; }
}

.hidden { display: none !important; }
.alert { border-radius: 8px; margin-bottom: 20px; }
