/* ==========================================================================
   Riseon Elevators CRM & Sales Pipeline - Modern Luxury Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Color Palette */
  --bg-primary: #0a0d14;
  --bg-secondary: #0f1422;
  --bg-card: rgba(18, 24, 40, 0.75);
  --bg-card-hover: rgba(26, 34, 56, 0.85);
  --bg-glass: rgba(15, 20, 34, 0.65);
  --bg-input: rgba(11, 16, 28, 0.85);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(234, 179, 8, 0.5);
  --border-cyan: rgba(56, 189, 248, 0.4);

  /* Brand Accents */
  --gold-primary: #f59e0b;
  --gold-light: #fbbf24;
  --gold-glow: rgba(245, 158, 11, 0.25);
  
  --cyan-primary: #06b6d4;
  --cyan-light: #38bdf8;
  --cyan-glow: rgba(6, 182, 212, 0.25);

  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.2);
  --rose: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.2);
  --violet: #8b5cf6;
  --amber: #f97316;

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #fcd34d;
  --text-cyan: #7dd3fc;

  /* Shadows & Elevation */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 0 25px rgba(245, 158, 11, 0.18);
  --shadow-cyan: 0 0 25px rgba(56, 189, 248, 0.18);

  /* Radii & Transitions */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.07) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(15, 23, 42, 0.8) 0px, transparent 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 13, 20, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

/* Top Navigation Bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: var(--shadow-gold);
  flex-shrink: 0;
  background: #000;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text-block h1 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #ffffff 40%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.73rem;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-subtitle .badge-live {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulseLive 2s infinite;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Live Header Metrics Ticker */
.header-stats-ticker {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(18, 24, 40, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 1rem;
  border-radius: 30px;
}

.ticker-item {
  display: flex;
  flex-direction: column;
}

.ticker-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.ticker-value {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.ticker-value.highlight-gold {
  color: var(--gold-light);
}

.ticker-value.highlight-cyan {
  color: var(--cyan-light);
}

.ticker-divider {
  width: 1px;
  height: 22px;
  background: var(--border-subtle);
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary) 0%, #d97706 100%);
  color: #0b0f19;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-cyan {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--cyan-light);
}

.btn-cyan:hover {
  background: rgba(6, 182, 212, 0.25);
  box-shadow: var(--shadow-cyan);
}

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

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fb7185;
}
.btn-danger:hover {
  background: rgba(244, 63, 94, 0.3);
}

/* Main Navigation Bar (Tabs) */
.sub-nav {
  background: rgba(15, 20, 34, 0.75);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.4rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow-x: auto;
  gap: 1rem;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #0b0f19;
  background: var(--gold-light);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

.nav-tab .tab-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: currentColor;
  font-weight: 700;
}

.nav-tab.active .tab-badge {
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
}

/* System Controls in Sub-nav (Currency switch, Export, Reset) */
.nav-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* App Main Container */
.app-container {
  padding: 1.5rem 1.75rem 3rem;
  max-width: 1720px;
  margin: 0 auto;
}

