/* ============================================================
   Grupo Altura CRM — Command Center
   Premium SaaS dark theme (HubSpot / Pipedrive inspired)
   ============================================================ */

/* --- Design Tokens --- */
:root {
  --bg: #06080F;
  --bg2: #0C1120;
  --bg3: #111827;
  --primary: #6366F1;
  --primary-l: #818CF8;
  --accent: #22D3EE;
  --success: #10b981;
  --warn: #F59E0B;
  --danger: #EF4444;
  --pink: #ec4899;
  --purple: #a855f7;
  --text: #F1F5F9;
  --muted: #94A3B8;
  --dim: #64748B;
  --border: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.04);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --mono: 'Space Mono', monospace;
  --sidebar-w: 220px;
  --sidebar-collapsed: 56px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --focus-ring: 0 0 0 3px rgba(99, 102, 241, 0.25);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

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

button {
  font-family: var(--font);
}

img {
  display: block;
  max-width: 100%;
}


/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}


/* ============================================================
   AUTH VIEW
   ============================================================ */

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(34, 211, 238, 0.06) 0%, transparent 50%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.auth-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--focus-ring);
}

.auth-input::placeholder {
  color: var(--dim);
}

.auth-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
  margin-top: 6px;
}

.auth-btn:hover {
  background: var(--primary-l);
}

.auth-btn:active {
  transform: scale(0.98);
}

.auth-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 12px;
  text-align: center;
}


/* ============================================================
   APP LAYOUT
   ============================================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: #0a0b0f;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  z-index: 100;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar__logo {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar__logo img {
  height: 28px;
  transition: opacity var(--transition);
}

.sidebar__hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar__hamburger:hover {
  background: var(--glass);
  color: var(--text);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.sidebar__item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--dim);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
  font-family: var(--font);
  white-space: nowrap;
}

.sidebar__item:hover {
  background: var(--glass);
  color: var(--text);
}

.sidebar__item--active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-l);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.sidebar__item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar__item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
}

.sidebar__status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 0.72rem;
  margin-bottom: 8px;
}

.sidebar__status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.sidebar__footer-btns {
  display: flex;
  gap: 6px;
}

.sidebar__btn {
  flex: 1;
  padding: 6px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  text-align: center;
}

.sidebar__btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.sidebar__btn--danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}


/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 28px 32px;
  overflow-y: auto;
  max-height: 100vh;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ============================================================
   SECTION HEADERS — Page-level headers for each view
   ============================================================ */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.section-header__title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.section-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}


/* ============================================================
   SEARCH INPUT — Dark themed search bars
   ============================================================ */

.section-search {
  width: 260px;
  padding: 10px 14px 10px 38px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cline x1='10.5' y1='10.5' x2='14' y2='14'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.section-search:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--focus-ring);
  background-color: rgba(255, 255, 255, 0.06);
}

.section-search::placeholder {
  color: var(--dim);
}


/* ============================================================
   FILTER SELECT — Dark themed filter dropdowns
   ============================================================ */

.section-filter {
  padding: 10px 36px 10px 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394A3B8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.section-filter:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--focus-ring);
}

.section-filter option {
  background: var(--bg2);
  color: var(--text);
}


/* ============================================================
   METRICS
   ============================================================ */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.metric:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-sm);
}

.metric__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  font-weight: 600;
  margin-bottom: 6px;
}

.metric__value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.metric__sub {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 4px;
}

.metric__accent {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  opacity: 0.1;
}


/* ============================================================
   DASHBOARD GRID — Two-column layout for tasks + activity
   ============================================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}


/* ============================================================
   PANELS
   ============================================================ */

.panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
  transition: border-color var(--transition);
}

.panel:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.panel__title {
  font-size: 0.88rem;
  font-weight: 700;
}

.panel__badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-l);
  border-radius: 6px;
}

.panel__body {
  padding: 16px 20px;
}

.panel__body--flush {
  padding: 0;
}


/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dim);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

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

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

.table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.table__link {
  color: var(--primary-l);
  cursor: pointer;
  transition: color 0.15s;
  font-weight: 600;
}

.table__link:hover {
  text-decoration: underline;
  color: #a5b4fc;
}

