/* ============================================================================
   SUDHAN ENTERPRISES - UNIFIED DESIGN SYSTEM CSS
   allinonepoint.in Inspired Theme, Dual Dark/Light Mode, Mobile-First
   Primary: #4361EE | Secondary: #3A0CA3 | Emerald: #10B981 | Orange: #F97316
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Poppins:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Poppins', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;
  
  --primary: #4361EE;
  --primary-hover: #3A0CA3;
  --primary-light: rgba(67, 97, 238, 0.12);
  --emerald: #10B981;
  --emerald-hover: #059669;
  --emerald-light: rgba(16, 185, 129, 0.12);
  --orange: #F97316;
  --orange-hover: #EA580C;
  --orange-light: rgba(249, 115, 22, 0.12);
  --rose: #EF4444;
  --rose-light: rgba(239, 68, 68, 0.12);
  --amber: #F59E0B;
  --amber-light: rgba(245, 158, 11, 0.12);

  /* Clean Default Fallback Variables to Prevent Any Black Screen Flash */
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F5F9;
  --bg-card: #FFFFFF;
  --border-color: #E2E8F0;
  --border-hover: #CBD5E1;
  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-dim: #94A3B8;
  --input-bg: #FFFFFF;
  --table-head: #F8FAFC;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(67, 97, 238, 0.08);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.08);
  --hub-gradient: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
}

/* Light Theme Variables (allinonepoint.in clean style) */
html.light, body.light {
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F5F9;
  --bg-card: #FFFFFF;
  --border-color: #E2E8F0;
  --border-hover: #CBD5E1;
  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-dim: #94A3B8;
  --input-bg: #FFFFFF;
  --table-head: #F8FAFC;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(67, 97, 238, 0.08);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.08);
  --hub-gradient: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
}

/* Dark Theme Variables (Sleek slate with blue-purple glows) */
html.dark, body.dark {
  --bg-primary: #090D16;
  --bg-secondary: #0F172A;
  --bg-tertiary: #1E293B;
  --bg-card: rgba(15, 23, 42, 0.95);
  --border-color: #1E293B;
  --border-hover: #334155;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-dim: #475569;
  --input-bg: #0B1120;
  --table-head: #162032;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.6);
  --hub-gradient: linear-gradient(135deg, #090D16 0%, #0F172A 100%);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Smooth transition ONLY during active toggle */
body.theme-transitioning,
body.theme-transitioning * {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease !important;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════
   3-IN-1 MAIN HUB LAYOUT (EXACT MATCH FOR 3in1.png)
══════════════════════════════════════════════════════════════ */
.hub-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--hub-gradient);
  position: relative;
  overflow-x: hidden;
}

.hub-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* Top Hub Header */
.hub-header {
  height: 72px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.hub-header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.hub-logo-mark {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-brand-titles {
  display: flex;
  flex-direction: column;
}

.hub-brand-main {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-brand-sub {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--emerald);
  text-transform: uppercase;
}

.hub-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Theme Switch Pill Toggle */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.theme-switch-wrapper:hover {
  border-color: var(--primary);
}

.theme-switch-track {
  width: 38px;
  height: 20px;
  background: #cbd5e1;
  border-radius: 9999px;
  position: relative;
  transition: background 0.3s ease;
}

body.dark .theme-switch-track {
  background: var(--primary);
}

.theme-switch-thumb {
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

body.dark .theme-switch-thumb {
  transform: translateX(18px);
}

/* User Badge in Header */
.hub-user-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
}

.hub-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.hub-user-greeting {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.hub-user-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hub-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--rose);
  transition: all 0.2s ease;
}

.hub-logout-btn:hover {
  background: var(--rose-light);
  border-color: var(--rose);
}

/* Hub Main Canvas */
.hub-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  position: relative;
}

/* Background Graphical Decors */
.hub-bg-decor {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.hub-bg-dots-left {
  top: 40px;
  left: 40px;
  width: 140px;
  height: 140px;
  background-image: radial-gradient(var(--primary) 1.5px, transparent 1.5px);
  background-size: 16px 16px;
}

.hub-bg-dots-right {
  top: 40px;
  right: 40px;
  width: 140px;
  height: 140px;
  background-image: radial-gradient(var(--primary) 1.5px, transparent 1.5px);
  background-size: 16px 16px;
}

.hub-bg-wave-left {
  bottom: 0;
  left: 0;
  width: 400px;
  height: 300px;
  background: radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
}

.hub-bg-wave-right {
  bottom: 0;
  right: 0;
  width: 450px;
  height: 350px;
  background: radial-gradient(circle at bottom right, rgba(67, 97, 238, 0.14) 0%, transparent 70%);
}

/* Hero Section */
.hub-hero {
  text-align: center;
  max-width: 600px;
  margin-bottom: 2.75rem;
  position: relative;
  z-index: 1;
}

.hub-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.hub-diamond {
  color: var(--emerald);
  font-size: 0.8rem;
}

.hub-eyebrow-text {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--emerald);
  text-transform: uppercase;
}

.hub-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hub-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* 3 Big Cards Grid */
.hub-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
  max-width: 1080px;
  position: relative;
  z-index: 1;
}

