/* ===== TSBD CONSULTANCY THEME ===== */

:root {
  /* Always use light UI controls */
  color-scheme: light;

  /* Sky Blue Theme */
  --primary: #38bdf8;
  --primary-dark: #0ea5e9;
  --primary-light: #7dd3fc;
  --primary-bg: #f0f9ff;
  
  /* Status Colors */
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #8b5cf6;
  --info-bg: #ede9fe;
  
  /* Neutral Colors */
  --dark: #1e293b;
  --gray-900: #334155;
  --gray-800: #475569;
  --gray-700: #64748b;
  --gray-600: #94a3b8;
  --gray-500: #cbd5e1;
  --gray-400: #e2e8f0;
  --gray-300: #f1f5f9;
  --gray-200: #f8fafc;
  --light: #ffffff;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--dark);
  background: linear-gradient(135deg, var(--gray-200) 0%, var(--light) 100%);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  min-height: calc(100vh - 140px);
}

/* ===== CIRCULAR LOGOS ===== */

/* Navbar Logo - Small Circular */
.navbar-brand img {
  height: 40px !important;
  width: 40px !important;
  border-radius: var(--radius-full);
  object-fit: contain;
  border: 2px solid var(--primary);
  padding: 4px;
  background: var(--light);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.navbar-brand img:hover {
  transform: scale(1.1);
  border-color: var(--primary-dark);
}

/* PNG Transparency Fixes */
.home-hero .hero-logo[src*=".png"],
.navbar-brand img[src*=".png"] {
  background: linear-gradient(45deg, var(--light) 0%, var(--gray-200) 100%);
  backdrop-filter: blur(8px);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--dark);
  letter-spacing: -0.025em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.text-muted {
  color: var(--gray-700) !important;
}

/* ===== ANIMATION FOR WELCOME TEXT ===== */
.welcome-text {
  position: relative;
  display: inline-block;
  overflow: hidden;
  padding: 0.5rem 1rem;
  margin-top: 1rem;
}

.welcome-text::before,
.welcome-text::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  border-radius: var(--radius);
  opacity: 0;
}

.welcome-text::before {
  background: linear-gradient(45deg, var(--primary-bg) 0%, transparent 100%);
  animation: welcomeGlow 3s ease-in-out infinite alternate;
}

.welcome-text::after {
  background: linear-gradient(45deg, transparent 0%, var(--primary-bg) 100%);
  animation: welcomeShimmer 6s ease-in-out infinite;
}

@keyframes welcomeTextEntrance {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    letter-spacing: 0.5em;
  }
  30% {
    opacity: 1;
    letter-spacing: 0.1em;
  }
  70% {
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    letter-spacing: normal;
  }
}

@keyframes welcomePulse {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

@keyframes welcomeGlow {
  0% {
    opacity: 0.3;
    transform: translateX(-100%) translateY(-50%) rotate(0deg);
  }
  100% {
    opacity: 0.5;
    transform: translateX(100%) translateY(50%) rotate(180deg);
  }
}

@keyframes welcomeShimmer {
  0%, 100% {
    opacity: 0;
    background-position: -200% center;
  }
  50% {
    opacity: 0.3;
    background-position: 200% center;
  }
}

@keyframes welcomeFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes welcomeTyping {
  0% {
    width: 0;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    width: 100%;
    opacity: 1;
  }
}

/* ===== NAVIGATION ===== */
.navbar {
  background: var(--light) !important;
  box-shadow: var(--shadow-sm);
  border: none !important;
  padding: 0.75rem 0;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95) !important;
}

.navbar-brand {
  font-weight: 700;
  color: var(--primary) !important;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

/* ===== CARDS ===== */
.card {
  border: none !important;
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg) !important;
  transition: all var(--transition);
  overflow: hidden;
  background: var(--light);
}

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

.card.shadow-sm {
  box-shadow: var(--shadow) !important;
}

.card-body {
  padding: var(--space-lg) !important;
}