.table__row--clickable {
  cursor: pointer;
  transition: background var(--transition);
}

.table__row--clickable:hover td {
  background: rgba(99, 102, 241, 0.06);
}

.table__row--clickable td:first-child {
  color: var(--primary-l);
  font-weight: 600;
}


/* ============================================================
   LIST / TABLE / DETAIL / EDITOR / TIMELINE CONTAINERS
   ============================================================ */

.list-container,
.table-container {
  /* Wrapper for list/table content */
}

.detail-container,
.editor-container {
  /* Wrapper for detail/editor views */
}

.timeline-container,
.tasks-container {
  /* Wrapper containers */
}

.activities-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}


/* ============================================================
   TAGS / BADGES
   ============================================================ */

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

/* Stage tags (inline styles from JS) */
.stage-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.66rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}

/* Priority tag */
.priority-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Named stage tags */
.tag--lead {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-l);
}

.tag--calificado {
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent);
}

.tag--demo {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warn);
}

.tag--negociacion {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
}

.tag--cliente {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.tag--perdido {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Estado tags */
.tag--new {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-l);
}

.tag--warm {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warn);
}

.tag--hot {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.tag--scheduled {
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent);
}

/* Priority */
.tag--low {
  background: rgba(100, 116, 139, 0.15);
  color: var(--dim);
}

.tag--medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warn);
}

.tag--high {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.tag--urgent {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  font-weight: 700;
}

/* Quote status */
.tag--draft {
  background: rgba(100, 116, 139, 0.15);
  color: var(--dim);
}

.tag--sent {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-l);
}

.tag--accepted {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.tag--rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.tag--expired {
  background: rgba(100, 116, 139, 0.12);
  color: var(--dim);
}

/* Pricing type */
.tag--hourly {
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent);
}

.tag--fixed {
  background: rgba(168, 85, 247, 0.1);
  color: var(--purple);
}

.tag--monthly {
  background: rgba(236, 72, 153, 0.1);
  color: var(--pink);
}


/* ============================================================
   DONUT CHART
   ============================================================ */

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 24px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.donut-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.donut-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend__label {
  flex: 1;
}

.donut-legend__count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text);
  font-weight: 600;
}


/* ============================================================
   PIPELINE / KANBAN
   ============================================================ */

.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(170px, 1fr));
  gap: 12px;
  min-height: 400px;
}

.kanban__col,
.kanban__column {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-height: 200px;
  transition: border-color var(--transition), background var(--transition);
}

.kanban__col-header,
.kanban__column-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kanban__column-title {
  flex: 1;
}

.kanban__column-count {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--muted);
}

.kanban__col-body,
.kanban__cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

.kanban__card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: grab;
  transition: border-color 0.15s, box-shadow 0.15s, opacity var(--transition), transform 0.15s;
}

.kanban__card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.kanban__card:active {
  cursor: grabbing;
}

.kanban__card.dragging,
.kanban__card--dragging {
  opacity: 0.4;
  transform: rotate(2deg);
}

.kanban__col.drag-over,
.kanban__cards--drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.05);
}

.kanban__card-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.kanban__card-company {
  font-size: 0.75rem;
  color: var(--muted);
}

.kanban__card-meta,
.kanban__card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--dim);
}

.kanban__card-amount {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.72rem;
}

.kanban__card-age {
  font-family: var(--mono);
  font-size: 0.68rem;
}

.kanban__card-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 600;
}


/* ============================================================
   FUNNEL BAR
   ============================================================ */

.funnel,
.funnel-bar,
#funnelBar {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  height: 40px;
  margin-bottom: 12px;
}

.funnel__segment,
.funnel-bar__segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.funnel-bar__count {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.funnel__labels,
.funnel-labels,
#funnelLabels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.72rem;
  color: var(--dim);
  gap: 4px;
}

.funnel-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.funnel-label__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.funnel__label-item {
  text-align: center;
  flex: 1;
  min-width: 0;
}

.funnel__label-item span {
  display: block;
}

.funnel__label-item span:first-child {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
}


