/* ===================================================
   TrainerConnect — Custom Design System
   assets/css/style.css
   =================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --tc-primary:    #6366f1;
  --tc-primary-d:  #4f46e5;
  --tc-primary-l:  #eef2ff;
  --tc-secondary:  #8b5cf6;
  --tc-accent:     #ec4899;
  --tc-success:    #10b981;
  --tc-success-l:  #d1fae5;
  --tc-warning:    #f59e0b;
  --tc-warning-l:  #fef3c7;
  --tc-danger:     #ef4444;
  --tc-danger-l:   #fee2e2;
  --tc-info:       #3b82f6;
  --tc-info-l:     #dbeafe;
  --tc-dark:       #1e293b;
  --tc-dark-2:     #0f172a;
  --tc-text:       #1e293b;
  --tc-text-muted: #64748b;
  --tc-border:     #e2e8f0;
  --tc-bg:         #f8fafc;
  --tc-bg-2:       #f1f5f9;
  --tc-bg-card:    #ffffff;
  --tc-shadow:     0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --tc-shadow-md:  0 4px 24px rgba(99,102,241,.12);
  --tc-shadow-lg:  0 12px 48px rgba(99,102,241,.18);
  --tc-shadow-card:0 2px 8px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04);
  --sidebar-w:     260px;
  --admin-sidebar: 250px;
  --navbar-h:      64px;
  --radius:        .875rem;
  --radius-sm:     .5rem;
  --radius-lg:     1.25rem;
  --radius-xl:     1.75rem;
  --transition:    .18s ease;
  --ease-out:      cubic-bezier(.22, 1, .36, 1);
  /* Spacing scale */
  --sp-1: .25rem;  --sp-2: .5rem;   --sp-3: .75rem;
  --sp-4: 1rem;    --sp-5: 1.25rem; --sp-6: 1.5rem;
  --sp-8: 2rem;    --sp-10: 2.5rem; --sp-12: 3rem;
  /* z-index stack */
  --z-sidebar: 400; --z-overlay: 399; --z-topbar: 100;
  --z-toast: 9999; --z-modal: 1055; --z-loader: 99998;
  /* Touch target min */
  --touch-min: 44px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--tc-text);
  background: var(--tc-bg);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--tc-primary); text-decoration: none; }
a:hover { color: var(--tc-primary-d); }
img { max-width: 100%; height: auto; }

/* Utility sizes */
.fs-xs   { font-size: .72rem !important; }
.fs-sm   { font-size: .82rem !important; }
.fs-base { font-size: .9rem !important; }
.x-small { font-size: .72rem; }
.btn-xs  { padding: .2rem .55rem; font-size: .72rem; border-radius: .4rem; }

/* Line clamp */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Spacing utilities */
.py-6 { padding-top: 4rem !important; padding-bottom: 4rem !important; }
.gap-xs { gap: .35rem !important; }

/* Section badge */
.section-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--tc-primary-l); color: var(--tc-primary);
  font-size: .72rem; font-weight: 700;
  padding: .3rem .9rem; border-radius: 50px;
  letter-spacing: .04em; text-transform: uppercase;
}

/* Responsive table wrapper */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll::-webkit-scrollbar { height: 4px; }

/* Object fit helper */
.object-fit-cover   { object-fit: cover; }
.object-fit-contain { object-fit: contain; }

/* ---------- Navbar ---------- */
.tc-navbar {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%);
  border-bottom: none;
  padding: 0;
  height: var(--navbar-h, 64px);
  transition: all var(--transition);
  position: sticky;
  top: 0;
  z-index: 1030;
}
.tc-navbar .container-xl { height: 100%; }
.tc-navbar .navbar-collapse { padding: .5rem 0; }
.tc-navbar .navbar-brand {
  font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em;
  color: #fff !important; display: flex; align-items: center; gap: .6rem;
}
.tc-navbar .nav-link {
  color: rgba(255,255,255,.8) !important;
  font-size: .875rem; font-weight: 500;
  padding: .5rem .85rem; border-radius: var(--radius-sm);
  transition: all var(--transition);
  min-height: var(--touch-min, 44px);
  display: flex; align-items: center;
}
.tc-navbar .nav-link:hover,
.tc-navbar .nav-link.active {
  background: rgba(255,255,255,.13); color: #fff !important;
}
.tc-navbar .nav-link.active { font-weight: 600; }
.tc-navbar .navbar-toggler {
  border: none; color: #fff; padding: .5rem;
  min-width: var(--touch-min, 44px);
  min-height: var(--touch-min, 44px);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.08);
  transition: background var(--transition);
}
.tc-navbar .navbar-toggler:hover { background: rgba(255,255,255,.18); }
.tc-navbar .navbar-toggler:focus { box-shadow: none; }

/* Icon button in navbar */
.icon-btn {
  width: var(--touch-min, 44px) !important;
  height: var(--touch-min, 44px) !important;
  display: flex !important; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 1rem;
  position: relative;
}

.brand-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--tc-primary), var(--tc-secondary)); border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: .95rem; flex-shrink: 0; }
.brand-icon-sm { width: 28px; height: 28px; font-size: .75rem; border-radius: .35rem; }
.badge-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--tc-danger); border-radius: 50%; border: 1.5px solid #312e81; pointer-events: none; }
.notif-dropdown {
  width: min(380px, calc(100vw - 2rem));
  max-height: 440px; overflow-y: auto;
  border: 1px solid var(--tc-border); border-radius: var(--radius-lg);
  box-shadow: var(--tc-shadow-lg);
}
.notif-item { display: flex; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--tc-border); transition: background var(--transition); cursor: pointer; }
.notif-item:hover { background: var(--tc-bg); }
.notif-item.unread { background: var(--tc-primary-l); }
.notif-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--tc-primary-l); color: var(--tc-primary); display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; }

/* Mobile navbar collapse is full-width */
@media (max-width: 991.98px) {
  .tc-navbar .navbar-collapse {
    background: #1e1b4b;
    border-top: 1px solid rgba(255,255,255,.08);
    padding: .75rem 1rem 1rem;
    margin: 0 -12px;
    border-radius: 0 0 var(--radius) var(--radius);
  }
  .tc-navbar .nav-link {
    padding: .6rem .85rem;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.85) !important;
  }
  .tc-navbar .navbar-nav { gap: .2rem; }
  /* Right-side icons stack horizontally */
  .tc-navbar .navbar-nav.align-items-center { flex-direction: row !important; flex-wrap: wrap; gap: .25rem; padding-top: .5rem; border-top: 1px solid rgba(255,255,255,.08); margin-top: .5rem; }
}

/* ---------- Hero Section ---------- */
.hero-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4c1d95 80%, #5b21b6 100%);
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 5rem 0 4.5rem;
}
.hero-bg-shapes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-bg-shapes .shape-1 { position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(99,102,241,.25), transparent 70%); top: -200px; right: -150px; }
.hero-bg-shapes .shape-2 { position: absolute; width: 350px; height: 350px; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.2), transparent 70%); bottom: -100px; left: 5%; }
.hero-bg-shapes .shape-3 { position: absolute; width: 250px; height: 250px; border-radius: 50%; background: radial-gradient(circle, rgba(236,72,153,.15), transparent 70%); top: 38%; left: 28%; }
.hero-stat-card {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: #fff;
  transition: transform var(--transition);
  text-align: center;
}
.hero-stat-card:hover { transform: translateY(-4px); }
.hero-stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; color: #fff;
  margin: 0 auto .5rem;
}

