/* 
   portal.css — Smriti Industries Admin & Staff CRM Design System
   Modern Enterprise SaaS Styling (Slate / White / Royal Blue Theme)
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Palette */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-text: #065f46;
  
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;
  
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-text: #991b1b;
  
  --info: #0ea5e9;
  --info-bg: #f0f9ff;
  --info-text: #075985;
  
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;
  --purple-text: #5b21b6;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --sidebar-width: 250px;
  --header-height: 68px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: 0.925rem;
}

/* ================= LAYOUT ================= */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  width: 100%;
  height: 100%;
}

.sidebar-logo-img {
  height: 44px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  padding: 0.75rem 0.75rem 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  position: relative;
}

.nav-item:hover {
  background: var(--border-light);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: #ffffff;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.logout-btn {
  color: var(--text-light);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.logout-btn:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header */
.top-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.sidebar-toggle-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.header-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
}

.header-breadcrumbs a {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.header-breadcrumbs a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.breadcrumb-arrow {
  color: var(--text-light);
  font-size: 0.75rem;
}

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

.website-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: all 0.15s;
}

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

.header-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

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

.header-icon-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* Duplicate Lead Warning */
.dup-warning-box {
  margin-top: 0.45rem;
  padding: 0.5rem 0.65rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  font-size: 0.775rem;
  color: #92400e;
  line-height: 1.4;
}

.dup-warning-box a {
  color: #92400e;
  font-weight: 700;
  text-decoration: underline;
}

/* Live Notification Toasts */
#toastContainer {
  position: fixed;
  top: 84px;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 340px;
}

.portal-toast {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem 1rem;
  font-size: 0.825rem;
  animation: toastSlideIn 0.25s ease-out;
  transition: opacity 0.3s ease;
}

.portal-toast.clickable {
  cursor: pointer;
}

.portal-toast strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text-main);
  font-size: 0.875rem;
}

.portal-toast span {
  color: var(--text-muted);
  line-height: 1.35;
}

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

/* Content Container */
.content-body {
  padding: 1.75rem;
  flex: 1;
}

/* Page Titles & Action Bars */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ================= UI COMPONENTS ================= */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
}

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

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

.btn-success:hover {
  background: #059669;
}

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

.btn-danger:hover {
  background: #dc2626;
}

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

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

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

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

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Metric KPI Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s, box-shadow 0.15s;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.metric-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.metric-sub {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-won, .badge-present, .badge-active, .badge-completed {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-in-discussion, .badge-contacted, .badge-late, .badge-pending {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge-quote-sent {
  background: var(--purple-bg);
  color: var(--purple-text);
}

.badge-new {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-lost, .badge-absent, .badge-urgent, .badge-rejected {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.badge-on-leave, .badge-follow-up {
  background: var(--info-bg);
  color: var(--info-text);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
}

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

.custom-table th {
  background: #f8fafc;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

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

.custom-table tbody tr:hover {
  background: #f8fafc;
}

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

/* Filter Controls */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  width: 280px;
}

/* Show/Hide Password Toggle */
.password-input-wrap {
  position: relative;
}

.password-input-wrap input.form-control {
  padding-right: 2.5rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-light);
}

.password-toggle-btn:hover {
  color: var(--text-main);
}

.search-input-box input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  color: var(--text-main);
}

.select-control {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.select-control:focus, .search-input-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

/* Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(260px, 1fr));
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.kanban-col {
  background: #f1f5f9;
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  min-height: 500px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.kanban-col-title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kanban-count {
  background: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.kanban-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.kanban-card.dragging {
  opacity: 0.4;
}

.kanban-cards.drag-over {
  background: var(--primary-light);
  border-radius: var(--radius-md);
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
}

.kanban-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.kanban-card-company {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.kanban-card-machine {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.6rem;
}

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

.kanban-card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.kanban-quick-move {
  flex: 1;
  min-width: 0;
  padding: 0.3rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.kanban-quick-move:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

.kanban-followup-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
}

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

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFade 0.2s ease-out;
}

.modal-box.modal-lg {
  max-width: 700px;
}

.modal-box.modal-xl {
  max-width: 860px;
}

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

@keyframes modalFade {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

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

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #f8fafc;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Flash Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success { background: var(--success-bg); color: var(--success-text); border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid #fde68a; }
.alert-info { background: var(--info-bg); color: var(--info-text); border: 1px solid #bae6fd; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .sidebar-toggle-btn {
    display: block;
  }
  .header-breadcrumbs {
    display: none;
  }
}

/* ================= MULTI-MACHINE & SPECIFICATION PICKER (CLEAN & MINIMALIST) ================= */
.machine-picker-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.machine-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.machine-picker-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.machine-select-bar {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.machine-select-wrapper {
  flex: 1;
  min-width: 0;
}

.machine-catalog-select {
  width: 100%;
  height: 40px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
  transition: all 0.2s ease;
}

.machine-catalog-select:focus {
  background-color: #ffffff;
  border-color: var(--primary);
}

.add-machine-action-btn {
  height: 40px;
  padding: 0 1.15rem;
  font-size: 0.825rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  white-space: nowrap;
}

.machine-spec-box {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  animation: fadeIn 0.2s ease;
}

.machine-spec-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.machine-spec-box-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.machine-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.machine-spec-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.machine-spec-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.machine-spec-field select {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #1e293b;
  outline: none;
}

.selected-machines-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.selected-machine-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}

.selected-machine-chip:hover {
  border-color: #cbd5e1;
}

.selected-machine-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.selected-machine-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.selected-machine-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #0f172a;
}

.selected-machine-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.spec-pill {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  padding: 0.12rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.selected-machine-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.selected-machine-price {
  font-size: 0.825rem;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid #a7f3d0;
}

.remove-machine-btn {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.remove-machine-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

.machine-empty-state {
  text-align: center;
  padding: 1.1rem 1rem;
  color: #94a3b8;
  font-size: 0.825rem;
  background: #fafafa;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.mode-toggle-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-toggle-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* ================= LEAD MACHINE PILLS & BADGES (TABLE & CARDS) ================= */
.lead-machine-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 220px;
  max-width: 380px;
}

.dashboard-leads-table {
  table-layout: fixed;
  width: 100%;
}

.dashboard-leads-table .lead-machine-stack {
  min-width: 0 !important;
  max-width: 100% !important;
}

.dashboard-leads-table th,
.dashboard-leads-table td {
  padding: 0.6rem 0.5rem;
}

.lead-machine-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}

.lead-machine-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.lead-machine-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lead-machine-title {
  font-weight: 700;
  font-size: 0.825rem;
  color: #0f172a;
  line-height: 1.25;
}

.lead-machine-spec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.lead-spec-tag {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: #2563eb;
  border: 1px solid #dbeafe;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
}

/* ================= RECENT ACTIVITY LOGS FEED ================= */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.activity-feed::-webkit-scrollbar {
  width: 4px;
}

.activity-feed::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.activity-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.activity-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #dbeafe;
  margin-top: 0.1rem;
}

.activity-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.activity-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.activity-title-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  min-width: 0;
}

.activity-action {
  font-size: 0.825rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.activity-author {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  background: #ffffff;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.activity-timestamp {
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

.activity-details-text {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
  word-break: break-word;
}

/* ================= DASHBOARD LEADS TABLE ================= */
.dashboard-leads-table {
  table-layout: fixed;
}

.dashboard-leads-table th {
  padding: 0.65rem 0.75rem !important;
  font-size: 0.72rem !important;
}

.dashboard-leads-table td {
  padding: 0.65rem 0.75rem !important;
}