/* ============================================================
   BREADCRUMB — Pill-style with back arrow
   ============================================================ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  margin-bottom: 20px;
}

.breadcrumb__link {
  color: var(--primary-l);
  cursor: pointer;
  transition: color 0.15s;
}

.breadcrumb__link:hover {
  text-decoration: underline;
}

.breadcrumb__sep {
  color: var(--dim);
  font-size: 0.7rem;
}

.breadcrumb__current {
  color: var(--text);
  font-weight: 600;
}

/* Detail breadcrumb (JS-generated) */
.detail-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 0.82rem;
  margin-bottom: 20px;
  color: var(--muted);
}

.detail-breadcrumb__back {
  color: var(--primary-l);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.detail-breadcrumb__back::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-left: 2px solid var(--primary-l);
  border-bottom: 2px solid var(--primary-l);
  transform: rotate(45deg);
  margin-right: 2px;
}

.detail-breadcrumb__back:hover {
  color: #a5b4fc;
  text-decoration: underline;
}


/* ============================================================
   DETAIL VIEWS — Profile cards and content
   ============================================================ */

.detail-header {
  padding: 24px;
}

.detail-header__name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.detail-header__company,
.detail-header__email {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

.detail-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--dim);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}


/* -- Detail Card (Contact/Company/Deal profile) -- */
.detail-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.detail-card__header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.detail-card__avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.detail-card__info {
  flex: 1;
  min-width: 0;
}

.detail-card__info h3 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.detail-card__info p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.detail-card__fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 32px;
}

.detail-card__actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.detail-field--full {
  grid-column: 1 / -1;
}

.detail-field__label,
.detail-field > span:first-child {
  display: block;
  font-size: 0.68rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-weight: 600;
}

.detail-field__value,
.detail-field > span:last-child {
  font-size: 0.88rem;
  color: var(--text);
}

.detail-field a {
  color: var(--primary-l);
  text-decoration: none;
}

.detail-field a:hover {
  text-decoration: underline;
}

/* Detail actions bar (below quote detail) */
.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding: 20px 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 20px;
}


/* ============================================================
   DETAIL SECTIONS — Subsections inside detail views
   (Deals, Notas, Documentos, Cotizaciones, Actividades)
   ============================================================ */

.detail-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.detail-section h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ============================================================
   NOTES
   ============================================================ */

.note-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.note-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color var(--transition);
}

.note-item:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.note-item__content {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.note-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.note-item__date {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--dim);
}


/* ============================================================
   DOCUMENTS
   ============================================================ */

.doc-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.doc-upload input[type="file"] {
  flex: 1;
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--muted);
}

.doc-upload input[type="file"]::file-selector-button {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--text);
  cursor: pointer;
  margin-right: 10px;
  transition: all var(--transition);
}

.doc-upload input[type="file"]::file-selector-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color var(--transition);
}

.doc-item:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.doc-item__name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-item__size {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--dim);
  white-space: nowrap;
}

.doc-item__date {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--dim);
  white-space: nowrap;
}


/* ============================================================
   QUOTES (inside detail views)
   ============================================================ */

.quote-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all var(--transition);
}

.quote-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.04);
}

.quote-item__number {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-l);
}

.quote-item__total {
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.quote-item__status {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quote-item__date {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--dim);
  margin-left: auto;
}


/* ============================================================
   ACTIVITY ITEMS (inside detail views)
   ============================================================ */

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.activity-item__dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  margin-top: 4px;
}

.activity-item__content {
  flex: 1;
  min-width: 0;
}

.activity-item__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.activity-item__type {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.activity-item__date {
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--dim);
}

.activity-item__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.activity-item__desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

.activity-item__icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.activity-item__outcome {
  font-size: 0.75rem;
  color: var(--success);
  margin-top: 4px;
}

.activity-item__duration {
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--dim);
  margin-top: 2px;
}

