/* ============================================================
   Console UI — design system
   ============================================================ */

/* --- Cloak (prevent FOUC for Alpine.js) --- */
[x-cloak] { display: none !important; }

/* --- Base typography & rendering --- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* --- Smooth transitions for dark mode (targeted, not wildcard) --- */
html.dark body,
html.dark .content-card,
html.dark .sidebar-panel,
html.dark .topbar-blur,
html.dark .auth-card,
html.dark .modal-panel,
html.dark .glass-card,
html.dark .badge,
html.dark .btn-secondary,
html.dark .search-trigger,
html.dark .table-modern,
html.dark .stat-card,
html.dark .interactive-card,
html.dark .input-modern,
html.dark .dark\:bg-gray-800,
html.dark .dark\:bg-gray-900,
html.dark .dark\:bg-gray-700,
html.dark main {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.1s ease;
}

/* --- Selection color --- */
::selection {
  background-color: #b8e0ff;
  color: #134e4a;
}
.dark ::selection {
  background-color: #0d9488;
  color: #ccfbf1;
}

/* --- Custom scrollbar --- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.dark ::-webkit-scrollbar-thumb { background: #374151; }
.dark ::-webkit-scrollbar-thumb:hover { background: #4b5563; }
* { scrollbar-width: thin; scrollbar-color: #d1d5db transparent; }
.dark * { scrollbar-color: #374151 transparent; }

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* Spinner */
@keyframes gh-spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid #e5e7eb;
  border-top-color: #14b8a6;
  border-radius: 50%;
  animation: gh-spin 0.6s linear infinite;
  display: inline-block;
}
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
.dark .spinner { border-color: #374151; border-top-color: #2dd4bf; }

/* Pulse dot (running status) */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.status-dot-pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Progress bar (indeterminate) */
@keyframes progress-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.progress-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 9999; overflow: hidden;
  background: transparent;
  pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
}
.progress-bar.active { opacity: 1; }
.progress-bar::after {
  content: '';
  display: block;
  width: 25%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #14b8a6, #2dd4bf, transparent);
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}

/* Skeleton loading shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}
.dark .skeleton {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
}

/* Smooth page entrance */
@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
main {
  animation: page-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fade in utility */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-fadeIn { animation: fadeIn 0.3s ease-out; }

/* Slide up utility */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-slideUp { animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

/* Float animation for decorative elements */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}
.animate-float { animation: float 4s ease-in-out infinite; }

/* Logo pulse */
@keyframes logo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20,184,166, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(20,184,166, 0); }
}
.logo-animated {
  animation: logo-pulse 3s ease-in-out infinite;
}

