/* ISP2Go Custom Styles - Modern Anthropic Design System */

:root {
  --sidebar-width: 240px;
  --header-height: 56px;

  /* Modern Anthropic-inspired palette - muted & sophisticated */
  --primary: #18181b;
  --primary-hover: #09090b;
  --accent: #a1a1aa;
  --accent-hover: #71717a;
  --secondary: #71717a;
  --success: #52525b;
  --warning: #a1a1aa;
  --danger: #71717a;
  --info: #a1a1aa;

  /* Backgrounds - subtle warm grays */
  --bg-page: #fafafa;
  --bg-card: #ffffff;
  --bg-muted: #f4f4f5;
  --bg-subtle: #fafafa;
  --bg-hover: #f4f4f5;
  --bg-cream: #faf9f7;

  /* Text - high contrast hierarchy */
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --text-placeholder: #d4d4d8;

  /* Borders - barely visible */
  --border-subtle: #f4f4f5;
  --border-light: #e4e4e7;
  --border-default: #d4d4d8;

  /* Shadows - ultra subtle */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.06);

  /* Transitions */
  --transition-fast: 0.1s ease;
  --transition-base: 0.15s ease;

  /* Border radius - modern subtle curves */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

/* ========================================
   Global Reset & Base
   ======================================== */
body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Button System - Clean & Minimal
   ======================================== */
.btn {
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
  box-shadow: none;
}