/* Activity type tags */
.tag--call { background: rgba(16,185,129,0.12); color: #34d399; }
.tag--email { background: rgba(34,211,238,0.12); color: var(--accent); }
.tag--meeting { background: rgba(245,158,11,0.12); color: #fbbf24; }
.tag--note { background: rgba(100,116,139,0.12); color: var(--dim); }
.tag--task { background: rgba(99,102,241,0.12); color: var(--primary-l); }

/* Task items in contact detail */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

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

.task-item__check {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}

.task-item__content { flex: 1; min-width: 0; }

.task-item__title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.task-item__desc {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.task-item__meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  align-items: center;
  font-size: 0.72rem;
}

.task-item--overdue {
  border-left: 3px solid var(--danger);
  padding-left: 12px;
}

.task-item--completed .task-item__title {
  text-decoration: line-through;
  color: var(--dim);
}

/* Detail grid columns */
.detail-grid__col {
  min-width: 0;
}

/* Quote mini-cards in contact detail */
.quote-card {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.quote-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.quote-card__number {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.quote-card__total {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.quote-card__date {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--dim);
}


/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.15s ease;
}

.modal-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: min(520px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
  box-shadow: var(--shadow-lg);
}

.modal-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-card__title {
  font-size: 1rem;
  font-weight: 700;
}

.modal-card__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s;
}

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

.modal-card__body {
  padding: 20px 24px;
}

.modal-card__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


/* ============================================================
   FORMS — Universal dark theme styling
   ============================================================ */

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

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--focus-ring);
  background: rgba(255, 255, 255, 0.06);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--dim);
}

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

.form-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394A3B8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option {
  background: var(--bg2);
  color: var(--text);
}

/* Inline form elements (inside detail cards) */
.form-select--inline,
.form-input--inline {
  display: inline-block;
  width: auto;
  min-width: 140px;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.form-select--inline {
  padding-right: 32px;
}

/* Probability input with % suffix */
.detail-field .form-input--inline {
  width: 80px;
  text-align: right;
  padding-right: 8px;
}

.detail-field .form-input--inline + span,
.detail-field .form-input--inline ~ span {
  /* For the stray "%" text next to probability input */
}

/* Date inputs */
.form-input[type="date"],
.form-input[type="number"] {
  color-scheme: dark;
}

/* Modal form layout */
.modal-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}

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


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.3);
}

.btn--primary:hover {
  background: var(--primary-l);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.btn--accent {
  background: var(--accent);
  color: var(--bg);
}

.btn--accent:hover {
  background: #5eebfc;
}

.btn--secondary {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn--ghost:hover {
  background: var(--glass);
  color: var(--text);
}

.btn--danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.btn--danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 0.75rem;
}

.btn--block {
  width: 100%;
}

/* Icon-only button (inline actions) */
.btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition);
  flex-shrink: 0;
}

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

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

.btn--danger-text:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}


/* ============================================================
   TOGGLE SWITCH (Service catalog)
   ============================================================ */

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-switch__slider {
  width: 36px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  position: relative;
  transition: background var(--transition);
}

.toggle-switch__slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition);
}

.toggle-switch input:checked + .toggle-switch__slider {
  background: var(--success);
}

.toggle-switch input:checked + .toggle-switch__slider::after {
  transform: translateX(16px);
}


/* ============================================================
   ACTIVITY TIMELINE
   ============================================================ */

.timeline {
  padding: 0 4px;
}

.timeline__item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 20px;
  border-left: 2px solid var(--border);
}

.timeline__item:last-child {
  border-left-color: transparent;
}

.timeline__dot {
  position: absolute;
  left: -6px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg2);
}

.timeline__dot--call {
  background: var(--success);
}

.timeline__dot--email {
  background: var(--accent);
}

.timeline__dot--meeting {
  background: var(--warn);
}

.timeline__dot--note {
  background: var(--dim);
}

.timeline__content {
  flex: 1;
}

.timeline__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.timeline__type {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline__date {
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--dim);
}

.timeline__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.timeline__contact {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.timeline__desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
}

.timeline__outcome {
  font-size: 0.75rem;
  color: var(--success);
  margin-top: 4px;
  font-weight: 500;
}

.timeline__duration {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--dim);
  margin-top: 2px;
}

.timeline__meta {
  font-size: 0.7rem;
  color: var(--dim);
  font-family: var(--mono);
  margin-top: 4px;
}


/* ============================================================
   TASKS
   ============================================================ */

.task-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

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

.task-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.task-item--overdue {
  border-left: 3px solid var(--danger);
}

.task-item--completed {
  opacity: 0.5;
}

.task-item--completed .task-item__title {
  text-decoration: line-through;
}

