/* ============================================================
   KNZ Sales — UI Components
   ============================================================ */

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center;
  gap: 8px; padding: 10px 20px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-decoration: none;
  white-space: nowrap; flex-shrink: 0;
  line-height: 1;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

.btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
  color: white; border: none;
  box-shadow: 0 4px 15px rgba(99,102,241,0.3), inset 0 1px 1px rgba(255,255,255,0.2);
  position: relative; z-index: 1;
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(99,102,241,0.45), 0 0 15px var(--accent-glow);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: scale(0.96); box-shadow: 0 2px 8px rgba(99,102,241,0.3); }

/* Secondary - outlined */
.btn-secondary {
  background: rgba(255,255,255,0.03); color: var(--text-primary);
  border-color: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}
.btn-secondary:active { transform: scale(0.96); }

/* Ghost */
.btn-ghost {
  background: transparent; color: var(--text-secondary); border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Danger */
.btn-danger {
  background: var(--danger-light); color: var(--danger); border-color: rgba(239,68,68,0.25);
}
.btn-danger:hover { background: var(--danger); color: white; }

/* Success */
.btn-success {
  background: var(--success-light); color: var(--success); border-color: rgba(34,197,94,0.25);
}
.btn-success:hover { background: var(--success); color: white; }

/* Icon button */
.btn-icon {
  padding: 8px; min-width: 34px; min-height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon svg { width: 16px; height: 16px; }

/* Sizes */
.btn-sm  { padding: 6px 13px; font-size: 12.5px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg  { padding: 12px 24px; font-size: 15px; }
.btn-lg svg { width: 18px; height: 18px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-top-color: rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}
.card:hover {
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}
.card-header {
  padding: 22px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.card-header-sub   { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.card-body { padding: 28px; }
.card-footer {
  padding: 16px 28px;
  background: rgba(0,0,0,0.1);
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: space-between;
}

/* Glass card */
.card-glass {
  background: rgba(18,20,28,0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.05);
  border-top: 1px solid rgba(255,255,255,0.12);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 7px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 14px; font-family: inherit;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.form-input:hover, .form-select:hover, .form-textarea:hover {
  border-color: rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2), inset 0 2px 4px rgba(0,0,0,0.1);
  background: var(--bg-primary);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }

.form-select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}
.form-select option { background: var(--bg-elevated); color: var(--text-primary); }

.form-textarea { resize: vertical; min-height: 90px; }

.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 11.5px; color: var(--danger); margin-top: 5px; display: none; }
.form-error.show { display: block; }

.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto; border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 12.5px;
}
.data-table thead tr {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.data-table th {
  padding: 10px 12px; text-align: left;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em; white-space: nowrap;
}
.data-table td {
  padding: 12px 14px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: all 0.2s ease;
}
.data-table tbody tr:hover td {
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
}
.data-table tbody tr:hover {
  transform: scale(0.998) translateX(4px);
}

.table-name { color: var(--text-primary); font-weight: 600; font-size: 13px; }
.table-sub  { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50;
  flex-shrink: 0;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger  { background: var(--danger-light);  color: var(--danger);  }
.badge-info    { background: var(--info-light);    color: var(--info);    }
.badge-indigo  { background: var(--accent-light);  color: var(--accent);  }
.badge-purple  { background: var(--accent-purp-light); color: var(--accent-purple); }
.badge-cyan    { background: var(--accent-cyan-light); color: var(--accent-cyan);   }
.badge-muted   { background: var(--bg-elevated);   color: var(--text-muted); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
}
.modal-overlay.open {
  opacity: 1; pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 0 1px var(--border-glow);
  transform: scale(0.95) translateY(15px); opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.modal-overlay.open .modal {
  transform: scale(1) translateY(0); opacity: 1;
}

.modal-lg  { max-width: 760px; }
.modal-xl  { max-width: 960px; }

.modal-header {
  padding: 22px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.modal-close {
  background: none; border: none;
  color: var(--text-muted); padding: 8px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
}
.modal-close:hover { background: var(--bg-hover); color: var(--danger); transform: rotate(90deg); }
.modal-close svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }

.modal-body {
  padding: 28px;
  overflow-y: auto; flex: 1;
}
.modal-footer {
  padding: 18px 28px;
  border-top: 1px solid rgba(255,255,255,0.04);
  background: rgba(0,0,0,0.1);
  display: flex; align-items: center;
  justify-content: flex-end; gap: 12px; flex-shrink: 0;
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed; right: 20px; bottom: 20px;
  z-index: 300; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 500;
  color: var(--text-primary);
  min-width: 250px; max-width: 380px;
  pointer-events: all;
  transform: translateX(110%);
  transition: transform 0.32s cubic-bezier(0.34,1.2,0.64,1), opacity 0.2s ease;
  opacity: 0;
}
.toast.toast-show { transform: translateX(0); opacity: 1; }

.toast-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.toast-success .toast-icon { background: var(--success-light); color: var(--success); }
.toast-error   .toast-icon { background: var(--danger-light);  color: var(--danger);  }
.toast-warning .toast-icon { background: var(--warning-light); color: var(--warning); }
.toast-info    .toast-icon { background: var(--info-light);    color: var(--info);    }

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger);  }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid var(--info);    }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  color: white; flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 17px; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state-icon {
  width: 60px; height: 60px;
  background: var(--bg-elevated); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.empty-state-icon svg { width: 26px; height: 26px; stroke: var(--text-muted); fill: none; stroke-width: 1.5; }
.empty-state h3 { font-size: 15px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; max-width: 300px; margin-left: auto; margin-right: auto; }

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.activity-feed { display: flex; flex-direction: column; gap: 0; }

.activity-item {
  display: flex; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 34px; height: 34px;
  border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; margin-top: 1px;
}
.activity-content { flex: 1; min-width: 0; }
.activity-title {
  font-size: 13.5px; font-weight: 500;
  color: var(--text-primary);
}
.activity-meta {
  font-size: 12px; color: var(--text-muted); margin-top: 3px;
}
.activity-time {
  font-size: 11.5px; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0; margin-top: 3px;
}

/* ============================================================
   PIPELINE STATUS BAR
   ============================================================ */
.status-pipeline {
  display: flex; gap: 0; border-radius: var(--radius);
  overflow: hidden; margin-bottom: 22px;
  border: 1px solid var(--border);
}
.pipeline-stage {
  flex: 1; padding: 8px 12px; text-align: center;
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--bg-elevated); color: var(--text-muted);
  border-right: 1px solid var(--border);
  transition: all var(--transition);
}
.pipeline-stage:last-child { border-right: none; }
.pipeline-stage.active { background: var(--accent-light); color: var(--accent); }
.pipeline-stage:hover:not(.active) { background: var(--bg-hover); color: var(--text-primary); }
.pipeline-stage .count {
  display: block; font-size: 18px; font-weight: 800;
  color: var(--text-primary); margin-bottom: 2px;
}
.pipeline-stage.active .count { color: var(--accent); }

/* ============================================================
   QUOTATION LINE ITEMS TABLE
   ============================================================ */
.line-items-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; margin-bottom: 12px;
}
.line-items-table th {
  text-align: left; padding: 8px 10px;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.line-items-table td { padding: 8px 6px; vertical-align: middle; }
.line-items-table .item-input {
  padding: 7px 10px; font-size: 13px; width: 100%;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  outline: none;
}
.line-items-table .item-input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light);
}
.line-items-total {
  text-align: right; font-size: 15px; font-weight: 700;
  color: var(--text-primary); padding: 12px 0 0;
}
.line-items-total span { color: var(--accent); }