.btn-primary:active {
  background: #000000 !important;
  border-color: #000000 !important;
  transform: scale(0.98);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

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

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

.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-outline-secondary {
  border-color: var(--border-light);
  color: var(--text-secondary);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--bg-muted);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.btn-success {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

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

.btn-danger {
  background: transparent;
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.btn-danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.btn-info {
  background: transparent;
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.btn-info:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

.btn-link {
  color: var(--text-secondary);
  text-decoration: none;
}

.btn-link:hover {
  color: var(--text-primary);
}

/* Ghost button for icon-only actions */
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.375rem;
}

.btn-ghost:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

/* ========================================
   Navbar - Minimal & Clean
   ======================================== */
.navbar {
  background: var(--bg-card) !important;
  border-bottom: 1px solid var(--border-light) !important;
  height: var(--header-height);
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.navbar .dropdown-menu {
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 0.375rem;
  min-width: 180px;
}

.navbar .dropdown-item {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.navbar .dropdown-item:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.navbar .dropdown-item i {
  opacity: 0.6;
}

.navbar .dropdown-item.text-danger {
  color: #b91c1c !important;
}

.navbar .dropdown-item.text-danger:hover {
  background: #fef2f2;
}

.dropdown-divider {
  margin: 0.375rem 0;
  border-color: var(--border-light);
}

/* ========================================
   Alert Banner
   ======================================== */
.alert-banner {
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-light);
  padding: 8px 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ========================================
   Sidebar - Clean Navigation
   ======================================== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  flex-shrink: 0;
  min-height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  overflow-x: visible;
  transition: width 0.2s ease, min-width 0.2s ease;
  background: var(--bg-card);
  border-right: 1px solid var(--border-light);
}

.sidebar-content {
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-section {
  padding: 1.25rem 1rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  margin: 0 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 450;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
  border-left: none;
}

.sidebar-item:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--bg-muted);
  color: var(--text-primary);
  font-weight: 500;
}

.sidebar-item i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  opacity: 0.7;
}

.sidebar-item.active i {
  opacity: 1;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  left: calc(var(--sidebar-width) - 12px);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  transition: left 0.2s ease, all var(--transition-fast);
  z-index: 1050;
  box-shadow: var(--shadow-sm);
}

.sidebar.collapsed ~ .sidebar-toggle-btn {
  left: calc(60px - 12px);
}

.sidebar-toggle-btn:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.sidebar-toggle-btn i {
  transition: transform 0.2s ease;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
  width: 60px;
  min-width: 60px;
}

.sidebar.collapsed .sidebar-content {
  padding: 0.75rem 0;
}

.sidebar.collapsed .sidebar-section {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 0.625rem;
  margin: 0.125rem 0.375rem;
}

.sidebar.collapsed .sidebar-item span,
.sidebar.collapsed .sidebar-item .submenu-arrow {
  display: none;
}

.sidebar.collapsed .sidebar-item i {
  margin: 0;
  font-size: 1.125rem;
}

.sidebar.collapsed .sidebar-submenu {
  display: none !important;
}

.sidebar.collapsed ~ .sidebar-toggle-btn i {
  transform: rotate(180deg);
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .sidebar-item {
  position: relative;
}

.sidebar.collapsed .sidebar-item::after {
  content: attr(data-title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: white;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  margin-left: 8px;
  z-index: 1000;
  font-weight: 500;
}

.sidebar.collapsed .sidebar-item:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Sidebar Submenu */
.sidebar-item.has-submenu {
  cursor: pointer;
}

.sidebar-item.has-submenu .submenu-arrow {
  margin-left: auto;
  font-size: 0.625rem;
  transition: transform 0.2s ease;
  opacity: 0.5;
}

.sidebar-item.has-submenu.expanded .submenu-arrow {
  transform: rotate(180deg);
}

.sidebar-submenu {
  display: none;
  flex-direction: column;
  overflow: hidden;
  margin: 0 0.5rem;
}

.sidebar-submenu.show {
  display: flex;
}

.sidebar-submenu-item {
  display: block;
  padding: 0.375rem 1rem 0.375rem 2.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
}

.sidebar-submenu-item:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.sidebar-submenu-item.active {
  color: var(--text-primary);
  font-weight: 500;
}

/* ========================================
   Main Content Area
   ======================================== */
.main-content {
  min-height: calc(100vh - var(--header-height));
  background: var(--bg-page);
  /* Prevent content overflow into sidebar */
  overflow-x: hidden;
  min-width: 0;
}

/* ========================================
   Page Header - Clean Typography
   ======================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
}

.page-title i {
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
  font-size: 0.8125rem;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}

.breadcrumb-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-nav a:hover {
  color: var(--text-primary);
}

/* ========================================
   Stat Cards - Modern & Subtle
   ======================================== */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  transition: all var(--transition-base);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.stat-card.success,
.stat-card.warning,
.stat-card.danger,
.stat-card.info {
  border-left: none;
}

.stat-card-title {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-card-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.stat-card-link:hover {
  color: var(--text-primary);
}

.stat-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Small Stat Cards */
.stat-card-sm {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-sm-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-card-sm-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================================
   Widget Cards - Clean Containers
   ======================================== */
.widget-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

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

.widget-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

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

/* ========================================
   DataTable Wrapper - Modern Design
   ======================================== */
.data-table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

/* DataTable Header */
.dt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

.dt-page-size {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dt-page-size select {
  width: auto;
  min-width: 60px;
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
}

.dt-filters {
  display: flex;
  gap: 0.375rem;
}

.dt-filters select {
  min-width: 100px;
  font-size: 0.75rem;
  padding: 0.375rem 0.5rem;
}

.dt-bulk-actions {
  min-width: 100px;
}

.dt-search {
  position: relative;
}

.dt-search input {
  width: 180px;
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  font-size: 0.8125rem;
  background: var(--bg-muted);
  border-color: transparent;
}

.dt-search input:focus {
  background: var(--bg-card);
  border-color: var(--border-default);
}

.dt-search i {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.75rem;
  pointer-events: none;
}

/* DataTable Footer/Pagination */
.dt-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dt-footer-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dt-footer-info strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.dt-pagination {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.dt-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 0.375rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dt-page-btn:hover:not(:disabled) {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.dt-page-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.dt-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dt-page-btn i {
  font-size: 0.625rem;
}

.dt-page-ellipsis {
  padding: 0 0.25rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Sortable columns */
.dt-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.dt-sortable:hover {
  color: var(--text-primary);
}

.dt-sortable i {
  margin-left: 0.25rem;
  font-size: 0.5rem;
  opacity: 0.4;
}

.dt-sortable.active i {
  opacity: 1;
  color: var(--primary);
}

/* DataTable Actions Column */
.dt-actions {
  white-space: nowrap;
}

.dt-actions .btn {
  padding: 0.25rem 0.5rem;
  margin-right: 0.125rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
}

.dt-actions .btn:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.dt-actions .btn:last-child {
  margin-right: 0;
}

/* ========================================
   Data Table Styles
   ======================================== */
.data-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  gap: 1rem;
  flex-wrap: wrap;
}

.data-table-filters {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.data-table {
  width: 100%;
  margin: 0;
}

.data-table thead th {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
}

.data-table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.8125rem;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--bg-muted);
}

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

/* Data Table Links */
.data-table a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.data-table a:hover {
  color: var(--text-secondary);
}

/* General Link Styles */
.content-area a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link) {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.content-area a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):hover {
  color: var(--text-secondary);
}

.data-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================================
   Status Badges - Muted & Minimal
   ======================================== */
.badge-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  letter-spacing: 0.01em;
  background: var(--bg-muted);
  color: var(--text-secondary);
}

/* Status variants - all muted grays */
.badge-status.active { background: #f0fdf4; color: #166534; }
.badge-status.new { background: var(--bg-muted); color: var(--text-secondary); }
.badge-status.inactive { background: var(--bg-muted); color: var(--text-muted); }
.badge-status.blocked { background: #fef2f2; color: #991b1b; }
.badge-status.suspended { background: #fffbeb; color: #92400e; }
.badge-status.online { background: #f0fdf4; color: #166534; }
.badge-status.offline { background: var(--bg-muted); color: var(--text-muted); }
.badge-status.pending { background: #fffbeb; color: #92400e; }
.badge-status.disabled { background: var(--bg-muted); color: var(--text-muted); }
.badge-status.terminated { background: var(--bg-muted); color: var(--text-muted); }
.badge-status.open { background: #eff6ff; color: #1e40af; }
.badge-status.closed { background: var(--bg-muted); color: var(--text-muted); }
.badge-status.resolved { background: #f0fdf4; color: #166534; }
.badge-status.waiting { background: #fffbeb; color: #92400e; }
.badge-status.draft { background: var(--bg-muted); color: var(--text-muted); }
.badge-status.sent { background: #eff6ff; color: #1e40af; }
.badge-status.paid { background: #f0fdf4; color: #166534; }
.badge-status.overdue { background: #fef2f2; color: #991b1b; }
.badge-status.completed { background: #f0fdf4; color: #166534; }
.badge-status.refunded { background: var(--bg-muted); color: var(--text-muted); }
.badge-status.contacted { background: #eff6ff; color: #1e40af; }
.badge-status.qualified { background: #f0fdf4; color: #166534; }
.badge-status.proposal { background: #fdf4ff; color: #86198f; }
.badge-status.negotiation { background: #fffbeb; color: #92400e; }
.badge-status.won { background: #f0fdf4; color: #166534; }
.badge-status.lost { background: #fef2f2; color: #991b1b; }
.badge-status.converted { background: #f0fdf4; color: #166534; }

/* Priority Badges */
.badge-priority {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.badge-priority.low { background: var(--bg-muted); color: var(--text-secondary); }
.badge-priority.medium { background: #eff6ff; color: #1e40af; }
.badge-priority.high { background: #fffbeb; color: #92400e; }
.badge-priority.urgent { background: #fef2f2; color: #991b1b; }

/* ========================================
   Link Grid Section
   ======================================== */
.link-grid-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.link-grid-section.success,
.link-grid-section.warning,
.link-grid-section.info {
  border-left: none;
}

.link-grid-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 1rem 1.25rem;
  margin: 0;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  letter-spacing: -0.01em;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0;
}

.link-grid-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.link-grid-item:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.link-grid-item i {
  font-size: 0.875rem;
  width: 1.25rem;
  text-align: center;
  opacity: 0.6;
}

/* ========================================
   Avatar Components
   ======================================== */
.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 0.6875rem;
  font-weight: 500;
}

.avatar-md {
  width: 36px;
  height: 36px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 1rem;
  font-weight: 500;
}

/* ========================================
   Loading States
   ======================================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Connection Status Indicator */
.connection-status {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.connection-status.reconnecting {
  background: #fef3c7;
  color: #92400e;
  border-bottom: 1px solid #fcd34d;
}

.connection-status.warning {
  background: #fef3c7;
  color: #92400e;
  border-bottom: 1px solid #fcd34d;
}

.connection-status.error {
  background: #fee2e2;
  color: #991b1b;
  border-bottom: 1px solid #fca5a5;
}

.connection-status.fade-out {
  opacity: 0;
  transform: translateY(-100%);
}

.connection-status .btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--border-light) 50%, var(--bg-muted) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  width: 100%;
}

.skeleton-circle {
  border-radius: var(--radius-full);
}

.skeleton-rect {
  border-radius: var(--radius-md);
}

/* ========================================
   Form Styles - Clean & Modern
   ======================================== */
.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.form-control,
.form-select {
  font-size: 0.8125rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  transition: all var(--transition-fast);
  background: var(--bg-card);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.08);
  outline: none;
}

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

.form-control:disabled,
.form-select:disabled {
  background: var(--bg-muted);
  color: var(--text-muted);
}

.form-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Form Check/Switch */
.form-check-input {
  width: 1rem;
  height: 1rem;
  border: 1.5px solid var(--border-default);
  background-color: var(--bg-card);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:focus {
  box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.08);
  border-color: var(--primary);
}

/* Modern toggle switch */
.form-switch .form-check-input {
  width: 2.5rem;
  height: 1.375rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-default);
  background-color: #d4d4d8;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
  background-size: contain;
  background-position: left center;
  transition: background-color 0.2s ease, background-position 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.form-switch .form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
  background-position: right center;
}

.form-switch .form-check-input:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.1);
}

.form-check-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Shortcuts Bar */
.shortcuts-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: color var(--transition-fast);
}

.shortcut-item:hover {
  color: var(--text-primary);
}

/* ========================================
   Welcome Panel - New Tenant Empty State
   ======================================== */
.welcome-panel {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

.welcome-header {
  text-align: center;
  margin-bottom: 2rem;
}

.welcome-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--bg-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.welcome-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.welcome-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.welcome-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.welcome-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-base);
}

.welcome-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
  color: inherit;
  text-decoration: none;
  transform: translateY(-1px);
}

.welcome-card-highlight {
  border-color: var(--border-default);
  background: var(--bg-cream);
}

.welcome-card-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.welcome-card-body {
  flex: 1;
}

.welcome-card-body h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.welcome-card-body p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.welcome-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #ec4899;
  background: rgba(236, 72, 153, 0.08);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  margin-top: 0.375rem;
}

.welcome-card-arrow {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: transform var(--transition-fast);
}

.welcome-card:hover .welcome-card-arrow {
  transform: translateX(3px);
  color: var(--text-secondary);
}

.welcome-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.welcome-footer p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.welcome-footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.welcome-footer a:hover {
  color: var(--text-primary);
}

/* ========================================
   Tabs Navigation - Minimal
   ======================================== */
.nav-tabs-custom {
  border-bottom: 1px solid var(--border-light);
  gap: 0;
}

.nav-tabs-custom .nav-link {
  border: none;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 0;
  transition: all var(--transition-fast);
}

.nav-tabs-custom .nav-link:hover {
  color: var(--text-primary);
  border-color: transparent;
  background: transparent;
}

.nav-tabs-custom .nav-link.active {
  color: var(--text-primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state h5 {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.empty-state p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Action Buttons */
.btn-action {
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
}

/* --- Hamburger toggle for mobile navbar (hidden by default, shown via media query) --- */
.navbar-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  padding: 0;
  flex-shrink: 0;
}

.navbar-mobile-toggle:hover {
  background: var(--bg-muted);
}

/* ========================================
   Responsive - Sidebar
   ======================================== */
@media (max-width: 1199.98px) {
  #sidebar.sidebar {
    width: 60px !important;
    min-width: 60px;
    overflow: visible;
  }

  #sidebar .sidebar-section {
    display: none !important;
  }

  #sidebar .sidebar-item {
    justify-content: center !important;
    padding: 0.625rem !important;
    gap: 0 !important;
  }

  #sidebar .sidebar-item span,
  #sidebar .sidebar-item .submenu-arrow {
    display: none !important;
  }

  #sidebar .sidebar-item i {
    margin: 0 !important;
    font-size: 1.125rem;
  }

  #sidebar .sidebar-submenu {
    display: none !important;
  }

  .sidebar-toggle-btn {
    left: 48px !important;
  }

  .sidebar-toggle-btn i {
    transform: rotate(180deg);
  }

  #sidebar.sidebar.expanded {
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
  }

  #sidebar.expanded .sidebar-section {
    display: block !important;
  }

  #sidebar.expanded .sidebar-item {
    justify-content: flex-start !important;
    padding: 0.5rem 1rem !important;
    gap: 0.75rem !important;
  }

  #sidebar.expanded .sidebar-item span {
    display: inline !important;
  }

  #sidebar.expanded .sidebar-item i {
    font-size: 1rem;
  }

  .sidebar.expanded ~ .sidebar-toggle-btn {
    left: calc(var(--sidebar-width) - 12px) !important;
  }

  .sidebar.expanded ~ .sidebar-toggle-btn i {
    transform: rotate(0deg);
  }
}

@media (max-width: 767.98px) {
  .page-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .page-header .btn {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
  }

  .page-title {
    font-size: 1.125rem;
  }

  /* Make all data tables horizontally scrollable */
  .data-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Also catch any standalone table not in a responsive wrapper */
  .tab-pane > table,
  .card-body > table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dt-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dt-header-left,
  .dt-header-right {
    justify-content: space-between;
  }

  .dt-search input {
    width: 100%;
  }

  .dt-footer {
    flex-direction: column;
    text-align: center;
  }

  .dt-pagination {
    justify-content: center;
  }

  /* --- Mobile sidebar: fully hidden, slide-out overlay --- */
  #sidebar.sidebar {
    position: fixed !important;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    z-index: 1040;
    transition: width 0.25s ease;
    border-right: none !important;
  }

  #sidebar.sidebar.expanded {
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    overflow-y: auto !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    border-right: 1px solid var(--border-light) !important;
  }

  /* Backdrop when sidebar is open */
  #sidebar.sidebar.expanded::after {
    content: '';
    position: fixed;
    top: var(--header-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
  }

  /* Restore full sidebar content when expanded on mobile */
  #sidebar.sidebar.expanded .sidebar-section {
    display: block !important;
  }

  #sidebar.sidebar.expanded .sidebar-item {
    justify-content: flex-start !important;
    padding: 0.5rem 1rem !important;
    gap: 0.75rem !important;
  }

  #sidebar.sidebar.expanded .sidebar-item span {
    display: inline !important;
  }

  #sidebar.sidebar.expanded .sidebar-item i {
    font-size: 1rem;
  }

  /* Hide the desktop toggle circle on mobile */
  .sidebar-toggle-btn {
    display: none !important;
  }

  /* Show hamburger button on mobile */
  .navbar-mobile-toggle {
    display: inline-flex !important;
  }

  /* Compact sandbox toggle: hide label text */
  .sandbox-toggle-container .mode-label {
    display: none;
  }

  /* Compact navbar button padding */
  .navbar .btn-sm {
    padding: 0.25rem 0.5rem;
  }
}

@media (max-width: 575.98px) {
  /* Hide sandbox toggle entirely on very small screens */
  .sandbox-toggle-container {
    display: none !important;
  }

  .main-content {
    padding: 1rem !important;
  }
}

/* ========================================
   Pipeline View
   ======================================== */
.pipeline-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.pipeline-column {
  min-width: 280px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.pipeline-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pipeline-header .badge {
  font-size: 0.6875rem;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-weight: 500;
}

.pipeline-body {
  padding: 0.75rem;
  min-height: 200px;
}

.pipeline-card {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 0.875rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.pipeline-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.pipeline-card-title {
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.pipeline-card-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.pipeline-card-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Pipeline Summary */
.pipeline-summary {
  display: flex;
  gap: 1px;
  background: var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.pipeline-summary-item {
  flex: 1;
  background: var(--bg-card);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.pipeline-summary-item:hover {
  background: var(--bg-muted);
}

.pipeline-summary-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.375rem;
}

.pipeline-summary-count {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pipeline-summary-value {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ========================================
   Finance Summary Cards
   ======================================== */
.finance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.finance-summary-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 1.25rem;
  text-align: center;
}

.finance-summary-card.success,
.finance-summary-card.warning,
.finance-summary-card.danger,
.finance-summary-card.info {
  border-top: none;
}

.finance-summary-value {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.finance-summary-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.25rem;
}

/* ========================================
   View Modal Sections - Modern Card Layout
   ======================================== */
.view-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.view-modal-grid.single-col {
  grid-template-columns: 1fr;
}

.view-card {
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 8px;
  padding: 0.875rem;
  border: 1px solid var(--border-light, #e9ecef);
}

.view-card.full-width {
  grid-column: 1 / -1;
}

.view-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light, #e9ecef);
}

.view-card-header i {
  font-size: 0.875rem;
  color: var(--primary, #0d6efd);
  opacity: 0.8;
}

.view-card-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #6c757d);
  margin: 0;
}

.view-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.view-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.8125rem;
  min-height: 1.5rem;
}

.view-row-label {
  color: var(--text-muted, #6c757d);
  font-size: 0.75rem;
}

.view-row-value {
  font-weight: 500;
  color: var(--text-primary, #212529);
  text-align: right;
}

.view-service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle, #f0f0f0);
}

.view-service-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.view-service-item:first-child {
  padding-top: 0;
}

.view-service-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.view-service-name {
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-primary, #212529);
}

.view-service-login {
  font-size: 0.6875rem;
  color: var(--text-muted, #6c757d);
}

/* Legacy view-section support (backwards compatibility) */
.view-section {
  margin-bottom: 0.75rem;
}

.view-section:last-child {
  margin-bottom: 0;
}

.view-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border-light);
}

.view-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.8125rem;
}

.view-field:last-child {
  border-bottom: none;
}

.view-field-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.view-field-value {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.8125rem;
  text-align: right;
}

/* ========================================
   Equipment Icons (Networking)
   ======================================== */
.equipment-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.equipment-icon.mikrotik {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
}

.equipment-icon.cisco {
  background: linear-gradient(135deg, #049fd9 0%, #0373a0 100%);
  color: white;
}

.equipment-icon.ubiquiti {
  background: linear-gradient(135deg, #0559C9 0%, #004499 100%);
  color: white;
}

.equipment-icon.huawei {
  background: linear-gradient(135deg, #e60012 0%, #cc0010 100%);
  color: white;
}

.equipment-icon.juniper {
  background: linear-gradient(135deg, #84bc34 0%, #6a9a2a 100%);
  color: white;
}

.equipment-icon.other {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;
}

.equipment-icon-lg {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
  border-radius: var(--radius-lg);
}

/* ========================================
   Modern View Modal
   ======================================== */
.router-view-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1rem;
}

.router-view-header .equipment-icon-lg {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.router-view-info {
  flex: 1;
  min-width: 0;
}

.router-view-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.router-view-badges {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 0.375rem;
}

.router-view-ip {
  font-family: 'SF Mono', Monaco, 'Consolas', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.router-view-stats {
  text-align: right;
  flex-shrink: 0;
}

.router-view-stats .stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.router-view-stats .stat-value {
  font-size: 0.8125rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Compact info grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.info-grid-full {
  grid-template-columns: 1fr;
}

.info-card {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.info-card-header i {
  font-size: 0.875rem;
  color: var(--primary);
  width: 18px;
  text-align: center;
}

.info-card-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.info-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}

.info-row-label {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.info-row-value {
  color: var(--text-primary);
  font-weight: 500;
}

.info-row-value code {
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

/* ========================================
   Modern Form Sections
   ======================================== */
.router-form {
  max-width: 100%;
}

.form-section {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  margin-bottom: 0.75rem;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
  display: flex;
  align-items: center;
}

.form-section-title i {
  font-size: 0.875rem;
  color: var(--primary);
}

.form-label-sm {
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

/* Compact form controls */
.router-form .form-control-sm,
.router-form .form-select-sm {
  font-size: 0.8125rem;
  padding: 0.375rem 0.625rem;
}

.router-form .form-control-sm:focus,
.router-form .form-select-sm:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* ========================================
   Timeline
   ======================================== */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.375rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-light);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.125rem;
  top: 0.25rem;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--primary);
}

.timeline-item.success::before { background: #22c55e; }
.timeline-item.warning::before { background: #f59e0b; }
.timeline-item.danger::before { background: #ef4444; }

.timeline-date {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.timeline-content {
  background: var(--bg-muted);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ========================================
   Message Thread
   ======================================== */
.message-thread {
  max-height: 400px;
  overflow-y: auto;
}

.message-item {
  margin-bottom: 1rem;
}

.message-item.staff .message-bubble {
  background: #eff6ff;
  margin-left: 2rem;
}

.message-item.customer .message-bubble {
  background: var(--bg-muted);
  margin-right: 2rem;
}

.message-bubble {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.8125rem;
}

.message-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ========================================
   Pagination
   ======================================== */
.pagination .page-link {
  border: none;
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  margin: 0 2px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  transition: all var(--transition-fast);
}

.pagination .page-link:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.pagination .page-item.active .page-link {
  background: var(--primary);
  color: #ffffff;
}

.pagination .page-item.disabled .page-link {
  color: var(--text-muted);
  pointer-events: none;
}

/* ========================================
   Scrollbar - Minimal
   ======================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========================================
   Autocomplete Dropdown
   ======================================== */
.autocomplete-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
}

.autocomplete-item {
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: var(--bg-muted);
}

/* ========================================
   Upload Area
   ======================================== */
.upload-area .border-dashed {
  border-style: dashed !important;
  border-color: var(--border-default) !important;
  border-radius: var(--radius-lg);
}

.upload-area:hover .border-dashed {
  border-color: var(--primary) !important;
  background: var(--bg-muted);
}

/* ========================================
   Modal Styling - Clean & Modern
   ======================================== */
.modal-content {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  padding: 1rem 1.25rem;
}

.modal-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-title i {
  color: var(--text-muted);
  font-size: 1rem;
}

.modal-body {
  background: var(--bg-card);
  padding: 1.25rem;
}

.modal-footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
  padding: 0.875rem 1.25rem;
}

.modal-xl {
  max-width: 1140px;
}

@media (max-width: 575.98px) {
  .modal-dialog,
  .modal-xl,
  .modal-lg {
    margin: 0.25rem;
    max-width: calc(100vw - 0.5rem) !important;
  }
  .modal-body {
    overflow-x: hidden;
  }
  .splynx-form-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .splynx-form-label {
    flex: none;
    text-align: left;
    padding-right: 0;
    margin-bottom: 0.25rem;
  }
  .splynx-form-input {
    width: 100%;
  }
}

.btn-close {
  opacity: 0.4;
  transition: opacity var(--transition-fast);
}

.btn-close:hover {
  opacity: 0.7;
}

/* Invoice Items Table */
#invoiceItemsTable .form-control-sm {
  padding: 0.375rem 0.5rem;
}

#invoiceItemsTable td {
  vertical-align: middle;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .sidebar,
  .navbar,
  .modal-footer,
  .btn {
    display: none !important;
  }

  .modal-dialog {
    max-width: 100%;
    margin: 0;
  }

  .modal-content {
    border: none;
    box-shadow: none;
  }
}

/* ========================================
   Splynx-style Form Layout - Refined
   ======================================== */
.splynx-form {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
}

.splynx-form-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.875rem;
}

.splynx-form-label {
  flex: 0 0 160px;
  text-align: right;
  padding-right: 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 450;
}

.splynx-form-input {
  flex: 1;
  position: relative;
}

.splynx-form-input .form-control,
.splynx-form-input .form-select {
  font-size: 0.8125rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  height: auto;
  background: var(--bg-card);
  transition: all var(--transition-fast);
}

.splynx-form-input .form-control:focus,
.splynx-form-input .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.06);
}

/* Input with button */
.splynx-input-group {
  display: flex;
  align-items: stretch;
}

.splynx-input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.splynx-input-group .btn-generate {
  border: 1px solid var(--border-default);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--bg-muted);
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.splynx-input-group .btn-generate:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Splynx modal footer */
.splynx-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
}

.splynx-modal-footer .btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Splynx page form */
.splynx-page-form {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  max-width: 700px;
}

.splynx-page-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.splynx-page-header .icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.splynx-page-header .title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.splynx-page-header .breadcrumb {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.splynx-page-header .breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.splynx-page-header .breadcrumb a:hover {
  color: var(--text-primary);
}

/* Splynx Section Header */
.splynx-section-header {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border-light);
  letter-spacing: -0.01em;
}

/* Splynx form wider labels */
.splynx-form .splynx-form-label {
  flex: 0 0 160px;
}

/* ========================================
   Ticket Rich Text Editor
   ======================================== */
.ticket-editor-container {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.ticket-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0.5rem;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.ticket-editor-toolbar .toolbar-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.ticket-editor-toolbar .toolbar-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ticket-editor-toolbar .toolbar-btn:active {
  background: var(--border-light);
}

.ticket-editor-toolbar .toolbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border-light);
  margin: 0 4px;
}

.ticket-editor {
  min-height: 150px;
  padding: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  outline: none;
  background: var(--bg-card);
  color: var(--text-primary);
}

.ticket-editor:focus {
  background: var(--bg-card);
}

.ticket-editor p {
  margin: 0 0 0.5rem 0;
}

.ticket-editor ul,
.ticket-editor ol {
  margin: 0 0 0.5rem 1.25rem;
  padding: 0;
}

/* Ticket Contact Panel */
.ticket-contact-panel {
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  min-height: 200px;
}

.ticket-contact-panel h6 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.ticket-contact-detail {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.ticket-contact-detail:last-child {
  border-bottom: none;
}

.ticket-contact-label {
  color: var(--text-muted);
}

.ticket-contact-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* Ticket Attachments Section */
.ticket-attachments-section {
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.ticket-attachments-section .btn-outline-secondary {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
}

/* ========================================
   Chart Cards
   ======================================== */
.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.chart-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--border-default);
}

.chart-card .card-body {
  padding: 1rem;
}

.chart-card .card-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-container {
  position: relative;
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

.chart-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.chart-period {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.chart-card-body {
  flex: 1;
  padding: 0.75rem;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-card-body canvas {
  max-height: 130px;
  width: 100% !important;
}

/* Analytics Chart Row */
#customerChartsRow .card,
#leadChartsRow .card,
#ticketChartsRow .card,
#financeChartsRow .card,
#networkChartsRow .card,
#schedulingChartsRow .card {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

#customerChartsRow .card:hover,
#leadChartsRow .card:hover,
#ticketChartsRow .card:hover,
#financeChartsRow .card:hover,
#networkChartsRow .card:hover,
#schedulingChartsRow .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--border-default);
}

/* Customer chart hover colors */
#customerChartsRow .col-md-3:nth-child(1) .card:hover { border-left: 3px solid #3b82f6; }
#customerChartsRow .col-md-3:nth-child(2) .card:hover { border-left: 3px solid #10b981; }
#customerChartsRow .col-md-3:nth-child(3) .card:hover { border-left: 3px solid #06b6d4; }
#customerChartsRow .col-md-3:nth-child(4) .card:hover { border-left: 3px solid #f59e0b; }

/* Fade-in animation for charts */
@keyframes chartFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#customerChartsRow .col-md-3:nth-child(1),
#leadChartsRow .col-md-3:nth-child(1),
#ticketChartsRow .col-md-3:nth-child(1),
#financeChartsRow .col-md-3:nth-child(1),
#networkChartsRow .col-md-3:nth-child(1),
#schedulingChartsRow .col-md-3:nth-child(1) { animation: chartFadeIn 0.5s ease-out 0.1s both; }

#customerChartsRow .col-md-3:nth-child(2),
#leadChartsRow .col-md-3:nth-child(2),
#ticketChartsRow .col-md-3:nth-child(2),
#financeChartsRow .col-md-3:nth-child(2),
#networkChartsRow .col-md-3:nth-child(2),
#schedulingChartsRow .col-md-3:nth-child(2) { animation: chartFadeIn 0.5s ease-out 0.2s both; }

#customerChartsRow .col-md-3:nth-child(3),
#leadChartsRow .col-md-3:nth-child(3),
#ticketChartsRow .col-md-3:nth-child(3),
#financeChartsRow .col-md-3:nth-child(3),
#networkChartsRow .col-md-3:nth-child(3),
#schedulingChartsRow .col-md-3:nth-child(3) { animation: chartFadeIn 0.5s ease-out 0.3s both; }

#customerChartsRow .col-md-3:nth-child(4),
#leadChartsRow .col-md-3:nth-child(4),
#ticketChartsRow .col-md-3:nth-child(4),
#financeChartsRow .col-md-3:nth-child(4),
#networkChartsRow .col-md-3:nth-child(4),
#schedulingChartsRow .col-md-3:nth-child(4) { animation: chartFadeIn 0.5s ease-out 0.4s both; }

/* Lead chart hover colors */
#leadChartsRow .col-md-3:nth-child(1) .card:hover { border-left: 3px solid #3b82f6; }
#leadChartsRow .col-md-3:nth-child(2) .card:hover { border-left: 3px solid #10b981; }
#leadChartsRow .col-md-3:nth-child(3) .card:hover { border-left: 3px solid #06b6d4; }
#leadChartsRow .col-md-3:nth-child(4) .card:hover { border-left: 3px solid #f59e0b; }

/* Ticket chart hover colors */
#ticketChartsRow .col-md-3:nth-child(1) .card:hover { border-left: 3px solid #3b82f6; }
#ticketChartsRow .col-md-3:nth-child(2) .card:hover { border-left: 3px solid #f59e0b; }
#ticketChartsRow .col-md-3:nth-child(3) .card:hover { border-left: 3px solid #10b981; }
#ticketChartsRow .col-md-3:nth-child(4) .card:hover { border-left: 3px solid #06b6d4; }

/* Finance chart hover colors */
#financeChartsRow .col-md-3:nth-child(1) .card:hover { border-left: 3px solid #059669; }
#financeChartsRow .col-md-3:nth-child(2) .card:hover { border-left: 3px solid #3b82f6; }
#financeChartsRow .col-md-3:nth-child(3) .card:hover { border-left: 3px solid #06b6d4; }
#financeChartsRow .col-md-3:nth-child(4) .card:hover { border-left: 3px solid #f59e0b; }

/* Network chart hover colors */
#networkChartsRow .col-md-3:nth-child(1) .card:hover { border-left: 3px solid #10b981; }
#networkChartsRow .col-md-3:nth-child(2) .card:hover { border-left: 3px solid #3b82f6; }
#networkChartsRow .col-md-3:nth-child(3) .card:hover { border-left: 3px solid #06b6d4; }
#networkChartsRow .col-md-3:nth-child(4) .card:hover { border-left: 3px solid #f59e0b; }

/* Scheduling chart hover colors */
#schedulingChartsRow .col-md-3:nth-child(1) .card:hover { border-left: 3px solid #3b82f6; }
#schedulingChartsRow .col-md-3:nth-child(2) .card:hover { border-left: 3px solid #10b981; }
#schedulingChartsRow .col-md-3:nth-child(3) .card:hover { border-left: 3px solid #06b6d4; }
#schedulingChartsRow .col-md-3:nth-child(4) .card:hover { border-left: 3px solid #f59e0b; }

@media (max-width: 1199.98px) {
  .chart-card-body {
    min-height: 160px;
  }
  .chart-card-body canvas {
    max-height: 150px;
  }
}

@media (max-width: 767.98px) {
  .chart-card-body {
    min-height: 180px;
  }
  .chart-card-body canvas {
    max-height: 170px;
  }

  #customerChartsRow .col-md-3,
  #leadChartsRow .col-md-3,
  #ticketChartsRow .col-md-3,
  #financeChartsRow .col-md-3,
  #networkChartsRow .col-md-3,
  #schedulingChartsRow .col-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* ========================================
   Custom Leaflet Marker
   ======================================== */
.custom-marker {
  background: transparent;
  border: none;
}

/* ========================================
   Utilities
   ======================================== */
.text-muted {
  color: var(--text-muted) !important;
}

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

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

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

.border-subtle {
  border-color: var(--border-subtle) !important;
}

/* Focus visible styles for accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ========================================
   Lifecycle Timeline - Horizontal Stepper
   ======================================== */
.lifecycle-timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  gap: 0;
}

.lifecycle-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 80px;
}

.lifecycle-dot {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  border: 2px solid var(--border-default);
  background: var(--bg-card);
  color: var(--text-muted);
}

.lifecycle-stage.complete .lifecycle-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.lifecycle-stage.current .lifecycle-dot {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.lifecycle-stage.pending .lifecycle-dot {
  background: var(--bg-muted);
  border-color: var(--border-default);
  color: var(--text-muted);
}

.lifecycle-label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.lifecycle-stage.current .lifecycle-label {
  color: #3b82f6;
  font-weight: 600;
}

.lifecycle-stage.complete .lifecycle-label {
  color: var(--text-secondary);
}

.lifecycle-connector {
  flex: 1;
  height: 2px;
  background: var(--border-default);
  min-width: 40px;
  max-width: 120px;
  margin: 0 0.25rem;
  margin-bottom: 1.5rem;
  transition: background 0.3s ease;
}

.lifecycle-connector.complete {
  background: var(--primary);
}

/* Lifecycle Alert - Status messages */
.lifecycle-alert {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  margin-bottom: 1rem;
  border: 1px solid;
}

.lifecycle-alert.success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.lifecycle-alert.info {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.lifecycle-alert.primary {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.lifecycle-alert.warning {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.lifecycle-alert.danger {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.lifecycle-alert.secondary {
  background: var(--bg-muted);
  color: var(--text-secondary);
  border-color: var(--border-light);
}

/* ========================================
   Activity Timeline - Vertical with Dots
   ======================================== */
.activity-timeline {
  position: relative;
  padding-left: 1.5rem;
}

.activity-item {
  position: relative;
  padding-bottom: 1rem;
  padding-left: 0.5rem;
}

.activity-item:last-child {
  padding-bottom: 0;
}

.activity-item::before {
  content: '';
  position: absolute;
  left: -1.125rem;
  top: 0.75rem;
  bottom: -0.25rem;
  width: 1px;
  background: var(--border-light);
}

.activity-item:last-child::before {
  display: none;
}

.activity-dot {
  position: absolute;
  left: -1.375rem;
  top: 0.375rem;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--border-default);
  border: 2px solid var(--bg-card);
  z-index: 1;
}

.activity-dot.current {
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.activity-content {
  font-size: 0.8125rem;
}

/* ========================================
   Responsive - Lifecycle Timeline
   ======================================== */
@media (max-width: 575.98px) {
  .lifecycle-timeline {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
  }

  .lifecycle-connector {
    min-width: 20px;
    max-width: 40px;
  }

  .lifecycle-stage {
    min-width: 60px;
  }

  .lifecycle-dot {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  .lifecycle-label {
    font-size: 0.625rem;
  }
}

/* Spinning icon animation (for cron jobs running state) */
.spin-icon {
  display: inline-block;
  animation: spin-anim 1s linear infinite;
}
@keyframes spin-anim {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Scheduler Dashboard — Anthropic design tokens ── */
.cron-stat-card {
  background: #fafaf8;
  border: 1px solid #e8e5e0;
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: border-color 0.15s;
}
.cron-stat-card:hover { border-color: #c9c5be; }
.cron-stat-card--alert { border-color: #d4574e; }
.cron-stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.2;
}
.cron-stat-card--alert .cron-stat-value { color: #d4574e; }
.cron-stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #8c8680;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

/* Badges — monochrome pills */
.cron-badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2em 0.65em;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}
.cron-badge--cat       { background: #1a1a1a; color: #fff; }
.cron-badge--ok        { background: #e6f4ea; color: #1a7f37; border: 1px solid #b4dfbf; }
.cron-badge--running   { background: #e8f0fe; color: #3367d6; border: 1px solid #a8c7fa; }
.cron-badge--failed    { background: #fce8e6; color: #c5221f; border: 1px solid #f5c6c2; }
.cron-badge--disabled  { background: #f0eeeb; color: #8c8680; border: 1px solid #e0ddd8; }
.cron-badge--idle      { background: #f5f3f0; color: #8c8680; border: 1px solid #e0ddd8; }

/* Action buttons — compact rounded squares */
.cron-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #d0cdc7;
  border-radius: 8px;
  background: #fff;
  color: #3d3929;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.12s;
  margin: 0 1px;
  padding: 0;
}
.cron-action-btn:hover { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.cron-action-btn:disabled { opacity: 0.35; pointer-events: none; }
.cron-action-btn--warn:hover { background: #d4574e; border-color: #d4574e; }
.cron-action-btn--ok:hover   { background: #1a7f37; border-color: #1a7f37; }

/* Modal buttons */
.cron-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.12s;
}
.cron-btn--primary { background: #1a1a1a; color: #fff; }
.cron-btn--primary:hover { background: #333; }
.cron-btn--ghost { background: transparent; color: #5a5550; border: 1px solid #d0cdc7; }
.cron-btn--ghost:hover { background: #f5f3f0; }