/* ===== BUTTONS ===== */
.btn {
  border-radius: var(--radius) !important;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border: none;
  transition: all var(--transition);
  letter-spacing: 0.025em;
}

.btn-sm {
  padding: 0.5rem 1rem !important;
  font-size: 0.875rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  border: none !important;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #0284c7 100%) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-outline-primary {
  color: var(--primary) !important;
  border: 2px solid var(--primary) !important;
  background: transparent !important;
}

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

.btn-outline-secondary {
  color: var(--gray-700) !important;
  border: 2px solid var(--gray-400) !important;
  background: transparent !important;
}

.btn-outline-secondary:hover {
  background: var(--gray-300) !important;
  border-color: var(--gray-500) !important;
  color: var(--gray-900) !important;
}

/* ===== FORMS ===== */
.form-control {
  border: 2px solid var(--gray-400) !important;
  border-radius: var(--radius) !important;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  transition: all var(--transition);
  background: var(--light);
}

.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
  outline: none;
}

.form-control::placeholder {
  color: var(--gray-600);
}

/* ===== BADGES ===== */
.badge {
  font-weight: 600;
  padding: 0.375em 0.875em;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  letter-spacing: 0.025em;
  border: 1px solid transparent;
}

.text-bg-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
}

.text-bg-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%) !important;
}

.text-bg-warning {
  background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%) !important;
}

.text-bg-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%) !important;
}

.text-bg-secondary {
  background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-700) 100%) !important;
}

/* ===== ALERTS ===== */
.alert {
  border: none !important;
  border-radius: var(--radius) !important;
  padding: 1rem 1.25rem !important;
  border-left: 4px solid transparent;
}