/* Individual Big Card */
.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.hub-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.hub-card-body {
  padding: 2.75rem 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.hub-card-icon-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.hub-card:hover .hub-card-icon-circle {
  transform: scale(1.08) rotate(-3deg);
}

.bg-emerald {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.35);
}

.bg-blue {
  background: linear-gradient(135deg, #0EA5E9 0%, #2563EB 100%);
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.35);
}

.bg-orange {
  background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.35);
}

.text-emerald { color: #10B981; }
.text-blue    { color: #2563EB; }
.text-orange  { color: #F97316; }

.hub-card-heading {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.02em;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.hub-card-divider {
  width: 36px;
  height: 2.5px;
  border-radius: 999px;
  margin: 0 auto 0.75rem;
}

.hub-card-tagline {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Card Bottom Wavy Curve & Arrow */
.hub-card-footer {
  height: 90px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-card-wave {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  pointer-events: none;
}

.wave-emerald {
  background: radial-gradient(ellipse at bottom, rgba(16, 185, 129, 0.4) 0%, transparent 75%);
}

.wave-blue {
  background: radial-gradient(ellipse at bottom, rgba(37, 99, 235, 0.4) 0%, transparent 75%);
}

.wave-orange {
  background: radial-gradient(ellipse at bottom, rgba(249, 115, 22, 0.4) 0%, transparent 75%);
}

.hub-arrow-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  position: relative;
  z-index: 2;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hub-card:hover .hub-arrow-circle {
  transform: scale(1.12);
}

.btn-emerald { background: linear-gradient(135deg, #10B981, #059669); }
.btn-blue    { background: linear-gradient(135deg, #0EA5E9, #2563EB); }
.btn-orange  { background: linear-gradient(135deg, #F97316, #EA580C); }

/* Hub Admin Bar */
.hub-admin-bar {
  margin-top: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
}

.hub-footer {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

/* ═══════════════════════════════════════════════════════════════
   MODULE PAGES APP SHELL LAYOUT
══════════════════════════════════════════════════════════════ */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 200;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35);
}

.sidebar-brand-text {
  flex: 1;
  min-width: 0;
}

.sidebar-brand-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-brand-subtitle {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
}

.sidebar-nav {
  padding: 0.75rem 0.85rem 2rem;
  flex: 1;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 1rem 0.5rem 0.4rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  border: 1px solid rgba(67, 97, 238, 0.25);
}

.nav-link-hub {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  margin-bottom: 0.5rem;
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 199;
}

.sidebar-overlay.show {
  display: block;
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Sticky Header */
.top-header {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.45rem;
  border-radius: 8px;
  cursor: pointer;
}

.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.theme-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.user-info {
  line-height: 1.1;
}

.user-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--primary);
}

/* Content Viewport */
.content-viewport {
  flex: 1;
  padding: 1.75rem;
}

.app-footer {
  padding: 1.25rem 1.75rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--primary);
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS: CARDS, BUTTONS, BADGES, FORMS
══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-success {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-hover));
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--rose), #DC2626);
  color: white;
}

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 8px;
}

.btn-xs {
  padding: 0.25rem 0.55rem;
  font-size: 0.7rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 0.95rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.badge-success { background: var(--emerald-light); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: var(--amber-light); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger  { background: var(--rose-light); color: var(--rose); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info    { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(67, 97, 238, 0.3); }
.badge-muted   { background: var(--bg-tertiary); color: var(--text-muted); border: 1px solid var(--border-color); }

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.form-control, .form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.95rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  transition: all 0.2s ease;
  outline: none;
}

.form-control:focus, .form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1rem;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96) translateY(-10px);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal-box {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--rose);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Alerts */
.alert {
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid;
}

.alert-success { background: var(--emerald-light); color: var(--emerald); border-color: rgba(16, 185, 129, 0.3); }
.alert-danger  { background: var(--rose-light); color: var(--rose); border-color: rgba(239, 68, 68, 0.3); }
.alert-info    { background: var(--primary-light); color: var(--primary); border-color: rgba(67, 97, 238, 0.3); }

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.85rem 1.25rem;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════════════
   TABLES & RESPONSIVE NO-HORIZONTAL-SCROLL STYLES
══════════════════════════════════════════════════════════════ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border-color);
}

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

.data-table th {
  background: var(--table-head);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--primary-light);
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE VIEW TRANSFORMATION: NO HORIZONTAL SCROLLING!
   On mobile screens (< 768px), wide tables transform into
   stacked card blocks with clear labels and values.
══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: block;
  }

  .main-wrapper {
    margin-left: 0 !important;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .hidden-mobile {
    display: none !important;
  }

  .content-viewport {
    padding: 1rem;
  }

  /* 3-in-1 Hub on Mobile */
  .hub-cards-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    gap: 1.5rem;
  }

  .hub-header {
    padding: 0 1rem;
    height: 60px;
  }

  .hub-title {
    font-size: 1.55rem;
  }

  .hub-admin-bar {
    border-radius: 16px;
    flex-direction: column;
    width: 100%;
    max-width: 420px;
  }

  /* MOBILE RESPONSIVE DATA TABLE TRANSFORM (Zero Horizontal Scroll!) */
  .table-responsive {
    border: none;
    background: transparent;
    overflow-x: visible;
  }

  .data-table, 
  .data-table thead, 
  .data-table tbody, 
  .data-table th, 
  .data-table td, 
  .data-table tr {
    display: block;
  }

  .data-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .data-table tbody tr {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
  }

  .data-table td {
    border: none;
    border-bottom: 1px dashed var(--border-color);
    position: relative;
    padding: 0.6rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    font-size: 0.82rem;
  }

  .data-table td:last-child {
    border-bottom: none;
    padding-top: 0.85rem;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .data-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    text-align: left;
    margin-right: 1rem;
    flex-shrink: 0;
  }

  .data-table td:only-child {
    justify-content: center;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PRINT STYLES
══════════════════════════════════════════════════════════════ */
@media print {
  .no-print, .sidebar, .top-header, .hub-header, .app-footer {
    display: none !important;
  }
  
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  
  .main-wrapper {
    margin-left: 0 !important;
  }
  
  .content-viewport {
    padding: 0 !important;
  }

  .print-area {
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
  }
}

/* ============================================================================
   GRID UTILITIES & PRODUCT THUMBNAILS
   ============================================================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Product Catalog Thumbnail */
.product-thumb-container {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  max-width: 48px;
  max-height: 48px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Service Center Dashboard 4-Column KPI Grid */
.svc-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) {
  .svc-metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .svc-metric-grid { grid-template-columns: 1fr; }
}
.svc-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.svc-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.svc-kpi-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.svc-kpi-val {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}
.svc-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* ============================================================================
   SERVICE REPORT & TAX INVOICE PRINT SHEET
   ============================================================================ */
.report-sheet-doc {
  background: #ffffff !important;
  color: #0f172a !important;
  border-radius: 16px;
  padding: 2.25rem 2.5rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
  border: 1px solid #e2e8f0;
  max-width: 850px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}
.report-sheet-doc * {
  color: #0f172a;
}
.rep-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  gap: 1rem;
}
.rep-brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a !important;
  line-height: 1.2;
}
.rep-brand-sub {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569 !important;
  margin-top: 0.25rem;
}
.rep-brand-details {
  font-size: 0.76rem;
  color: #475569 !important;
  margin-top: 0.35rem;
  line-height: 1.4;
}
.rep-badge-title {
  display: inline-block;
  background: #eff6ff;
  color: #1e40af !important;
  border: 1px solid #bfdbfe;
  font-weight: 800;
  font-size: 0.76rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  text-transform: uppercase;
}
.rep-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.rep-info-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
}
.rep-info-card-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b !important;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.35rem;
  margin-bottom: 0.5rem;
}
.rep-table-custom {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 1.25rem 0;
  border: 1px solid #cbd5e1;
}
.rep-table-custom th {
  background: #f1f5f9;
  color: #0f172a !important;
  font-weight: 800;
  padding: 0.65rem 0.75rem;
  border-bottom: 2px solid #cbd5e1;
  text-align: left;
}
.rep-table-custom td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  color: #334155 !important;
}
.rep-totals-box {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}
.rep-totals-table {
  width: 280px;
  font-size: 0.82rem;
}
.rep-totals-table td {
  padding: 0.35rem 0.5rem;
}
.rep-totals-table tr.grand-row td {
  font-weight: 800;
  font-size: 1rem;
  color: #0f172a !important;
  border-top: 2px solid #0f172a;
  border-bottom: 2px solid #0f172a;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.rep-sig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #0f172a;
}
.rep-sig-box {
  text-align: center;
  font-size: 0.78rem;
}
.rep-sig-img {
  max-height: 55px;
  max-width: 180px;
  margin: 0 auto 0.5rem auto;
  object-fit: contain;
  display: block;
}