/* View Sections */
.tab-view {
  display: none;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   DASHBOARD VIEW
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

.kpi-card.gold::before {
  background: linear-gradient(90deg, var(--gold-primary), var(--gold-light));
}
.kpi-card.cyan::before {
  background: linear-gradient(90deg, var(--cyan-primary), var(--cyan-light));
}
.kpi-card.emerald::before {
  background: linear-gradient(90deg, #059669, var(--emerald));
}
.kpi-card.violet::before {
  background: linear-gradient(90deg, #7c3aed, var(--violet));
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.kpi-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.kpi-subtext .trend-up {
  color: var(--emerald);
  font-weight: 600;
}

/* Dashboard Analytics Row */
.dashboard-analytics-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(12px);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-head h2 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  color: var(--text-secondary);
}

/* Funnel Visualization */
.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.funnel-row {
  display: grid;
  grid-template-columns: 140px 1fr 100px 90px;
  align-items: center;
  gap: 1rem;
}

.funnel-stage-name {
  font-weight: 600;
  font-size: 0.83rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.funnel-bar-track {
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.funnel-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.funnel-amount {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
  color: var(--text-main);
}

.funnel-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
}

/* Distribution Chart & Quick Highlights */
.spec-distribution-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.spec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.spec-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.spec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.spec-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.spec-stats {
  text-align: right;
}

.spec-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold-light);
}

.spec-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   PIPELINE KANBAN VIEW
   ========================================================================== */
.pipeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-grow: 1;
  max-width: 720px;
}

.search-input-wrap {
  position: relative;
  flex-grow: 1;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem 0.55rem 2.25rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control.no-icon {
  padding-left: 0.85rem;
}

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

select.form-control {
  cursor: pointer;
  background-color: #111827;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.1rem;
  overflow-x: auto;
  min-height: 680px;
  padding-bottom: 1rem;
}

.kanban-column {
  background: rgba(15, 20, 32, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: 82vh;
  backdrop-filter: blur(8px);
}

.kanban-column.drag-over {
  border-color: var(--cyan-light);
  background: rgba(6, 182, 212, 0.08);
}

.kanban-col-head {
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kanban-col-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.col-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}

.col-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.col-count {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-weight: 600;
}

.col-subtotal {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold-light);
  font-weight: 600;
}

.kanban-card-list {
  padding: 0.85rem;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Individual Pipeline Lead Card */
.lead-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  cursor: grab;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.lead-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.lead-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.card-priority {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.priority-hot {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.priority-warm {
  background: rgba(245, 158, 11, 0.18);
  color: var(--gold-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.priority-cold {
  background: rgba(56, 189, 248, 0.15);
  color: var(--cyan-light);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.card-lift-tag {
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.card-client {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.card-specs-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--cyan-light);
  background: rgba(6, 182, 212, 0.08);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.65rem;
  font-size: 0.78rem;
}

.card-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--gold-light);
}

.card-owner {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
}

.owner-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #334155;
  color: #f8fafc;
  font-size: 0.62rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.card-actions-quick {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.lead-card:hover .card-actions-quick {
  opacity: 1;
}

/* ==========================================================================
   LEADS & DEALS TABLE VIEW
   ========================================================================== */
.table-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.table-toolbar {
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: rgba(10, 13, 20, 0.65);
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  font-size: 0.84rem;
}

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

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 600;
}

.stage-inquiry { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.stage-survey { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.stage-quote { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.stage-negotiation { background: rgba(249, 115, 22, 0.15); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); }
.stage-won { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.stage-lost { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }

/* ==========================================================================
   ELEVATOR COST ESTIMATOR & QUOTATION BUILDER
   ========================================================================== */
.estimator-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
}

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

.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.range-slider-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.range-slider {
  flex-grow: 1;
  accent-color: var(--gold-primary);
  cursor: pointer;
}

.range-val-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gold-light);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  min-width: 52px;
  text-align: center;
}

.checkbox-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.feature-check-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.feature-check-label:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.feature-check-label input[type="checkbox"] {
  accent-color: var(--gold-primary);
  width: 16px;
  height: 16px;
}

/* Quote Summary Card */
.quote-summary-card {
  background: linear-gradient(145deg, rgba(20, 27, 46, 0.95), rgba(13, 17, 30, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  position: sticky;
  top: 90px;
}

.quote-brand-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  margin-bottom: 1.25rem;
}

.quote-price-tag {
  text-align: center;
  margin: 1.25rem 0;
  padding: 1.25rem;
  background: rgba(10, 13, 20, 0.7);
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.quote-price-tag .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.quote-price-tag .amount {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--gold-light);
  line-height: 1.1;
}

.quote-breakdown-table {
  width: 100%;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
}

.quote-breakdown-table tr td {
  padding: 0.45rem 0;
  color: var(--text-secondary);
}

.quote-breakdown-table tr td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  color: var(--text-main);
  font-weight: 600;
}

.quote-breakdown-table tr.total-row td {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gold-light);
}

/* ==========================================================================
   SITE SURVEY AUDIT FORM
   ========================================================================== */
.survey-diagram-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.technical-illustration {
  background: #060910;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 380px;
}

.shaft-schematic {
  width: 100%;
  max-width: 320px;
  stroke: var(--cyan-light);
}

/* ==========================================================================
   MODAL WINDOW SYSTEM
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.open {
  display: flex;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-card {
  background: #0f1422;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), var(--shadow-gold);
}

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

.modal-head h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 1.5rem;
}

.modal-foot {
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #111827;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  color: var(--text-main);
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.25s ease forwards;
}

.toast.toast-success {
  border-left: 4px solid var(--emerald);
}

.toast.toast-info {
  border-left: 4px solid var(--cyan-light);
}

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

/* Printable Quotation Sheet (hidden on screen, visible on print) */
@media print {
  body {
    background: #fff !important;
    color: #111 !important;
  }
  .app-header, .sub-nav, .pipeline-toolbar, .btn, .modal-backdrop {
    display: none !important;
  }
  .print-proposal-page {
    display: block !important;
    padding: 2rem;
    color: #000;
  }
}

.print-proposal-page {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-analytics-row {
    grid-template-columns: 1fr;
  }
  .estimator-layout {
    grid-template-columns: 1fr;
  }
  .kanban-board {
    grid-template-columns: repeat(3, 300px);
  }
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .survey-diagram-container {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   AUTHENTICATION & LOGIN ACCESS PORTAL
   ========================================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 20%, rgba(15, 23, 42, 0.95), #060910 80%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 480px;
  background: rgba(15, 20, 34, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), var(--shadow-gold);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
  animation: loginSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-primary), var(--cyan-light), var(--gold-light));
}

.login-brand-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo-box {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  margin: 0 auto 1rem;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: var(--shadow-gold);
  background: #000;
}

.login-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.login-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.login-nav-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-subtle);
}

.login-sub-tab {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-align: center;
}

.login-sub-tab.active {
  background: rgba(245, 158, 11, 0.2);
  color: var(--gold-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.login-error-msg {
  display: none;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fb7185;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
  align-items: center;
  gap: 0.5rem;
}

.login-error-msg.visible {
  display: flex;
}

.login-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.login-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.login-checkbox-label input[type="checkbox"] {
  accent-color: var(--gold-primary);
}

.quick-profiles-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.quick-profile-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
}

.quick-profile-btn:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateX(3px);
}

.quick-profile-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quick-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.quick-profile-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.quick-profile-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* User Profile Badge in Header */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.75rem 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.user-profile-badge:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-primary), #d97706);
  color: #0b0f19;
  font-weight: 800;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}