/* Gradient shimmer for premium elements */
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.gradient-animated {
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed; top: 1rem; right: 1rem;
  z-index: 9998;
  display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none;
  max-width: 400px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(100%) scale(0.95); }
}
.toast {
  pointer-events: auto;
  padding: 0.75rem 1rem;
  border-radius: 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.toast.removing { animation: toast-out 0.25s ease-in forwards; }

.toast-success { background: rgba(240, 253, 244, 0.95); color: #166534; border-color: #bbf7d0; }
.toast-error   { background: rgba(254, 242, 242, 0.95); color: #991b1b; border-color: #fecaca; }
.toast-warning { background: rgba(255, 251, 235, 0.95); color: #92400e; border-color: #fde68a; }
.toast-info    { background: rgba(239, 246, 255, 0.95); color: #1e40af; border-color: #bfdbfe; }

.dark .toast-success { background: rgba(5, 46, 22, 0.95); color: #86efac; border-color: #166534; }
.dark .toast-error   { background: rgba(69, 10, 10, 0.95); color: #fca5a5; border-color: #991b1b; }
.dark .toast-warning { background: rgba(69, 26, 3, 0.95); color: #fde68a; border-color: #92400e; }
.dark .toast-info    { background: rgba(23, 37, 84, 0.95); color: #93c5fd; border-color: #1e40af; }

.toast-close {
  background: none; border: none; cursor: pointer;
  opacity: 0.5; font-size: 1.1rem; line-height: 1;
  margin-left: auto; padding: 0 0.25rem;
  transition: opacity 0.15s;
}
.toast-close:hover { opacity: 1; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem; font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.01em;
}
.badge-running { background: #dcfce7; color: #166534; }
.badge-stopped { background: #f3f4f6; color: #4b5563; }
.badge-error   { background: #fef2f2; color: #991b1b; }
.badge-frozen  { background: #eff6ff; color: #1e40af; }

.dark .badge-running { background: #052e16; color: #86efac; }
.dark .badge-stopped { background: #27272a; color: #9ca3af; }
.dark .badge-error   { background: #450a0a; color: #fca5a5; }
.dark .badge-frozen  { background: #172554; color: #93c5fd; }

/* ============================================================
   CARDS & PANELS
   ============================================================ */

/* Content card */
.content-card {
  background: white;
  border-radius: 1rem;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.03),
    0 2px 4px rgba(0,0,0,0.02),
    0 4px 8px rgba(0,0,0,0.01);
}
.dark .content-card {
  background: #1e1e22;
  border-color: rgba(255,255,255,0.09);
  box-shadow: none;
}

/* Interactive card hover */
.interactive-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}
.interactive-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 6px rgba(0,0,0,0.04),
    0 10px 24px rgba(0,0,0,0.06),
    0 20px 48px rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.1);
}
.dark .interactive-card:hover {
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.1);
}

/* Glass card variant */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px) saturate(1.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 1rem;
}
.dark .glass-card {
  background: rgba(31, 41, 55, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Card with gradient border effect */
.card-gradient-border {
  position: relative;
  background: white;
  border-radius: 1rem;
  border: 1px solid transparent;
}
.card-gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(13,148,136,0.2), rgba(139,92,246,0.2), rgba(6,182,212,0.2));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card-gradient-border:hover::before {
  opacity: 1;
}

/* Sidebar panel */
.sidebar-panel {
  background: #fbfbfd;
  border-right: 1px solid rgba(0,0,0,0.06);
}
.dark .sidebar-panel {
  background: #131316;
  border-right: 1px solid rgba(255,255,255,0.08);
}

/* Topbar blur */
.topbar-blur {
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  background: rgba(255, 255, 255, 0.82);
}
.dark .topbar-blur {
  background: rgba(24, 24, 27, 0.82);
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  position: relative;
  overflow: hidden;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

/* Sidebar link active indicator */
.sidebar-link {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 0;
  background: linear-gradient(180deg, #14b8a6, #0d9488);
  border-radius: 0 3px 3px 0;
  transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-link.active::before {
  height: 60%;
}

/* Sidebar nav badge (count) */
.sidebar-badge {
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 0 0.3rem;
  background: rgba(20,184,166, 0.1);
  color: #14b8a6;
}
.dark .sidebar-badge {
  background: rgba(83, 177, 255, 0.15);
  color: #2dd4bf;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-modern tbody tr {
  transition: background-color 0.1s ease;
}
.table-modern tbody tr:hover {
  background-color: rgba(0,0,0,0.015);
}
.dark .table-modern tbody tr:hover {
  background-color: rgba(255,255,255,0.02);
}
.table-modern thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: inherit;
}

/* ============================================================
   DETAIL LIST
   ============================================================ */
.detail-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.detail-list > div:last-child { border-bottom: none; }
.dark .detail-list > div {
  border-bottom-color: rgba(255,255,255,0.04);
}

/* ============================================================
   BUTTONS
   ============================================================ */

/* Gradient button */
.btn-gradient {
  background: #14b8a6;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.btn-gradient:hover { background: #0d9488; transform: translateY(-1px); }
.btn-gradient:active { transform: translateY(0); }
.btn-gradient:focus-visible { outline: 2px solid #14b8a6; outline-offset: 2px; }
.btn-gradient:hover {
  box-shadow: 0 6px 20px rgba(20,184,166, 0.35), inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.btn-gradient:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(20,184,166, 0.2);
  filter: brightness(0.98);
}
.btn-gradient:focus-visible {
  outline: none;
  box-shadow: 0 2px 8px rgba(20,184,166, 0.3), 0 0 0 3px rgba(20,184,166, 0.3);
}

/* Secondary button (outlined) */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.75rem;
  border: 1px solid rgba(0,0,0,0.12);
  background: white;
  color: #374151;
  transition: all 0.15s ease;
}
.btn-secondary:hover {
  background: #f9fafb;
  border-color: rgba(0,0,0,0.18);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.dark .btn-secondary {
  background: #27272a;
  border-color: rgba(255,255,255,0.12);
  color: #d1d5db;
}
.dark .btn-secondary:hover {
  background: #374151;
  border-color: rgba(255,255,255,0.18);
}

/* Danger button */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.75rem;
  background: #ef4444;
  color: white;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}
.btn-danger:active {
  transform: translateY(0);
}

/* Action button */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.625rem;
  transition: all 0.15s ease;
}
.action-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px white, 0 0 0 4px #14b8a6;
}
.dark .action-btn:focus-visible {
  box-shadow: 0 0 0 2px #27272a, 0 0 0 4px #2dd4bf;
}

/* Button loading state */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: gh-spin 0.6s linear infinite;
}

/* Icon-only button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem; height: 2rem;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  color: #6b7280;
}
.btn-icon:hover {
  background: rgba(0,0,0,0.05);
  color: #374151;
}
.dark .btn-icon:hover {
  background: rgba(255,255,255,0.08);
  color: #d1d5db;
}

/* ============================================================
   FORM INPUTS
   ============================================================ */
.input-modern {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.input-modern:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.15);
  background-color: white;
}
.dark .input-modern:focus {
  box-shadow: 0 0 0 3px rgba(20,184,166, 0.15);
  background-color: #18181b;
}

/* Input with left icon */
.input-icon-left {
  padding-left: 2.5rem;
}
.input-icon-wrapper {
  position: relative;
}
.input-icon-wrapper > svg,
.input-icon-wrapper > i {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #9ca3af;
}

/* Checkbox / radio modernization */
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
  transition: all 0.15s ease;
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px white, 0 0 0 4px #14b8a6;
}

/* Select dropdown */
select.input-modern {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* Search input (cmd+k style) */
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
  font-size: 0.8125rem;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 200px;
}
.search-trigger:hover {
  border-color: rgba(0,0,0,0.15);
  background: rgba(0,0,0,0.03);
  color: #6b7280;
}
.dark .search-trigger {
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.dark .search-trigger:hover {
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
}

/* Keyboard shortcut badge */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  font-family: inherit;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 0.25rem;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
  color: #9ca3af;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
.dark kbd {
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #6b7280;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9990;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; }

.modal-panel {
  background: white; border-radius: 1.25rem;
  padding: 1.5rem; max-width: 28rem; width: 90%;
  box-shadow: 0 25px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
  transform: scale(0.95) translateY(10px); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-panel { transform: scale(1) translateY(0); }

.dark .modal-panel {
  background: #27272a;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-bg {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(20,184,166, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
}
.dark .auth-bg {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(20,184,166, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
}

.auth-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.04),
    0 4px 6px rgba(0,0,0,0.04),
    0 24px 68px rgba(0,0,0,0.08);
}
.dark .auth-card {
  background: rgba(31, 41, 55, 0.85);
  border-color: rgba(75, 85, 99, 0.5);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.1),
    0 4px 6px rgba(0,0,0,0.1),
    0 24px 68px rgba(0,0,0,0.3);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* Empty state illustrations */
.empty-state-icon {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border-radius: 1.5rem;
  padding: 1.5rem;
  display: inline-flex;
}
.dark .empty-state-icon {
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(16,185,129,0.1));
}

/* Gradient text */
.text-gradient {
  background: linear-gradient(135deg, #14b8a6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 1.25rem;
}
.dark .section-header {
  border-bottom-color: rgba(255,255,255,0.05);
}

/* Dot separator */
.dot-sep::before {
  content: '\00b7';
  margin: 0 0.375rem;
  opacity: 0.4;
}

/* Truncate with ellipsis */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Divider with text */
.divider-text {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 500;
}
.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.06);
}
.dark .divider-text::before,
.dark .divider-text::after {
  background: rgba(255,255,255,0.06);
}

/* ============================================================
   HTMX LOADING INDICATOR
   ============================================================ */
.htmx-indicator {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* Subtle loading overlay for htmx swaps */
[hx-get].htmx-swapping,
[hx-post].htmx-swapping {
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

/* ============================================================
   MOBILE SIDEBAR OVERLAY
   ============================================================ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   TERMINAL
   ============================================================ */
.terminal-fullscreen {
  position: fixed !important; inset: 0; z-index: 9999;
  border-radius: 0 !important;
}
.terminal-fullscreen #terminal-container {
  height: 100vh !important;
}

/* ============================================================
   FOCUS RING SYSTEM
   ============================================================ */
:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}
.dark :focus-visible {
  outline-color: #2dd4bf;
}

/* Remove default outline for non-keyboard focus */
:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   DIALOGS & NATIVE MODALS
   ============================================================ */
dialog {
  border: none;
  padding: 0;
  background: transparent;
}
dialog::backdrop {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
dialog[open] {
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   NUMBER INPUT SPINNERS
   ============================================================ */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.5;
  cursor: pointer;
}
input[type="number"]:hover::-webkit-inner-spin-button,
input[type="number"]:hover::-webkit-outer-spin-button {
  opacity: 1;
}

/* ============================================================
   TABLE ENHANCEMENTS
   ============================================================ */
.table-modern tbody tr:nth-child(even) {
  background-color: rgba(0,0,0,0.008);
}
.dark .table-modern tbody tr:nth-child(even) {
  background-color: rgba(255,255,255,0.008);
}

/* ============================================================
   LINK HOVER UNDERLINE ANIMATION
   ============================================================ */
.link-animated {
  position: relative;
  display: inline-block;
}
.link-animated::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: currentColor;
  transition: width 0.2s ease;
}
.link-animated:hover::after {
  width: 100%;
}

/* ============================================================
   TOOLTIP (CSS-only)
   ============================================================ */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  padding: 0.375rem 0.625rem;
  background: #27272a;
  color: #f9fafb;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.dark [data-tooltip]::after {
  background: #e5e7eb;
  color: #27272a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
}
.breadcrumb-item {
  color: #9ca3af;
  transition: color 0.15s ease;
}
.breadcrumb-item:hover {
  color: #6b7280;
}
.dark .breadcrumb-item:hover {
  color: #d1d5db;
}
.breadcrumb-sep {
  color: #d1d5db;
  margin: 0 0.125rem;
}
.dark .breadcrumb-sep {
  color: #4b5563;
}
.breadcrumb-current {
  color: #18181b;
  font-weight: 600;
}
.dark .breadcrumb-current {
  color: #f3f4f6;
}

/* ============================================================
   STEPPED LIST (e.g. MFA setup steps)
   ============================================================ */
.step-number {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  background: #14b8a6;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(20,184,166, 0.25);
}

/* ============================================================
   GRADIENT TEXT BADGE
   ============================================================ */
.badge-gradient {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, rgba(13,148,136,0.1), rgba(139,92,246,0.1));
  color: #14b8a6;
  border: 1px solid rgba(13,148,136,0.15);
}
.dark .badge-gradient {
  background: linear-gradient(135deg, rgba(83,177,255,0.1), rgba(167,139,250,0.1));
  color: #2dd4bf;
  border-color: rgba(83,177,255,0.15);
}

/* ============================================================
   QUOTA WARNING BAR
   ============================================================ */
.progress-warn { background: linear-gradient(90deg, #f59e0b, #ef4444) !important; }
.progress-ok { background: linear-gradient(90deg, #10b981, #34d399) !important; }

/* ============================================================
   PLAN CARD HIGHLIGHT
   ============================================================ */
.plan-card-popular {
  position: relative;
}
.plan-card-popular::before {
  content: 'Most popular';
  position: absolute;
  top: -0.625rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.125rem 0.75rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, rgba(107,104,227,0.08), rgba(139,92,246,0.05));
  color: white;
  border-radius: 9999px;
  white-space: nowrap;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  aside, header, .toast-container, .progress-bar, .sidebar-overlay { display: none !important; }
  main { padding: 0 !important; }
  .content-card { box-shadow: none !important; border: 1px solid #e5e7eb !important; }
}

/* ============================================================
   MICRO-INTERACTIONS & POLISH
   ============================================================ */

/* 1. Stat card hover lift */
.stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}
.dark .stat-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
}

/* 2. Table row selection indicator */
.table-modern tbody tr {
  border-left: 3px solid transparent;
}
.table-modern tbody tr:hover {
  border-left-color: #14b8a6;
}
.dark .table-modern tbody tr:hover {
  border-left-color: #2dd4bf;
}

/* 3. Badge pulse animation */
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}
.badge-pulse {
  animation: badge-pulse 2s ease-in-out infinite;
}

/* 4. Input focus glow (enhanced) */
.input-modern:focus {
  box-shadow: 0 0 0 3px rgba(20,184,166, 0.10);
}
.dark .input-modern:focus {
  box-shadow: 0 0 0 3px rgba(83, 177, 255, 0.15);
}

/* 5. Interactive card gradient border on hover */
.interactive-card {
  border: 1px solid transparent;
  background-clip: padding-box;
}
.interactive-card:hover {
  border-color: rgba(20,184,166, 0.15);
}
.dark .interactive-card:hover {
  border-color: rgba(83, 177, 255, 0.12);
}

/* 6. Page enter animation class */
.page-enter {
  animation: page-enter 0.3s ease-out both;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar-desktop-only {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar-desktop-only.mobile-open {
    transform: translateX(0);
  }
}

/* --- RTL support --- */
[dir="rtl"] .sidebar-panel {
  left: auto;
  right: 0;
}
[dir="rtl"] .sidebar-desktop-only {
  margin-left: 0;
  margin-right: 16rem;
}
[dir="rtl"] .breadcrumb-sep {
  transform: scaleX(-1);
}
[dir="rtl"] .ml-auto {
  margin-left: 0;
  margin-right: auto;
}
[dir="rtl"] .mr-auto {
  margin-right: 0;
  margin-left: auto;
}
[dir="rtl"] .pl-6 {
  padding-left: 0;
  padding-right: 1.5rem;
}
[dir="rtl"] .pr-6 {
  padding-right: 0;
  padding-left: 1.5rem;
}
[dir="rtl"] .left-0 { left: auto; right: 0; }
[dir="rtl"] .right-0 { right: auto; left: 0; }
[dir="rtl"] .text-left { text-align: right; }
[dir="rtl"] .text-right { text-align: left; }
[dir="rtl"] .rounded-l-lg { border-radius: 0 0.5rem 0.5rem 0; }
[dir="rtl"] .rounded-r-lg { border-radius: 0.5rem 0 0 0.5rem; }
[dir="rtl"] .border-l { border-left: 0; border-right-width: 1px; }
[dir="rtl"] .border-r { border-right: 0; border-left-width: 1px; }
[dir="rtl"] .sidebar-desktop-only.mobile-open {
  transform: translateX(100%);
}

/* --- Status pill: dot + muted text (Linear-style, replaces loud badges) --- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 11px;
  font-weight: 500;
  color: var(--pill-fg, #4b5563);
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: transparent;
}
html.dark .status-pill { color: #9ca3af; }
.status-pill::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--pill-dot, #9ca3af);
  flex-shrink: 0;
}
.status-pill.is-ok      { --pill-dot: #22c55e; --pill-fg: #15803d; }
.status-pill.is-warn    { --pill-dot: #eab308; --pill-fg: #a16207; }
.status-pill.is-error   { --pill-dot: #ef4444; --pill-fg: #b91c1c; }
.status-pill.is-info    { --pill-dot: #14b8a6; --pill-fg: #0d9488; }
.status-pill.is-muted   { --pill-dot: #9ca3af; }
html.dark .status-pill.is-ok    { --pill-fg: #4ade80; }
html.dark .status-pill.is-warn  { --pill-fg: #facc15; }
html.dark .status-pill.is-error { --pill-fg: #f87171; }
html.dark .status-pill.is-info  { --pill-fg: #2dd4bf; }

/* --- Dashboard stat cards (Linear-style: quiet, high-contrast) --- */
.stat-card {
  position: relative;
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;               /* gray-700 */
  letter-spacing: 0.01em;
}
html.dark .stat-label { color: #d1d5db; }  /* gray-300 */
.stat-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #18181b;               /* gray-900 */
}
html.dark .stat-value { color: #ffffff; }
.stat-unit {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;               /* gray-500 */
}
html.dark .stat-unit { color: #9ca3af; }
.stat-meta {
  font-size: 12px;
  color: #6b7280;               /* gray-500 — readable, not washed out */
}
html.dark .stat-meta { color: #9ca3af; }
.stat-track {
  background: #e5e7eb;          /* gray-200 — visible on white */
  border-radius: 9999px;
  height: 6px;
}
html.dark .stat-track { background: #374151; }  /* gray-700 */
.stat-fill {
  height: 6px;
  border-radius: 9999px;
  background: #14b8a6;          /* brand-500 */
  transition: width 0.4s ease;
}
.stat-fill.is-warn { background: #f59e0b; }
.stat-fill.is-crit { background: #ef4444; }
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff8ff;          /* brand-50 */
}
html.dark .stat-icon { background: rgba(0, 153, 255, 0.12); }
.stat-icon svg { color: #14b8a6; width: 18px; height: 18px; }
html.dark .stat-icon svg { color: #2dd4bf; }

/* table header contrast */
.table-modern thead th {
  color: #4b5563;               /* gray-600 */
}
html.dark .table-modern thead th { color: #d1d5db; }

/* --- Critical dark-mode utilities (Tailwind JIT fails to emit these in Docker) --- */
html.dark .dark\:text-gray-100 { color: #f3f4f6; }
html.dark .dark\:text-gray-200 { color: #e5e7eb; }
html.dark .dark\:text-gray-300 { color: #d1d5db; }
html.dark .dark\:text-gray-400 { color: #9ca3af; }
html.dark .dark\:text-gray-500 { color: #6b7280; }
html.dark .dark\:text-gray-600 { color: #4b5563; }
html.dark .dark\:text-white { color: #ffffff; }
html.dark .dark\:bg-gray-900 { background-color: #18181b; }
html.dark .dark\:bg-gray-800 { background-color: #27272a; }
html.dark .dark\:bg-gray-700 { background-color: #374151; }
html.dark .dark\:bg-gray-700\/50 { background-color: rgba(55, 65, 81, 0.5); }
html.dark .dark\:bg-gray-800\/80 { background-color: rgba(31, 41, 55, 0.8); }
html.dark .dark\:bg-brand-900\/20 { background-color: rgba(0, 68, 153, 0.2); }
html.dark .dark\:bg-brand-900\/10 { background-color: rgba(0, 68, 153, 0.1); }
html.dark .dark\:text-brand-300 { color: #78ccff; }
html.dark .dark\:text-brand-400 { color: #2dd4bf; }
html.dark .dark\:border-gray-700 { border-color: #374151; }
html.dark .dark\:border-gray-700\/50 { border-color: rgba(55, 65, 81, 0.5); }
html.dark .dark\:border-gray-800 { border-color: #27272a; }
html.dark .dark\:hover\:bg-gray-700\/50:hover { background-color: rgba(55, 65, 81, 0.5); }
html.dark .dark\:hover\:text-white:hover { color: #ffffff; }
html.dark .dark\:divide-gray-700\/40 > * + * { border-color: rgba(55, 65, 81, 0.4); }
html.dark .dark\:hover\:bg-gray-800:hover { background-color: #27272a; }
html.dark .dark\:hover\:text-gray-200:hover { color: #e5e7eb; }

/* CSS-VERSION-MARKER: veloxahost-blue-2026-09-04 */

/* ============================================================
   SKELETON LOADING PLACEHOLDERS
   ============================================================ */
.skeleton {
  border-radius: 0.75rem;
  background: #e4e4e7;
  background-image: linear-gradient(90deg, #e4e4e7 25%, #f4f4f5 37%, #e4e4e7 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.3s ease infinite;
}
.dark .skeleton {
  background: #27272a;
  background-image: linear-gradient(90deg, #27272a 25%, #3f3f46 37%, #27272a 63%);
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ============================================================
   LAYOUT BALANCE + ACCESSIBILITY
   ============================================================ */
/* Consistent, visible keyboard focus everywhere */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
  border-radius: 0.5rem;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   TYPOGRAPHY LEGIBILITY PASS
   - Bump the small-text scale (10-13px was too small)
   - Raise dark-mode contrast for secondary text
   ============================================================ */
.text-\[10px\] { font-size: 0.72rem !important; }   /* 11.5px */
.text-\[11px\] { font-size: 0.78rem !important; }   /* 12.5px */
.text-\[12px\] { font-size: 0.84rem !important; }   /* 13.5px */
.text-\[13px\] { font-size: 0.9rem !important; }    /* 14.4px */
.text-\[14px\] { font-size: 0.95rem !important; }
.text-\[15px\] { font-size: 1rem !important; }      /* 16px */
.text-xs { font-size: 0.8125rem !important; }       /* 13px */
.text-sm { font-size: 0.9375rem !important; }       /* 15px */
body { font-size: 0.9375rem; }

/* Dark mode: secondary text lifted from ~#71717a to readable grays */
.dark .text-gray-400 { color: #b8b8c0 !important; }
.dark .text-gray-500 { color: #a6a6ae !important; }
.dark .text-gray-600 { color: #9a9aa2 !important; }
.dark .text-gray-300 { color: #c9c9cf !important; }
/* Keep placeholders softer but visible */
.dark .placeholder\:text-gray-400::placeholder,
.dark .placeholder\:text-gray-500::placeholder { color: #8f8f98 !important; }