/* ============================================================
   TIMELINE (Customer Profile)
   ============================================================ */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ''; position: absolute; left: 8px;
  top: 8px; bottom: 8px; width: 1px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute; left: -20px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); top: 5px;
  border: 2px solid var(--bg-card);
}
.timeline-dot.green  { background: var(--success); }
.timeline-dot.amber  { background: var(--warning); }
.timeline-dot.red    { background: var(--danger);  }
.timeline-dot.cyan   { background: var(--accent-cyan); }
.timeline-content {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.timeline-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.timeline-text  { font-size: 12.5px; color: var(--text-secondary); }
.timeline-time  { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }

/* ============================================================
   OVERDUE BANNER
   ============================================================ */
.alert-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px;
  border-radius: var(--radius); margin-bottom: 20px;
  border: 1px solid;
}
.alert-banner svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.alert-banner-danger  { background: var(--danger-light);  border-color: rgba(239,68,68,0.3);  color: #fca5a5; }
.alert-banner-warning { background: var(--warning-light); border-color: rgba(245,158,11,0.3); color: #fcd34d; }
.alert-banner-info    { background: var(--info-light);    border-color: rgba(59,130,246,0.3); color: #93c5fd; }

.alert-banner-text { flex: 1; font-size: 13.5px; }
.alert-banner strong { font-weight: 700; }

/* ============================================================
   STAT ROWS / SUMMARY ROWS
   ============================================================ */
.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-row-label { font-size: 13.5px; color: var(--text-secondary); }
.stat-row-value { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar-wrap {
  background: var(--bg-elevated); border-radius: 100px;
  height: 6px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* ============================================================
   DROPDOWN MENU
   ============================================================ */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); min-width: 170px;
  box-shadow: var(--shadow-lg); z-index: 150;
  overflow: hidden;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; font-size: 13.5px;
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition); border: none;
  background: none; width: 100%; text-align: left;
  font-family: inherit;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger:hover { background: var(--danger-light); color: var(--danger); }
.dropdown-item svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab-btn {
  padding: 10px 18px; font-size: 13.5px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border: none; background: none; font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ============================================================
   SEARCH RESULT HIGHLIGHT
   ============================================================ */
.highlight { background: rgba(99,102,241,0.25); color: var(--accent); border-radius: 2px; }

/* ============================================================
   PRIORITY INDICATOR
   ============================================================ */
.priority-high   { color: var(--danger);   font-weight: 600; }
.priority-medium { color: var(--warning);  font-weight: 600; }
.priority-low    { color: var(--success);  font-weight: 600; }

/* ============================================================
   RESPONSIVE UTILS
   ============================================================ */
@media (max-width: 680px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .modal { max-width: 100%; border-radius: var(--radius-lg); }
  .modal-body { padding: 18px; }
  .modal-header { padding: 16px 18px; }
  .modal-footer { padding: 12px 18px; }
}

/* ============================================================
   DYNAMIC LABELS SETTINGS PANEL
   ============================================================ */
.labels-settings-wrap {
  display: flex; flex-direction: column; gap: 12px;
}

/* Accordion Section */
.label-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

.label-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px;
  cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  background: var(--bg-elevated);
  transition: background var(--transition);
  user-select: none;
}
.label-section-header:hover { background: var(--bg-hover); }
.label-chevron {
  stroke: currentColor; fill: none; stroke-width: 2;
  transition: transform 0.22s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.label-section-body {
  display: none; flex-direction: column;
  gap: 0;
  padding: 0;
}
.label-section-body.open {
  display: flex;
}

/* Label Row */
.label-row {
  display: flex; align-items: center;
  gap: 16px; padding: 12px 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  transition: background var(--transition);
}
.label-row:hover { background: var(--bg-hover); }

.label-row-meta {
  flex: 0 0 220px; min-width: 140px;
}
.label-row-name {
  font-size: 13.5px; font-weight: 600;
  color: var(--text-primary);
}
.label-row-key {
  font-size: 11px; color: var(--text-muted);
  font-family: 'Courier New', monospace;
  margin-top: 2px;
}

.label-row-input-wrap {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 200px;
}

.label-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  transition: border-color 0.16s, box-shadow 0.16s;
}

/* Dirty (unsaved changes) state */
.lbl-save-btn {
  white-space: nowrap; flex-shrink: 0;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border);
  transition: all 0.18s ease;
}
.lbl-save-btn.dirty {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(99,102,241,0.4);
  animation: lbl-pulse 1.6s ease-in-out infinite;
}

@keyframes lbl-pulse {
  0%, 100% { box-shadow: 0 3px 10px rgba(99,102,241,0.4); }
  50%       { box-shadow: 0 5px 20px rgba(99,102,241,0.7); }
}

@media (max-width: 680px) {
  .label-row { flex-direction: column; align-items: stretch; }
  .label-row-meta { flex: none; }
}

/* ============================================================
   USER ACCESS CONTROL (Admin)
   ============================================================ */
.access-user-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 12px;
  background: var(--bg-card);
  transition: opacity var(--transition);
}
.access-user-inactive { opacity: 0.65; }

.access-user-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 14px;
}
.access-user-identity {
  display: flex; align-items: center; gap: 14px;
}
.access-user-name { font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.access-user-email { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.access-user-desig { font-size: 12px; color: var(--accent); font-weight: 500; margin-top: 2px; }

.access-user-controls {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.access-module-section {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 14px 18px;
  border: 1px solid var(--border-strong);
}
.access-module-label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px;
}
.access-pills-wrap {
  display: flex; flex-wrap: wrap; gap: 8px;
}

.access-pill {
  padding: 6px 12px; border-radius: 100px; font-size: 12.5px;
  font-weight: 500; cursor: pointer; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--transition); background: transparent;
  font-family: inherit;
}
.access-pill:disabled { cursor: not-allowed; opacity: 0.8; }
.access-pill-on {
  background: rgba(34,197,94,0.15); color: var(--success);
  border-color: rgba(34,197,94,0.3);
}
.access-pill-on:hover:not(:disabled) { background: rgba(34,197,94,0.25); }
.access-pill-off {
  background: rgba(239,68,68,0.1); color: var(--danger);
  border-color: rgba(239,68,68,0.2); text-decoration: line-through; opacity: 0.8;
}
.access-pill-off:hover:not(:disabled) { background: rgba(239,68,68,0.2); opacity: 1; text-decoration: none; }

/* Add User Modal - Modules Grid */
.new-user-modules-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px; margin-top: 8px;
  background: var(--bg-elevated); padding: 16px;
  border-radius: var(--radius); border: 1px solid var(--border-strong);
}
.module-check-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-primary); cursor: pointer;
}
.module-check-item input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer;
  accent-color: var(--accent);
}