.task-item__left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.task-item__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.task-item__check,
.task-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.task-item__title {
  font-size: 0.82rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item__contact {
  font-size: 0.72rem;
  color: var(--dim);
  margin-left: 4px;
}

.task-item__due {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--dim);
  white-space: nowrap;
}

.task-item__due--overdue {
  color: var(--danger);
  font-weight: 600;
}


/* ============================================================
   QUOTE EDITOR
   ============================================================ */

.editor-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}

.editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.quote-editor-totals {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.quote-items {
  width: 100%;
  border-collapse: collapse;
}

.quote-items th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dim);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.quote-items td {
  padding: 8px;
  font-size: 0.82rem;
}

.quote-items input,
.quote-items select {
  width: 100%;
  padding: 7px 10px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.quote-items input:focus,
.quote-items select:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--focus-ring);
}

.quote-item-row td {
  padding: 6px 8px;
}

.qi-total {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
}

.qi-remove {
  cursor: pointer;
}

.quote-totals {
  text-align: right;
  padding: 16px 20px;
}

.quote-totals__row {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin-bottom: 8px;
  align-items: baseline;
}

.quote-totals__row--total {
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.quote-totals__label {
  color: var(--muted);
  font-size: 0.82rem;
}

.quote-totals__value {
  font-weight: 600;
  font-size: 0.88rem;
  min-width: 100px;
}

.quote-totals__total {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
}


/* ============================================================
   EMPTY STATES — Centered, icon-friendly placeholders
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--dim);
  font-size: 0.85rem;
  line-height: 1.6;
}

.empty-state::before {
  content: '';
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  border: 1px solid var(--border);
}

.empty {
  text-align: center;
  padding: 40px;
  color: var(--dim);
  font-size: 0.85rem;
}


/* ============================================================
   UTILITY
   ============================================================ */

[hidden] {
  display: none !important;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warn {
  color: var(--warn);
}

.text-muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.text-dim {
  color: var(--dim);
}

.font-mono {
  font-family: var(--mono);
}

.currency-select {
  display: inline-block;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 2px 4px;
  outline: none;
}


/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
  .metrics {
    grid-template-columns: repeat(4, 1fr);
  }

  .kanban {
    grid-template-columns: repeat(3, 1fr);
    overflow-x: auto;
  }

  .detail-card__fields {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .kanban {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .activities-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }

  .sidebar__item span,
  .sidebar__logo img,
  .sidebar__status,
  .sidebar__footer-btns {
    display: none;
  }

  .sidebar__hamburger {
    display: flex;
  }

  .sidebar.sidebar--expanded {
    width: var(--sidebar-w);
    position: fixed;
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  }

  .sidebar.sidebar--expanded .sidebar__item span,
  .sidebar.sidebar--expanded .sidebar__logo img,
  .sidebar.sidebar--expanded .sidebar__status,
  .sidebar.sidebar--expanded .sidebar__footer-btns {
    display: flex;
  }

  .main-content {
    margin-left: var(--sidebar-collapsed);
    padding: 20px 14px;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .kanban {
    grid-template-columns: 1fr;
  }

  .donut-wrap {
    flex-direction: column;
  }

  .form-row,
  .form-row--half {
    grid-template-columns: 1fr;
  }

  .funnel__labels,
  .funnel-labels {
    flex-wrap: wrap;
  }

  .modal-card__body {
    padding: 16px;
  }

  .modal-card__header {
    padding: 14px 16px;
  }

  .modal-card__footer {
    padding: 12px 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-header__actions {
    width: 100%;
  }

  .section-search {
    width: 100%;
  }

  .section-filter {
    flex: 1;
  }

  .detail-card__fields {
    grid-template-columns: 1fr;
  }

  .detail-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-actions {
    flex-wrap: wrap;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .activities-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 16px 10px;
  }

  .metric {
    padding: 14px 16px;
  }

  .metric__value {
    font-size: 1.4rem;
  }

  .panel__header {
    padding: 12px 14px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.78rem;
  }

  .detail-card {
    padding: 16px;
  }

  .detail-section {
    padding: 16px;
  }

  .section-header__title {
    font-size: 1.25rem;
  }

  .detail-breadcrumb {
    font-size: 0.78rem;
    padding: 6px 14px;
  }
}
