/* ==========================================================================
   Sistem Informasi Tracer Study STIKes Bakti Utama Pati
   Theme: Medical Elegance (Emerald & Navy Theme)
   ========================================================================== */

:root {
  --primary-50: #f0fdfa;
  --primary-100: #ccfbf1;
  --primary-200: #99f6e4;
  --primary-500: #14b8a6;
  --primary-600: #0d9488;
  --primary-700: #0f766e;
  --primary-800: #115e59;
  --primary-900: #134e4a;
  --primary-950: #042f2e;

  --navy-800: #1e293b;
  --navy-900: #0f172a;
  --navy-950: #020617;

  --accent-gold: #f59e0b;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;

  --surface-bg: #f8fafc;
  --surface-card: #ffffff;
  --surface-border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.03);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.04);
  --shadow-glow: 0 0 25px -5px rgba(13, 148, 136, 0.35);

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

img, svg {
  max-width: 100%;
  height: auto;
}

img.sidebar-logo-img, .sidebar-logo-img {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  object-fit: contain;
  flex-shrink: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--surface-bg);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--navy-900);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: var(--primary-700);
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover {
  color: var(--primary-800);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-danger  { background: #ffe4e6; color: #be123c; border: 1px solid #fecdd3; }
.badge-info    { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-primary { background: var(--primary-100); color: var(--primary-900); border: 1px solid var(--primary-200); }
.badge-purple  { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
}

.btn-secondary {
  background: #ffffff;
  color: var(--navy-800);
  border: 1px solid var(--surface-border);
}
.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-danger {
  background: #e11d48;
  color: #ffffff;
}
.btn-danger:hover {
  background: #be123c;
}

.btn-success {
  background: #10b981;
  color: #ffffff;
}
.btn-success:hover {
  background: #059669;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.775rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-danger  { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ==========================================================================
   App Layout (Admin & Alumni)
   ========================================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--navy-950);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.4);
}

.sidebar-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.sidebar-brand h2 {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-brand span {
  font-size: 0.7rem;
  color: var(--primary-400, #2dd4bf);
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.sidebar-nav {
  padding: 1.25rem 0.85rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.75rem 0.75rem 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item.active {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-600));
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.nav-item svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.6);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-500), var(--accent-gold));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-info-text {
  flex: 1;
  min-width: 0;
}
.user-info-text .name {
  color: #ffffff;
  font-size: 0.825rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-info-text .role {
  color: #94a3b8;
  font-size: 0.7rem;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-navbar {
  background: var(--surface-card);
  border-bottom: 1px solid var(--surface-border);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-wrapper {
  padding: 2rem;
  flex: 1;
}

/* ==========================================================================
   Welcome Banner (Alumni & Admin Dashboards)
   ========================================================================== */
.welcome-banner {
  background-color: #022c22;
  background-image: 
    radial-gradient(rgba(45, 212, 191, 0.16) 1.5px, transparent 1.5px),
    radial-gradient(circle at 85% 20%, rgba(13, 148, 136, 0.45) 0%, transparent 60%),
    radial-gradient(circle at 15% 85%, rgba(56, 189, 248, 0.2) 0%, transparent 55%),
    linear-gradient(135deg, #022c22 0%, #064e3b 45%, #0f172a 100%);
  background-size: 28px 28px, 100% 100%, 100% 100%, 100% 100%;
  border-radius: 20px;
  padding: 2.25rem 2.5rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 35px -5px rgba(2, 44, 34, 0.35);
  border: 1px solid rgba(45, 212, 191, 0.25);
}
.welcome-banner h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff !important;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.welcome-banner p {
  font-size: 0.95rem;
  color: #ccfbf1 !important;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Cards & KPI Metrics
   ========================================================================== */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy-900);
}

.card-body {
  padding: 1.5rem;
}

.grid-cols-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.grid-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.kpi-card {
  background: var(--surface-card);
  color: var(--text-main);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-primary::before { background: var(--primary-600); }
.kpi-emerald::before { background: var(--accent-emerald); }
.kpi-gold::before    { background: var(--accent-gold); }
.kpi-blue::before    { background: var(--accent-blue); }
.kpi-purple::before  { background: var(--accent-purple); }

.kpi-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-primary .kpi-icon-box { background: var(--primary-50); color: var(--primary-700); }
.kpi-emerald .kpi-icon-box { background: #ecfdf5; color: #059669; }
.kpi-gold .kpi-icon-box    { background: #fffbeb; color: #d97706; }
.kpi-blue .kpi-icon-box    { background: #eff6ff; color: #2563eb; }

.kpi-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--navy-950);
  line-height: 1.1;
}

.kpi-sub {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ==========================================================================
   Table & Data Listing
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.table th {
  background: #f8fafc;
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--surface-border);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--navy-800);
  vertical-align: middle;
}

.table tr:hover td {
  background-color: #f8fafc;
}

/* ==========================================================================
   Forms & Multi-step Wizard
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 0.4rem;
}

.form-label .req {
  color: #e11d48;
}

.form-label .code-badge {
  font-family: monospace;
  font-size: 0.75rem;
  background: #e2e8f0;
  color: #334155;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.25rem;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.65rem 0.95rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--navy-900);
  background-color: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  cursor: pointer;
}

.form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  cursor: pointer;
  accent-color: var(--primary-600);
}

/* Wizard Steps Indicator */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 2.5rem;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 2;
  cursor: pointer;
  flex: 1;
}

.step-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--surface-border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.wizard-step.active .step-circle {
  border-color: var(--primary-600);
  background: var(--primary-600);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.wizard-step.completed .step-circle {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald);
  color: #ffffff;
}

.step-label {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.wizard-step.active .step-label {
  color: var(--primary-800);
  font-weight: 700;
}

/* Matrix Table for f17 Competency */
.matrix-table th, .matrix-table td {
  text-align: center;
  padding: 0.75rem 0.5rem;
}
.matrix-table td:first-child {
  text-align: left;
  font-weight: 500;
}

/* ==========================================================================
   Print / Surat Bukti Tracer
   ========================================================================== */
.letterhead {
  border-bottom: 3px double #0f172a;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.letterhead-logo {
  width: 80px;
  height: 80px;
}

.letterhead-text {
  text-align: center;
  flex: 1;
}

.letterhead-text h2 {
  font-size: 1.35rem;
  color: #042f2e;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.letterhead-text h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
}

.letterhead-text p {
  font-size: 0.75rem;
  color: #475569;
}

@media print {
  body {
    background: #ffffff;
  }
  .no-print {
    display: none !important;
  }
  .page-wrapper {
    padding: 0;
  }
  .card {
    border: none;
    box-shadow: none;
  }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app-container { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .grid-cols-4, .grid-cols-2 { grid-template-columns: 1fr; }
  .page-wrapper { padding: 1rem; }
  .top-navbar { padding: 0.75rem 1rem; }
}

/* ==========================================================================
   Dark Mode Theme System ([data-theme="dark"])
   ========================================================================== */
[data-theme="dark"] {
  --surface-bg: #0b1120;
  --surface-card: #1e293b;
  --surface-border: #334155;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --navy-950: #f8fafc;
  --navy-900: #f1f5f9;
  --navy-800: #e2e8f0;
  --primary-50: rgba(13, 148, 136, 0.2);
  --primary-100: rgba(13, 148, 136, 0.3);
  --primary-200: #0f766e;
  --primary-500: #14b8a6;
  --primary-600: #2dd4bf;
  --primary-700: #5eead4;
  --primary-800: #99f6e4;
  --primary-900: #ccfbf1;
  --primary-950: #f0fdfa;
}

[data-theme="dark"] body {
  background-color: var(--surface-bg) !important;
  color: var(--text-main) !important;
}

[data-theme="dark"] .main-content,
[data-theme="dark"] .app-container {
  background-color: var(--surface-bg) !important;
}

/* Card & KPI Components in Dark Mode */
[data-theme="dark"] .card {
  background-color: var(--surface-card) !important;
  border-color: var(--surface-border) !important;
  color: var(--text-main) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .kpi-card {
  background-color: var(--surface-card) !important;
  border-color: var(--surface-border) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .kpi-value {
  color: #f8fafc !important;
}

[data-theme="dark"] .kpi-title {
  color: #94a3b8 !important;
}

[data-theme="dark"] .kpi-sub {
  color: #64748b !important;
}

[data-theme="dark"] .kpi-primary .kpi-icon-box {
  background: rgba(13, 148, 136, 0.25) !important;
  color: #2dd4bf !important;
}

[data-theme="dark"] .kpi-emerald .kpi-icon-box {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #34d399 !important;
}

[data-theme="dark"] .kpi-gold .kpi-icon-box {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fbbf24 !important;
}

[data-theme="dark"] .kpi-blue .kpi-icon-box {
  background: rgba(59, 130, 246, 0.25) !important;
  color: #60a5fa !important;
}

[data-theme="dark"] .kpi-purple .kpi-icon-box {
  background: rgba(139, 92, 246, 0.25) !important;
  color: #a78bfa !important;
}

[data-theme="dark"] .card-header {
  border-color: var(--surface-border) !important;
  background-color: rgba(30, 41, 59, 0.5) !important;
}

[data-theme="dark"] .card-footer {
  background-color: rgba(15, 23, 42, 0.6) !important;
  border-color: var(--surface-border) !important;
}

[data-theme="dark"] .topbar,
[data-theme="dark"] .top-navbar {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* Tables in Dark Mode */
[data-theme="dark"] .table,
[data-theme="dark"] table {
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .table thead th,
[data-theme="dark"] table thead th {
  background-color: #0b1120 !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .table tbody td,
[data-theme="dark"] .table tfoot td,
[data-theme="dark"] table tbody td {
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .table tfoot,
[data-theme="dark"] table tfoot {
  background-color: rgba(15, 23, 42, 0.8) !important;
}

[data-theme="dark"] .table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.04) !important;
}

/* Forms in Dark Mode */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] select {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] textarea:focus {
  border-color: var(--primary-500) !important;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25) !important;
}

[data-theme="dark"] .form-label {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .form-check {
  color: #f1f5f9 !important;
}

/* Buttons in Dark Mode */
[data-theme="dark"] .btn-secondary {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .btn-secondary:hover {
  background-color: #475569 !important;
}

[data-theme="dark"] .theme-toggle-btn {
  background: #334155;
  color: #f59e0b;
  border: 1px solid #475569;
}

[data-theme="dark"] .sidebar {
  background: #02201c !important;
  border-color: #1e293b !important;
}

[data-theme="dark"] .user-profile-badge {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Override inline white backgrounds & dark text in Dark Mode */
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background:#ffffff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#f1f5f9"],
[data-theme="dark"] [style*="background: #f1f5f9"] {
  background-color: var(--surface-card) !important;
  border-color: var(--surface-border) !important;
  color: var(--text-main) !important;
}

[data-theme="dark"] [style*="color: #0f172a"],
[data-theme="dark"] [style*="color: #1e293b"],
[data-theme="dark"] [style*="color: #334155"],
[data-theme="dark"] [style*="color: #475569"],
[data-theme="dark"] [style*="color: #020617"],
[data-theme="dark"] [style*="color: #042f2e"],
[data-theme="dark"] [style*="color: #115e59"] {
  color: #f1f5f9 !important;
}

[data-theme="dark"] [style*="color: var(--navy-950)"],
[data-theme="dark"] [style*="color: var(--navy-900)"],
[data-theme="dark"] [style*="color: var(--navy-800)"] {
  color: #f8fafc !important;
}

[data-theme="dark"] [style*="color: var(--text-muted)"] {
  color: #94a3b8 !important;
}

/* Modals & Dialogs in Dark Mode */
[data-theme="dark"] #changePassModal > div,
[data-theme="dark"] #jobDetailModal > div,
[data-theme="dark"] #filterModal > div,
[data-theme="dark"] #detailModal > div,
[data-theme="dark"] .modal-content {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #f1f5f9 !important;
}

/* Badges & Alerts in Dark Mode */
[data-theme="dark"] [style*="font-family: monospace"],
[data-theme="dark"] [style*="font-family:monospace"],
[data-theme="dark"] code {
  color: #5eead4 !important;
  background-color: rgba(13, 148, 136, 0.22) !important;
  border-color: #0d9488 !important;
}

[data-theme="dark"] .badge-primary { background: #0d9488 !important; color: #ffffff !important; }
[data-theme="dark"] .badge-success { background: #059669 !important; color: #ffffff !important; }
[data-theme="dark"] .badge-warning { background: #d97706 !important; color: #ffffff !important; }
[data-theme="dark"] .badge-danger  { background: #dc2626 !important; color: #ffffff !important; }
[data-theme="dark"] .badge-info    { background: #2563eb !important; color: #ffffff !important; }
[data-theme="dark"] .badge-secondary { background: #475569 !important; color: #f1f5f9 !important; }

[data-theme="dark"] .alert-info { background: #082f49 !important; border-color: #0369a1 !important; color: #bae6fd !important; }
[data-theme="dark"] .alert-warning { background: #451a03 !important; border-color: #92400e !important; color: #fde68a !important; }
[data-theme="dark"] .alert-success { background: #022c22 !important; border-color: #047857 !important; color: #a7f3d0 !important; }
[data-theme="dark"] .alert-danger { background: #450a0a !important; border-color: #991b1b !important; color: #fecaca !important; }

/* Theme Toggle Button Component */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  background: #e2e8f0;
  transform: scale(1.05);
}

/* ==========================================================================
   Responsive Mobile & Tablet Design System
   ========================================================================== */

/* Mobile Sidebar Toggle Button */
.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  color: var(--text-main);
  font-size: 1.25rem;
  cursor: pointer;
  margin-right: 0.5rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
  background: var(--surface-border);
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

.sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  margin-left: auto;
  transition: all 0.2s ease;
}
.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Breakpoint: Large Tablets & Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .sidebar {
    width: 250px;
  }
  .page-wrapper {
    padding: 1.5rem;
  }
}

/* Breakpoint: Tablets & Mobile Devices (<= 992px) */
@media (max-width: 992px) {
  .sidebar-toggle-btn {
    display: inline-flex;
  }
  .sidebar-close-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    z-index: 1050;
    transform: translateX(-100%);
    box-shadow: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.6);
  }

  .main-content {
    width: 100%;
    min-width: 0;
  }

  .top-navbar {
    padding: 0.75rem 1rem;
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Breakpoint: Small Mobile Screens (<= 640px) */
@media (max-width: 640px) {
  .page-wrapper {
    padding: 0.85rem 0.75rem;
  }

  .top-navbar {
    padding: 0.65rem 0.75rem;
    gap: 0.5rem;
  }

  .top-navbar .top-brand-text h1,
  .top-navbar h1 {
    font-size: 0.92rem !important;
    line-height: 1.25;
  }
  .top-navbar .top-brand-text span {
    font-size: 0.7rem !important;
  }

  .top-nav-actions {
    gap: 0.35rem !important;
  }
  .top-nav-actions .btn-text-hide {
    display: none;
  }
  .top-nav-actions .btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }

  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  .kpi-card {
    padding: 1rem;
  }
  .kpi-value {
    font-size: 1.6rem !important;
  }
  .kpi-title {
    font-size: 0.8rem !important;
  }

  /* Page Header / Action Bar */
  .page-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.75rem;
  }
  .page-header > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }
  .page-header > div:last-child .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  /* Card Header */
  .card-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
    padding: 1rem 1.15rem !important;
  }
  .card-header .btn {
    align-self: stretch;
    justify-content: center;
  }

  .card-body {
    padding: 1rem !important;
  }

  /* Responsive Welcome Banner */
  .welcome-banner {
    padding: 1.35rem 1.25rem !important;
    border-radius: var(--radius-lg) !important;
  }
  .welcome-banner h2 {
    font-size: 1.35rem !important;
  }
  .welcome-banner p {
    font-size: 0.85rem !important;
  }
  .welcome-banner .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Wizard Steps on Mobile */
  .wizard-steps {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .wizard-step {
    flex: 0 0 auto;
    min-width: 65px;
  }
  .step-circle {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.8rem !important;
  }
  .step-label {
    font-size: 0.65rem !important;
  }

  /* Filter Bars on Mobile */
  form[style*="display: flex"][style*="flex-wrap"] > div,
  .filter-bar form > div {
    width: 100% !important;
    min-width: 100% !important;
    margin-left: 0 !important;
  }
  form[style*="display: flex"][style*="flex-wrap"] .btn,
  .filter-bar .btn {
    width: 100% !important;
    justify-content: center;
  }

  /* Column Spans & Grids */
  [style*="grid-column: span 2"],
  [style*="grid-column: span 3"],
  [style*="grid-column:span 2"],
  [style*="grid-column:span 3"] {
    grid-column: span 1 !important;
  }

  /* Tables */
  .table-container,
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  .table th,
  .table td {
    padding: 0.6rem 0.65rem !important;
    font-size: 0.8rem !important;
    white-space: nowrap;
  }

  /* Modals */
  #changePassModal > div,
  #jobDetailModal > div,
  #filterModal > div,
  #detailModal > div {
    width: 94% !important;
    max-width: 94% !important;
    padding: 1.25rem !important;
    margin: 0.75rem !important;
  }

  /* Responsive Grids on Stats & Dashboard */
  div[style*="grid-template-columns: 3fr 2fr"],
  div[style*="grid-template-columns: 3fr 2fr;"],
  div[style*="grid-template-columns: repeat(3, 1fr)"],
  div[style*="grid-template-columns: repeat(3,1fr)"],
  div[style*="grid-template-columns: repeat(2, 1fr)"],
  div[style*="grid-template-columns: repeat(2,1fr)"],
  div[style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
}

/* ==========================================================================
   1. SHIMMER SKELETON LOADERS
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite linear;
  border-radius: var(--radius-md);
  display: block;
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text {
  height: 14px;
  width: 100%;
  margin-bottom: 8px;
  border-radius: 4px;
}
.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
  border-radius: 6px;
}
.skeleton-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}
.skeleton-card {
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   2. MODERN FLOATING TOAST NOTIFICATIONS
   ========================================================================== */
.app-toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-width: 400px;
  width: calc(100vw - 3rem);
}
.app-toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 0.9rem 1.15rem;
  color: #ffffff;
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.app-toast.is-show {
  transform: translateX(0);
  opacity: 1;
}
.app-toast.is-hide {
  transform: translateX(120%);
  opacity: 0;
}
.app-toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.app-toast.toast-success::before { background: #10b981; }
.app-toast.toast-warning::before { background: #f59e0b; }
.app-toast.toast-error::before { background: #ef4444; }
.app-toast.toast-info::before { background: #38bdf8; }

.app-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.toast-success .app-toast-icon { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.toast-warning .app-toast-icon { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.toast-error .app-toast-icon { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.toast-info .app-toast-icon { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }

.app-toast-content {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #f1f5f9;
}
.app-toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.15s ease;
}
.app-toast-close:hover {
  color: #ffffff;
}

/* ==========================================================================
   3. CUSTOM CONFIRMATION MODAL
   ========================================================================== */
.custom-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 9995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}
.custom-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}
.custom-confirm-card {
  background: #ffffff;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  text-align: center;
  transform: scale(0.95) translateY(10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.custom-modal-backdrop.active .custom-confirm-card {
  transform: scale(1) translateY(0);
}

/* ==========================================================================
   4. INTERACTIVE ONBOARDING TOUR MODAL
   ========================================================================== */
.onboarding-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 44, 34, 0.75);
  backdrop-filter: blur(10px);
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.onboarding-backdrop.active {
  opacity: 1;
  visibility: visible;
}
.onboarding-card {
  background: #ffffff;
  border-radius: 24px;
  max-width: 580px;
  width: 100%;
  padding: 2.25rem;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  transform: scale(0.95);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.onboarding-backdrop.active .onboarding-card {
  transform: scale(1);
}
.onboarding-step-content {
  display: none;
  animation: stepFade 0.35s ease forwards;
}
.onboarding-step-content.active {
  display: block;
}
@keyframes stepFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.onboarding-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: all 0.25s ease;
}
.onboarding-indicator-dot.active {
  background: var(--primary-600);
  width: 24px;
  border-radius: 12px;
}