/* ============================================================
   MEETINGS MODULE & NOTIFICATIONS
   ============================================================ */

/* Topbar Notification Badge */
.nav-badge.bg-danger { background: var(--danger); color: white; border: 2px solid var(--bg-app); border-radius: 50%; width:18px;height:18px;font-size:10px;display:flex;align-items:center;justify-content:center; }

.notif-item {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  transition: all 0.2s; cursor: pointer; display: flex; gap: 12px; align-items:flex-start;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(99,102,241,0.05); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink:0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-body { font-size: 12px; color: var(--text-secondary); }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── Calendar UI (Meetings Module) ── */
.calendar-container {
  display: flex; flex-direction: column; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.calendar-header-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--bg-app); border-bottom: 1px solid var(--border);
}
.calendar-header-col {
  padding: 10px; text-align: center; font-weight: 600; font-size: 12px;
  color: var(--text-muted); text-transform: uppercase; border-right: 1px solid var(--border);
}
.calendar-header-col:last-child { border-right: none; }
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(110px, auto);
}
.calendar-day {
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 6px; min-height: 110px; transition: background 0.2s; cursor: pointer; display: flex; flex-direction: column; gap:4px;
}
.calendar-day:nth-child(7n) { border-right: none; }
.calendar-day:hover { background: rgba(99,102,241,0.02); }
.calendar-day.empty { background: rgba(0,0,0,0.02); cursor: default; }
.calendar-day.today { background: rgba(99,102,241,0.04); }
.calendar-date {
  font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; display: inline-flex; align-items:center; justify-content:center;
}
.calendar-day.today .calendar-date {
  background: var(--accent); color: #fff; border-radius: 50%; width: 22px; height: 22px;
}