.alert-warning {
  background: linear-gradient(135deg, var(--warning-bg) 0%, #fffbeb 100%) !important;
  color: #92400e !important;
  border-left-color: var(--warning) !important;
}

.alert-info {
  background: linear-gradient(135deg, var(--info-bg) 0%, #f5f3ff 100%) !important;
  color: #5b21b6 !important;
  border-left-color: var(--info) !important;
}

.alert-success {
  background: linear-gradient(135deg, var(--success-bg) 0%, #ecfdf5 100%) !important;
  color: #065f46 !important;
  border-left-color: var(--success) !important;
}

.alert-danger {
  background: linear-gradient(135deg, var(--danger-bg) 0%, #fef2f2 100%) !important;
  color: #991b1b !important;
  border-left-color: var(--danger) !important;
}

/* ===== STATUS CARDS (Workflow Steps) ===== */
.border.rounded-3 {
  border: 2px solid var(--gray-300) !important;
  border-radius: var(--radius-lg) !important;
  transition: all var(--transition);
  height: 100%;
  padding: var(--space-md);
  background: var(--light);
}

.border.rounded-3:hover {
  border-color: var(--primary) !important;
  background: var(--primary-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Status Badges in Workflow */
.border.rounded-3 .badge {
  font-size: 0.6875rem;
  padding: 0.25em 0.75em;
}

/* ===== LIST GROUPS ===== */
.list-group-item {
  border: 1px solid var(--gray-300);
  padding: 1rem 1.25rem !important;
  transition: all var(--transition);
  border-radius: var(--radius) !important;
  margin-bottom: 0.5rem;
  background: var(--light);
}

.list-group-item:hover {
  background: linear-gradient(135deg, var(--primary-bg) 0%, #f0f9ff 100%);
  border-color: var(--primary-light);
  transform: translateX(8px);
  box-shadow: var(--shadow-sm);
}

.list-group-item-action {
  color: var(--dark);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.list-group-item-action:hover {
  border-left-color: var(--primary);
}

/* ===== FOOTER ===== */
footer {
  background: var(--light);
  border-top: 1px solid var(--gray-300);
  padding: 1.5rem 0 !important;
  margin-top: auto;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95) !important;
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.status-updated {
  animation: pulse 0.5s ease;
}

/* ===== UTILITY CLASSES ===== */
.border-primary-light {
  border-color: var(--primary-light) !important;
}

.bg-primary-light {
  background: var(--primary-bg) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--gray-200);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-full);
  border: 2px solid var(--gray-200);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #0284c7 100%);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  
  .card-body {
    padding: var(--space-md) !important;
  }
  
  .navbar-brand img {
    height: 36px !important;
    width: 36px !important;
  }
  
  .border.rounded-3 {
    padding: var(--space);
  }
  
  .d-sm-flex .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .list-group-item:hover {
    transform: translateX(4px);
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .navbar,
  .btn,
  footer,
  .home-hero,
  .list-group-item-action:hover {
    display: none !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid var(--gray-400) !important;
    break-inside: avoid;
  }
  
  body {
    background: white !important;
  }
}

/* ===== FORCE LIGHT MODE (NO DARK THEME) ===== */
/* Some mobile browsers apply dark UI controls when the device is in dark mode.
   These rules keep the site in white/light mode always. */
:root, html {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root, html, body {
    color-scheme: light;
  }

  body {
    background: linear-gradient(135deg, var(--gray-200) 0%, var(--light) 100%) !important;
    color: var(--dark) !important;
  }

  .navbar,
  footer,
  .card,
  .list-group-item,
  .border.rounded-3,
  .form-control,
  .form-select,
  .modal-content {
    background: var(--light) !important;
    color: var(--dark) !important;
  }

  .text-muted {
    color: var(--gray-700) !important;
  }
}



/* ===== HOME (PUBLIC) ===== */
.home-hero {
  position: relative;
  padding: clamp(2.5rem, 4vw, 4rem) 0;
  border-bottom: 1px solid var(--gray-400);
  background:
    radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.12) 0%, transparent 55%),
    radial-gradient(circle at 85% 10%, rgba(14, 165, 233, 0.10) 0%, transparent 55%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(255, 255, 255, 1) 100%);
  overflow: hidden;
}

/* Subtle office-style grid pattern */
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.15) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at 40% 20%, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 55%);
  pointer-events: none;
}

.home-hero > .container {
  position: relative;
  z-index: 1;
}

.home-hero .hero-logo {
  height: 64px;
  width: 64px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  padding: 10px;
  background: var(--light);
  border: 1px solid var(--gray-400);
  box-shadow: var(--shadow-sm);
}

.home-title {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: clamp(1.75rem, 2.6vw, 2.75rem);
  margin-bottom: 0.75rem;
}

.home-subtitle {
  color: var(--gray-800);
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  max-width: 56ch;
  margin-bottom: 1.25rem;
}

.home-badges .badge {
  border: 1px solid var(--gray-400);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.home-search-card {
  border: 1px solid var(--gray-400);
  box-shadow: var(--shadow-md);
}

.home-search-card .form-label {
  font-weight: 600;
  color: var(--gray-900);
}

.home-search-card .btn {
  width: 100%;
}

.home-section {
  margin-top: clamp(2.25rem, 4vw, 3.5rem);
}

.section-heading {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.section-subheading {
  color: var(--gray-700);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.home-feature-card {
  border: 1px solid var(--gray-400) !important;
}

.home-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary-dark);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-weight: 800;
}

/* ===== HOME: SERVICES ===== */
.service-card {
  height: 260px;
  border: 1px solid var(--gray-400) !important;
}

.service-card .card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-details-preview {
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
  max-height: 4.8em; /* ~3 lines */
  overflow: hidden;
}

.service-title {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.service-showmore-btn {
  border-radius: var(--radius-full) !important;
}

.service-modal-body {
  max-height: 65vh;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .home-hero .hero-logo {
    height: 56px;
    width: 56px;
  }
  .home-search-card .btn {
    width: 100%;
  }
  .service-card {
    height: auto;
  }
}

/* Mobile UX improvements */
img, svg {
  max-width: 100%;
  height: auto;
}

/* Prevent iOS Safari from zooming inputs on focus (requires 16px font-size) */
@media (max-width: 576px) {
  input, select, textarea, button {
    font-size: 16px !important;
  }

  main.container {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
}

/* Smooth horizontal scrolling for tables on mobile */
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* ===== ACCESSIBILITY ===== */
*:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ===== LOADING STATES ===== */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

/* ===== SPECIAL EFFECTS ===== */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.shadow-glow {
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

/* ===== FORM SPECIFIC ===== */
.form-control:invalid {
  border-color: var(--danger) !important;
}

.form-control:valid {
  border-color: var(--success) !important;
}

/* ===== HOVER EFFECTS ===== */
.hover-lift {
  transition: transform var(--transition);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

/* ===== BORDER ANIMATIONS ===== */
.animated-border {
  position: relative;
  overflow: hidden;
}

.animated-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: shimmer 3s infinite;
}

/* ===== CLIENT STATUS INDICATORS ===== */
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-right: 0.5rem;
}

.status-indicator.done {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.status-indicator.pending {
  background: var(--warning);
  animation: pulse 2s infinite;
}

/* ===== SEARCH FORM ENHANCEMENT ===== */
form.d-grid.gap-2.d-sm-flex {
  gap: 0.75rem !important;
}

form .form-control {
  min-height: 48px;
}

form .btn-primary {
  min-height: 48px;
  white-space: nowrap;
}
/* ===== ADMIN PANEL STYLES ===== */

/* Admin body override - when inside admin layout */
body.admin-body {
  overflow: hidden;
}

/* Admin cards consistent style */
.admin-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}

.admin-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fafbfc;
}

.admin-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-card-body {
  padding: 1.25rem;
}

/* Admin stat cards */
.admin-stat-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.admin-stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.admin-stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.admin-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

.admin-stat-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.2rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Admin tables */
.admin-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.admin-table thead th {
  background: #f8fafc;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 0.875rem;
  vertical-align: middle;
}

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

.admin-table tbody tr:hover td {
  background: #fafbff;
}

/* Admin buttons */
.btn-admin-primary {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.4rem;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.btn-admin-primary:hover {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn-admin-secondary {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 0.4rem;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}
.btn-admin-secondary:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.btn-admin-danger {
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 0.4rem;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}
.btn-admin-danger:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}


/* ══════════════════════════════════════════════════════════════════════
   Sticky Horizontal Scrollbar (shs)
   ----------------------------------------------------------------------
   Wide tables scroll left↔right, but the browser puts that scrollbar at
   the *bottom of the table*. On a 100-row table you had to scroll all the
   way down, drag right, then scroll back up. This floats a proxy
   scrollbar pinned to the bottom of the viewport, so the table can be
   scrolled sideways from anywhere on the page.

   Driven by static/js/sticky-hscroll.js — it only appears while the
   table's own scrollbar is off-screen, and disappears otherwise.
   ══════════════════════════════════════════════════════════════════════ */

.shs-bar {
  position: fixed;
  bottom: 0;
  height: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  z-index: 1035;
  background: rgba(241, 245, 249, 0.97);
  border-top: 1px solid #cbd5e1;
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.10);
  display: none;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: #64748b #e2e8f0;
  /* never let it swallow a click meant for the page behind it */
  -webkit-overflow-scrolling: touch;
}

.shs-bar.shs-visible { display: block; }

.shs-bar > .shs-inner {
  height: 1px;
}

/* Force the scrollbar to stay painted — macOS/iOS overlay scrollbars
   otherwise fade out and the whole point is lost. */
.shs-bar::-webkit-scrollbar {
  height: 14px;
  -webkit-appearance: none;
  background: #e2e8f0;
}
.shs-bar::-webkit-scrollbar-thumb {
  background: #64748b;
  border-radius: 8px;
  border: 3px solid #e2e8f0;
}
.shs-bar::-webkit-scrollbar-thumb:hover { background: #475569; }
.shs-bar::-webkit-scrollbar-track {
  background: #e2e8f0;
}

/* Keep the last table rows clear of the floating bar */
body.shs-active { padding-bottom: 16px; }

@media print {
  .shs-bar { display: none !important; }
  body.shs-active { padding-bottom: 0; }
}