/* ---------- How It Works ---------- */
.hiw-panel {
  background: var(--tc-bg-card, #fff);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: var(--tc-shadow);
  border: 1px solid var(--tc-border);
  height: 100%;
}
.hiw-role-icon {
  width: 52px; height: 52px; min-width: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
}
.hiw-step-num {
  width: 28px; height: 28px; min-width: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800;
}
.hiw-step-icon {
  width: 44px; height: 44px; min-width: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

/* ---------- Category Cards ---------- */
.category-card {
  background: var(--tc-bg-card, #fff);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  border: 1px solid var(--tc-border);
  transition: all .2s var(--ease-out);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
}
.category-card:hover { transform: translateY(-4px); box-shadow: var(--tc-shadow-md); border-color: rgba(99,102,241,.3); color: inherit; }
.cat-icon { width: 52px; height: 52px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }

/* ---------- Trainer Cards ---------- */
.trainer-card {
  background: var(--tc-bg-card, #fff);
  border-radius: var(--radius-lg);
  border: 1px solid var(--tc-border);
  overflow: hidden;
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), border-color .2s;
  height: 100%; display: flex; flex-direction: column;
}
.trainer-card:hover { transform: translateY(-5px); box-shadow: var(--tc-shadow-md); border-color: rgba(99,102,241,.3); }
.trainer-card-top { padding: 1.35rem; display: flex; gap: 1rem; align-items: flex-start; }
.trainer-card-full {
  background: var(--tc-bg-card, #fff);
  border-radius: var(--radius-lg);
  border: 1px solid var(--tc-border);
  overflow: hidden;
  transition: transform .2s var(--ease-out), box-shadow .2s;
  height: 100%; display: flex; flex-direction: column;
}
.trainer-card-full:hover { box-shadow: var(--tc-shadow-md); border-color: rgba(99,102,241,.3); transform: translateY(-3px); }
.trainer-card-banner { height: 56px; flex-shrink: 0; background: linear-gradient(135deg, var(--tc-primary-d), var(--tc-secondary)); }
.trainer-rate { font-size: .875rem; font-weight: 700; color: #059669; }

/* ---------- Requirement Cards ---------- */
.req-card {
  background: var(--tc-bg-card, #fff);
  border-radius: var(--radius-lg);
  border: 1px solid var(--tc-border);
  padding: 1.35rem 1.5rem;
  transition: transform .2s var(--ease-out), box-shadow .2s, border-color .2s;
  height: 100%; display: flex; flex-direction: column;
}
.req-card:hover { transform: translateY(-5px); box-shadow: var(--tc-shadow-md); border-color: rgba(99,102,241,.3); }
.req-card-full {
  background: var(--tc-bg-card, #fff);
  border-radius: var(--radius-lg); border: 1px solid var(--tc-border);
  transition: transform .2s var(--ease-out), box-shadow .2s;
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
}
.req-card-full:hover { box-shadow: var(--tc-shadow-md); border-color: rgba(99,102,241,.3); transform: translateY(-3px); }
.req-card-header { height: 4px; flex-shrink: 0; }
.hover-primary:hover { color: var(--tc-primary) !important; }
.stretched-link-inner { position: relative; z-index: 1; }
.req-cat-icon { width: 52px; height: 52px; min-width: 52px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.req-cat-icon-sm { width: 36px; height: 36px; min-width: 36px; border-radius: .4rem; display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; }
.page-header { padding-bottom: 1rem; border-bottom: 1px solid var(--tc-border); margin-bottom: 1.5rem !important; }
.filter-card { background: var(--tc-bg-card,#fff); border: 1px solid var(--tc-border); border-radius: var(--radius-lg); box-shadow: var(--tc-shadow-sm); }
.filter-card-body { padding: 1.5rem; }
.req-budget { font-size: .875rem; font-weight: 700; color: #059669; }
.req-mini-card {
  background: var(--tc-bg); border-radius: var(--radius); border: 1px solid var(--tc-border);
  padding: .9rem 1.1rem; display: flex; gap: .75rem; align-items: center;
  transition: all var(--transition); text-decoration: none; color: inherit; cursor: pointer;
}
.req-mini-card:hover { background: var(--tc-primary-l); border-color: rgba(99,102,241,.25); color: inherit; transform: translateY(-1px); }
.app-mini-card {
  background: var(--tc-bg-card, #fff); border-radius: var(--radius);
  border: 1px solid var(--tc-border); padding: .9rem 1.1rem;
  display: flex; align-items: center; gap: .75rem;
}

/* ---------- Feature Cards ---------- */
.feature-card {
  background: var(--tc-bg-card, #fff);
  border-radius: var(--radius-lg); padding: 1.75rem 2rem;
  border: 1px solid var(--tc-border);
  height: 100%;
  transition: transform .2s var(--ease-out), box-shadow .2s, border-color .2s;
}
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--tc-shadow-md); border-color: rgba(99,102,241,.3); }
.feature-icon { width: 54px; height: 54px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 1.1rem; }

/* ---------- CTA Section ---------- */
.cta-section { background: linear-gradient(135deg, var(--tc-primary-d) 0%, var(--tc-secondary) 100%); position: relative; overflow: hidden; }
.cta-inner { position: relative; z-index: 1; }
.cta-section::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }

/* ---------- Stat Cards ---------- */
.stat-card {
  background: var(--tc-bg-card, #fff);
  border-radius: var(--radius-lg);
  border: 1px solid var(--tc-border);
  padding: 1.35rem 1.5rem;
  display: flex; gap: 1rem; align-items: center;
  box-shadow: var(--tc-shadow-card);
  transition: all .2s var(--ease-out);
  overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--tc-shadow-md); border-color: rgba(99,102,241,.2); }
.stat-number {
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  font-weight: 800; line-height: 1;
  color: var(--tc-dark); letter-spacing: -.02em;
}
.stat-label { font-size: .8rem; color: var(--tc-text-muted); font-weight: 500; margin-top: .2rem; }
.stat-icon {
  width: 52px; height: 52px; min-width: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.stat-card-sm .stat-number { font-size: clamp(1.15rem, 2.5vw, 1.45rem); }
.stat-icon-sm { width: 42px; height: 42px; min-width: 42px; font-size: 1.05rem; }

/* ---------- Welcome Banner ---------- */
.welcome-banner {
  background: linear-gradient(135deg, var(--tc-primary-d) 0%, var(--tc-primary) 60%, var(--tc-secondary) 100%);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.75rem;
}
.welcome-banner::after {
  content: '';
  position: absolute; right: -40px; top: -40px;
  width: 220px; height: 220px;
  background: rgba(255,255,255,.06); border-radius: 50%;
  pointer-events: none;
}
.welcome-vendor { background: linear-gradient(135deg, #0f766e 0%, #0d9488 60%, #14b8a6 100%); }

/* ---------- Dash Card ---------- */
.dash-card { background: var(--tc-bg-card,#fff); border: 1px solid var(--tc-border); border-radius: var(--radius-lg); box-shadow: var(--tc-shadow-sm); overflow: hidden; }
.dash-card-header { padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--tc-border); display: flex; align-items: center; justify-content: space-between; background: transparent; }
.dash-card-body { padding: 1.25rem 1.5rem; }

/* ---------- Dashboard Layout ---------- */
.dashboard-layout { display: flex; min-height: 100vh; }
.dashboard-main {
  flex: 1; min-width: 0;
  padding: 1.75rem 2rem;
  background: var(--tc-bg);
  overflow-x: hidden;
}
@media (max-width: 1199.98px) {
  .dashboard-main { padding: 1.5rem; }
}

/* ---------- Sidebar (Trainer / Vendor) ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: #0f172a;
  border-right: none;
  display: flex; flex-direction: column;
  height: 100vh;
  position: sticky; top: 0;
  overflow-y: auto; overflow-x: hidden;
  z-index: var(--z-sidebar, 400);
  flex-shrink: 0;
  transition: transform .25s var(--ease-out, ease);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }
.sidebar-brand {
  padding: 1.25rem 1.25rem .85rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: .75rem;
  min-height: var(--navbar-h, 64px);
}
.sidebar-brand .brand-name { font-size: 1.05rem; font-weight: 800; color: #fff; }
.sidebar-user {
  padding: .9rem 1.25rem;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: .75rem;
}
.sidebar-nav { padding: .5rem .625rem; flex: 1; }
.sidebar-section {
  font-size: .62rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  color: #475569;
  padding: .9rem .5rem .25rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .625rem .875rem;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: .875rem; font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
  position: relative; overflow: hidden;
  margin-bottom: .1rem;
  min-height: var(--touch-min, 44px);
}
.sidebar-link i { font-size: .9rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #e2e8f0; text-decoration: none; }
.sidebar-link.active {
  background: rgba(99,102,241,.18);
  color: #a5b4fc;
  border-left: 3px solid var(--tc-primary);
  padding-left: calc(.875rem - 3px);
}
.sidebar-link .sidebar-icon { width: 20px; text-align: center; font-size: .9rem; }
.sidebar-badge {
  margin-left: auto;
  background: var(--tc-danger); color: #fff;
  font-size: .65rem; font-weight: 800;
  border-radius: 50px; padding: .15rem .5rem;
  min-width: 20px; text-align: center; line-height: 1.3;
}
.sidebar-link.active .sidebar-badge { background: rgba(255,255,255,.2); }
.sidebar-toggle-btn {
  display: none;
  position: fixed; bottom: 1.5rem; right: 1.25rem;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--tc-primary); color: #fff; border: none;
  box-shadow: 0 4px 20px rgba(99,102,241,.45);
  z-index: calc(var(--z-sidebar, 400) + 10);
  font-size: 1.15rem;
  align-items: center; justify-content: center;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: calc(var(--z-sidebar, 400) - 1);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ---------- Admin Layout ---------- */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: var(--admin-sidebar);
  background: var(--tc-dark);
  color: #cbd5e1;
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0;
  overflow-y: auto; flex-shrink: 0;
  z-index: 200;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 3px; }
.admin-sidebar-brand {
  padding: 1.1rem 1.1rem .9rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: .65rem;
  min-height: 60px;
}
.admin-sidebar-brand .brand-name { font-size: .95rem; font-weight: 800; color: #fff; }
.admin-user-info { padding: .75rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.03); }
.admin-nav { padding: .5rem .625rem; flex: 1; }
.admin-nav-section { font-size: .6rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #475569; padding: .85rem .5rem .2rem; }
.admin-nav-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .85rem;
  border-radius: var(--radius-sm); color: #94a3b8;
  font-size: .82rem; font-weight: 500;
  transition: all var(--transition); text-decoration: none;
  margin-bottom: .1rem;
  min-height: 40px;
}
.admin-nav-link:hover { background: rgba(255,255,255,.07); color: #e2e8f0; text-decoration: none; }
.admin-nav-link.active { background: var(--tc-primary); color: #fff; }
.admin-nav-link .nav-icon { width: 16px; text-align: center; font-size: .8rem; }
.admin-main { flex: 1; min-width: 0; overflow-x: hidden; }
.admin-topbar {
  background: #fff; border-bottom: 1px solid var(--tc-border);
  padding: .75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: var(--z-topbar, 100);
}

/* ---------- Auth Pages ---------- */
.auth-page { min-height: 100vh; }
.auth-wrapper {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.auth-left {
  background: linear-gradient(160deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
  padding: 3rem 2.5rem;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-left::before { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: rgba(99,102,241,.15); top: -100px; right: -100px; }
.auth-left::after  { content: ''; position: absolute; width: 280px; height: 280px; border-radius: 50%; background: rgba(139,92,246,.1); bottom: -80px; left: -80px; }
.auth-left-content { position: relative; z-index: 1; }
.auth-right {
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2.5rem;
}
.auth-box { width: 100%; max-width: 420px; }
.auth-card { border-radius: var(--radius-xl); overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,.1); }
.auth-features { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
.auth-feat-icon { width: 40px; height: 40px; border-radius: .5rem; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; font-size: .9rem; color: #fff; flex-shrink: 0; }
.role-selector-tabs { display: flex; background: var(--tc-bg-2); border-radius: var(--radius-sm); padding: .3rem; margin-bottom: 1.5rem; gap: .25rem; }
.role-tab { flex: 1; text-align: center; padding: .625rem; border-radius: .4rem; cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--tc-text-muted); transition: all var(--transition); border: none; background: none; }
.role-tab.active { background: #fff; color: var(--tc-primary); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.role-display-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius); padding: 1.25rem; color: rgba(255,255,255,.85); transition: all var(--transition); }
.role-display-card:hover { background: rgba(255,255,255,.14); }
.role-display-card.active { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); color: #fff; }
.role-icon { width: 38px; height: 38px; min-width: 38px; border-radius: .5rem; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-size: .9rem; color: #fff; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: .75rem; top: 0; bottom: 0; width: 2px; background: var(--tc-border); }
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -1.75rem; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--tc-primary); background: var(--tc-primary); top: .25rem; }
.timeline-content { background: var(--tc-bg); border-radius: var(--radius-sm); padding: .75rem 1rem; border: 1px solid var(--tc-border); }

/* ---------- Hover Lift ---------- */
.hover-lift { transition: transform var(--transition), box-shadow var(--transition); }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--tc-shadow-md); }

/* ---------- Quick Action Buttons ---------- */
.quick-action-btn { background: #fff; border: 1px solid var(--tc-border); border-radius: var(--radius); padding: 1.25rem; text-align: center; text-decoration: none; color: var(--tc-text); transition: all var(--transition); display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.quick-action-btn:hover { border-color: var(--tc-primary); color: var(--tc-primary); transform: translateY(-2px); box-shadow: var(--tc-shadow-md); text-decoration: none; }
.quick-action-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }

/* ---------- Footer ---------- */
.tc-footer {
  background: var(--tc-dark-2);
  color: #94a3b8;
  padding: 4rem 0 0;
  border-top: 1px solid rgba(255,255,255,.05);
}
.tc-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 1.25rem 0;
  margin-top: 3rem;
  font-size: .8rem; color: #94a3b8;
}
.tc-footer h6, .tc-footer .footer-heading {
  color: #e2e8f0; font-weight: 700;
  font-size: .875rem; margin-bottom: 1.1rem;
  letter-spacing: .02em;
}
.tc-footer a {
  color: #94a3b8; text-decoration: none;
  font-size: .875rem;
  transition: color var(--transition);
  display: inline-flex; align-items: center; gap: .35rem;
}
.tc-footer a:hover { color: #e2e8f0; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.footer-links li a { padding: .1rem 0; }
.footer-links li a::before { content: '›'; color: var(--tc-primary); font-weight: 800; transition: transform var(--transition); display: inline-block; }
.footer-links li a:hover::before { transform: translateX(3px); }
.social-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.social-btn {
  width: 38px; height: 38px; border-radius: .5rem;
  background: rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; transition: all var(--transition);
  font-size: .9rem;
}
.social-btn:hover { background: var(--tc-primary); color: #fff !important; transform: translateY(-2px); }

/* ---------- Admin table ---------- */
.admin-table td, .admin-table th { vertical-align: middle; }

/* ---------- Flash Messages ---------- */
.flash-alert { border: none; border-radius: var(--radius-sm); font-size: .875rem; }

/* ---------- Form Styles ---------- */
.form-control, .form-select {
  border: 1.5px solid var(--tc-border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  padding: .6rem .9rem;
  min-height: var(--touch-min, 44px);
  background: #fafbfc;
  color: var(--tc-text);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--tc-primary);
  box-shadow: 0 0 0 3.5px rgba(99,102,241,.14);
  background: #fff;
  outline: none;
}
.form-control::placeholder { color: #b0bec5; }
.form-control.is-valid { border-color: var(--tc-success); }
.form-control.is-invalid { border-color: var(--tc-danger); }
.form-label { font-size: .875rem; font-weight: 600; color: var(--tc-text); margin-bottom: .4rem; }
.form-text  { font-size: .78rem; color: var(--tc-text-muted); margin-top: .25rem; }
.input-group-text { background: var(--tc-bg-2); border: 1.5px solid var(--tc-border); color: var(--tc-text-muted); }

/* ---------- Buttons ---------- */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600; letter-spacing: .01em;
  transition: transform .15s var(--ease-out), box-shadow .15s, background .15s;
  min-height: 36px;
}
.btn-lg { min-height: var(--touch-min, 44px); padding: .75rem 1.75rem; }
.btn-primary { background: var(--tc-primary); border-color: var(--tc-primary); font-weight: 600; box-shadow: 0 1px 8px rgba(99,102,241,.22); }
.btn-primary:hover { background: var(--tc-primary-d); border-color: var(--tc-primary-d); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,.38); }
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-outline-primary { border-color: var(--tc-primary); color: var(--tc-primary); font-weight: 600; }
.btn-outline-primary:hover { background: var(--tc-primary); border-color: var(--tc-primary); transform: translateY(-1px); }
.btn-outline-secondary:hover { transform: translateY(-1px); }

/* ---------- Cards ---------- */
.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--tc-border);
  box-shadow: var(--tc-shadow-card);
  overflow: hidden;
}
.card-header {
  background: var(--tc-bg-card, #fff);
  border-bottom: 1px solid var(--tc-border);
  font-weight: 700; font-size: .9rem;
  padding: 1rem 1.25rem;
}
.card-body { padding: 1.25rem; }
.card-footer {
  background: var(--tc-bg-card, #fff);
  border-top: 1px solid var(--tc-border);
  padding: .85rem 1.25rem;
}

/* ---------- Table ---------- */
.table { font-size: .875rem; }
.table th {
  font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--tc-text-muted);
  border-bottom: 2px solid var(--tc-border);
  padding: .75rem .9rem;
  white-space: nowrap;
}
.table td { padding: .75rem .9rem; vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background: #f8fafc; }
.table-responsive { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--tc-border); }

/* ---------- Select2 Theme ---------- */
.select2-container--bootstrap-5 .select2-selection { border-color: var(--tc-border); border-radius: var(--radius-sm); min-height: 40px; font-size: .9rem; }
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice { background: var(--tc-primary-l); color: var(--tc-primary); border: none; border-radius: .3rem; font-size: .78rem; }

/* ---------- DataTables ---------- */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input { border-color: var(--tc-border); border-radius: var(--radius-sm); font-size: .875rem; padding: .4rem .7rem; }
.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--tc-primary); box-shadow: none; outline: none; }
div.dataTables_info { font-size: .8rem; color: var(--tc-text-muted); }

/* ---------- Pagination ---------- */
.pagination { gap: .2rem; }
.page-link { border-radius: .4rem !important; border: 1px solid var(--tc-border); color: var(--tc-text); font-size: .82rem; padding: .4rem .7rem; }
.page-link:hover { background: var(--tc-primary-l); color: var(--tc-primary); border-color: var(--tc-primary); }
.page-item.active .page-link { background: var(--tc-primary); border-color: var(--tc-primary); }
.page-item.disabled .page-link { opacity: .45; }

/* ---------- Stars ---------- */
.star-rating .fa-star { color: #fbbf24; }
.star-rating .fa-star.empty { color: #e2e8f0; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 50px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---------- Chart containers ---------- */
.chart-container { position: relative; }
.chart-container canvas { max-width: 100%; }

/* ---------- Misc Utilities ---------- */
.mini-icon { width: 28px; height: 28px; border-radius: .35rem; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; }
.admin-link { font-size: .82rem; color: var(--tc-text); text-decoration: none; display: flex; align-items: center; gap: .4rem; padding: .3rem .5rem; border-radius: .3rem; transition: all var(--transition); }
.admin-link:hover { background: var(--tc-bg); color: var(--tc-primary); }
.bg-primary-subtle { background-color: var(--tc-primary-l) !important; }
.text-primary { color: var(--tc-primary) !important; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .auth-wrapper { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { padding: 2rem 1.5rem; min-height: 100vh; display: flex; align-items: center; justify-content: center; }

  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); z-index: var(--z-sidebar, 400); height: 100vh; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--tc-shadow-lg); }
  .sidebar-toggle-btn { display: flex; align-items: center; justify-content: center; }
  .sidebar-overlay.active { display: block; }
  .dashboard-layout { display: block; }
  .dashboard-main { padding: 1rem; }

  .admin-wrapper { display: block; }
  .admin-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); height: 100vh; transition: transform .25s var(--ease-out); z-index: var(--z-sidebar, 400); }
  .admin-sidebar.open { transform: translateX(0); }

  .hero-section { padding: 4.5rem 0 3rem; min-height: 72vh; }
  .hiw-panel { padding: 1.75rem 1.5rem; }
}
@media (max-width: 767.98px) {
  .hero-section h1 { font-size: clamp(1.65rem, 6vw, 2.2rem); }
  .hero-section { padding: 3.5rem 0 2.5rem; min-height: unset; }
  .stat-card { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .stat-card .stat-icon { width: 44px; height: 44px; font-size: 1.1rem; }
  .notif-dropdown { width: calc(100vw - 1.5rem); }
  .welcome-banner { padding: 1.25rem 1.35rem; }
  .welcome-banner .display-6 { font-size: 1.25rem; }
  .feature-card { padding: 1.5rem; }
  .hero-stat-card { padding: .75rem 1rem; }
  .tc-footer { padding: 2.5rem 0 0; }
}
@media (max-width: 575.98px) {
  .dashboard-main { padding: .75rem .625rem; }
  .trainer-card-full, .req-card-full { flex-direction: column; }
  .trainer-card-full .flex-shrink-0, .req-card-full .req-cat-icon { margin-bottom: .5rem; }
  .auth-right { padding: 1.5rem 1rem; }
  .stat-number { font-size: 1.4rem; }
  .hiw-panel { padding: 1.25rem 1rem; }
  .quick-action-btn { padding: 1rem .75rem; }
  .welcome-banner { border-radius: var(--radius); }
  .card-body { padding: 1rem; }
  .table th, .table td { padding: .6rem .65rem; font-size: .78rem; }
  .chat-layout { height: calc(100vh - 90px); }
  .chat-messages { padding: .75rem; }
  .chat-input-area { padding: .65rem .75rem; }
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp .5s ease forwards; }
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: .7; }
}
.pulse-dot { animation: pulse-dot 2s infinite; }

/* ---------- Dark mode override (optional, future) ---------- */
@media (prefers-color-scheme: dark) {
  /* intentionally empty — light mode enforced */
}

/* ---------- Back To Top ---------- */
#back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--tc-primary);
  color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
  cursor: pointer;
  opacity: 0; visibility: hidden;
  transform: translateY(12px);
  transition: opacity .25s, visibility .25s, transform .25s var(--ease-out);
  z-index: var(--z-toast, 9999);
}
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { background: var(--tc-primary-d); transform: translateY(-2px); }
/* Push away from sidebar-toggle on mobile */
@media (max-width: 991.98px) {
  #back-to-top { bottom: 5rem; right: 1rem; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .admin-sidebar, .tc-navbar, .sidebar-toggle-btn, #back-to-top { display: none !important; }
  .dashboard-main, .admin-main { padding: 0 !important; }
}

/* =====================================================
   v2 Enterprise Additions
   ===================================================== */

/* ---------- Glass Cards ---------- */
.glass-card {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(99,102,241,.1);
}
.glass-dark {
  background: rgba(30,27,75,.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
}

/* ---------- Training Mode Badges ---------- */
.mode-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 700; padding: .2rem .65rem;
  border-radius: 50px; letter-spacing: .03em; text-transform: uppercase;
}
.mode-online   { background: #d1fae5; color: #065f46; }
.mode-offline  { background: #dbeafe; color: #1e40af; }
.mode-hybrid   { background: #ede9fe; color: #5b21b6; }

/* ---------- Online Presence Indicator ---------- */
.online-indicator {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--tc-success); border: 2px solid #fff;
  display: inline-block; flex-shrink: 0;
}
.online-indicator.offline { background: #94a3b8; }
.user-avatar-wrap { position: relative; display: inline-block; }
.user-avatar-wrap .online-indicator {
  position: absolute; bottom: 1px; right: 1px;
}

/* ---------- Chat UI ---------- */
.chat-layout { display: flex; height: calc(100vh - 160px); min-height: 500px; gap: 0; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--tc-border); background: #fff; box-shadow: var(--tc-shadow); }

/* Conversations panel */
.chat-sidebar { width: 320px; border-right: 1px solid var(--tc-border); display: flex; flex-direction: column; flex-shrink: 0; background: #fafafa; }
.chat-sidebar-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--tc-border); background: #fff; }
.chat-sidebar-search { padding: .75rem 1rem; border-bottom: 1px solid var(--tc-border); }
.chat-sidebar-list { flex: 1; overflow-y: auto; }
.conv-item { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; cursor: pointer; border-bottom: 1px solid var(--tc-border); transition: background var(--transition); position: relative; }
.conv-item:hover { background: var(--tc-primary-l); }
.conv-item.active { background: linear-gradient(90deg, var(--tc-primary-l), transparent); border-left: 3px solid var(--tc-primary); }
.conv-item .conv-name { font-size: .875rem; font-weight: 600; color: var(--tc-dark); }
.conv-item .conv-preview { font-size: .78rem; color: var(--tc-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.conv-item .conv-time { font-size: .68rem; color: var(--tc-text-muted); white-space: nowrap; }
.conv-item .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tc-primary); flex-shrink: 0; }
.conv-unread-count { background: var(--tc-primary); color: #fff; font-size: .62rem; font-weight: 700; border-radius: 50px; padding: .1rem .4rem; min-width: 18px; text-align: center; }
.conv-item.has-unread .conv-name { color: var(--tc-primary); }

/* Thread panel */
.chat-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-thread-header { padding: .85rem 1.25rem; border-bottom: 1px solid var(--tc-border); display: flex; align-items: center; gap: .75rem; background: #fff; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; background: var(--tc-bg); }
.chat-messages-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--tc-text-muted); gap: .5rem; }

/* Message bubbles */
.msg-row { display: flex; align-items: flex-end; gap: .5rem; max-width: 70%; }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-row.theirs { align-self: flex-start; }
.msg-bubble {
  padding: .65rem 1rem; border-radius: 1rem;
  font-size: .875rem; line-height: 1.5; word-break: break-word;
  position: relative; max-width: 100%;
}
.msg-row.mine .msg-bubble   { background: var(--tc-primary); color: #fff; border-bottom-right-radius: .25rem; }
.msg-row.theirs .msg-bubble { background: #fff; color: var(--tc-text); border: 1px solid var(--tc-border); border-bottom-left-radius: .25rem; }
.msg-meta { display: flex; align-items: center; gap: .3rem; font-size: .65rem; margin-top: .25rem; }
.msg-row.mine   .msg-meta { color: rgba(255,255,255,.75); justify-content: flex-end; }
.msg-row.theirs .msg-meta { color: var(--tc-text-muted); }

/* File message bubble */
.msg-bubble-file {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; min-width: 220px;
}
.msg-file-icon { width: 40px; height: 40px; border-radius: .5rem; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.msg-row.mine .msg-file-icon   { background: rgba(255,255,255,.2); color: #fff; }
.msg-row.theirs .msg-file-icon { background: var(--tc-primary-l); color: var(--tc-primary); }
.msg-file-info { flex: 1; min-width: 0; }
.msg-file-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-file-size { font-size: .7rem; opacity: .8; }
.msg-file-dl { font-size: .72rem; opacity: .85; }
.msg-file-dl:hover { opacity: 1; }

/* Image message */
.msg-bubble-img { padding: .35rem !important; }
.msg-bubble-img img { max-width: 240px; max-height: 240px; border-radius: .65rem; cursor: pointer; display: block; object-fit: cover; }

/* Date separator */
.chat-date-sep { text-align: center; font-size: .72rem; color: var(--tc-text-muted); position: relative; margin: .5rem 0; }
.chat-date-sep::before, .chat-date-sep::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--tc-border); }
.chat-date-sep::before { left: 0; }
.chat-date-sep::after  { right: 0; }
.chat-date-sep span { background: var(--tc-bg); padding: 0 .75rem; position: relative; }

/* Reaction */
.msg-reaction { font-size: .9rem; position: absolute; bottom: -12px; right: 8px; background: #fff; border-radius: 50px; padding: .05rem .35rem; box-shadow: 0 1px 4px rgba(0,0,0,.12); line-height: 1; }
.msg-row.theirs .msg-reaction { right: auto; left: 8px; }

/* Read receipts */
.msg-read-tick { font-size: .65rem; }
.msg-read-tick.read    { color: #38bdf8; }
.msg-read-tick.unread  { color: rgba(255,255,255,.65); }

/* Typing indicator */
.typing-indicator { display: flex; align-items: center; gap: .4rem; padding: .5rem .75rem; font-size: .8rem; color: var(--tc-text-muted); }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tc-text-muted); animation: typing-bounce .9s infinite ease-in-out; }
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

/* Chat input area */
.chat-input-area { padding: 1rem 1.25rem; border-top: 1px solid var(--tc-border); background: #fff; }
.chat-input-wrap { display: flex; align-items: flex-end; gap: .5rem; background: var(--tc-bg); border: 1px solid var(--tc-border); border-radius: var(--radius); padding: .5rem .75rem; transition: border-color var(--transition), box-shadow var(--transition); }
.chat-input-wrap:focus-within { border-color: var(--tc-primary); box-shadow: 0 0 0 .2rem rgba(99,102,241,.15); }
.chat-input { flex: 1; border: none; background: transparent; outline: none; resize: none; font-size: .9rem; line-height: 1.5; max-height: 120px; overflow-y: auto; padding: .25rem 0; color: var(--tc-text); }
.chat-send-btn { width: 36px; height: 36px; border-radius: .5rem; border: none; background: var(--tc-primary); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background var(--transition), transform var(--transition); flex-shrink: 0; }
.chat-send-btn:hover { background: var(--tc-primary-d); transform: scale(1.05); }
.chat-attach-btn { width: 36px; height: 36px; border-radius: .5rem; border: none; background: transparent; color: var(--tc-text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition); flex-shrink: 0; }
.chat-attach-btn:hover { background: var(--tc-primary-l); color: var(--tc-primary); }
/* Attach preview chips */
.attach-preview-bar { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem 0 0; }
.attach-chip { display: flex; align-items: center; gap: .35rem; background: var(--tc-primary-l); border-radius: 50px; padding: .25rem .65rem; font-size: .75rem; color: var(--tc-primary); }
.attach-chip .remove-chip { cursor: pointer; opacity: .7; }
.attach-chip .remove-chip:hover { opacity: 1; }

/* Drag-drop overlay */
.drop-overlay { position: absolute; inset: 0; background: rgba(99,102,241,.08); border: 2px dashed var(--tc-primary); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; z-index: 50; pointer-events: none; opacity: 0; transition: opacity var(--transition); }
.drop-overlay.active { opacity: 1; }
.chat-thread { position: relative; }

/* No conversation selected */
.chat-empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--tc-text-muted); gap: 1rem; padding: 2rem; }
/* Mobile chat */
@media (max-width: 767.98px) {
  .chat-layout { height: calc(100vh - 120px); }
  .chat-sidebar { position: absolute; left: 0; top: 0; bottom: 0; z-index: 10; transform: translateX(-100%); transition: transform var(--transition); width: 90%; max-width: 320px; background: #fff; }
  .chat-sidebar.open { transform: translateX(0); box-shadow: var(--tc-shadow-lg); }
  .msg-row { max-width: 90%; }
}

/* ---------- Floating WhatsApp Button ---------- */
.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 9998;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25d366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; box-shadow: 0 4px 16px rgba(37,211,102,.45);
  text-decoration: none; transition: transform var(--transition), box-shadow var(--transition);
}
.whatsapp-float:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(37,211,102,.6); color: #fff; }
.whatsapp-float::before {
  content: ''; position: absolute; width: 100%; height: 100%;
  border-radius: 50%; background: #25d366;
  animation: wa-pulse 2.5s infinite; opacity: .6;
}
@keyframes wa-pulse {
  0%   { transform: scale(1); opacity: .6; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- Admin Ban / Warn Controls ---------- */
.ban-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 600; padding: .25rem .65rem; border-radius: 50px; }
.ban-status.active-ban { background: #fee2e2; color: #991b1b; }
.ban-status.warned    { background: #fef3c7; color: #92400e; }
.ban-status.clean     { background: #d1fae5; color: #065f46; }
.warn-count-badge { background: #fef3c7; color: #b45309; font-size: .72rem; font-weight: 700; border-radius: 50px; padding: .1rem .45rem; }
.admin-note-snippet { font-size: .78rem; color: var(--tc-text-muted); font-style: italic; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ban-log-row td { vertical-align: middle; font-size: .82rem; }
.action-ban    { background: #fee2e2; color: #991b1b; }
.action-unban  { background: #d1fae5; color: #065f46; }
.action-warn   { background: #fef3c7; color: #92400e; }

/* ---------- Profile Score / Rating Bar ---------- */
.profile-score-bar { height: 6px; border-radius: 50px; background: var(--tc-border); overflow: hidden; }
.profile-score-fill { height: 100%; border-radius: 50px; transition: width .6s ease; }
.score-0-40  { background: var(--tc-danger); }
.score-40-70 { background: var(--tc-warning); }
.score-70-100{ background: var(--tc-success); }

/* ---------- Application Score Slider ---------- */
.score-slider { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 50px; background: var(--tc-border); outline: none; }
.score-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--tc-primary); cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(99,102,241,.4);
}
.score-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--tc-primary); cursor: pointer; border: 2px solid #fff;
}
.score-display { font-size: 1.1rem; font-weight: 800; color: var(--tc-primary); min-width: 28px; text-align: center; }

/* ---------- Interview Status Badge ---------- */
.badge-interviewed { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; font-size: .72rem; font-weight: 700; }

/* ---------- Shortlist Order ---------- */
.shortlist-order-btn { width: 28px; height: 28px; border-radius: .35rem; border: 1px solid var(--tc-border); background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; transition: all var(--transition); }
.shortlist-order-btn:hover { background: var(--tc-primary-l); border-color: var(--tc-primary); color: var(--tc-primary); }

/* ---------- Navbar Phone CTA ---------- */
.navbar-phone-cta { display: flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; padding: .4rem .9rem; border-radius: 50px; transition: all var(--transition); white-space: nowrap; }
.btn-wa-nav { background: #25d366 !important; border-color: #25d366 !important; color: #fff !important; }

/* ---------- Premium Landing Sections ---------- */
.contact-info-bar { background: linear-gradient(90deg, var(--tc-primary-d), var(--tc-secondary)); padding: .5rem 0; }
.contact-info-bar a, .contact-info-bar span { color: rgba(255,255,255,.9); font-size: .8rem; }
.contact-info-bar a:hover { color: #fff; }
.cta-phone-btn { background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.4); color: #fff !important; border-radius: 50px; padding: .65rem 1.5rem; font-weight: 700; font-size: .95rem; transition: all var(--transition); display: inline-flex; align-items: center; gap: .5rem; }
.cta-phone-btn:hover { background: rgba(255,255,255,.25); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.cta-wa-btn { background: #25d366; border: none; color: #fff !important; border-radius: 50px; padding: .65rem 1.5rem; font-weight: 700; font-size: .95rem; transition: all var(--transition); display: inline-flex; align-items: center; gap: .5rem; }
.cta-wa-btn:hover { background: #1ebe5d; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(37,211,102,.4); }

/* ---------- Trainer Card v2 enhancements ---------- */
.trainer-card-v2 .trainer-card-top { background: linear-gradient(135deg, var(--tc-primary-l) 0%, #fff 100%); }
.availability-pulse { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; color: var(--tc-success); font-weight: 600; }
.availability-pulse::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--tc-success); animation: pulse-dot 2s infinite; }

/* ---------- Skill Chips ---------- */
.skill-chip { display: inline-block; background: var(--tc-bg-2); border: 1px solid var(--tc-border); border-radius: 50px; padding: .2rem .6rem; font-size: .72rem; color: var(--tc-text-muted); font-weight: 500; transition: all var(--transition); }
.skill-chip:hover { background: var(--tc-primary-l); border-color: var(--tc-primary); color: var(--tc-primary); }

/* ---------- Portfolio Items ---------- */
.portfolio-item { border-radius: var(--radius); overflow: hidden; position: relative; }
.portfolio-item img { width: 100%; height: 180px; object-fit: cover; transition: transform .4s; }
.portfolio-item:hover img { transform: scale(1.05); }
.portfolio-overlay { position: absolute; inset: 0; background: rgba(30,27,75,.55); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--transition); }
.portfolio-item:hover .portfolio-overlay { opacity: 1; }

/* ---------- Content Report Button ---------- */
.report-btn { font-size: .72rem; color: var(--tc-text-muted); transition: color var(--transition); border: none; background: none; padding: 0; cursor: pointer; }
.report-btn:hover { color: var(--tc-danger); }

/* ---------- Navbar v2 — extra compact on small screens ---------- */
@media (max-width: 1199.98px) {
  .navbar-phone-cta .cta-label { display: none; }
}
@media (max-width: 991.98px) {
  .whatsapp-float { bottom: 90px; right: 16px; width: 48px; height: 48px; font-size: 1.3rem; z-index: 9990; }
}

/* ---------- Pulse Dot (Live indicator) ---------- */
@keyframes pulse-anim { 0% { opacity: 1; } 50% { opacity: .3; } 100% { opacity: 1; } }
.pulse-dot { animation: pulse-anim 1.5s ease-in-out infinite; }

/* ---------- Timeline Mini ---------- */
.timeline-mini { border-left: 2px solid var(--tc-border, #e5e7eb); padding-left: .75rem; margin-left: .3rem; }

/* ---------- SVG Illustrations ---------- */
.svg-illustration { width: 100%; height: auto; display: block; }
.hero-illustration-wrap { max-width: 480px; margin: 0 auto; }
.hero-illustration-wrap .svg-hero { filter: drop-shadow(0 8px 32px rgba(99,102,241,.12)); }
.svg-empty { max-width: 220px; margin: 0 auto; opacity: .85; }
.svg-error { max-width: 300px; margin: 0 auto; }
.svg-auth  { max-width: 280px; margin: 0 auto; filter: drop-shadow(0 4px 24px rgba(0,0,0,.08)); }
.svg-feature { max-width: 200px; margin: 0 auto; }

/* SVG float animation (used via class on wrapper) */
@keyframes svgFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.svg-float { animation: svgFloat 3s ease-in-out infinite; }
@keyframes svgPulse { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.03); opacity: 1; } }
.svg-pulse { animation: svgPulse 3s ease-in-out infinite; }

/* ================================================================
   OTP VERIFICATION STYLES
   ================================================================ */

/* Step indicator used in register/forgot-password 2-step flows */
.step-indicator { display: flex; align-items: center; gap: 0; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
  border: 2px solid var(--tc-border, #e2e8f0);
  background: #fff; color: var(--tc-text-muted, #94a3b8);
  transition: all .3s ease; flex-shrink: 0;
}
.step-dot.current {
  border-color: var(--tc-primary, #6366f1);
  background: var(--tc-primary, #6366f1);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,.15);
}
.step-dot.done {
  border-color: #10b981;
  background: #10b981;
  color: #fff;
}
.step-line {
  width: 40px; height: 2px;
  background: var(--tc-border, #e2e8f0);
  transition: background .3s ease; flex-shrink: 0;
}
.step-line.done { background: #10b981; }
.step-label { font-size: .7rem; color: var(--tc-text-muted, #94a3b8); font-weight: 500; white-space: nowrap; }
.step-label.current { color: var(--tc-primary, #6366f1); font-weight: 700; }
.step-label.done { color: #10b981; }

/* OTP digit boxes */
.otp-input-group { display: flex; gap: .4rem; justify-content: center; }
.otp-digit {
  width: clamp(38px, 13vw, 52px);
  height: clamp(44px, 14vw, 60px);
  flex: 1 1 0;
  min-width: 0;
  max-width: 52px;
  text-align: center;
  font-size: clamp(1.2rem, 4.5vw, 1.6rem); font-weight: 800; font-family: 'Courier New', monospace;
  border: 2px solid var(--tc-border, #e2e8f0);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--tc-primary, #6366f1);
  transition: border-color .2s, box-shadow .2s, background .2s, transform .15s;
  outline: none;
  caret-color: var(--tc-primary, #6366f1);
  -moz-appearance: textfield;
}
.otp-digit::-webkit-outer-spin-button,
.otp-digit::-webkit-inner-spin-button { -webkit-appearance: none; }
.otp-digit:focus {
  border-color: var(--tc-primary, #6366f1);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,.12);
  transform: translateY(-2px);
}
.otp-digit.filled {
  border-color: var(--tc-primary, #6366f1);
  background: rgba(99,102,241,.06);
}
/* Shake animation on wrong OTP */
@keyframes otp-shake {
  0%,100% { transform: translateX(0); }
  15%      { transform: translateX(-7px); }
  30%      { transform: translateX(7px); }
  45%      { transform: translateX(-5px); }
  60%      { transform: translateX(5px); }
  75%      { transform: translateX(-3px); }
  90%      { transform: translateX(3px); }
}
.otp-input-group.otp-shake .otp-digit {
  animation: otp-shake .55s ease;
  border-color: var(--tc-danger, #ef4444) !important;
  background: rgba(239,68,68,.07);
}

/* Resend countdown */
.resend-countdown { font-size: .8rem; color: var(--tc-text-muted, #64748b); }
.resend-countdown strong { color: var(--tc-primary, #6366f1); }

/* ================================================================
   SKILLS SELECT2 MULTI-SELECT
   ================================================================ */

/* Override Select2 container */
.select2-skills + .select2-container .select2-selection--multiple,
.select2-container--bootstrap-5 .select2-selection--multiple {
  min-height: 46px;
  padding: .4rem .6rem;
  border-radius: 10px !important;
  border: 1.5px solid var(--tc-border, #e2e8f0) !important;
  background: #f8fafc;
  cursor: text;
}
.select2-container--bootstrap-5 .select2-selection--multiple:focus-within {
  border-color: var(--tc-primary, #6366f1) !important;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,.1) !important;
}
/* Tags inside Select2 */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
  background: var(--tc-primary-l, #eef2ff);
  border: 1px solid rgba(99,102,241,.25);
  color: var(--tc-primary, #6366f1);
  border-radius: 50px;
  padding: .2rem .75rem;
  font-size: .78rem;
  font-weight: 600;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
  color: var(--tc-primary, #6366f1);
  opacity: .6;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
  opacity: 1; background: transparent;
}
/* Dropdown */
.select2-container--bootstrap-5 .select2-dropdown {
  border-radius: 12px;
  border: 1.5px solid var(--tc-border, #e2e8f0);
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
  overflow: hidden;
}
.select2-container--bootstrap-5 .select2-results__option--highlighted {
  background: var(--tc-primary-l, #eef2ff);
  color: var(--tc-primary, #6366f1);
}
.select2-container--bootstrap-5 .select2-results__option--selected {
  background: rgba(99,102,241,.12);
  color: var(--tc-primary, #6366f1);
}
.select2-container--bootstrap-5 .select2-results__group {
  font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--tc-text-muted, #94a3b8);
  padding: .6rem 1rem .3rem;
}
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
  border-radius: 8px;
  border: 1.5px solid var(--tc-border, #e2e8f0);
  padding: .45rem .75rem;
  font-size: .85rem;
}
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--tc-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  outline: none;
}

/* ================================================================
   GENERAL UI IMPROVEMENTS
   ================================================================ */

/* Smoother card hovers */
.card { transition: box-shadow .22s ease, transform .2s ease; }
.card-hover:hover { box-shadow: 0 8px 32px rgba(0,0,0,.1) !important; transform: translateY(-2px); }

/* Input group improvements */
.input-group .form-control { border-radius: var(--radius-sm) !important; }
.input-group .input-group-text {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border: 1.5px solid var(--tc-border); background: var(--tc-bg-2);
}
.input-group > .form-control:not(:first-child) { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }

/* Auth page improvements */
.auth-panel-left { background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 100%); }

/* Password strength bar */
.pass-strength-bar { height: 4px; border-radius: 50px; background: var(--tc-border); overflow: hidden; margin-top: .5rem; }
.pass-strength-fill { height: 100%; border-radius: 50px; transition: width .4s, background .4s; width: 0%; }

/* Skill chip (legacy, kept for backwards compat) */
.skill-chip { display: inline-flex; align-items: center; padding: .3rem .8rem; border-radius: 50px; background: var(--tc-bg); border: 1.5px solid var(--tc-border); font-size: .8rem; cursor: pointer; transition: all .2s; user-select: none; }
.skill-chip.selected, .skill-chip:has(input:checked) { background: var(--tc-primary-l); border-color: var(--tc-primary); color: var(--tc-primary); font-weight: 600; }
.skill-chip:hover { border-color: var(--tc-primary); }

/* ================================================================
   MISSING COMPONENTS — Added to complete the enterprise UI
   ================================================================ */

/* ---- Extra :root tokens (consolidated — duplicates from bottom) ---- */
:root {
  --ease-in:   cubic-bezier(.55, 0, 1, .45);
  --dur-fast:  120ms;
  --dur:       200ms;
  --dur-slow:  380ms;
}

/* ---- Focus visible (keyboard accessibility) ---- */
:focus-visible {
  outline: 2px solid var(--tc-primary);
  outline-offset: 2px;
}
.btn:focus-visible   { outline-offset: 3px; }
.sidebar-link:focus-visible { outline-color: #a5b4fc; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -999px;
  left: 1rem;
  z-index: 99999;
  background: var(--tc-primary);
  color: #fff;
  padding: .5rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 700;
  font-size: .875rem;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---- Page Loader ---- */
#page-loader {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-loader, 99998);
  transition: opacity .35s ease, visibility .35s ease;
}
#page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-ring {
  width: 44px;
  height: 44px;
  border: 3px solid var(--tc-primary-l);
  border-top-color: var(--tc-primary);
  border-radius: 50%;
  animation: loader-spin .7s linear infinite;
}
@keyframes loader-spin { to { transform: rotate(360deg); } }

/* ---- Sidebar user card (dark sidebar) ---- */
.user-name {
  font-size: .875rem;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role-badge {
  display: inline-block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 50px;
  padding: .1rem .55rem;
  margin-top: .1rem;
}
.badge-vendor  { background: rgba(20,184,166,.2); color: #2dd4bf; border: 1px solid rgba(45,212,191,.3); }
.badge-trainer { background: rgba(99,102,241,.2); color: #a5b4fc; border: 1px solid rgba(165,180,252,.3); }

/* ---- Sidebar divider ---- */
.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,.07);
  margin: .5rem .75rem;
}

/* ---- Sidebar danger link (logout) ---- */
.sidebar-link-danger       { color: #f87171; }
.sidebar-link-danger:hover { background: rgba(239,68,68,.12); color: #ef4444; }

/* ---- Notification badge (numeric) ---- */
.badge-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 .35rem;
  background: var(--tc-danger);
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  border-radius: 50px;
  line-height: 1;
  position: absolute;
  top: 4px;
  right: 4px;
  border: 1.5px solid #312e81;
}

/* ---- Stat card accent-line (data-accent attribute) ---- */
.stat-card { position: relative; }
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 3px;
  border-radius: 50px;
  background: var(--_accent, transparent);
  transform: scaleX(0);
  transition: transform .3s var(--ease-out, ease);
}
.stat-card:hover::after { transform: scaleX(1); }
.stat-card[data-accent="primary"]  { --_accent: var(--tc-primary); }
.stat-card[data-accent="success"]  { --_accent: var(--tc-success); }
.stat-card[data-accent="warning"]  { --_accent: var(--tc-warning); }
.stat-card[data-accent="danger"]   { --_accent: var(--tc-danger); }
.stat-card[data-accent="info"]     { --_accent: var(--tc-info, #3b82f6); }

/* ---- Stat trend badge ---- */
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 50px;
  margin-top: .25rem;
}
.stat-trend.up      { color: #065f46; background: var(--tc-success-l, #d1fae5); }
.stat-trend.down    { color: #991b1b; background: var(--tc-danger-l,  #fee2e2); }
.stat-trend.neutral { color: #374151; background: #f1f5f9; }

/* ---- Ripple micro-interaction ---- */
.btn         { position: relative; overflow: hidden; }
.sidebar-link { overflow: hidden; } /* already set above but explicit here */
.tc-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  transform: scale(0);
  animation: tc-ripple-anim .55s var(--ease-out, ease) forwards;
  pointer-events: none;
  z-index: 0;
}
@keyframes tc-ripple-anim { to { transform: scale(4); opacity: 0; } }

/* Breadcrumb refinements */
.breadcrumb { font-size: .8rem; padding: .45rem 0; margin-bottom: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--tc-text-muted); }
.breadcrumb-item a { color: var(--tc-primary); text-decoration: none; font-weight: 500; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--tc-text-muted); font-weight: 500; }

/* ================================================================
   ENTERPRISE POLISH — Phase 3
   ================================================================ */

/* ---- 1. Skeleton Loading Placeholders ---- */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--tc-bg-2) 25%, #e2e8f0 37%, var(--tc-bg-2) 63%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
.skeleton * { visibility: hidden; }
.skeleton-text    { height: .9rem; border-radius: 4px; margin-bottom: .5rem; }
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-heading { height: 1.4rem; border-radius: 4px; width: 40%; margin-bottom: .75rem; }
.skeleton-avatar  { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.skeleton-card    { height: 140px; border-radius: var(--radius); }
.skeleton-stat    { height: 88px; border-radius: var(--radius); }
.skeleton-img     { height: 180px; border-radius: var(--radius); }

/* ---- 2. Enhanced Stat Cards ---- */
.stat-card {
  font-feature-settings: 'tnum' 1;
  transition: transform .22s var(--ease-out), box-shadow .22s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--tc-shadow-md);
}
.stat-number { font-variant-numeric: tabular-nums; }

/* ---- 3. Welcome Banner Upgrades ---- */
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.welcome-banner {
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
  overflow: hidden;
}
.welcome-banner::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  pointer-events: none;
}
.welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -30%; left: 10%;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  pointer-events: none;
}
.welcome-banner .btn {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ---- 4. Card & Component Refinements ---- */
.dash-card {
  transition: transform .22s var(--ease-out), box-shadow .25s ease;
  border: 1px solid var(--tc-border);
}
.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99,102,241,.08);
}
.dash-card .card-header {
  border-left: 3px solid var(--tc-primary);
  font-weight: 700;
}

/* Badge refinements */
.badge {
  font-weight: 600;
  letter-spacing: .02em;
  padding: .3em .65em;
}
.badge-soft-primary { background: var(--tc-primary-l); color: var(--tc-primary); }
.badge-soft-success { background: var(--tc-success-l); color: #047857; }
.badge-soft-warning { background: var(--tc-warning-l); color: #92400e; }
.badge-soft-danger  { background: var(--tc-danger-l); color: #b91c1c; }
.badge-soft-info    { background: var(--tc-info-l); color: #1d4ed8; }

/* Alert refinements */
.alert {
  border-left: 4px solid;
  border-radius: var(--radius-sm);
  font-size: .875rem;
}
.alert-success { border-left-color: var(--tc-success); }
.alert-warning { border-left-color: var(--tc-warning); }
.alert-danger  { border-left-color: var(--tc-danger); }
.alert-info    { border-left-color: var(--tc-info); }

/* ---- 5. Table Enhancements ---- */
.table > tbody > tr:nth-child(even) > td,
.table > tbody > tr:nth-child(even) > th {
  background: rgba(248,250,252,.6);
}
.table > tbody > tr {
  transition: background .15s ease;
  position: relative;
}
.table > tbody > tr:hover > td,
.table > tbody > tr:hover > th {
  background: var(--tc-primary-l);
}
.table > tbody > tr:hover > td:first-child {
  box-shadow: inset 3px 0 0 var(--tc-primary);
}
.table > thead > tr > th {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tc-text-muted);
  border-bottom-width: 2px;
}

/* DataTables pagination match */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--radius-sm) !important;
  font-size: .82rem;
  padding: .35rem .7rem !important;
  margin: 0 2px;
  transition: all var(--transition);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--tc-primary) !important;
  border-color: var(--tc-primary) !important;
  color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--tc-primary-l) !important;
  border-color: var(--tc-primary) !important;
  color: var(--tc-primary) !important;
}
.dataTables_wrapper .dataTables_filter input {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--tc-border);
  padding: .4rem .75rem;
  font-size: .85rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--tc-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  outline: none;
}
.dataTables_wrapper .dataTables_length select {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--tc-border);
  padding: .3rem .5rem;
  font-size: .85rem;
}
.dataTables_wrapper .dataTables_info {
  font-size: .8rem;
  color: var(--tc-text-muted);
}

/* ---- 6. Form & Input Polish ---- */
.form-control, .form-select {
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--tc-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.input-group-text {
  transition: border-color var(--transition), color var(--transition);
}
.input-group:focus-within .input-group-text {
  border-color: var(--tc-primary);
  color: var(--tc-primary);
}

/* File input styling */
.form-control[type="file"] {
  padding: .5rem;
  cursor: pointer;
}
.form-control[type="file"]::file-selector-button {
  background: var(--tc-primary-l);
  color: var(--tc-primary);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: var(--radius-sm);
  padding: .35rem .85rem;
  font-weight: 600;
  font-size: .82rem;
  cursor: pointer;
  transition: all var(--transition);
}
.form-control[type="file"]::file-selector-button:hover {
  background: var(--tc-primary);
  color: #fff;
}

/* Custom checkbox & radio */
.form-check-input {
  width: 1.15em; height: 1.15em;
  border: 2px solid var(--tc-border);
  transition: all var(--transition);
  cursor: pointer;
}
.form-check-input:checked {
  background-color: var(--tc-primary);
  border-color: var(--tc-primary);
}
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  border-color: var(--tc-primary);
}

/* ---- 7. Empty State Upgrades ---- */
@keyframes empty-breathe {
  0%, 100% { transform: scale(1); opacity: .85; }
  50%      { transform: scale(1.03); opacity: 1; }
}
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.empty-state img, .empty-state svg {
  max-width: 200px;
  margin: 0 auto 1.25rem;
  display: block;
  animation: empty-breathe 3.5s ease-in-out infinite;
}
.empty-state h5, .empty-state .empty-title {
  font-weight: 700;
  color: var(--tc-text);
  margin-bottom: .5rem;
}
.empty-state p, .empty-state .empty-desc {
  color: var(--tc-text-muted);
  font-size: .875rem;
  max-width: 360px;
  margin: 0 auto 1.25rem;
  line-height: 1.6;
}
.empty-state .btn {
  font-weight: 600;
  padding: .55rem 1.5rem;
}

/* ---- 8. Page Transitions & Micro-interactions ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Page entry — applied by JS on DOMContentLoaded */
body:not(.page-loaded) .dashboard-main,
body:not(.page-loaded) .auth-wrapper,
body:not(.page-loaded) .admin-wrapper > .container-fluid {
  opacity: 0;
}
.page-loaded .dashboard-main,
.page-loaded .auth-wrapper,
.page-loaded .admin-wrapper > .container-fluid {
  animation: slideUp .45s var(--ease-out) forwards;
}
.page-loaded .hero-section {
  animation: fadeIn .5s ease forwards;
}

/* Staggered children animation */
.stagger-in > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
}
.stagger-in.animated > * { opacity: 1; transform: translateY(0); }
.stagger-in.animated > *:nth-child(1) { transition-delay: 0ms; }
.stagger-in.animated > *:nth-child(2) { transition-delay: 60ms; }
.stagger-in.animated > *:nth-child(3) { transition-delay: 120ms; }
.stagger-in.animated > *:nth-child(4) { transition-delay: 180ms; }
.stagger-in.animated > *:nth-child(5) { transition-delay: 240ms; }
.stagger-in.animated > *:nth-child(6) { transition-delay: 300ms; }
.stagger-in.animated > *:nth-child(n+7) { transition-delay: 360ms; }

/* Button press feedback */
.btn:active:not(:disabled) {
  transform: scale(.97);
  transition-duration: 80ms;
}

/* Navbar scroll state */
.tc-navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.12);
  transition: box-shadow .3s ease;
}
.tc-navbar.scrolled .navbar-brand { transform: scale(.97); }

/* ---- 9. Sidebar Refinements ---- */
.sidebar-link {
  position: relative;
  transition: background .18s ease, color .18s ease, padding-left .18s ease;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 15%; bottom: 15%;
  width: 3px;
  border-radius: 0 50px 50px 0;
  background: var(--tc-primary);
  animation: slideRight .25s var(--ease-out);
}
@keyframes slideRight {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

.sidebar-section-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.35);
  padding: .75rem .75rem .25rem;
}

/* Sidebar footer */
.sidebar-footer {
  padding: .75rem;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: .65rem;
  color: rgba(255,255,255,.3);
}

/* ---- 10. Responsive Refinements ---- */
@media (max-width: 767.98px) {
  /* 2-column stat cards on mobile */
  .stat-row, .row:has(> .col-md-3 > .stat-card) {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
  }
  .stat-row > *, .row:has(> .col-md-3 > .stat-card) > * {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  /* Tighter card padding on mobile */
  .dash-card .card-body { padding: .85rem; }
  .stat-card .card-body { padding: .75rem; }

  /* Safe area insets for notched devices */
  .sidebar { padding-bottom: env(safe-area-inset-bottom, 0); }
  .dashboard-main { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0)); }
}

@media (max-width: 575.98px) {
  /* Stack stat cards single column on very small screens */
  .stat-row, .row:has(> .col-md-3 > .stat-card) {
    grid-template-columns: 1fr;
  }
}

/* Smooth scrollbar styling (webkit) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,.2); border-radius: 50px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,.35); }

/* ---- Print Styles ---- */
@media print {
  .sidebar, .tc-navbar, .whatsapp-float, .back-to-top, #page-loader { display: none !important; }
  .dashboard-main { margin-left: 0 !important; padding: 0 !important; }
  .dash-card, .stat-card { break-inside: avoid; box-shadow: none !important; border: 1px solid #ddd; }
  body { font-size: 12pt; }
}

/* ---- Reduced Motion Preference ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .skeleton { animation: none; background: var(--tc-bg-2); }
  .welcome-banner { animation: none; }
}