/* ============================================================================
   WIZARD STEPPER TIMELINE & HIDDEN UTILITY
   ============================================================================ */
.hidden { display: none !important; }

.wizard-stepper-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.wizard-stepper-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.wizard-step-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.85rem;
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.wizard-step-pill:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.wizard-step-pill.active {
  background: rgba(67, 97, 238, 0.12);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 700;
}

.wizard-step-pill.completed {
  color: var(--emerald);
}

.wizard-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.wizard-step-pill.active .wizard-step-circle {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35);
}

.wizard-step-pill.completed .wizard-step-circle {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  border-color: var(--emerald);
}

.wizard-step-divider {
  flex: 1;
  height: 2px;
  background: var(--border-color);
  min-width: 15px;
}

@media (max-width: 640px) {
  .wizard-step-pill span.step-text { display: none; }
  .wizard-step-pill { padding: 0.4rem; }
}

.wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
  .wizard-card { padding: 1.25rem 1rem; }
}

.wizard-issue-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}
@media (max-width: 900px) {
  .wizard-issue-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .wizard-issue-grid { grid-template-columns: 1fr; }
}

.wizard-issue-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  transition: all 0.2s ease;
  user-select: none;
}
.wizard-issue-item:hover {
  border-color: var(--primary);
}
.wizard-issue-item.selected {
  background: rgba(67, 97, 238, 0.12);
  border-color: var(--primary);
  color: var(--text-primary);
}