.cal-event-pill {
  font-size: 10.5px; padding: 4px 6px; border-radius: 4px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500;
  display: flex; align-items:center; gap: 4px;
}
.cal-event-pill:hover { filter: brightness(1.1); }
.cal-event-assigned { background: var(--accent-light); color: var(--accent); border-color: rgba(99,102,241,0.2); }
.cal-event-completed { background: var(--success-light); color: var(--success); text-decoration: line-through; opacity:0.75; }

/* ── Split Layout for Meetings ── */
.meetings-layout {
  display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start;
}
@media(max-width: 900px) {
  .meetings-layout { grid-template-columns: 1fr; }
}

/* ============================================================
   RESOURCE LIBRARY (DIGITAL CENTER)
   ============================================================ */
.library-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.library-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-glow);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-glow);
}

.library-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--accent);
  opacity: 0.6;
}

.resource-category-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  width: fit-content;
}

.cat-catalogues      { color: var(--accent-cyan);   background: var(--accent-cyan-light); }
.cat-price-lists     { color: var(--success);       background: var(--success-light); }
.cat-technical-sheets { color: var(--accent-purple);     background: var(--accent-purp-light); }
.cat-certificates    { color: var(--warning);       background: var(--warning-light); }

.resource-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.resource-desc {
  font-size: 12px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.resource-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn-whatsapp {
  background: #25D366;
  color: white;
  border: none;
}
.btn-whatsapp:hover {
  background: #128C7E;
  color: white;
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .resource-actions { flex-direction: column; }

/* ============================================================
   PRODUCT CATALOG & PICKER
   ============================================================ */
.product-card {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  overflow: hidden;
  height: 100%;
}
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}
.product-img-wrap {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--surface-light);
  position: relative;
  overflow: hidden;
}
.product-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .product-img-wrap img {
  transform: scale(1.1);
}
.product-badge {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 2;
  font-size: 10px;
  padding: 4px 8px;
}