.user-display-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-role-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-light);
  letter-spacing: 0.04em;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: #0f1422;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 100;
}

.user-dropdown-menu.open {
  display: flex;
  animation: fadeIn 0.15s ease;
}

.dropdown-item-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  width: 100%;
}

.dropdown-item-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.dropdown-item-btn.danger {
  color: #fb7185;
}
.dropdown-item-btn.danger:hover {
  background: rgba(244, 63, 94, 0.15);
}

/* ==========================================================================
   ADMIN PERMISSIONS & ACCESS MANAGEMENT SUITE
   ========================================================================== */
.admin-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(15, 20, 34, 0.95) 100%);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-banner-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-banner-sub {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.admin-scoping-alert {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #fde68a;
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.user-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.user-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}

.user-card.admin-card {
  border-color: rgba(124, 58, 237, 0.4);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.05) 0%, var(--bg-surface) 100%);
}

.user-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

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

.user-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.user-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.user-card-email {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-card-role {
  font-size: 0.75rem;
  color: var(--gold-light);
  font-weight: 600;
  margin-top: 2px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.suspended {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.policy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.policy-badge.restricted {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.policy-badge.full {
  background: rgba(124, 58, 237, 0.2);
  color: #c084fc;
  border: 1px solid rgba(124, 58, 237, 0.4);
}

.user-card-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.65rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.perm-chip {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.perm-chip.enabled {
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.25);
}

.user-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.perm-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.perm-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.perm-toggle-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.perm-toggle-desc {
  font-size: 0.73rem;
  color: var(--text-muted);
}