/* Picker Items */
.picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.picker-item:hover {
  background: rgba(99, 102, 241, 0.08);
}
.picker-item img {
  width: 50px; height: 50px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-light);
}

/* Quotation Browse Button */
.btn-browse-catalog {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  border: 1px dashed var(--accent);
  margin-top: 5px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.btn-browse-catalog:hover {
  background: rgba(99, 102, 241, 0.2);
}

/* Quotation Searchable Lookup */
.quote-lookup-wrap { position: relative; }
.quote-lookup-results {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}
.quote-lookup-results.show {
  display: block;
}
.lookup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}
.lookup-item:last-child { border-bottom: none; }
.lookup-item:hover, .lookup-item.active { 
  background: rgba(99, 102, 241, 0.25); 
  border-left: 4px solid var(--accent);
  padding-left: 8px; /* Compensate for border */
  box-shadow: inset 4px 0 0 var(--accent);
}
.lookup-item.active {
  background: rgba(99, 102, 241, 0.35);
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.2);
}
.lookup-item img {
  width: 36px; height: 36px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--surface-light);
}
.lookup-item .li-info { flex: 1; text-align: left; }
.lookup-item .li-name { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.lookup-item .li-meta { font-size: 11px; color: var(--text-muted); }
.lookup-item .li-price { font-weight: 700; color: var(--accent); font-size: 13px; }

/* ============================================================
   EXCEL-STYLE PRODUCT TABLE (Themed)
   ============================================================ */
.excel-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
}
.excel-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-primary);
  table-layout: fixed;
}
.excel-table th {
  background: var(--bg-elevated); /* Themed header instead of yellow */
  color: var(--accent);            /* Use accent color for headings */
  text-align: left;
  padding: 12px 15px;
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.excel-table td {
  padding: 10px 15px;
  border: 1px solid var(--border);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  color: var(--text-secondary);
}
.excel-table tr:nth-child(even) {
  background: rgba(255,255,255,0.02);
}
.excel-table tr:hover {
  background: var(--bg-hover);
}
.excel-btn-edit, .excel-btn-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-secondary);
}
.excel-btn-edit {
  color: var(--accent);
  border-color: var(--accent-light);
}
.excel-btn-edit:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.excel-btn-delete {
  color: var(--danger);
  border-color: var(--danger-light);
}
.excel-btn-delete:hover {
  background: var(--danger);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--danger-light);
}

/* ============================================================
   PRODUCT MINI TABLE (Ultra-Slim)
   ============================================================ */
.product-mini-table {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.pm-header, .pm-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.pm-header {
  background: var(--bg-elevated);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.pm-row {
  transition: all 0.2s ease;
}
.pm-row:last-child { border-bottom: none; }
.pm-row:hover {
  background: var(--bg-hover);
  transform: translateX(4px);
}
.pm-col-name { 
  width: 25%; 
  font-size: 13.5px;
  font-weight: 600; 
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-col-desc { 
  flex: 1; 
  color: var(--text-muted); 
  font-size: 12px; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
}
.pm-col-cct { 
  width: 100px; 
  text-align: center; 
  font-size: 12px; 
  font-weight: 600;
  color: var(--accent);
}
.pm-col-actions { 
  width: 90px; 
  text-align: right; 
  display: flex; 
  justify-content: flex-end; 
  gap: 5px; 
}
